source: trunk/dports/sysutils/bacula/Portfile @ 139229

Last change on this file since 139229 was 139229, checked in by jeremyhu@…, 4 years ago

misc: Change port:openssl dependency to path:lib/libssl.dylib:openssl

This should allow usage of libressl as a replacement for openssl in relevant
ports. Not all ports have been tested, but libressl aims for API
compatibility with OpenSSL, so it is expected to work.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 11.1 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 139229 2015-08-08 03:10:35Z jeremyhu@macports.org $
3
4PortSystem          1.0
5
6name                bacula
7version             7.0.4
8categories          sysutils
9platforms           darwin
10license             {AGPL-3 OpenSSLException}
11maintainers         googlemail.com:robertoschwald
12
13description         network based backup program
14long_description    Bacula is a set of computer programs that permit you to \
15                    manage backup, recovery, and verification of computer data across \
16                    a network of computers of different kinds.
17
18homepage            http://www.bacula.org/
19master_sites        sourceforge
20
21checksums           rmd160  09d033f4ea3431f57d8018647af41c1ae417652d \
22                    sha256  ebf802b843a95f6526e82dd181dff7cd7dc7d1fdc55cec8636e0fe3af69acf7e
23
24depends_build       port:pkgconfig
25depends_lib         port:gawk \
26                    port:gettext \
27                    port:libiconv \
28                    port:ncurses \
29                    path:lib/libssl.dylib:openssl \
30                    port:tcp_wrappers \
31                    port:zlib \
32                    port:lzo2
33
34configure.ccache    no
35configure.args      --mandir=${prefix}/share/man \
36                    --docdir=${prefix}/share/doc/bacula \
37                    --datarootdir=${prefix}/share \
38                    --with-pid-dir=${prefix}/var/run \
39                    --with-subsys-dir=${prefix}/var/run/subsys \
40                    --sysconfdir=${prefix}/etc/${name} \
41                    --with-libintl-prefix=${prefix} \
42                    --with-openssl=${prefix} \
43                    --with-libiconv-prefix=${prefix} \
44                    --with-archivedir=/var/tmp \
45                    --with-working-dir=${prefix}/var/bacula/working \
46                    --with-included-gettext=${prefix} \
47                    --enable-smartalloc \
48                    --enable-largefile \
49                    --enable-conio \
50                    --without-sqlite3 \
51                    --without-postgresql \
52                    --without-mysql \
53                    --with-tcp-wrappers
54
55configure.cppflags-append   -I${prefix}/ncurses
56configure.ldflags           ""
57
58destroot.keepdirs   ${destroot}${prefix}/var/run/subsys \
59                    ${destroot}${prefix}/var/bacula/working
60
61# Don't overwrite preference files
62post-destroot {
63    file rename ${destroot}${prefix}/etc/bacula/bacula-fd.conf ${destroot}${prefix}/etc/bacula/bacula-fd.conf.example
64    file rename ${destroot}${prefix}/etc/bacula/bconsole.conf ${destroot}${prefix}/etc/bacula/bconsole.conf.example
65    file rename ${destroot}${prefix}/etc/bacula/mtx-changer.conf ${destroot}${prefix}/etc/bacula/mtx-changer.conf.example
66}
67
68startupitem.create  yes
69startupitem.init    "BIN=${prefix}/sbin/bacula-fd\nPID=${prefix}/var/run/bacula-fd.*.pid"
70startupitem.start   "\[ -x \${BIN} \] && \${BIN} -c ${prefix}/etc/bacula/bacula-fd.conf"
71startupitem.stop    "\[ -r \${PID} \] && /bin/kill \$(cat \${PID})"
72
73notes "To use the Bacula FD client, you'll need to configure \"${prefix}/etc/bacula/bacula-fd.conf\"."
74notes-append "To use bconsole, you'll need to configure \"${prefix}/etc/bacula/bconsole.conf\"."
75
76variant client_only conflicts mysql51 mysql55 postgresql83 postgresql84 sqlite3 description "Install bacula client (bacula-fd) only" {
77    configure.args-append --enable-client-only
78}
79
80variant console_bat description "Install BAT console GUI application" {
81    depends_build-append  port:tcp_wrappers \
82                          port:makeicns
83    depends_lib-append    port:qt4-mac \
84                          port:qwt52
85    configure.args-append --enable-bat
86    post-patch {
87        system "makeicns -in ${worksrcpath}/src/qt-console/images/bat_icon.png -out ${worksrcpath}/src/qt-console/images/bat_icon.icns"
88    }
89    post-destroot {
90        file rename ${destroot}${prefix}/etc/bacula/bat.conf ${destroot}${prefix}/etc/bacula/bat.conf.example
91        # for now, copy manually until upstream provider fixes bat.app install routines
92        xinstall -m 755 -d ${destroot}${applications_dir}
93        copy ${worksrcpath}/src/qt-console/bat.app ${destroot}${applications_dir}/Bacula-BAT.app
94    }
95    notes-append "To use the Bacula BAT GUI, you'll need to configure \"${prefix}/etc/bacula/bat.conf\"."
96}
97
98variant mysql51 conflicts client_only mysql55 postgresql83 postgresql84 sqlite3 description "Install bacula client and server with mysql 5.1 backend" {
99    depends_lib-append    port:mysql51
100    configure.args-append --with-mysql=${prefix}/include/mysql51/mysql
101    configure.args-delete --without-mysql
102    configure.args-append --enable-batch-insert
103    configure.cppflags-append   -I${prefix}/include/mysql51/mysql
104
105    patchfiles          patch-configure-mysql.diff
106    post-patch {
107                     reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/configure
108    }
109    notes-append "
110       To use the Bacula Director, you'll need to perform the following steps:
111         1. create user \"bacula\" on a mysql database
112         2. execute \"${prefix}/etc/bacula/create_bacula_database -h <mysql_server> -u <db_admin_user> -p\"
113         3. execute \"${prefix}/etc/bacula/make_bacula_tables -h <mysql_server> -u <db_admin_user> -p\"
114         4. execute \"${prefix}/etc/bacula/grant_bacula_privileges -h <mysql_server> -u <db_admin_user> -p\"
115         5. configure \"${prefix}/etc/bacula/bacula-dir.conf\" and set the catalog database settings for the bacula db user.
116    "
117}
118
119variant mysql55 conflicts client_only mysql51 postgresql83 postgresql84 sqlite3 description "Install bacula client and server with mysql 5.5 backend" {
120    depends_lib-append    port:mysql55
121    configure.args-append --with-mysql=${prefix}/include/mysql55/mysql
122    configure.args-delete --without-mysql
123    configure.args-append --enable-batch-insert
124    configure.cppflags-append   -I${prefix}/include/mysql55/mysql
125
126    patchfiles          patch-configure-mysql.diff
127    post-patch {
128                     reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/configure
129    }
130    notes-append "
131       To use the Bacula Director, you'll need to perform the following steps:
132         1. create user \"bacula\" on a mysql database
133         2. execute \"${prefix}/etc/bacula/create_bacula_database -h <mysql_server> -u <db_admin_user> -p\"
134         3. execute \"${prefix}/etc/bacula/make_bacula_tables -h <mysql_server> -u <db_admin_user> -p\"
135         4. execute \"${prefix}/etc/bacula/grant_bacula_privileges -h <mysql_server> -u <db_admin_user> -p\"
136         5. configure \"${prefix}/etc/bacula/bacula-dir.conf\" and set the catalog database settings for the bacula db user.
137    "
138}
139
140variant postgresql83 conflicts mysql51 mysql55 postgresql84 sqlite3 client_only description "Install bacula client and server with postgresql 8.3 backend" {
141    depends_lib-append    port:postgresql83
142    configure.args-append --with-postgresql
143    configure.args-delete --without-postgresql
144    configure.args-append --enable-batch-insert
145    configure.env-append  PATH=${prefix}/lib/postgresql83/bin:$env(PATH)
146
147    patchfiles          patch-create_postgresql_database.diff
148
149    notes-append "
150       To use the Bacula Director, you'll need to perform the following steps:
151         1. create user \"bacula\" on a PostgreSQL database
152         2. execute \"${prefix}/etc/bacula/create_bacula_database -h <postgresql-server> -U <db_admin_user>\"
153         3. execute \"${prefix}/etc/bacula/make_bacula_tables -h <postgresql-server> -U <db_admin_user>\"
154         4. execute \"${prefix}/etc/bacula/grant_bacula_privileges -h <postgresql-server> -U <db_admin_user> -p\"
155         5. configure \"${prefix}/etc/bacula/bacula-dir.conf\" and set the catalog database settings for the bacula db user.
156    "
157}
158
159variant postgresql84 conflicts mysql51 mysql55 postgresql83 sqlite3 client_only description "Install bacula client and server with postgresql 8.4 backend" {
160    depends_lib-append    port:postgresql84
161    configure.args-append --with-postgresql
162    configure.args-delete --without-postgresql
163    configure.args-append --enable-batch-insert
164    configure.env-append  PATH=${prefix}/lib/postgresql84/bin:$env(PATH)
165
166    patchfiles          patch-create_postgresql_database.diff
167
168    notes-append "
169       To use the Bacula Director, you'll need to perform the following steps:
170         1. create user \"bacula\" on a PostgreSQL database
171         2. execute \"${prefix}/etc/bacula/create_bacula_database -h <postgresql-server> -U <db_admin_user>\"
172         3. execute \"${prefix}/etc/bacula/make_bacula_tables -h <postgresql-server> -U <db_admin_user>\"
173         4. execute \"${prefix}/etc/bacula/grant_bacula_privileges -h <postgresql-server> -U <db_admin_user> -p\"
174         5. configure \"${prefix}/etc/bacula/bacula-dir.conf\" and set the catalog database settings for the bacula db user.
175    "
176}
177
178variant sqlite3 conflicts client_only mysql51 mysql55 postgresql83 postgresql84 description "Install bacula client and server with sqlite 3 backend" {
179    depends_lib-append    port:sqlite3
180    configure.args-append --with-sqlite3=${prefix}
181    configure.args-delete --without-sqlite3
182    configure.args-append --enable-batch-insert
183    notes-append "
184       To use the Bacula Director, you'll need to perform the following steps:
185         1. execute \"${prefix}/etc/bacula/create_bacula_database\"
186         2. execute \"${prefix}/etc/bacula/make_bacula_tables\"
187         3. configure \"${prefix}/etc/bacula/bacula-dir.conf\" and set the catalog database settings for the bacula db user.
188    "
189}
190
191default_variants +console_bat
192
193if {![variant_isset mysql51] && ![variant_isset mysql55] && ![variant_isset postgresql83] && ![variant_isset postgresql84] && ![variant_isset sqlite3]} {
194    default_variants-append +client_only
195} else {
196    # is a server installation
197
198    # Add the server daemons to the startupitem wrapper
199    startupitem.init-append    "BIN_DIR=${prefix}/sbin/bacula-dir\nPID_DIR=${prefix}/var/run/bacula-dir.*.pid\n"
200    startupitem.init-append    "BIN_SD=${prefix}/sbin/bacula-sd\nPID_SD=${prefix}/var/run/bacula-sd.*.pid\n"
201    startupitem.start-append   "\[ -x \${BIN_DIR} -a -f ${prefix}/etc/bacula/bacula-dir.conf \] && \${BIN_DIR} -c ${prefix}/etc/bacula/bacula-dir.conf"
202    startupitem.start-append   "\[ -x \${BIN_SD} -a -f ${prefix}/etc/bacula/bacula-sd.conf \] && \${BIN_SD} -c ${prefix}/etc/bacula/bacula-sd.conf"
203    startupitem.stop-append    "\[ -r \${PID_DIR} \] && /bin/kill \$(cat \${PID_DIR})"
204    startupitem.stop-append    "\[ -r \${PID_SD} \] && /bin/kill \$(cat \${PID_SD})"
205
206    # Don't overwrite existing preference files
207    post-destroot {
208        file rename ${destroot}${prefix}/etc/bacula/bacula-dir.conf ${destroot}${prefix}/etc/bacula/bacula-dir.conf.example
209        file rename ${destroot}${prefix}/etc/bacula/bacula-sd.conf ${destroot}${prefix}/etc/bacula/bacula-sd.conf.example
210    }
211    notes-append "To use the Bacula Storage Daemon, you'll need to configure \"${prefix}/etc/bacula/bacula-sd.conf\"."
212}
213
214pre-deactivate {
215    if {[file exists /Library/LaunchDaemons/org.macports.bacula.plist]} {
216         system "launchctl unload /Library/LaunchDaemons/org.macports.bacula.plist"
217    }
218}
219
220livecheck.type           regex
221livecheck.url            ${homepage}
222livecheck.regex          {Bacula ([0-9\.]+)}
Note: See TracBrowser for help on using the repository browser.