Ignore:
Timestamp:
Nov 12, 2014, 2:40:07 AM (5 years ago)
Author:
ionic@…
Message:

gpg-agent: add launchd patchset. #43584

Location:
trunk/dports/security/gpg-agent
Files:
2 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/security/gpg-agent/Portfile

    r128045 r128050  
    77name                gpg-agent
    88version             2.0.26
     9revision            1
    910categories          security mail
    1011maintainers         ionic openmaintainer
     
    2526checksums           rmd160  874040ed8fad12067cbe67c8da222b2ad99a5a96 \
    2627                    sha256  7758e30dc382ae7a7167ed41b7f936aa50af5ea2d6fccdef663b5b750b65b8e0
     28
     29startupitem.location \
     30                    LaunchAgents
     31
     32set launchd_dir     ${prefix}/etc/${startupitem.location}/${startupitem.uniquename}/
    2733
    2834configure.args      --enable-agent-only \
     
    4753patchfiles          patch-po_Makevars.diff
    4854
     55# DO NOT USE. Maintainer-only helper for debugging purposes. DO NOT USE.
     56#configure.cflags-append -g3 -ggdb3 -gdwarf-2 -O0
     57
     58platform darwin {
     59    patchfiles-append        patch-agent_gpg-agent.c-launchd.diff
     60    configure.cflags-append  -F/System/Library/Frameworks/CoreFoundation.framework \
     61                             -D__APPLE_LAUNCHD__
     62
     63    if { [tbool startupitem.install] } {
     64        notes-append "
     65                       A startup item has been installed that will aid in
     66                       starting ${name} with launchd. It is disabled
     67                       by default. Execute the following command to launch
     68                       ${name} at user login:
     69
     70                       launchctl load -w /Library/${startupitem.location}/${startupitem.plist}
     71
     72                       To actually start ${name}, log out and back in.
     73                     "
     74    } else {
     75        notes-append "
     76                       A startup item was not installed for ${name}.
     77                       Some programs which depend on ${name} might not function properly,
     78                       most notably eMail clients.
     79                       Execute the following command to launch ${name} at user login:
     80
     81                       launchctl load -w ${launchd_dir}/${startupitem.plist}
     82
     83                       To actually start ${name}, log out and back in.
     84                     "
     85    }
     86}
     87
     88post-extract {
     89    xinstall -m 644 -W ${filespath} gpg-agent.plist.default ${worksrcpath}
     90}
     91
     92post-configure {
     93    reinplace -W "${worksrcpath}" "s|@PREFIX@|${prefix}|g" gpg-agent.plist.default
     94    reinplace -W "${worksrcpath}" "s|@LABEL@|${startupitem.uniquename}|g" gpg-agent.plist.default
     95
     96    if {${os.platform} eq "darwin"} {
     97        reinplace -W "${worksrcpath}" "s|@SSH_SUPPORT@||g" gpg-agent.plist.default
     98    }
     99}
     100
    49101post-destroot {
    50102    # Prevent conflict with gnupg2 port.
    51103    delete ${destroot}${prefix}/share/doc/gnupg/README
     104
     105    if {${os.platform} eq "darwin"} {
     106        xinstall -m 755 -d \
     107            ${destroot}${launchd_dir}
     108        xinstall -m 444 \
     109            ${worksrcpath}/gpg-agent.plist.default \
     110            ${destroot}${launchd_dir}${startupitem.plist}.default
     111    }
     112}
     113
     114post-activate {
     115    if {${os.platform} eq "darwin"} {
     116        xinstall -m 644 \
     117            ${launchd_dir}${startupitem.plist}.default \
     118            ${launchd_dir}${startupitem.plist}
     119
     120        # install the plist, if startupitem.install is set
     121        if {[tbool startupitem.install]} {
     122            ln -sf "${launchd_dir}${startupitem.plist}" "/Library/${startupitem.location}"
     123        }
     124    }
     125}
     126
     127post-deactivate {
     128    if {${os.platform} eq "darwin"} {
     129        delete ${launchd_dir}${startupitem.plist}
     130
     131        if { [tbool startupitem.install] } {
     132           delete "/Library/${startupitem.location}/${startupitem.plist}"
     133        }
     134    }
    52135}
    53136
Note: See TracChangeset for help on using the changeset viewer.