Ticket #44127: Portfile-7.0.4_2014-06-29.diff

File Portfile-7.0.4_2014-06-29.diff, 11.3 KB (added by robertoschwald (Robert Oschwald), 10 years ago)

Portfile patch for 7.0.4, obsoletes all other former Portfile patches of this ticket

  • Portfile

    old new  
    44PortSystem          1.0
    55
    66name                bacula
    7 version             5.2.13
     7version             7.0.4
    88categories          sysutils
    99platforms           darwin
    1010license             {AGPL-3 OpenSSLException}
     
    1818homepage            http://www.bacula.org/
    1919master_sites        sourceforge
    2020
    21 checksums           rmd160  bcc168143c0eec5cb5e983f765935534379f4fcf \
    22                     sha256  a4bed458bf001889bd06bf31671b5d9908055a1d1e8113fd750ae4d326607ad8
     21checksums           rmd160  09d033f4ea3431f57d8018647af41c1ae417652d \
     22                    sha256  ebf802b843a95f6526e82dd181dff7cd7dc7d1fdc55cec8636e0fe3af69acf7e
    2323
    2424depends_build       port:pkgconfig
    2525depends_lib         port:gawk \
     
    2828                    port:ncurses \
    2929                    port:openssl \
    3030                    port:tcp_wrappers \
    31                     port:zlib
     31                    port:zlib \
     32                    port:lzo2
    3233
    3334configure.ccache    no
    3435configure.args      --mandir=${prefix}/share/man \
     
    4041                    --with-libintl-prefix=${prefix} \
    4142                    --with-openssl=${prefix} \
    4243                    --with-libiconv-prefix=${prefix} \
    43                     --with-readline=${prefix} \
    4444                    --with-archivedir=/var/tmp \
    4545                    --with-working-dir=${prefix}/var/bacula/working \
    4646                    --with-included-gettext=${prefix} \
    4747                    --enable-smartalloc \
    4848                    --enable-largefile \
    49                     --without-sqlite \
     49                    --enable-conio \
    5050                    --without-sqlite3 \
    5151                    --without-postgresql \
    5252                    --without-mysql \
    53                     --disable-gnome \
    54                     --disable-wx-console \
    55                     --disable-tray-monitor \
    5653                    --with-tcp-wrappers
    5754
    5855configure.cppflags-append   -I${prefix}/ncurses
     
    7370startupitem.start   "\[ -x \${BIN} \] && \${BIN} -c ${prefix}/etc/bacula/bacula-fd.conf"
    7471startupitem.stop    "\[ -r \${PID} \] && /bin/kill \$(cat \${PID})"
    7572
    76 variant client_only conflicts mysql55 postgresql83 postgresql84 sqlite2 sqlite3 description "Install bacula client (bacula-fd) only" {
     73notes "*******************************************************************************************************************"
     74notes-append "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" {
    7778    configure.args-append --enable-client-only
    7879}
    7980
     
    9293        xinstall -m 755 -d ${destroot}${applications_dir}
    9394        copy ${worksrcpath}/src/qt-console/bat.app ${destroot}${applications_dir}/Bacula-BAT.app
    9495    }
    95     notes "To use the Bacula BAT GUI, you'll need to configure \"${prefix}/etc/bacula/bat.conf\"."
     96    notes-append "To use the Bacula BAT GUI, you'll need to configure \"${prefix}/etc/bacula/bat.conf\"."
    9697}
    9798
    98 variant mysql55 conflicts client_only postgresql83 postgresql84 sqlite2 sqlite3 description "Install bacula client and server with mysql 5 backend" {
     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" {
    99121    depends_lib-append    port:mysql55
    100122    configure.args-append --with-mysql=${prefix}/include/mysql55/mysql
    101123    configure.args-delete --without-mysql
     124    configure.args-append --enable-batch-insert
    102125    configure.cppflags-append   -I${prefix}/include/mysql55/mysql
    103126
    104127    patchfiles          patch-configure-mysql.diff
    105128    post-patch {
    106129                     reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/configure
    107130    }
     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    "
    108139}
    109140
    110 variant postgresql83 conflicts mysql55 postgresql84 sqlite2 sqlite3 client_only description "Install bacula client and server with postgresql 8.3 backend" {
     141variant postgresql83 conflicts mysql51 mysql55 postgresql84 sqlite3 client_only description "Install bacula client and server with postgresql 8.3 backend" {
    111142    depends_lib-append    port:postgresql83
    112143    configure.args-append --with-postgresql
    113144    configure.args-delete --without-postgresql
     145    configure.args-append --enable-batch-insert
    114146    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    "
    115158}
    116159
    117 variant postgresql84 conflicts mysql55 postgresql83 sqlite2 sqlite3 client_only description "Install bacula client and server with postgresql 8.4 backend" {
     160variant postgresql84 conflicts mysql51 mysql55 postgresql83 sqlite3 client_only description "Install bacula client and server with postgresql 8.4 backend" {
    118161    depends_lib-append    port:postgresql84
    119162    configure.args-append --with-postgresql
    120163    configure.args-delete --without-postgresql
     164    configure.args-append --enable-batch-insert
    121165    configure.env-append  PATH=${prefix}/lib/postgresql84/bin:$env(PATH)
    122 }
    123166
    124 variant sqlite2 conflicts client_only sqlite3 mysql55 postgresql83 postgresql84 description "Install bacula client and server with sqlite 2 backend" {
    125     depends_lib-append    port:sqlite2
    126     configure.args-append --with-sqlite=${prefix}
    127     configure.args-delete --without-sqlite
     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    "
    128177}
    129178
    130 variant sqlite3 conflicts client_only sqlite2 mysql55 postgresql83 postgresql84 description "Install bacula client and server with sqlite 3 backend" {
     179variant sqlite3 conflicts client_only mysql51 mysql55 postgresql83 postgresql84 description "Install bacula client and server with sqlite 3 backend" {
    131180    depends_lib-append    port:sqlite3
    132181    configure.args-append --with-sqlite3=${prefix}
    133182    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    "
    134190}
    135191
    136192default_variants +console_bat
    137193
    138 if {![variant_isset mysql55] && ![variant_isset postgresql83] && ![variant_isset postgresql84] && ![variant_isset sqlite2] && ![variant_isset sqlite3]} {
     194if {![variant_isset mysql51] && ![variant_isset mysql55] && ![variant_isset postgresql83] && ![variant_isset postgresql84] && ![variant_isset sqlite3]} {
    139195    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-activate {
     216    notes-append "*******************************************************************************************************************"
     217}
     218
     219pre-deactivate {
     220    if {[file exists /Library/LaunchDaemons/org.macports.bacula.plist]} {
     221         system "launchctl unload /Library/LaunchDaemons/org.macports.bacula.plist"
     222    }
    140223}
    141224
    142225livecheck.type           regex