source: trunk/dports/security/gpg-agent/Portfile

Last change on this file was 149184, checked in by ionic@…, 14 months ago

gpg-agent: update to 2.0.30.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 6.7 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 149184 2016-06-04 21:57:33Z ryandesign@macports.org $
3
4PortSystem          1.0
5
6# When updating gpg-agent, update gnupg2 also if applicable.
7name                gpg-agent
8version             2.0.30
9revision            0
10categories          security mail
11maintainers         ionic openmaintainer
12license             GPL-3+
13installs_libs       no
14
15description         GPG key agent
16long_description    gpg-agent is a key management agent similar \
17                    in function to ssh-agent.
18homepage            http://www.gnupg.org
19platforms           darwin freebsd sunos
20distname            gnupg-${version}
21dist_subdir         gnupg2
22master_sites        gnupg:gnupg
23conflicts           gnupg21
24
25use_bzip2           yes
26
27checksums           rmd160  7d682c3e0e1c188d026519b0511ecde6a0cc6bd7 \
28                    sha256  e329785a4f366ba5d72c2c678a7e388b0892ac8440c2f4e6810042123c235d71
29
30startupitem.location \
31                    LaunchAgents
32
33set launchd_dir     ${prefix}/etc/${startupitem.location}/${startupitem.uniquename}/
34
35configure.args      --enable-agent-only
36
37depends_lib         port:libiconv       \
38                    port:gettext        \
39                    port:zlib           \
40                    port:bzip2          \
41                    port:bison          \
42                    port:libassuan      \
43                    port:libksba        \
44                    port:libgcrypt      \
45                    port:libgpg-error   \
46                    port:pth
47
48
49patchfiles          patch-po_Makevars.diff
50
51# Recent clang versions include the system stdint.h header
52# and we don't need quirks for "esoteric" systems, so just
53# we simply include the system header.
54patchfiles-append   patch-gl_stdint__h.diff
55
56# DO NOT USE. Maintainer-only helper for debugging purposes. DO NOT USE.
57#configure.cflags-append -g3 -ggdb3 -gdwarf-2 -O0
58
59platform darwin {
60    if {![variant_isset pinentry] && ![variant_isset pinentry_mac]} {
61        # Automatically switch between pinentry and pinentry-mac, with pinentry-mac being
62        # preferred.
63        # 10.7 and below are not supported by pinentry-mac, though, and will default to
64        # pinentry. Just like pure darwin without OS X will.
65        if {${os.subplatform} ne "macosx" ||
66            ${xcodeversion} eq "none" ||
67            [vercmp ${xcodeversion} {5.0}] < 0 ||
68            ${os.major} < 12 || (![catch {registry_active pinentry}] &&
69                                 [catch {registry_active pinentry-mac}])} {
70            default_variants-append +pinentry
71        } else {
72            default_variants-append +pinentry_mac
73        }
74    }
75
76
77    patchfiles-append       patch-agent_gpg-agent.c-launchd.diff
78    configure.cflags-append -F/System/Library/Frameworks/CoreFoundation.framework \
79                            -D__APPLE_LAUNCHD__
80
81    if {${os.major} < 11} {
82        patchfiles-append   patch-agent_agent.h-strndup-compat-10.6.diff
83    }
84
85    if { [tbool startupitem.install] } {
86        notes-append "
87                       A startup item has been installed that will aid in\
88                       starting ${name} with launchd. It is disabled by\
89                       default. Execute the following command to launch\
90                       ${name} at user login:
91
92                       launchctl load -w /Library/${startupitem.location}/${startupitem.plist}
93
94                       To actually start ${name}, log out and back in.
95                     "
96    } else {
97        notes-append "
98                       A startup item was not installed for ${name}.\
99                       Some programs which depend on ${name} might not\
100                       function properly, most notably eMail clients.\
101                       Execute the following command to launch ${name} at user login:
102
103                       launchctl load -w ${launchd_dir}/${startupitem.plist}
104
105                       To actually start ${name}, log out and back in.
106                     "
107    }
108}
109
110post-extract {
111    xinstall -m 644 -W ${filespath} gpg-agent.plist.default ${worksrcpath}
112}
113
114post-configure {
115    reinplace -W "${worksrcpath}" "s|@PREFIX@|${prefix}|g" gpg-agent.plist.default
116    reinplace -W "${worksrcpath}" "s|@LABEL@|${startupitem.uniquename}|g" gpg-agent.plist.default
117
118    if {${os.platform} eq "darwin"} {
119        if {[variant_isset ssh_agent]} {
120            # Remove lines with @SSH_SUPPORT@ in them.
121            # Uncomments sections.
122            reinplace -W "${worksrcpath}" "/@SSH_SUPPORT@/d" gpg-agent.plist.default
123        } else {
124            # Simply remove all @SSH_SUPPORT@ strings to comment out these sections.
125            reinplace -W "${worksrcpath}" "s|@SSH_SUPPORT@||g" gpg-agent.plist.default
126        }
127    }
128}
129
130post-destroot {
131    # Prevent conflict with gnupg2 port.
132    delete ${destroot}${prefix}/share/doc/gnupg/README
133
134    if {${os.platform} eq "darwin"} {
135        xinstall -m 755 -d \
136            ${destroot}${launchd_dir}
137        xinstall -m 444 \
138            ${worksrcpath}/gpg-agent.plist.default \
139            ${destroot}${launchd_dir}${startupitem.plist}.default
140    }
141}
142
143post-activate {
144    if {${os.platform} eq "darwin"} {
145        xinstall -m 644 \
146            ${launchd_dir}${startupitem.plist}.default \
147            ${launchd_dir}${startupitem.plist}
148
149        # install the plist, if startupitem.install is set
150        if {[tbool startupitem.install]} {
151            ln -sf "${launchd_dir}${startupitem.plist}" "/Library/${startupitem.location}"
152        }
153    }
154}
155
156post-deactivate {
157    if {${os.platform} eq "darwin"} {
158        delete ${launchd_dir}${startupitem.plist}
159
160        if { [tbool startupitem.install] } {
161           delete "/Library/${startupitem.location}/${startupitem.plist}"
162        }
163    }
164}
165
166variant pinentry conflicts pinentry_mac description {Handle user input via pinentry.} {
167    depends_lib-append      port:pinentry
168    configure.args-append   --with-pinentry-pgm=${prefix}/bin/pinentry
169}
170
171variant pinentry_mac conflicts pinentry description {Handle user input via pinentry-mac. Only compatible with OS X 10.8+.} {
172    depends_lib-append      port:pinentry-mac
173    configure.args-append   --with-pinentry-pgm=${applications_dir}/pinentry-mac.app/Contents/MacOS/pinentry-mac
174}
175
176variant ssh_agent description {Enables SSH agent support.} {
177    notes-append "
178                   You have enabled the optional SSH agent feature.
179
180                   This only has an effect on Darwin-based platforms.
181
182                   It is your responsiblity to disable any other SSH agent\
183                   so that this feature has a chance to actually work.
184
185                   Please note that this feature is untested.
186                 "
187}
188
189livecheck.type      regex
190livecheck.url       ftp://ftp.gnupg.org/gcrypt/gnupg/
191livecheck.regex     gnupg-(2\\.0\\.\\d+)
Note: See TracBrowser for help on using the repository browser.