当前时区为 UTC + 8 小时



发表新帖 回复这个主题  [ 4 篇帖子 ] 
作者 内容
1 楼 
 文章标题 : lxr-cvs怎么设置???想读内核源代码。求解.........
帖子发表于 : 2007-10-15 19:12 

注册: 2007-06-26 1:42
帖子: 24
送出感谢: 0 次
接收感谢: 0 次
想做成想下面的 样子
http://lxr.linux.no/
没有设置成功,请高手指教。
模板好像没起作用 ,和没装lxr基本上一样。不知为何?
我用的mysql5.1 里面关于‘release’关键字 我也改 了。最后索引 还用行了两三个小时。
就是这一步 :
genxref --url=http://localhost/lxr/ --version="2.6.17"
好像有一个perl DBD fail:
我使用新德里安装的 lxr-cvs,其他的和下面差不多。

1. 下载lxr 的源代码
apt-get source lxr-cvs

2. 将 lxr 解压缩为 /var/lib/lxr/

建立 /var/lib/src/ 目录,用以存放 源代码
将内核源代码解压到/var/lib/src/ , 以版本号命名,比如 2.6.17。可以放置多份不同
版本的源代码。 新建文件/var/lib/src/versions , 将各个版本号列入其中。

建立 /var/lib/swish-e/ 目录 ,用以存放 swish-cache

3. 安装 ctags
apt-get install ctags

4. 安装 mysql
apt-get install mysql-server-4.1 mysql-client-4.1


5. 安装 apache 及 mod_perl (必须是 apache ,而非 apache2)
apt-get install apache libapache-mod-perl

6. 安装 swish-e , 用于文本搜索
apt-get install swish-e

7. 安装 Perl File:MMagic 模块
apt-get install libfile-mmagic-perl

8. mysql环境的搭建,首先需要初始化系统表
mysql_install_db -u root
然后启动mysql服务器
mysqld_safe -u root &
最后需要创建lxr所需要的数据库和数据表,切换到 /var/lib/lxr/ 目录,
以root 身份运行 mysql
mysql -u root -p
当数据库提示输入密码时,直接按回车即可,在mysql的提示符下输入
\. initdb-mysql //这里initdb-mysql要全路径才行例如在/root/lxr/initdb-mysql
以建立数据库表

9. 运行:
cp /var/lib/lxr/Local.pm /usr/lib/perl5/
cp -r /var/lib/lxr/lib/LXR /usr/lib/perl5/

