Lines 1-9
Link Here
|
1 |
# Created by: Dmitry Sivachenko <demon@FreeBSD.org> |
1 |
# Created by: Dmitry Sivachenko <demon@FreeBSD.org> |
2 |
# $FreeBSD: head/sysutils/bacula-server/Makefile 327772 2013-09-20 23:05:58Z bapt $ |
2 |
# $FreeBSD: head/sysutils/bacula-server/Makefile 359586 2014-06-27 17:21:06Z miwi $ |
3 |
|
3 |
|
4 |
PORTNAME= bacula |
4 |
PORTNAME= bacula |
5 |
DISTVERSION= 7.0.4 |
5 |
DISTVERSION= 5.2.12 |
6 |
PORTREVISION?= 1 |
6 |
PORTREVISION?= 4 |
7 |
CATEGORIES?= sysutils |
7 |
CATEGORIES?= sysutils |
8 |
MASTER_SITES= SF/bacula/bacula/${PORTVERSION} |
8 |
MASTER_SITES= SF/bacula/bacula/${PORTVERSION} |
9 |
PKGNAMEPREFIX?= # |
9 |
PKGNAMEPREFIX?= # |
Lines 12-28
Link Here
|
12 |
MAINTAINER= dan@langille.org |
12 |
MAINTAINER= dan@langille.org |
13 |
COMMENT?= Network backup solution (server) |
13 |
COMMENT?= Network backup solution (server) |
14 |
|
14 |
|
15 |
CONFLICTS_BUILD= bacula-*-5.2.12_3 |
15 |
LIB_DEPENDS+= lzo2:${PORTSDIR}/archivers/lzo2 |
16 |
|
|
|
17 |
GNU_CONFIGURE= yes |
18 |
|
19 |
LIB_DEPENDS= liblzo2.so:${PORTSDIR}/archivers/lzo2 |
20 |
|
21 |
.if ${PKGNAMESUFFIX} == "-server" |
22 |
RUN_DEPENDS= ${LOCALBASE}/lib/libbac.so:${PORTSDIR}/sysutils/bacula-client \ |
23 |
${LOCALBASE}/lib/libbacfg.so:${PORTSDIR}/sysutils/bacula-client \ |
24 |
${LOCALBASE}/lib/libbacfind.so:${PORTSDIR}/sysutils/bacula-client |
25 |
.endif |
26 |
|
16 |
|
27 |
UNIQUENAME?= ${PORTNAME}${PKGNAMESUFFIX} |
17 |
UNIQUENAME?= ${PORTNAME}${PKGNAMESUFFIX} |
28 |
|
18 |
|
Lines 34-48
Link Here
|
34 |
GNU_CONFIGURE= yes |
24 |
GNU_CONFIGURE= yes |
35 |
USE_LDCONFIG= yes |
25 |
USE_LDCONFIG= yes |
36 |
|
26 |
|
37 |
USES= libtool |
|
|
38 |
|
39 |
CPPFLAGS+= -I/usr/include/readline -I${LOCALBASE}/include |
27 |
CPPFLAGS+= -I/usr/include/readline -I${LOCALBASE}/include |
40 |
#LDFLAGS+= -L${LOCALBASE}/lib |
28 |
LDFLAGS+= -L${LOCALBASE}/lib |
41 |
|
29 |
|
42 |
OPTIONS_DEFINE?= SQLITE3 MYSQL PGSQL MTX PYTHON NLS OPENSSL |
30 |
OPTIONS_DEFINE?= SQLITE3 MYSQL PGSQL MTX PYTHON NLS OPENSSL |
43 |
OPTIONS_DEFAULT?= NLS OPENSSL PGSQL |
31 |
OPTIONS_DEFAULT?= NLS OPENSSL PGSQL |
44 |
MTX_DESC= Install mtx for control of autochanger devices |
32 |
MTX_DESC= Install mtx for control of autochanger devices |
45 |
|
33 |
|
|
|
34 |
NO_STAGE= yes |
46 |
.include <bsd.port.options.mk> |
35 |
.include <bsd.port.options.mk> |
47 |
|
36 |
|
48 |
.if ${PKGNAMESUFFIX} == "-client" || ${PKGNAMESUFFIX} == "-server" #Till end of the file |
37 |
.if ${PKGNAMESUFFIX} == "-client" || ${PKGNAMESUFFIX} == "-server" #Till end of the file |
Lines 53-59
Link Here
|
53 |
.endif |
42 |
.endif |
54 |
|
43 |
|
55 |
.if !defined(WITH_CLIENT_ONLY) |
44 |
.if !defined(WITH_CLIENT_ONLY) |
56 |
LIB_DEPENDS= libbac.so:${PORTSDIR}/sysutils/bacula-client |
45 |
LIB_DEPENDS+= bac:${PORTSDIR}/sysutils/bacula-client |
57 |
USE_RC_SUBR?= bacula-dir bacula-sd |
46 |
USE_RC_SUBR?= bacula-dir bacula-sd |
58 |
.endif |
47 |
.endif |
59 |
|
48 |
|
Lines 63-68
Link Here
|
63 |
SUB_FILES+= pkg-install.server pkg-deinstall.server pkg-message.server |
52 |
SUB_FILES+= pkg-install.server pkg-deinstall.server pkg-message.server |
64 |
.endif |
53 |
.endif |
65 |
|
54 |
|
|
|
55 |
MANCOMPRESSED= yes |
66 |
CONFIGURE_ARGS+=--with-tcp-wrappers=/usr/lib \ |
56 |
CONFIGURE_ARGS+=--with-tcp-wrappers=/usr/lib \ |
67 |
--enable-smartalloc \ |
57 |
--enable-smartalloc \ |
68 |
--sysconfdir=${ETCDIR} \ |
58 |
--sysconfdir=${ETCDIR} \ |
Lines 77-83
Link Here
|
77 |
--with-db-name=bacula \ |
67 |
--with-db-name=bacula \ |
78 |
--with-sbin-perm=755 \ |
68 |
--with-sbin-perm=755 \ |
79 |
--with-db-user=bacula \ |
69 |
--with-db-user=bacula \ |
80 |
--with-logdir=/var/log \ |
|
|
81 |
--with-baseport=9101 |
70 |
--with-baseport=9101 |
82 |
|
71 |
|
83 |
.if defined(WITH_CLIENT_ONLY) |
72 |
.if defined(WITH_CLIENT_ONLY) |
Lines 123-130
Link Here
|
123 |
CONFFILES= fd |
112 |
CONFFILES= fd |
124 |
CONFIGURE_ARGS+= --enable-client-only |
113 |
CONFIGURE_ARGS+= --enable-client-only |
125 |
|
114 |
|
126 |
PKGDEINSTALL= ${STAGEDIR}${FILESDIR}/pkg-deinstall.client |
115 |
PKGDEINSTALL= ${FILESDIR}/pkg-deinstall.client |
127 |
PKGINSTALL= ${STAGEDIR}${FILESDIR}/pkg-install.client |
116 |
PKGINSTALL= ${FILESDIR}/pkg-install.client |
128 |
.else |
117 |
.else |
129 |
# Server only Options |
118 |
# Server only Options |
130 |
CONFFILES= sd dir |
119 |
CONFFILES= sd dir |
Lines 136-142
Link Here
|
136 |
SUB_LIST+= REQ_MYSQL=mysql REQ_PGSQL="" |
125 |
SUB_LIST+= REQ_MYSQL=mysql REQ_PGSQL="" |
137 |
.elif ${PORT_OPTIONS:MSQLITE3} |
126 |
.elif ${PORT_OPTIONS:MSQLITE3} |
138 |
CONFIGURE_ARGS+= --with-sqlite3=yes |
127 |
CONFIGURE_ARGS+= --with-sqlite3=yes |
139 |
LIB_DEPENDS= libsqlite3.so:${PORTSDIR}/databases/sqlite3 |
128 |
LIB_DEPENDS+= sqlite3:${PORTSDIR}/databases/sqlite3 |
140 |
DBTYPE= sqlite3 |
129 |
DBTYPE= sqlite3 |
141 |
.else |
130 |
.else |
142 |
USE_PGSQL= yes |
131 |
USE_PGSQL= yes |
Lines 145-151
Link Here
|
145 |
SUB_LIST+= REQ_MYSQL="" REQ_PGSQL=postgresql |
134 |
SUB_LIST+= REQ_MYSQL="" REQ_PGSQL=postgresql |
146 |
.endif |
135 |
.endif |
147 |
PLIST_SUB+= DBTYPE=${DBTYPE} |
136 |
PLIST_SUB+= DBTYPE=${DBTYPE} |
148 |
## Install mtx |
137 |
# Install mtx |
149 |
.if ${PORT_OPTIONS:MMTX} |
138 |
.if ${PORT_OPTIONS:MMTX} |
150 |
RUN_DEPENDS+= ${LOCALBASE}/sbin/mtx:${PORTSDIR}/misc/mtx |
139 |
RUN_DEPENDS+= ${LOCALBASE}/sbin/mtx:${PORTSDIR}/misc/mtx |
151 |
.endif |
140 |
.endif |
Lines 158-163
Link Here
|
158 |
CONFIGURE_ARGS+= --with-openssl="no" |
147 |
CONFIGURE_ARGS+= --with-openssl="no" |
159 |
.endif |
148 |
.endif |
160 |
|
149 |
|
|
|
150 |
.if defined(WITH_CLIENT_ONLY) |
151 |
MAN8+= bacula-fd.8 bconsole.8 |
152 |
.else |
153 |
MAN8+= bacula.8 bacula-dir.8 bacula-sd.8 bcopy.8 bextract.8 bls.8 bscan.8 \ |
154 |
btape.8 btraceback.8 dbcheck.8 bwild.8 bregex.8 |
155 |
MAN1+= bsmtp.1 bacula-tray-monitor.1 bacula-bwxconsole.1 |
156 |
.endif |
157 |
|
161 |
MAKE_ENV+= MAN8="${MAN8}" MAN1="${MAN1}" |
158 |
MAKE_ENV+= MAN8="${MAN8}" MAN1="${MAN1}" |
162 |
|
159 |
|
163 |
pre-everything:: |
160 |
pre-everything:: |
Lines 187-220
Link Here
|
187 |
@${REINPLACE_CMD} -e 's|$$(ECHO)|echo|g' ${WRKSRC}/src/filed/Makefile.in \ |
184 |
@${REINPLACE_CMD} -e 's|$$(ECHO)|echo|g' ${WRKSRC}/src/filed/Makefile.in \ |
188 |
${WRKSRC}/src/console/Makefile.in |
185 |
${WRKSRC}/src/console/Makefile.in |
189 |
# Default bconsole.conf is in ${ETCDIR} |
186 |
# Default bconsole.conf is in ${ETCDIR} |
190 |
@${REINPLACE_CMD} -e 's|./bconsole.conf|${STAGEDIR}${ETCDIR}/bconsole.conf|g' ${WRKSRC}/src/console/console.c |
187 |
@${REINPLACE_CMD} -e 's|./bconsole.conf|${ETCDIR}/bconsole.conf|g' ${WRKSRC}/src/console/console.c |
191 |
# @${REINPLACE_CMD} -e 's|^MAN8 =|MAN8 ?=|g' -e 's|^MAN1 =|MAN1 ?=|g' ${WRKSRC}/manpages/Makefile.in |
188 |
@${REINPLACE_CMD} -e 's|^MAN8 =|MAN8 ?=|g' -e 's|^MAN1 =|MAN1 ?=|g' ${WRKSRC}/manpages/Makefile.in |
192 |
#.if defined(WITH_CLIENT_ONLY) |
189 |
.if defined(WITH_CLIENT_ONLY) |
193 |
## In client port only install startup script out of script dir (see below post-install) |
190 |
# In client port only install startup script out of script dir (see below post-install) |
194 |
## Dont mkdir ${PREFIX}/share/bacula cause it's empty |
191 |
# Dont mkdir ${PREFIX}/share/bacula cause it's empty |
195 |
# @${REINPLACE_CMD} -e 's|^\(fd_subdirs = .*\)scripts\(.*\)|\1\2|g' ${WRKSRC}/Makefile.in |
192 |
@${REINPLACE_CMD} -e 's|^\(fd_subdirs = .*\)scripts\(.*\)|\1\2|g' ${WRKSRC}/Makefile.in |
196 |
# ${REINPLACE_CMD} -e 's|\(.*$${MKDIR} $${DESTDIR}$${scriptdir}\)|#\1|g' ${WRKSRC}/Makefile.in |
193 |
${REINPLACE_CMD} -e 's|\(.*$${MKDIR} $${DESTDIR}$${scriptdir}\)|#\1|g' ${WRKSRC}/Makefile.in |
197 |
#.else |
194 |
.else |
198 |
## In server port don't install filed |
195 |
# In server port don't install filed |
199 |
# @${REINPLACE_CMD} -e '/^fd_subdirs = /s|src/filed||' -e 's|src/console||' \ |
196 |
@${REINPLACE_CMD} -e '/^fd_subdirs = /s|src/filed||' -e 's|src/console||' \ |
200 |
# -e 's|src/lib||' -e 's|src/findlib||' -e 's|@FD_PLUGIN_DIR@||' ${WRKSRC}/Makefile.in |
197 |
-e 's|src/lib||' -e 's|src/findlib||' -e 's|@FD_PLUGIN_DIR@||' ${WRKSRC}/Makefile.in |
201 |
# @${REINPLACE_CMD} -e 's|../lib/|$$(LOCALBASE)/lib/|g' -e 's|../findlib/|$$(LOCALBASE)/lib/|g' ${WRKSRC}/src/dird/Makefile.in \ |
198 |
@${REINPLACE_CMD} -e 's|../lib/|$$(LOCALBASE)/lib/|g' -e 's|../findlib/|$$(LOCALBASE)/lib/|g' ${WRKSRC}/src/dird/Makefile.in \ |
202 |
# ${WRKSRC}/src/stored/Makefile.in ${WRKSRC}/src/tools/Makefile.in |
199 |
${WRKSRC}/src/stored/Makefile.in ${WRKSRC}/src/tools/Makefile.in |
203 |
# @${REINPLACE_CMD} -e 's|fd_plugins.h|filed/fd_plugins.h|g' -e 's|dir_plugins.h|dird/dir_plugins.h|g' -e 's|stored.h|stored/stored.h|g' \ |
200 |
@${REINPLACE_CMD} -e 's|fd_plugins.h|filed/fd_plugins.h|g' -e 's|dir_plugins.h|dird/dir_plugins.h|g' -e 's|stored.h|stored/stored.h|g' \ |
204 |
# ${WRKSRC}/src/tools/bpluginfo.c |
201 |
${WRKSRC}/src/tools/bpluginfo.c |
205 |
#.endif |
202 |
.endif |
206 |
|
203 |
|
207 |
.if !target(pre-install) |
204 |
.if !target(pre-install) |
208 |
pre-install: |
205 |
pre-install: |
209 |
if [ ! -d "${STAGEDIR}${BACULA_DIR}" ]; then \ |
206 |
if [ ! -d "${BACULA_DIR}" ]; then \ |
210 |
${ECHO_CMD} "creating ${STAGEDIR}${BACULA_DIR}" ; \ |
207 |
${ECHO_CMD} "creating ${BACULA_DIR}" ; \ |
211 |
${MKDIR} ${STAGEDIR}${BACULA_DIR}; \ |
208 |
${MKDIR} ${BACULA_DIR}; \ |
212 |
else \ |
209 |
else \ |
213 |
${ECHO_CMD} "${STAGEDIR}${BACULA_DIR} already exists"; \ |
210 |
${ECHO_CMD} "${BACULA_DIR} already exists"; \ |
214 |
fi |
211 |
fi |
215 |
|
212 |
|
216 |
# Extend /etc/services and install UID/GID |
213 |
# Extend /etc/services and install UID/GID |
217 |
@ ${SETENV} PKG_PREFIX=${STAGEDIR}${PREFIX} \ |
214 |
@ ${SETENV} PKG_PREFIX=${PREFIX} \ |
218 |
${SH} ${PKGINSTALL} ${PORTNAME} PRE-INSTALL |
215 |
${SH} ${PKGINSTALL} ${PORTNAME} PRE-INSTALL |
219 |
.endif |
216 |
.endif |
220 |
|
217 |
|
Lines 222-271
Link Here
|
222 |
post-install: |
219 |
post-install: |
223 |
.if defined(WITH_CLIENT_ONLY) |
220 |
.if defined(WITH_CLIENT_ONLY) |
224 |
# Extend only /etc/services |
221 |
# Extend only /etc/services |
225 |
@ ${SETENV} PKG_PREFIX=${STAGEDIR}${PREFIX} \ |
222 |
@ ${SETENV} PKG_PREFIX=${PREFIX} \ |
226 |
${SH} ${PKGINSTALL} ${PORTNAME} |
223 |
${SH} ${PKGINSTALL} ${PORTNAME} |
227 |
# Console stuff |
224 |
# Console stuff |
228 |
if [ -f ${STAGEDIR}${ETCDIR}/bconsole.conf.new ]; then \ |
225 |
if [ -f ${ETCDIR}/bconsole.conf.new ]; then \ |
229 |
${ECHO_CMD} "etc/bconsole.conf.new" >> ${TMPPLIST}; \ |
226 |
${ECHO_CMD} "etc/bconsole.conf.new" >> ${TMPPLIST}; \ |
230 |
${CHGRP} bacula ${STAGEDIR}${ETCDIR}/bconsole.conf.new; \ |
227 |
${CHGRP} bacula ${ETCDIR}/bconsole.conf.new; \ |
231 |
elif [ -f ${STAGEDIR}${ETCDIR}/bconsole.conf ]; then \ |
228 |
elif [ -f ${ETCDIR}/bconsole.conf ]; then \ |
232 |
${MV} ${STAGEDIR}${ETCDIR}/bconsole.conf ${STAGEDIR}${ETCDIR}/bconsole.conf.sample; \ |
229 |
${MV} ${ETCDIR}/bconsole.conf ${ETCDIR}/bconsole.conf.sample; \ |
233 |
${CHGRP} bacula ${STAGEDIR}${ETCDIR}/bconsole.conf.sample; \ |
230 |
${CHGRP} bacula ${ETCDIR}/bconsole.conf.sample; \ |
234 |
${ECHO_CMD} "etc/bacula/bconsole.conf.sample" >> ${TMPPLIST}; \ |
231 |
${ECHO_CMD} "etc/bacula/bconsole.conf.sample" >> ${TMPPLIST}; \ |
235 |
fi |
232 |
fi |
236 |
|
233 |
|
237 |
# ensure that users in the bacula group can run bconsole |
234 |
# ensure that users in the bacula group can run bconsole |
238 |
${CHGRP} bacula ${STAGEDIR}${PREFIX}/sbin/bconsole |
235 |
${CHGRP} bacula ${PREFIX}/sbin/bconsole |
239 |
.else |
236 |
.else |
240 |
# Install config files and preserve existing ones |
237 |
# Install config files and preserve existing ones |
241 |
${INSTALL_SCRIPT} ${FILESDIR}/chio-bacula ${STAGEDIR}${PREFIX}/sbin |
238 |
${INSTALL_SCRIPT} ${FILESDIR}/chio-bacula ${PREFIX}/sbin |
242 |
if [ -f ${ETCDIR}/bacula-barcodes ]; then \ |
239 |
if [ -f ${ETCDIR}/bacula-barcodes ]; then \ |
243 |
${INSTALL_DATA} ${FILESDIR}/bacula-barcodes ${ETCDIR}/bacula-barcodes.new ; \ |
240 |
${INSTALL_DATA} ${FILESDIR}/bacula-barcodes ${ETCDIR}/bacula-barcodes.new ; \ |
244 |
${ECHO_CMD} "etc/bacula/bacula-barcodes.new" >> ${TMPPLIST}; \ |
241 |
${ECHO_CMD} "etc/bacula/bacula-barcodes.new" >> ${TMPPLIST}; \ |
245 |
else \ |
242 |
else \ |
246 |
${INSTALL_DATA} ${FILESDIR}/bacula-barcodes ${STAGEDIR}${ETCDIR}/bacula-barcodes.samples ; \ |
243 |
${INSTALL_DATA} ${FILESDIR}/bacula-barcodes ${ETCDIR}/bacula-barcodes.samples ; \ |
247 |
${ECHO_CMD} "etc/bacula/bacula-barcodes.samples" >> ${TMPPLIST}; \ |
244 |
${ECHO_CMD} "etc/bacula/bacula-barcodes.samples" >> ${TMPPLIST}; \ |
248 |
fi |
245 |
fi |
249 |
# Add configuration files directory to packing list |
246 |
# Add configuration files directory to packing list |
250 |
${ECHO_CMD} "@unexec ${RMDIR} %D/etc/bacula 2>/dev/null || true" >> ${TMPPLIST} |
247 |
${ECHO_CMD} "@unexec ${RMDIR} %D/etc/bacula 2>/dev/null || true" >> ${TMPPLIST} |
251 |
${CHOWN} -R bacula:bacula ${STAGEDIR}${PREFIX}/share/bacula |
248 |
# chmod of bsmtp program so bacula can use it with dropped down permissions |
|
|
249 |
${CHMOD} o+x ${PREFIX}/sbin/bsmtp |
250 |
${CHOWN} -R bacula:bacula ${PREFIX}/share/bacula |
252 |
|
251 |
|
253 |
# on a fresh install, the .new suffix is not used |
252 |
# on a fresh install, the .new suffix is not used |
254 |
if [ -f ${STAGEDIR}${ETCDIR}/bacula-dir.conf.new ]; then \ |
253 |
if [ -f ${ETCDIR}/bacula-dir.conf.new ]; then \ |
255 |
${CHGRP} bacula ${STAGEDIR}${ETCDIR}/bacula-dir.conf.new; \ |
254 |
${CHGRP} bacula ${ETCDIR}/bacula-dir.conf.new; \ |
256 |
else \ |
255 |
else \ |
257 |
${CHGRP} bacula ${STAGEDIR}${ETCDIR}/bacula-dir.conf; \ |
256 |
${CHGRP} bacula ${ETCDIR}/bacula-dir.conf; \ |
258 |
fi |
257 |
fi |
259 |
|
258 |
|
260 |
${CHGRP} bacula ${STAGEDIR}${PREFIX}/sbin/dbcheck |
259 |
${CHGRP} bacula ${PREFIX}/sbin/dbcheck |
261 |
|
260 |
|
262 |
.endif |
261 |
.endif |
263 |
# Install leaves existing conf files untouched. Respect this here! |
262 |
# Install leaves existing conf files untouched. Respect this here! |
264 |
for na in ${CONFFILES}; do \ |
263 |
for na in ${CONFFILES}; do \ |
265 |
if [ -f ${STAGEDIR}${ETCDIR}/bacula-$$na.conf.new ]; then \ |
264 |
if [ -f ${ETCDIR}/bacula-$$na.conf.new ]; then \ |
266 |
${ECHO_CMD} "etc/bacula/bacula-$$na.conf.new" >> ${TMPPLIST}; \ |
265 |
${ECHO_CMD} "etc/bacula/bacula-$$na.conf.new" >> ${TMPPLIST}; \ |
267 |
elif [ -f ${STAGEDIR}${ETCDIR}/bacula-$$na.conf ]; then \ |
266 |
elif [ -f ${ETCDIR}/bacula-$$na.conf ]; then \ |
268 |
${MV} ${STAGEDIR}${ETCDIR}/bacula-$$na.conf ${STAGEDIR}${ETCDIR}/bacula-$$na.conf.sample; \ |
267 |
${MV} ${ETCDIR}/bacula-$$na.conf ${ETCDIR}/bacula-$$na.conf.sample; \ |
269 |
${ECHO_CMD} "etc/bacula/bacula-$$na.conf.sample" >> ${TMPPLIST}; \ |
268 |
${ECHO_CMD} "etc/bacula/bacula-$$na.conf.sample" >> ${TMPPLIST}; \ |
270 |
fi; \ |
269 |
fi; \ |
271 |
done |
270 |
done |
Lines 273-280
Link Here
|
273 |
# Add configuration files directory to packing list |
272 |
# Add configuration files directory to packing list |
274 |
${ECHO_CMD} "@unexec ${RMDIR} %D/etc/bacula 2>/dev/null || true" >> ${TMPPLIST} |
273 |
${ECHO_CMD} "@unexec ${RMDIR} %D/etc/bacula 2>/dev/null || true" >> ${TMPPLIST} |
275 |
|
274 |
|
276 |
${CHGRP} wheel ${STAGEDIR}${PREFIX}/etc |
275 |
${CHGRP} wheel ${PREFIX}/etc |
277 |
|
276 |
|
|
|
277 |
@${CAT} ${PKGMESSAGE} |
278 |
.endif |
278 |
.endif |
279 |
.else |
279 |
.else |
280 |
.include "${MASTERDIR}/Makefile.common" |
280 |
.include "${MASTERDIR}/Makefile.common" |