# -*- 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 # $Id: Portfile 128214 2014-11-16 17:54:16Z ionic@macports.org $ PortSystem 1.0 # When updating gpg-agent, update gnupg2 also if applicable. name gpg-agent version 2.0.26 revision 3 categories security mail maintainers ionic openmaintainer license GPL-3+ installs_libs no description GPG key agent long_description gpg-agent is a key management agent similar \ in function to ssh-agent. homepage http://www.gnupg.org platforms darwin freebsd sunos distname gnupg-${version} dist_subdir gnupg2 master_sites gnupg:gnupg use_bzip2 yes checksums rmd160 874040ed8fad12067cbe67c8da222b2ad99a5a96 \ sha256 7758e30dc382ae7a7167ed41b7f936aa50af5ea2d6fccdef663b5b750b65b8e0 startupitem.location \ LaunchAgents set launchd_dir ${prefix}/etc/${startupitem.location}/${startupitem.uniquename}/ configure.args --enable-agent-only # glib fails to find the right stdint.h It picks clang's internal one rather # than the system header configure.env gl_cv_absolute_stdint_h=/usr/include/stdint.h depends_lib port:libiconv \ port:gettext \ port:zlib \ port:bzip2 \ port:bison \ port:libassuan \ port:libksba \ port:libgcrypt \ port:libgpg-error \ port:pth patchfiles patch-po_Makevars.diff # DO NOT USE. Maintainer-only helper for debugging purposes. DO NOT USE. #configure.cflags-append -g3 -ggdb3 -gdwarf-2 -O0 platform darwin { if {![variant_isset no_pinentry]} { # Automatically switch between pinentry and pinentry-mac, with pinentry-mac being # preferred. # 10.7 and below are not supported by pinentry-mac, though, and will default to # pinentry. Just like pure darwin without OS X will. set pinentry pinentry-mac if {${os.subplatform} ne "macosx" || ${os.major} < 12 || ([catch "registry_active pinentry"] && ![catch "registry_active pinentry-mac"])} { set pinentry pinentry } set pinentry_binary "" if {${pinentry} eq "pinentry"} { set pinentry_binary "${prefix}/bin/${pinentry}" } else { set pinentry_binary "${applications_dir}/${pinentry}.app/Contents/MacOS/${pinentry}" } depends_lib-append port:${pinentry} configure.args-append --with-pinentry-pgm=${pinentry_binary} } patchfiles-append patch-agent_gpg-agent.c-launchd.diff configure.cflags-append -F/System/Library/Frameworks/CoreFoundation.framework \ -D__APPLE_LAUNCHD__ if {${os.major} < 11} { patchfiles-append patch-agent_agent.h-strndup-compat-10.6.diff } if { [tbool startupitem.install] } { notes-append " A startup item has been installed that will aid in starting ${name} with launchd. It is disabled by default. Execute the following command to launch ${name} at user login: launchctl load -w /Library/${startupitem.location}/${startupitem.plist} To actually start ${name}, log out and back in. " } else { notes-append " A startup item was not installed for ${name}. Some programs which depend on ${name} might not function properly, most notably eMail clients. Execute the following command to launch ${name} at user login: launchctl load -w ${launchd_dir}/${startupitem.plist} To actually start ${name}, log out and back in. " } } post-extract { xinstall -m 644 -W ${filespath} gpg-agent.plist.default ${worksrcpath} } post-configure { reinplace -W "${worksrcpath}" "s|@PREFIX@|${prefix}|g" gpg-agent.plist.default reinplace -W "${worksrcpath}" "s|@LABEL@|${startupitem.uniquename}|g" gpg-agent.plist.default if {${os.platform} eq "darwin"} { reinplace -W "${worksrcpath}" "s|@SSH_SUPPORT@||g" gpg-agent.plist.default } } post-destroot { # Prevent conflict with gnupg2 port. delete ${destroot}${prefix}/share/doc/gnupg/README if {${os.platform} eq "darwin"} { xinstall -m 755 -d \ ${destroot}${launchd_dir} xinstall -m 444 \ ${worksrcpath}/gpg-agent.plist.default \ ${destroot}${launchd_dir}${startupitem.plist}.default } } post-activate { if {${os.platform} eq "darwin"} { xinstall -m 644 \ ${launchd_dir}${startupitem.plist}.default \ ${launchd_dir}${startupitem.plist} # install the plist, if startupitem.install is set if {[tbool startupitem.install]} { ln -sf "${launchd_dir}${startupitem.plist}" "/Library/${startupitem.location}" } } } post-deactivate { if {${os.platform} eq "darwin"} { delete ${launchd_dir}${startupitem.plist} if { [tbool startupitem.install] } { delete "/Library/${startupitem.location}/${startupitem.plist}" } } } # FIXME: switch to (default on) pinentry variant. variant no_pinentry description {Do not use pinentry to handle user input} { } livecheck.type regex livecheck.url ftp://ftp.gnupg.org/gcrypt/gnupg/ livecheck.regex gnupg-(\\d+\\.\\d+\\.\\d+)