mv /var/lib/lxr/templates/* /var/lib/lxr/

10 编辑 /var/lib/lxr/lxr.conf
1)注释掉所有带 glimps 的行
2) 将 'swishbin' => "/some/path/to/exectuable" 改为
'swishbin'=> '/usr/bin/swish-e'

3) 将 baseurl 设为 'http://localhost/lxr/'
将 virtroot 设为 '/lxr'
4) 注释掉 basealias
5) 找到 readfile('src/versions'), 将其修改为 readfile('/var/lib/src/versions')
将 default 设为默认的源代码版本号(比如 2.6.17)
将 sourceroot 设为 /var/lib/src/
6) 将 swishdir 设为 /var/lib/swish-e/
7) 将'genericconf' => '/path/to/lib/LXR/Lang/generic.conf',
改为'genericconf' => '/var/lib/lxr/lib/LXR/Lang/generic.conf',
8)将'ectagsconf' => '/path/to/lib/LXR/Lang/ectags.conf',
改为'ectagsconf' => '/var/lib/lxr/lib/LXR/Lang/ectags.conf',

11. 生成索引
运行 : /var/lib/lxr/genxref --url=http://localhost/lxr/ --version="2.6.17"
其中 2.6.17 是内核版本号(与 /var/lib/src/ 下的目录相一致)。也可以使用 --allversions
选项生成 /var/lib/src/ 目录下所有源代码的索引。

由于我之前直接通过apt-get install lxr-cvs下载过lxr,因此需要将lxr.conf拷贝到/etc/lxr-cvs/中,

(注意: 这个操作要花非常非常长的时间)

12. 配置 apache 服务器
打开 /etc/apache/httpd.conf ,写入
Alias /lxr /var/lib/lxr
<Directory /var/lib/lxr>
Options All
AllowOverride All
</Directory>


最后由 baiyipiaopiao 编辑于 2007-10-17 10:10,总共编辑了 1 次

页首
 用户资料  
 
2 楼 
 文章标题 :
帖子发表于 : 2007-10-17 10:04 

注册: 2007-06-26 1:42
帖子: 24
送出感谢: 0 次
接收感谢: 0 次
怎么没有人回答呀 !!!!!!!


页首
 用户资料  
 
3 楼 
 文章标题 :
帖子发表于 : 2007-10-17 10:09 

注册: 2007-06-26 1:42
帖子: 24
送出感谢: 0 次
接收感谢: 0 次
想做成下面的 这样子 !!!
却只有上面的样子 !!


附件:
Screenshot-1.png
Screenshot-1.png [ 73.65 KiB | 被浏览 2056 次 ]

Screenshot.png
Screenshot.png [ 120.59 KiB | 被浏览 2045 次 ]

页首
 用户资料  
 
4 楼 
 文章标题 : 附上 lxr.conf
帖子发表于 : 2007-10-17 10:12 

注册: 2007-06-26 1:42
帖子: 24
送出感谢: 0 次
接收感谢: 0 次
# -*- mode: perl -*-
# Configuration file
#
(
{

# Global configuration

# Path to glimpse executables.
# Define this OR the swish-e variable depending which search engine you want to use.
#'glimpsebin' => '/bin/glimpse',
#'glimpseindex' => '/bin/glimpseindex',

# Location of SWISH-E binary
'swishbin' => '/usr/bin/swish-e',

# Path to Exuberant Ctags executable
'ectagsbin' => '/usr/bin/ctags-exuberant',

# Place where lxr can write temporary files
'tmpdir' => '/tmp',

# Location of the Generic.pm config file
'genericconf' => '/usr/share/perl5/LXR/Lang/generic.conf',

# Location of the ectags.conf file
'ectagsconf' => '/usr/share/perl5/LXR/Lang/ectags.conf',

# Paths for CVS module
'cvspath' => '/bin:/usr/local/bin:/usr/bin:/usr/sbin',

},

{

# Configuration for http://1ocalhost/lxr.
# baseurl is used to select configuration block.

'baseurl' => 'http://ubuntu/lxr', # Put your URL here
# baseurl_aliases allows other URLs to be used to reach the site
# comment this out if you do not want any aliases
#'baseurl_aliases' => [ 'http://mydebian/lxr', 'http://mydomain/lxr' ],
'virtroot' => '/lxr', # The bit after the / above

'variables' => {

# Define typed variable "v". This is the list of versions to index.
'v' => {
'name' => 'Version',

# This can come from a file, a function or be explicitly
# ennumerated.
# From a file:
'range' => [ readfile('/usr/src/versions') ],

# Explicitly:
# 'range' => [qw(v1 v2 v3.1 v4 experimental)],
# If files within a tree can have different versions,
# e.g in a CVS tree, 'range' can be specified as a
# function to call for each file:
#'range' => sub { return
# ($files->allreleases($LXR::Common::pathname),
# $files->allrevisions($LXR::Common::pathname))
# }, # deferred function call.

# The default version to display
'default' => '2.6.20'
},

# Define typed variable "a". First value is default.
'a' => {
'name' => 'Architecture',
'range' => [qw(i386 alpha arm m68k mips ppc sparc sparc64)]
},
},

# These do funky things to paths in the system - you probably don't need them.
'maps' => {
'/include/asm[^\/]*/' => '/include/asm-$a/',
'/arch/[^\/]+/' => '/arch/$a/',
},

# Templates used for headers and footers
'htmlhead' => '/etc/lxr-cvs/html-head.html',
'htmltail' => '/etc/lxr-cvs/html-tail.html',
'htmldir' => '/etc/lxr-cvs/html-dir.html',
'htmlident' => '/etc/lxr-cvs/html-ident.html',
'htmlident_refs' => '/etc/lxr-cvs/html-ident-refs.html',
'htmlfind' => '/etc/lxr-cvs/html-find.html',
'htmlsearch' => '/etc/lxr-cvs/html-search-swish.html',


