diff options
author | Martin Wilke <miwi@FreeBSD.org> | 2009-05-30 18:44:29 +0000 |
---|---|---|
committer | Martin Wilke <miwi@FreeBSD.org> | 2009-05-30 18:44:29 +0000 |
commit | 71f51f5b92856ecba1a38d225fbe4b6a6324a1dd (patch) | |
tree | d9be05090d5d3d93d0994ff7bb95de2e9a1dbf7e /devel/lxr | |
parent | bf21c8ac85dd29c5b9ee63c2f04c295c2c40eb63 (diff) | |
download | ports-71f51f5b92856ecba1a38d225fbe4b6a6324a1dd.tar.gz ports-71f51f5b92856ecba1a38d225fbe4b6a6324a1dd.zip |
A general purpose source code indexer and cross-referencer that
provides web-based browsing of source code with links to the
definition and usage of any identifier.
WWW: http://sourceforge.net/projects/lxr/
PR: ports/134145
Submitted by: Eygene Ryabinkin
Notes
Notes:
svn path=/head/; revision=234847
Diffstat (limited to 'devel/lxr')
-rw-r--r-- | devel/lxr/Makefile | 137 | ||||
-rw-r--r-- | devel/lxr/distinfo | 3 | ||||
-rw-r--r-- | devel/lxr/files/fix-perl-warnings.patch | 127 | ||||
-rw-r--r-- | devel/lxr/files/pkg_message.in | 28 | ||||
-rw-r--r-- | devel/lxr/files/pkg_message.mysql.in | 9 | ||||
-rw-r--r-- | devel/lxr/files/pkg_message.postgresql.in | 12 | ||||
-rw-r--r-- | devel/lxr/pkg-descr | 7 | ||||
-rw-r--r-- | devel/lxr/pkg-plist | 60 |
8 files changed, 383 insertions, 0 deletions
diff --git a/devel/lxr/Makefile b/devel/lxr/Makefile new file mode 100644 index 000000000000..06b3912fcb2f --- /dev/null +++ b/devel/lxr/Makefile @@ -0,0 +1,137 @@ +# Ports collection makefile for: lxr +# Date created: 11 Dec 2008 +# Whom: Eygene Ryabinkin +# +# $FreeBSD$ +# + +PORTNAME= lxr +PORTVERSION= 0.9.6 +CATEGORIES= devel +MASTER_SITES= SF +EXTRACT_SUFX= .tgz + +MAINTAINER= rea-fbsd@codelabs.ru +COMMENT= Source code indexer and cross-referencer + +BUILD_DEPENDS= exctags:${PORTSDIR}/devel/ctags \ + swish-e:${PORTSDIR}/www/swish-e \ + ${SITE_PERL}/File/MMagic.pm:${PORTSDIR}/devel/p5-File-MMagic + +PATCH_STRIP= -p1 +EXTRA_PATCHES= ${PATCHDIR}/fix-perl-warnings.patch + +USE_GZIP= yes +USE_PERL5= yes +NO_BUILD= yes + +OPTIONS= POSTGRESQL "Enable PostgreSQL support" on \ + MYSQL "Enable MySQL support (untested)" off + +# Name prefix for database tables, indexes, sequences and other stuff. +DB_PREFIX= lxr + +# Installation directory +.if !defined(LXRDIR) +.if defined(APACHE_DATADIR) +LXRTOPDIR= ${APACHE_DATADIR}/data +.else +LXRTOPDIR= ${PREFIX}/www/data +.endif # defined(APACHE_DATADIR) +LXRDIR= ${LXRTOPDIR}/lxr +.endif # !defined(LXRDIR) + +PLIST_SUB+= LXRDIR=${LXRDIR:S!^${PREFIX}/!!} +PLIST_SUB+= LXRTOPDIR=${LXRTOPDIR:S!^${PREFIX}/!!} +SUB_LIST+= LXRDIR=${LXRDIR} + +.include <bsd.port.pre.mk> + +.if defined(WITH_POSTGRESQL) && defined(WITH_MYSQL) +IGNORE= you must choose only one database backend +.endif + +.if defined(WITH_POSTGRESQL) +BUILD_DEPENDS+= ${SITE_PERL}/${PERL_ARCH}/DBD/Pg.pm:${PORTSDIR}/databases/p5-DBD-Pg +MSG_FILES+= pkg_message.postgresql +DB_DRIVER= Pg +.endif # defined(WITH_POSTGRESQL) + +.if defined(WITH_MYSQL) +BUILD_DEPENDS+= ${SITE_PERL}/DBD/mysql.pm:${PORTSDIR}/databases/p5-DBD-mysql +MSG_FILES+= pkg_message.mysql +DB_DRIVER= mysql +.endif # defined(WITH_MYSQL) + +MSG_FILES+= pkg_message + +SUB_FILES+= ${MSG_FILES} + +LXR_SCRIPTS= diff \ + find \ + genxref \ + ident \ + search \ + source + +LXR_CONF= swish-e.conf \ + initdb-postgres \ + initdb-mysql + +LXR_DOCS= BUGS \ + CREDITS.txt \ + ChangeLog \ + HACKING \ + INSTALL \ + LICENSE \ + RELEASING \ + notes + +post-patch: + @${REINPLACE_CMD} \ + -e"s|'glimpsebin'|# 'glimpsebin'|" \ + -e"s|'glimpseindex'|# 'glimpseindex'|" \ + -e"s|'/usr/local/bin/swish-e'|'${LOCALBASE}/bin/swish-e'|" \ + -e"s|'/usr/bin/ctags'|'${LOCALBASE}/bin/exctags'|" \ + -e"s|'/path/to/lib/LXR/Lang/generic.conf'|'${SITE_PERL}/LXR/Lang/generic.conf'|" \ + -e"s|'/path/to/lib/LXR/Lang/ectags.conf'|'${SITE_PERL}/LXR/Lang/ectags.conf'|" \ + -e"s|'dbi:mysql:|'dbi:${DB_DRIVER}:|" \ + -e's|'lxr_'|'${DB_PREFIX}_'|g' \ + ${WRKSRC}/templates/lxr.conf && \ + ${RM} -f ${WRKSRC}/templates/lxr.conf.bak + @${REINPLACE_CMD} \ + -e's|lxr_|${DB_PREFIX}_|g' \ + ${WRKSRC}/initdb-postgres + @${REINPLACE_CMD} \ + -e's|lxr|${DB_PREFIX}|g' \ + ${WRKSRC}/initdb-mysql + +do-install: + ${MKDIR} ${LXRDIR} +.for f in ${LXR_SCRIPTS} + ${INSTALL_SCRIPT} ${WRKSRC}/${f} ${LXRDIR} +.endfor # ${LXR_SCRIPTS} +.for f in ${LXR_CONF} + ${INSTALL_DATA} ${WRKSRC}/${f} ${LXRDIR} +.endfor # ${LXR_CONF} +.if !defined(NOPORTDOCS) + ${MKDIR} ${DOCSDIR} +.for f in ${LXR_DOCS} + ${INSTALL_DATA} ${WRKSRC}/${f} ${DOCSDIR} +.endfor # ${LXR_DOCS} +.endif # !defined(NOPORTDOCS) + ${MKDIR} ${PREFIX}/${SITE_PERL_REL} + ${INSTALL_DATA} ${WRKSRC}/Local.pm ${PREFIX}/${SITE_PERL_REL} + ${TAR} -C ${WRKSRC}/lib -cf - --exclude *.orig LXR | ${TAR} -C ${PREFIX}/${SITE_PERL_REL} -xf - + ${TAR} -C ${WRKSRC} -cf - --exclude *.orig templates | ${TAR} -C ${LXRDIR} -xf - + ${CHMOD} 640 ${LXRDIR}/templates/lxr.conf + +post-install: + @${ECHO} + @${ECHO} "******************** Installation tips ********************" + @${ECHO} +.for f in ${MSG_FILES} + @${CAT} ${WRKDIR}/${f} +.endfor # ${MSG_FILES} + +.include <bsd.port.post.mk> diff --git a/devel/lxr/distinfo b/devel/lxr/distinfo new file mode 100644 index 000000000000..bd2e78f41bf0 --- /dev/null +++ b/devel/lxr/distinfo @@ -0,0 +1,3 @@ +MD5 (lxr-0.9.6.tgz) = 2388d79c91d39063a41d99c7300615d1 +SHA256 (lxr-0.9.6.tgz) = 18c02e814da196b4d66809fb14ff260b20f2dd52c36e2453147a6a4609a1180d +SIZE (lxr-0.9.6.tgz) = 97109 diff --git a/devel/lxr/files/fix-perl-warnings.patch b/devel/lxr/files/fix-perl-warnings.patch new file mode 100644 index 000000000000..b933fd980197 --- /dev/null +++ b/devel/lxr/files/fix-perl-warnings.patch @@ -0,0 +1,127 @@ +From 5e71b7d7e7b4b7619b156b0fb13e52775ed17ccc Mon Sep 17 00:00:00 2001 +From: Eygene Ryabinkin <rea-fbsd@codelabs.ru> +Date: Fri, 12 Dec 2008 19:26:20 +0300 +Subject: [PATCH] Fixed some warnings produced by 'perl -w' + +Signed-off-by: Eygene Ryabinkin <rea-fbsd@codelabs.ru> +--- + lib/LXR/Common.pm | 23 +++++++++++++++++------ + lib/LXR/Files/Plain.pm | 1 + + lib/LXR/Index/Postgres.pm | 6 ++++++ + 3 files changed, 24 insertions(+), 6 deletions(-) + +diff --git a/lib/LXR/Common.pm b/lib/LXR/Common.pm +index fea8479..84f38e4 100644 +--- a/lib/LXR/Common.pm ++++ b/lib/LXR/Common.pm +@@ -120,6 +120,7 @@ sub fileref { + # jwz: URL-quote any special characters. + $path =~ s|([^-a-zA-Z0-9.\@/_\r\n])|sprintf("%%%02X", ord($1))|ge; + ++ $line = -1 unless defined($line); + if ($line > 0 && length($line) < 3) { + $line = ('0' x (3 - length($line))) . $line; + } +@@ -134,7 +135,8 @@ sub diffref { + my ($desc, $css, $path, $darg) = @_; + my $dval; + +- ($darg, $dval) = $darg =~ /(.*?)=(.*)/; ++ ($darg, $dval) = (defined($darg) ? ++ $darg =~ /(.*?)=(.*)/ : (undef, undef)); + return ("<a class='$css' href=\"$config->{virtroot}/diff$path" + . &urlargs(($darg ? "diffvar=$darg" : ""), ($dval ? "diffval=$dval" : "")) + . "\"\>$desc</a>"); +@@ -280,6 +282,9 @@ sub markupfile { + while (defined($frag)) { + &markspecials($frag); + ++ # Use value that won't match anything ++ # in the next if-else for the undefined $btype ++ $btype = '' unless (defined($btype)); + if ($btype eq 'comment') { + + # Comment +@@ -295,7 +300,6 @@ sub markupfile { + # Include directive + $lang->processinclude(\$frag, $dir); + } else { +- + # Code + $lang->processcode(\$frag); + } +@@ -371,6 +375,7 @@ sub markupfile { + } + + sub fixpaths { ++ return '/' unless defined($_[0]); + my $node = '/' . shift; + + while ($node =~ s|/[^/]+/\.\./|/|g) { } +@@ -473,7 +478,9 @@ sub httpinit { + $HTTP->{'this_url'} = 'http://' . $ENV{'SERVER_NAME'}; + $HTTP->{'this_url'} .= ':' . $ENV{'SERVER_PORT'} + if $ENV{'SERVER_PORT'} != 80; +- $HTTP->{'this_url'} .= $ENV{'SCRIPT_NAME'} . $ENV{'PATH_INFO'}; ++ $HTTP->{'this_url'} .= $ENV{'SCRIPT_NAME'}; ++ $HTTP->{'this_url'} .= $ENV{'PATH_INFO'} ++ if defined($ENV{'PATH_INFO'}); + $HTTP->{'this_url'} .= '?' . $ENV{'QUERY_STRING'} + if $ENV{'QUERY_STRING'}; + +@@ -721,9 +728,13 @@ sub varlinks { + $vallink = &idref($val, "varlink", $identifier, "$var=$val"); + } elsif ($who eq 'search') { + $vallink = +- "<a class=\"varlink\" href=\"$config->{virtroot}/search" +- . &urlargs("$var=$val", "string=" . $HTTP->{'param'}->{'string'}) +- . "\">$val</a>"; ++ "<a class=\"varlink\" href=\"$config->{virtroot}/search"; ++ if (defined($HTTP->{'param'}->{'string'})) { ++ $vallink .= &urlargs("$var=$val", ++ "string=" . ++ $HTTP->{'param'}->{'string'}); ++ } ++ $vallink .= "\">$val</a>"; + } + } + +diff --git a/lib/LXR/Files/Plain.pm b/lib/LXR/Files/Plain.pm +index 27c5dee..ade40fd 100644 +--- a/lib/LXR/Files/Plain.pm ++++ b/lib/LXR/Files/Plain.pm +@@ -131,6 +131,7 @@ sub getdir { + + sub toreal { + my ($self, $pathname, $release) = @_; ++ $release = "" unless defined($release); + + # nearly all (if not all) method calls eventually call toreal(), so this is a good place to block file access + foreach my $ignoredir ($config->ignoredirs) { +diff --git a/lib/LXR/Index/Postgres.pm b/lib/LXR/Index/Postgres.pm +index ae1e11f..4667036 100644 +--- a/lib/LXR/Index/Postgres.pm ++++ b/lib/LXR/Index/Postgres.pm +@@ -158,6 +158,9 @@ sub getindex { + my ($self, $symname, $release) = @_; + my ($rows, @ret); + ++ $release = "" unless defined($release); ++ return () unless defined($symname); ++ + $rows = $indexes_select->execute("$symname", "$release"); + + while ($rows-- > 0) { +@@ -175,6 +178,9 @@ sub getreference { + my ($self, $symname, $release) = @_; + my ($rows, @ret); + ++ $release = "" unless defined($release); ++ return () unless defined($symname); ++ + $rows = $usage_select->execute("$symname", "$release"); + + while ($rows-- > 0) { +-- +1.6.0.4 + diff --git a/devel/lxr/files/pkg_message.in b/devel/lxr/files/pkg_message.in new file mode 100644 index 000000000000..35f9754d4e1d --- /dev/null +++ b/devel/lxr/files/pkg_message.in @@ -0,0 +1,28 @@ +Configuring LXR +=============== + +First-time installation +----------------------- + +For the first-time installations you should copy the template files +for LXR to your installation + + cp %%LXRDIR%%/templates/* %%LXRDIR%%/ + +Then you should glance over configuration file at + %%LXRDIR%%/lxr.conf + +It has some reasonable values for the helper programs, but you should +customize variables like 'baseurl', 'virtroot' and others. + +Upgrades +-------- + +You should look at the contents of the directory + %%LXRDIR%%/templates/ +and possibly merge new stuff from it to the corresponding files in + %%LXRDIR%%/ + + +Happy cross-referencing and code mining! + diff --git a/devel/lxr/files/pkg_message.mysql.in b/devel/lxr/files/pkg_message.mysql.in new file mode 100644 index 000000000000..e57a83a28066 --- /dev/null +++ b/devel/lxr/files/pkg_message.mysql.in @@ -0,0 +1,9 @@ +MySQL setup +=========== + +Run 'mysql' and then read in the initdb-mysql file using +'\. %%LXRDIR%%/initdb-mysql'. + +This will create the database and a user called lxr with access +rights to the database. + diff --git a/devel/lxr/files/pkg_message.postgresql.in b/devel/lxr/files/pkg_message.postgresql.in new file mode 100644 index 000000000000..01fe9c7abf3f --- /dev/null +++ b/devel/lxr/files/pkg_message.postgresql.in @@ -0,0 +1,12 @@ +PostgreSQL setup +================ + +Create a user for lxr and give the user permission to create databases: + createuser -P lxr +Create a database for lxr: + createdb -O lxr lxr +Initialise the database: + psql -U lxr lxr + \i %%LXRDIR%%/initdb-postgres +Just ignore the errors about unimplemented functions. + diff --git a/devel/lxr/pkg-descr b/devel/lxr/pkg-descr new file mode 100644 index 000000000000..c1152c64863e --- /dev/null +++ b/devel/lxr/pkg-descr @@ -0,0 +1,7 @@ +LXR -- Linux Cross-Reference + +A general purpose source code indexer and cross-referencer that +provides web-based browsing of source code with links to the +definition and usage of any identifier. + +WWW: http://sourceforge.net/projects/lxr/ diff --git a/devel/lxr/pkg-plist b/devel/lxr/pkg-plist new file mode 100644 index 000000000000..abdbb19d4b8c --- /dev/null +++ b/devel/lxr/pkg-plist @@ -0,0 +1,60 @@ +%%LXRDIR%%/diff +%%LXRDIR%%/find +%%LXRDIR%%/genxref +%%LXRDIR%%/ident +%%LXRDIR%%/search +%%LXRDIR%%/source +%%LXRDIR%%/swish-e.conf +%%LXRDIR%%/initdb-postgres +%%LXRDIR%%/initdb-mysql +%%LXRDIR%%/templates/html-dir.html +%%LXRDIR%%/templates/html-find.html +%%LXRDIR%%/templates/html-head.html +%%LXRDIR%%/templates/html-ident-refs.html +%%LXRDIR%%/templates/html-ident.html +%%LXRDIR%%/templates/html-search-glimpse.html +%%LXRDIR%%/templates/html-search-swish.html +%%LXRDIR%%/templates/html-tail.html +%%LXRDIR%%/templates/lxr.conf +%%LXRDIR%%/templates/lxr.css +%%PORTDOCS%%%%DOCSDIR%%/BUGS +%%PORTDOCS%%%%DOCSDIR%%/CREDITS.txt +%%PORTDOCS%%%%DOCSDIR%%/ChangeLog +%%PORTDOCS%%%%DOCSDIR%%/HACKING +%%PORTDOCS%%%%DOCSDIR%%/INSTALL +%%PORTDOCS%%%%DOCSDIR%%/LICENSE +%%PORTDOCS%%%%DOCSDIR%%/RELEASING +%%PORTDOCS%%%%DOCSDIR%%/notes +%%SITE_PERL%%/Local.pm +%%SITE_PERL%%/LXR/Files/Plain.pm +%%SITE_PERL%%/LXR/Files/BK.pm +%%SITE_PERL%%/LXR/Files/CVS.pm +%%SITE_PERL%%/LXR/Files/GIT.pm +%%SITE_PERL%%/LXR/Common.pm +%%SITE_PERL%%/LXR/Config.pm +%%SITE_PERL%%/LXR/Files.pm +%%SITE_PERL%%/LXR/Index.pm +%%SITE_PERL%%/LXR/Lang.pm +%%SITE_PERL%%/LXR/SimpleParse.pm +%%SITE_PERL%%/LXR/Tagger.pm +%%SITE_PERL%%/LXR/Index/Mysql.pm +%%SITE_PERL%%/LXR/Index/DB.pm +%%SITE_PERL%%/LXR/Index/DBI.pm +%%SITE_PERL%%/LXR/Index/Oracle.pm +%%SITE_PERL%%/LXR/Index/Postgres.pm +%%SITE_PERL%%/LXR/Lang/Cobol.pm +%%SITE_PERL%%/LXR/Lang/Generic.pm +%%SITE_PERL%%/LXR/Lang/Java.pm +%%SITE_PERL%%/LXR/Lang/Perl.pm +%%SITE_PERL%%/LXR/Lang/Python.pm +%%SITE_PERL%%/LXR/Lang/ectags.conf +%%SITE_PERL%%/LXR/Lang/ectags.conf.documentation +%%SITE_PERL%%/LXR/Lang/generic.conf +%%PORTDOCS%%@dirrm %%DOCSDIR%% +@dirrm %%SITE_PERL%%/LXR/Files +@dirrm %%SITE_PERL%%/LXR/Lang +@dirrm %%SITE_PERL%%/LXR/Index +@dirrm %%SITE_PERL%%/LXR +@dirrm %%LXRDIR%%/templates +@dirrmtry %%LXRDIR%% +@dirrmtry %%LXRTOPDIR%% |