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

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

gpg-agent: fix livecheck to 2.0.x.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 6.1 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 133299 2015-02-24 22:17:00Z ionic@macports.org $
3
4PortSystem          1.0
5
6# When updating gpg-agent, update gnupg2 also if applicable.
7name                gpg-agent
8version             2.0.26
9revision            4
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  874040ed8fad12067cbe67c8da222b2ad99a5a96 \
28                    sha256  7758e30dc382ae7a7167ed41b7f936aa50af5ea2d6fccdef663b5b750b65b8e0
29
30startupitem.location \
31                    LaunchAgents
32
33set launchd_dir     ${prefix}/etc/${startupitem.location}/${startupitem.uniquename}/
34
35configure.args      --enable-agent-only
36
37# glib fails to find the right stdint.h  It picks clang's internal one rather
38# than the system header
39configure.env       gl_cv_absolute_stdint_h=/usr/include/stdint.h
40
41depends_lib         port:libiconv       \
42                    port:gettext        \
43                    port:zlib           \
44                    port:bzip2          \
45                    port:bison          \
46                    port:libassuan      \
47                    port:libksba        \
48                    port:libgcrypt      \
49                    port:libgpg-error   \
50                    port:pth
51
52
53patchfiles          patch-po_Makevars.diff
54
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    if {![variant_isset no_pinentry] &&
60        ![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
89                       by 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 function properly,
100                       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        reinplace -W "${worksrcpath}" "s|@SSH_SUPPORT@||g" gpg-agent.plist.default
120    }
121}
122
123post-destroot {
124    # Prevent conflict with gnupg2 port.
125    delete ${destroot}${prefix}/share/doc/gnupg/README
126
127    if {${os.platform} eq "darwin"} {
128        xinstall -m 755 -d \
129            ${destroot}${launchd_dir}
130        xinstall -m 444 \
131            ${worksrcpath}/gpg-agent.plist.default \
132            ${destroot}${launchd_dir}${startupitem.plist}.default
133    }
134}
135
136post-activate {
137    if {${os.platform} eq "darwin"} {
138        xinstall -m 644 \
139            ${launchd_dir}${startupitem.plist}.default \
140            ${launchd_dir}${startupitem.plist}
141
142        # install the plist, if startupitem.install is set
143        if {[tbool startupitem.install]} {
144            ln -sf "${launchd_dir}${startupitem.plist}" "/Library/${startupitem.location}"
145        }
146    }
147}
148
149post-deactivate {
150    if {${os.platform} eq "darwin"} {
151        delete ${launchd_dir}${startupitem.plist}
152
153        if { [tbool startupitem.install] } {
154           delete "/Library/${startupitem.location}/${startupitem.plist}"
155        }
156    }
157}
158
159# Remove after 11-17-2015.
160variant no_pinentry conflicts pinentry pinentry_mac description {Legacy compatibility variant for disabling pinentry. Will be removed soon.} {
161}
162
163variant pinentry conflicts pinentry_mac no_pinentry description {Handle user input via pinentry.} {
164    depends_lib-append      port:pinentry
165    configure.args-append   --with-pinentry-pgm=${prefix}/bin/pinentry
166}
167
168variant pinentry_mac conflicts pinentry no_pinentry description {Handle user input via pinentry-mac. Only compatible with OS X 10.8+.} {
169    depends_lib-append      port:pinentry-mac
170    configure.args-append   --with-pinentry-pgm=${applications_dir}/pinentry-mac.app/Contents/MacOS/pinentry-mac
171}
172
173livecheck.type      regex
174livecheck.url       ftp://ftp.gnupg.org/gcrypt/gnupg/
175livecheck.regex     gnupg-(2\\.0\\.\\d+)
Note: See TracBrowser for help on using the repository browser.