'sourcehead' => '/etc/lxr-cvs/html-head.html',
'sourcedirhead' => '/etc/lxr-cvs/html-head.html',
'stylesheet' => 'lxr.css',

# sourceroot - where to get the source files from

# For ordinary directories, this specifies a directory which has each version as a
# subdirectory e.g.
# indexed-src/version1/...
# indexed-src/version2/...
# The names of the version directories must match the values for the Version
# variable above.
'sourceroot' => '/usr/src',

# Alternatively, this can specify a CVS repository by setting the value to "cvs:"
# followed by the path to the repository. Note this must be file accessible - remote
# server access does NOT work.
# 'sourceroot' => 'cvs:/hom/karsk/a/CVSROOT/linux',

# For a BitKeeper repository, specify bk: followed by the path to the
# repository. For BK it is also necessary to specify a 'cachepath' parameter in
# the 'sourceparams' value below. This should point to a directory where the
# code can write and read files.
# 'sourceroot' => 'bk:/some/repository/here',

# Finally, you can also use GIT, Linux Kernel's new
# distributes SCM to access the history:
# 'sourceroot' => 'git:/some/repository/.git'
# 'sourceroot' => 'git:/some/repostitory.git'
# The `sourceroot' config variable points to the directory
# in which you find the `objects', `refs', `index' etc.
# directories.

# The name to display for this source tree
'sourcerootname' => 'LXR Example',

# Any parameters to the source access method should be specified below
'sourceparams' => {'cachepath' => '/a/path/here'},

# The DBI identifier for the database to use
# For mysql, the format is dbi:mysql:dbname=<name>
# for Postgres, it is dbi:Pg:dbname=<name>
# for Oracle, it is dbi:Oracle:host=localhost;sid=DEVMMS;port=1521
'dbname' => 'dbi:mysql:dbname=lxr',

# If you need to specify the username or password for the database connection,
# uncomment the following two lines
# 'dbpass' => 'foo',
# 'dbuser' => 'lxr',

# If you need multiple lxr configurations in one database, set different table
# prefixes for them.
# 'dbprefix' => 'lxr_',

# For using glimpse, the directory to store the .glimpse files in is required
#'glimpsedir' => '/path/to/glimpse/databases',

# Location of swish-e index database files if using swish-e
'swishdir' => '/var/lib/lxr-cvs/index/',

# where to look for include files inside the sourcetree. This is used to hyperlink
# to included files.
'incprefix' => [ '/include', '/include/linux' ],

# Which extensions to treat as images when browsing. If a file is an image,
# it is displayed.
'graphicfile' => '(?i)\.(gif|jpg|jpeg|pjpg|pjpeg|xbm|png)$', #'

