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

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

gpg-agent:

  • try to pull pinentry-mac on 10.8+ only
  • respect no_pinentry variant
  • ADD REMINDER TO ACTUALLY REPLACE THAT NEGATIVE VARIABLE LATER!
  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.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 128214 2014-11-16 17:54:16Z 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            3
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
23
24use_bzip2           yes
25
26checksums           rmd160  874040ed8fad12067cbe67c8da222b2ad99a5a96 \
27                    sha256  7758e30dc382ae7a7167ed41b7f936aa50af5ea2d6fccdef663b5b750b65b8e0
28
29startupitem.location \
30                    LaunchAgents
31
32set launchd_dir     ${prefix}/etc/${startupitem.location}/${startupitem.uniquename}/
33
34configure.args      --enable-agent-only
35
36# glib fails to find the right stdint.h  It picks clang's internal one rather
37# than the system header
38configure.env       gl_cv_absolute_stdint_h=/usr/include/stdint.h
39
40depends_lib         port:libiconv       \
41                    port:gettext        \
42                    port:zlib           \
43                    port:bzip2          \
44                    port:bison          \
45                    port:libassuan      \
46                    port:libksba        \
47                    port:libgcrypt      \
48                    port:libgpg-error   \
49                    port:pth
50
51
52patchfiles          patch-po_Makevars.diff
53
54# DO NOT USE. Maintainer-only helper for debugging purposes. DO NOT USE.
55#configure.cflags-append -g3 -ggdb3 -gdwarf-2 -O0
56
57platform darwin {
58    if {![variant_isset no_pinentry]} {
59      # Automatically switch between pinentry and pinentry-mac, with pinentry-mac being
60      # preferred.
61      # 10.7 and below are not supported by pinentry-mac, though, and will default to
62      # pinentry. Just like pure darwin without OS X will.
63      set pinentry            pinentry-mac
64      if {${os.subplatform} ne "macosx" ||
65          ${os.major} < 12 || ([catch "registry_active pinentry"] &&
66                               ![catch "registry_active pinentry-mac"])} {
67          set pinentry        pinentry
68      }
69
70      set pinentry_binary     ""
71
72      if {${pinentry} eq "pinentry"} {
73          set pinentry_binary "${prefix}/bin/${pinentry}"
74      } else {
75          set pinentry_binary "${applications_dir}/${pinentry}.app/Contents/MacOS/${pinentry}"
76      }
77
78      depends_lib-append      port:${pinentry}
79      configure.args-append   --with-pinentry-pgm=${pinentry_binary}
80    }
81
82
83    patchfiles-append       patch-agent_gpg-agent.c-launchd.diff
84    configure.cflags-append -F/System/Library/Frameworks/CoreFoundation.framework \
85                            -D__APPLE_LAUNCHD__
86
87    if {${os.major} < 11} {
88        patchfiles-append   patch-agent_agent.h-strndup-compat-10.6.diff
89    }
90
91    if { [tbool startupitem.install] } {
92        notes-append "
93                       A startup item has been installed that will aid in
94                       starting ${name} with launchd. It is disabled
95                       by default. Execute the following command to launch
96                       ${name} at user login:
97
98                       launchctl load -w /Library/${startupitem.location}/${startupitem.plist}
99
100                       To actually start ${name}, log out and back in.
101                     "
102    } else {
103        notes-append "
104                       A startup item was not installed for ${name}.
105                       Some programs which depend on ${name} might not function properly,
106                       most notably eMail clients.
107                       Execute the following command to launch ${name} at user login:
108
109                       launchctl load -w ${launchd_dir}/${startupitem.plist}
110
111                       To actually start ${name}, log out and back in.
112                     "
113    }
114}
115
116post-extract {
117    xinstall -m 644 -W ${filespath} gpg-agent.plist.default ${worksrcpath}
118}
119
120post-configure {
121    reinplace -W "${worksrcpath}" "s|@PREFIX@|${prefix}|g" gpg-agent.plist.default
122    reinplace -W "${worksrcpath}" "s|@LABEL@|${startupitem.uniquename}|g" gpg-agent.plist.default
123
124    if {${os.platform} eq "darwin"} {
125        reinplace -W "${worksrcpath}" "s|@SSH_SUPPORT@||g" gpg-agent.plist.default
126    }
127}
128
129post-destroot {
130    # Prevent conflict with gnupg2 port.
131    delete ${destroot}${prefix}/share/doc/gnupg/README
132
133    if {${os.platform} eq "darwin"} {
134        xinstall -m 755 -d \
135            ${destroot}${launchd_dir}
136        xinstall -m 444 \
137            ${worksrcpath}/gpg-agent.plist.default \
138            ${destroot}${launchd_dir}${startupitem.plist}.default
139    }
140}
141
142post-activate {
143    if {${os.platform} eq "darwin"} {
144        xinstall -m 644 \
145            ${launchd_dir}${startupitem.plist}.default \
146            ${launchd_dir}${startupitem.plist}
147
148        # install the plist, if startupitem.install is set
149        if {[tbool startupitem.install]} {
150            ln -sf "${launchd_dir}${startupitem.plist}" "/Library/${startupitem.location}"
151        }
152    }
153}
154
155post-deactivate {
156    if {${os.platform} eq "darwin"} {
157        delete ${launchd_dir}${startupitem.plist}
158
159        if { [tbool startupitem.install] } {
160           delete "/Library/${startupitem.location}/${startupitem.plist}"
161        }
162    }
163}
164
165# FIXME: switch to (default on) pinentry variant.
166variant no_pinentry description {Do not use pinentry to handle user input} {
167}
168
169livecheck.type      regex
170livecheck.url       ftp://ftp.gnupg.org/gcrypt/gnupg/
171livecheck.regex     gnupg-(\\d+\\.\\d+\\.\\d+)
Note: See TracBrowser for help on using the repository browser.