Tweak misc/amanda-server version 3.3.2,1
[dports.git] / misc / amanda-server / Makefile
1 # New ports collection makefile for:    amanda
2 # Date created:                         28th Feb 1995
3 # Whom:                                 gpalmer
4 #
5 # $FreeBSD: ports/misc/amanda-server/Makefile,v 1.131 2013/01/31 19:48:36 svnexp Exp $
6 #
7
8 PORTNAME=       amanda
9 PORTVERSION=    3.3.2
10 PORTEPOCH=      1
11 CATEGORIES=     misc
12 MASTER_SITES=   SF/amanda/amanda%20-%20stable/${PORTVERSION}
13 PKGNAMESUFFIX?= -server
14
15 MAINTAINER=     kuriyama@FreeBSD.org
16 COMMENT?=       The Advanced Maryland Automatic Network Disk Archiver (server)
17
18 RUN_DEPENDS=    perl-amanda:${PORTSDIR}/misc/amanda-perl-wrapper
19 BUILD_DEPENDS=  perl-amanda:${PORTSDIR}/misc/amanda-perl-wrapper
20
21 WRKSRC=         ${WRKDIR}/amanda-${PORTVERSION}
22 SLAVEDIRS=      misc/amanda-client
23
24 LATEST_LINK=    ${PORTNAME}${PKGNAMESUFFIX}
25 GNU_CONFIGURE=  yes
26 USE_GNOME=      pkgconfig glib20
27 USE_GMAKE=      yes
28 USE_OPENSSL=    yes
29 USE_LDCONFIG=   yes
30 USE_PERL5=      yes
31 CONFIGURE_ARGS= --libexecdir=${PREFIX}/libexec/amanda \
32                 --without-amlibexecdir \
33                 --with-amandahosts --with-fqdn \
34                 --with-dump-honor-nodump \
35                 --prefix=${PREFIX} \
36                 --disable-glibtest \
37                 --with-user=${USERS} --with-group=${AMANDA_GROUP} \
38                 --with-bsdtcp-security --with-bsdudp-security \
39                 --with-ssh-security
40 CONFIGURE_ENV=  PERL=${LOCALBASE}/bin/perl-amanda
41 PKG_MESSAGE=    ${WRKDIR}/pkg-message
42 SUB_FILES=      pkg-message
43 SUB_LIST=       PORTSDIR=${PORTSDIR}
44
45 OPTIONS=        GNUTAR "use GNU tar" on
46
47 .include <bsd.port.pre.mk>
48
49 .if defined(AMANDA_USER)
50 USERS=          ${AMANDA_USER}
51 .else
52 USERS?=         amanda
53 .endif
54 .if !defined(AMANDA_GROUP)
55 AMANDA_GROUP=   amanda
56 .endif
57 GROUPS?=        operator amanda
58
59 AMANDA_GNUTAR_LISTDIR?= ${PREFIX}/var/amanda/gnutar-lists
60 AMANDA_DATES?=          ${PREFIX}/var/amanda/amandates
61 PLIST_SUB=              SHLIBVER=${PORTVERSION} AMANDA_DATES=${AMANDA_DATES}
62
63 # amanda-server/amanda-client common part
64 .if defined (AMANDA_SERVER)
65 CONFIGURE_ARGS+=        --with-index-server=${AMANDA_SERVER}
66 CONFIGURE_ARGS+=        --with-tape-server=${AMANDA_SERVER}
67 .endif
68
69 .if !defined(WITHOUT_GNUTAR)
70 CONFIGURE_ARGS+=--with-gnutar-listdir=${AMANDA_GNUTAR_LISTDIR} \
71                 --with-gnutar=${LOCALBASE}/bin/gtar
72 BUILD_DEPENDS+= gtar:${PORTSDIR}/archivers/gtar
73 RUN_DEPENDS+=   gtar:${PORTSDIR}/archivers/gtar
74 .endif
75
76 # amanda-server part
77 .if !defined(CLIENT_ONLY)
78
79 SUB_FILES+=     pkg-install pkg-deinstall
80 SUB_LIST+=      PERL=${PERL} SITE_PERL_REL=${SITE_PERL_REL}
81
82 pre-fetch:
83         @${ECHO} ""
84         @${ECHO} "You may use the following build options:"
85         @${ECHO} ""
86         @${ECHO} "    AMANDA_SERVER=server to specify a server name"
87         @${ECHO} "        The default is `uname -n`"
88         @${ECHO} "    AMANDA_USER=user to specify the default user"
89         @${ECHO} "        The default is amanda"
90         @${ECHO} "    AMANDA_GROUP=group to specify the default group"
91         @${ECHO} "        The default is amanda"
92         @${ECHO} "    AMANDA_DATES=path to client amandates file"
93         @${ECHO} ""
94
95 CONFLICTS=      amanda-server-2.5.* amanda-server-2.6.* amanda-server-3.2.*
96
97 BUILD_DEPENDS+= ${LOCALBASE}/lib/amanda/libamandad-${PORTVERSION}.so:${PORTSDIR}/misc/amanda-client
98 RUN_DEPENDS+=   ${LOCALBASE}/lib/amanda/libamandad-${PORTVERSION}.so:${PORTSDIR}/misc/amanda-client
99
100 CONFIGURE_ARGS+=--without-client
101
102 MAN5=           disklist.5 \
103                 tapelist.5
104 MAN7=           amanda-changers.7 \
105                 amanda-compatibility.7 \
106                 amanda-devices.7 \
107                 amanda-interactivity.7 \
108                 amanda-taperscan.7
109 MAN8=           amaddclient.8 amadmin.8 amaespipe.8 amcheck.8 \
110                 amcheckdb.8 amcheckdump.8 \
111                 amcleanup.8 \
112                 amcleanupdisk.8 \
113                 amcrypt.8 amcryptsimple.8 amcrypt-ossl-asym.8 amcrypt-ossl.8 \
114                 amdevcheck.8 \
115                 amdump.8 amfetchdump.8 amflush.8 amgetconf.8 amgpgcrypt.8 \
116                 amlabel.8 \
117                 amoverview.8 amreport.8 amrestore.8 amrmtape.8 \
118                 amserverconfig.8 amstatus.8 \
119                 amtape.8 amtoc.8 amtapetype.8 \
120                 amvault.8
121
122 OPTIONS+=       PLOT "enable ploting, requires X11 libraries" off\
123                 SAMBA "enable the use of smbclient" off \
124                 S3 "enable Amazon S3 device support" off
125
126 .if defined (WITH_PLOT)
127 BUILD_DEPENDS+= gnuplot:${PORTSDIR}/math/gnuplot
128 RUN_DEPENDS+=   gnuplot:${PORTSDIR}/math/gnuplot
129 MAN8+=          amplot.8
130 PLIST_SUB+=     PLOT=''
131 CONFIGURE_ARGS+=        --with-gnuplot=${LOCALBASE}/bin/gnuplot
132 .else
133 PLIST_SUB+=     PLOT='@comment '
134 CONFIGURE_ARGS+=        --without-gnuplot
135 .endif
136
137 .if defined (WITH_SAMBA)
138 SAMBA_PORT?=    samba36
139 BUILD_DEPENDS+= smbclient:${PORTSDIR}/net/${SAMBA_PORT}
140 RUN_DEPENDS+=   smbclient:${PORTSDIR}/net/${SAMBA_PORT}
141 CONFIGURE_ARGS+=        --with-smbclient=${LOCALBASE}/bin/smbclient
142 .endif
143
144 # If configure founds libcurl, automatically enabled it (with plist change).
145 .if defined(WITH_S3)
146 LIB_DEPENDS+=   curl:${PORTSDIR}/ftp/curl
147 CONFIGURE_ARGS+=        --enable-s3-device
148 PLIST_SUB+=     S3DEVICE=''
149 .else
150 CONFIGURE_ARGS+=        --disable-s3-device
151 PLIST_SUB+=     S3DEVICE='@comment '
152 .endif
153
154 post-install:
155         @${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
156         @${CAT} ${PKGMESSAGE}
157
158 # amanda-client part
159 .else
160
161 pre-fetch:
162         @${ECHO} ""
163         @${ECHO} "You may use the following build options:"
164         @${ECHO} ""
165         @${ECHO} "    AMANDA_SERVER=server to specify a server name"
166         @${ECHO} "        The default is `uname -n`"
167         @${ECHO} "    AMANDA_GNUTAR_LISTDIR=dir to specify the directory that"
168         @${ECHO} "        the gnutar index files should live in"
169         @${ECHO} "        The default is ${PREFIX}/var/amanda/gnutar-lists"
170         @${ECHO} "    AMANDA_USER=user to specify the default user"
171         @${ECHO} "        The default is amanda"
172         @${ECHO} "    AMANDA_GROUP=group to specify the default group"
173         @${ECHO} "        The default is amanda"
174         @${ECHO} "    AMANDA_DATES=path to client amandates file"
175         @${ECHO} ""
176
177 CONFLICTS=      amanda-client-2.5.* amanda-client-2.6.* amanda-client-3.2.*
178 CONFIGURE_ARGS+=--without-server --with-amandates=${AMANDA_DATES}
179 .if defined(AMANDA_NO_SNAPSHOT_DUMP)
180 CFLAGS=         -DFreeBSD_NO_SNAPSHOT_DUMP=t
181 .endif
182
183 MAN5=           amanda-archive-format.5 \
184                 amanda-client.conf.5 \
185                 amanda.conf.5
186 MAN7=           amanda-applications.7 \
187                 amanda-auth.7 \
188                 amanda-match.7 \
189                 amanda-scripts.7
190 MAN8=           amanda.8 \
191                 amarchiver.8 \
192                 amdump_client.8 \
193                 amgtar.8 \
194                 ampgsql.8 \
195                 amraw.8 \
196                 amrecover.8 \
197                 amsamba.8 \
198                 amservice.8 \
199                 amstar.8 \
200                 amsuntar.8 \
201                 amzfs-sendrecv.8 \
202                 amzfs-snapshot.8 \
203                 script-email.8
204
205 post-install:
206         ${MKDIR} ${AMANDA_GNUTAR_LISTDIR}
207         ${CHOWN} ${USERS}:${AMANDA_GROUP} ${AMANDA_GNUTAR_LISTDIR}
208         ${TOUCH} ${AMANDA_DATES}
209         ${CHOWN} ${USERS}:${AMANDA_GROUP} ${AMANDA_DATES}
210         ${CAT} ${PKGMESSAGE}
211
212 .endif
213
214 # MEMO:
215 #   Prefix @WANT_SERVER_TRUE@ for server only files.
216 #   Prefix @WANT_CLIENT_TRUE@ for client only files.
217 #   For debugging: dbprintf(_("getcmd: %s\n"), line);
218
219 .include <bsd.port.post.mk>