# How to map files to languages
# Note that the string for the key and the first entry in the
# array MUST match
'filetype' => {

# Format is
# Language name, filepatten regexp, module to invoke,
# (optional )tabwidth
# Note that to have another language supported by Generic.pm,
# you must ensure that:
# a) exuberant ctags supports it
# b) generic.conf is updated to specify information about the language
# c) the name of the language given here matches the entry in generic.conf
'C' => [
'C', '\.c$|\.pc$' #'
, 'LXR::Lang::Generic', '8'
],
'C++' => [
'C++',
'\.C$|((?i)\.c\+\+$|\.cc$|\.cpp$|\.cxx$|\.h$|\.hh$|\.hpp$|\.hxx$|\.h\+\+$)' #'
, 'LXR::Lang::Generic', '8'
],

# Some languages are commented out until the relevant entries in generic.conf are made
# The list here is the set supported by ctags 5.0.1
# 'Beta' => [ 'Beta', '(?i)\.bet$', 'LXR::Lang::Generic' ],
# 'Eiffel' => [ 'Eiffel', '(?i)\.e$', 'LXR::Lang::Generic' ],
# 'Fortran' =>
# [ 'Fortran', '(?i)\.f$|\.for$|\.ftn$|\.f77$|\.f90$|\.f95$', 'LXR::Lang::Generic' ],
'Cobol' => [ 'Cobol', '(?i)\.cob$', 'LXR::Lang::Cobol' ],
'Java' => [ 'Java', '(?i)\.java$', 'LXR::Lang::Java', '4' ],

# 'Lisp' => [
# 'Lisp', '(?i)\.cl$|\.clisp$|\.el$|\.l$|\.lisp$|\.lsp$|\.ml$', 'LXR::Lang::Generic'
# ],

# No tabwidth specified here as an example
'Make' => [ 'Make', '(?i)\.mak$|(?i)\.mk$|makefile*', 'LXR::Lang::Generic' ],

# 'Pascal' => [ 'Pascal', '(?i)\.p$|\.pas$', 'LXR::Lang::Generic' ],
'Perl' => [ 'Perl', '(?i)\.pl$|\.pm$|\.perl$', 'LXR::Lang::Generic', '4' ],
'php' => [ 'php', '(?i)\.php$|\.php3$|\.phtml$', 'LXR::Lang::Generic', '2' ],
'Python' => [ 'Python', '(?i)\.py$|\.python$', 'LXR::Lang::Generic', '4' ],

# 'rexx' => [ 'rexx', '(?i)\.cmd$|\.rexx$|\.rx$', 'LXR::Lang::Generic' ],
# 'ruby' => [ 'ruby', '(?i)\.rb$', 'LXR::Lang::Generic' ],
# 'scheme' => [ 'scheme', '(?i)\.sch$|\.scheme$|\.scm$|\.sm$', 'LXR::Lang::Generic' ],
'shell' => [ 'shell', '(?i)\.sh$|\.bsh$|\.bash$|\.ksh$|\.zsh$', 'LXR::Lang::Generic' ],

# 's-Lang' => [ 's-Lang', '(?i)\.sl$', 'LXR::Lang::Generic' ],
'SQL' => [ 'SQL', '(?i)\.sql$|\.pks$|\.pkb$', 'LXR::Lang::Generic' ],
'VB' => [ 'VB', '(?i)\.bas$|\.cls$|\.ctl$|\.frm$|\.vbs$', 'LXR::Lang::Generic' ],
#'tcl' => [ 'tcl', '(?i)\.tcl$|\.wish$', 'LXR::Lang::Generic' ],
},

# Maps interpreter names to languages. The format is:
# regexp => langname
# regexp is matched against the part after #! on the first line of a file
# langname must match one of the keys in filetype above.
#
# This mapping is only used if the filename doesn't match a pattern above, so
# a shell script called shell.c will be recognised as a C file, not a shell file.

'interpreters' => {
'perl' => 'Perl',
'bash' => 'shell',
'csh' => 'shell',
'python' => 'Python',
'ksh' => 'shell',
'zsh' => 'shell',
'sh' => 'shell',
'ksh' => 'shell',
},

# a link of the form (prefix)($filepath)(postfix) is generated when viewing a file
# example for cvsweb:
#'cvswebprefix' => 'http://cvs.myhost.com/cgi-bin/cvsweb.cgi',
#'cvswebpostfix' => '?cvsroot=rootname',
# example for viewcvs:
#'cvswebprefix' => 'http://cvs.myhost.com/cgi-bin/viewcvs.cgi/myroot',
#'cvswebpostfix' => '',

# Directories to always ignore. These usually are the SCM's
# private directories which possibly may contain non-public
# project history.
'ignoredirs' => ['CVSROOT', '.git'],
}
)


页首
 用户资料  
 
显示帖子 :  排序  
发表新帖 回复这个主题  [ 4 篇帖子 ] 

当前时区为 UTC + 8 小时


在线用户

正在浏览此版面的用户:没有注册用户 和 3 位游客


不能 在这个版面发表主题
不能 在这个版面回复主题
不能 在这个版面编辑帖子
不能 在这个版面删除帖子
不能 在这个版面提交附件

前往 :  
本站点为公益性站点,用于推广开源自由软件,由 DiaHosting VPSBudgetVM VPS 提供服务。
我们认为:软件应可免费取得,软件工具在各种语言环境下皆可使用,且不会有任何功能上的差异;
人们应有定制和修改软件的自由,且方式不受限制,只要他们自认为合适。

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
简体中文语系由 王笑宇 翻译