Ticket #36974: portfile_add_console_bat_ok2.diff

File portfile_add_console_bat_ok2.diff, 2.8 KB (added by robertoschwald (Robert Oschwald), 12 years ago)

Preserve bat.conf file on uninstall

  • Portfile

    old new  
    55
    66name             bacula
    77version          5.2.12
     8revision         2
    89categories       sysutils
    910platforms        darwin
    1011license          GPL
     
    2930                 port:tcp_wrappers \
    3031                 port:zlib
    3132
     33patchfiles       patch-qt-console-osx.diff
    3234# Comment out patchfiles in case they are needed in the future or for the non-client version which is completely untested at this point
    33 #patchfiles       patch-configure.diff \
    34 #                 patch-base64-typecast.diff
     35#                patch-configure.diff \
     36#                patch-base64-typecast.diff
    3537
    3638#post-patch {
    3739#                 reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/configure
     
    8789  configure.args-append --enable-client-only
    8890}
    8991
     92variant console_bat description "Install bacula BAT console" {
     93  depends_lib-append    port:qt4-mac
     94  depends_lib-append    port:qwt-devel
     95  depends_build-append  port:tcp_wrappers
     96  depends_build-append  port:makeicns
     97  configure.args-append --enable-bat
     98  startupitem.create  no
     99  # as bat can only be built with the client or server variants, we build with client
     100  configure.args-append --enable-client-only
     101  post-patch {
     102    system "makeicns -in ${worksrcpath}/src/qt-console/images/bat_icon.png -out ${worksrcpath}/src/qt-console/images/bat_icon.icns"
     103  }
     104  post-destroot {
     105    file rename ${destroot}${prefix}/etc/bacula/bat.conf ${destroot}${prefix}/etc/bacula/bat.conf.example
     106    # for now, copy manually until upstream provider fixes bat.app install routines
     107    xinstall -m 755 -d ${destroot}${applications_dir}
     108    copy ${worksrcpath}/src/qt-console/bat.app ${destroot}${applications_dir}/Bacula-BAT.app
     109  }
     110  post-install {
     111        ui_msg "####################################################################################################"
     112        ui_msg "\nTo use the Bacula BAT Gui, you'll need to configure \"${prefix}/etc/bacula/bat.conf\"."
     113        ui_msg "####################################################################################################"
     114  }
     115}
     116
    90117variant mysql5 conflicts client_only postgresql83 postgresql84 sqlite2 sqlite3 description "Install bacula client and server with mysql 5 backend" {
    91118  depends_lib-append    path:bin/mysql_config5:mysql5
    92119  configure.args-append --with-mysql
     
    119146  configure.args-delete --without-sqlite3
    120147}
    121148
    122 if {![variant_isset mysql5] && ![variant_isset postgresql83] && ![variant_isset postgresql84] && ![variant_isset sqlite2] && ![variant_isset sqlite3]} {
     149if {![variant_isset mysql5] && ![variant_isset postgresql83] && ![variant_isset postgresql84] && ![variant_isset sqlite2] && ![variant_isset sqlite3] && ![variant_isset console_bat]} {
    123150  default_variants +client_only
    124151}
    125152