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

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

ncurses: update to 6.0, rev bump dependents due to new ABI

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