blob: 31d91a7f7834a5c14afaccc360eeebd7f8f33050 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
# Ports collection makefile for: lxr
# Date created: 11 Dec 2008
# Whom: Eygene Ryabinkin
#
# $FreeBSD$
#
PORTNAME= lxr
PORTVERSION= 0.10.2
CATEGORIES= devel
MASTER_SITES= SF/${PORTNAME}/stable/${PORTNAME}-${PORTVERSION}
EXTRACT_SUFX= .tgz
MAINTAINER= rea@FreeBSD.org
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
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}
SUB_FILES+= upgrade-0.9.10-postgres upgrade-0.9.10-mysql
.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 \
genxref \
ident \
search \
source
LXR_CONF= swish-e.conf \
initdb-postgres \
initdb-mysql
LXR_DOCS= BUGS \
CREDITS.txt \
ChangeLog \
HACKING \
INSTALL \
LICENSE \
RELEASING
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}
${INSTALL_DATA} ${WRKSRC}/LXRversion.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
${INSTALL_DATA} ${WRKDIR}/upgrade-0.9.10-postgres ${LXRDIR}
${INSTALL_DATA} ${WRKDIR}/upgrade-0.9.10-mysql ${LXRDIR}
post-install:
@${ECHO}
@${ECHO} "******************** Installation tips ********************"
@${ECHO}
.for f in ${MSG_FILES}
@${CAT} ${WRKDIR}/${f}
.endfor # ${MSG_FILES}
.include <bsd.port.post.mk>
|