[101173] trunk/dports/net

ryandesign at macports.org ryandesign at macports.org
Sat Jan 5 13:33:42 PST 2013


Revision: 101173
          https://trac.macports.org/changeset/101173
Author:   ryandesign at macports.org
Date:     2013-01-05 13:33:42 -0800 (Sat, 05 Jan 2013)
Log Message:
-----------
curl: add curl-ca-bundle as a subport

Modified Paths:
--------------
    trunk/dports/net/curl/Portfile

Added Paths:
-----------
    trunk/dports/net/curl/files/patch-no-autodownload.diff

Removed Paths:
-------------
    trunk/dports/net/curl-ca-bundle/

Modified: trunk/dports/net/curl/Portfile
===================================================================
--- trunk/dports/net/curl/Portfile	2013-01-05 20:11:15 UTC (rev 101172)
+++ trunk/dports/net/curl/Portfile	2013-01-05 21:33:42 UTC (rev 101173)
@@ -1,167 +1,237 @@
 # -*- 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$
 
-PortSystem                  1.0
-PortGroup                   muniversal 1.0
+PortSystem                      1.0
 
-name                        curl
-# keep the version in sync with the curl-ca-bundle port
-version                     7.28.1
-categories                  net www
-maintainers                 ryandesign
-license                     curl
-homepage                    http://curl.haxx.se/
-platforms                   darwin freebsd
-use_bzip2                   yes
-use_parallel_build          yes
+name                            curl
+version                         7.28.1
+categories                      net www
+platforms                       darwin freebsd
+maintainers                     ryandesign
+license                         Curl
 
-description                 Tool for transferring files with URL syntax
+description                     Tool for transferring files with URL syntax
 
-long_description            curl is a client to get documents/files from servers, \
-                            using any of the supported protocols. The command is \
-                            designed to work without user interaction or any kind \
-                            of interactivity.
+long_description                curl is a client to get documents/files from servers, \
+                                using any of the supported protocols. The command is \
+                                designed to work without user interaction or any kind \
+                                of interactivity.
 
-# keep the master_sites in sync with the curl-ca-bundle port
-master_sites                http://curl.haxx.se/download/ \
-                            ftp://ftp.sunet.se/pub/www/utilities/curl/ \
-                            http://www.execve.net/curl/
+homepage                        http://curl.haxx.se/
+master_sites                    ${homepage}download/ \
+                                ftp://ftp.sunet.se/pub/www/utilities/curl/ \
+                                http://www.execve.net/curl/
 
-checksums                   rmd160  d4a0cb79756607c3b573970648d639744f15fc65 \
-                            sha256  e569d6deb58a516e6858cd4c348949e0397433e1354666bafde1a52d1ea77367
+use_bzip2                       yes
 
-patchfiles                  patch-curl.h.diff
+checksums                       ${distfiles} \
+                                rmd160  d4a0cb79756607c3b573970648d639744f15fc65 \
+                                sha256  e569d6deb58a516e6858cd4c348949e0397433e1354666bafde1a52d1ea77367
 
-configure.args              --enable-ipv6 \
-                            --without-gnutls \
-                            --without-gssapi \
-                            --without-librtmp \
-                            --without-libssh2 \
-                            --without-nss \
-                            --without-polarssl \
-                            --without-spnego \
-                            --without-ssl \
-                            --disable-ares \
-                            --disable-ldap \
-                            --disable-ldaps \
-                            --with-libidn \
-                            --with-zlib=${prefix}
+if {${name} == ${subport}} {
+    PortGroup                   muniversal 1.0
 
-configure.env               PKG_CONFIG_PATH=${prefix}
+    depends_build               port:pkgconfig
 
-depends_build               port:pkgconfig
+    depends_lib                 port:libidn \
+                                port:zlib
 
-depends_lib                 port:zlib \
-                            port:libidn
+    patchfiles                  patch-curl.h.diff
 
-test.run                    yes
-test.target                 test-full
+    configure.args              --enable-ipv6 \
+                                --without-gnutls \
+                                --without-gssapi \
+                                --without-librtmp \
+                                --without-libssh2 \
+                                --without-nss \
+                                --without-polarssl \
+                                --without-spnego \
+                                --without-ssl \
+                                --disable-ares \
+                                --disable-ldap \
+                                --disable-ldaps \
+                                --with-libidn \
+                                --with-zlib=${prefix}
 
-post-configure {
-    if {[variant_isset universal]} {
-        set dirs {}
-        foreach arch ${universal_archs_to_use} {
-            lappend dirs ${worksrcpath}-${arch}
+    configure.env               PKG_CONFIG_PATH=${prefix}
+
+    post-configure {
+        if {[variant_isset universal]} {
+            set dirs {}
+            foreach arch ${universal_archs_to_use} {
+                lappend dirs ${worksrcpath}-${arch}
+            }
+        } else {
+            set dirs ${worksrcpath}
         }
-    } else {
-        set dirs ${worksrcpath}
+        foreach dir ${dirs} {
+            reinplace -E {s|-arch [a-z0-9_]+||g} \
+                ${dir}/curl-config \
+                ${dir}/libcurl.pc
+            reinplace -E {s/ '(host_alias|--host)=[^']+'//g} ${dir}/curl-config
+        }
     }
-    foreach dir ${dirs} {
-        reinplace -E {s|-arch [a-z0-9_]+||g} \
-            ${dir}/curl-config \
-            ${dir}/libcurl.pc
-        reinplace -E {s/ '(host_alias|--host)=[^']+'//g} ${dir}/curl-config
+
+    test.run                    yes
+    test.target                 test-full
+
+    global merger_dont_diff
+    set merger_dont_diff "${prefix}/include/curl/curlbuild.h"
+
+    post-destroot {
+        set docdir ${prefix}/share/doc/${name}
+        xinstall -d ${destroot}${docdir}/html/libcurl ${destroot}${docdir}/pdf/libcurl \
+            ${destroot}${prefix}/share/aclocal
+        xinstall -m 0644 -W ${worksrcpath} \
+            CHANGES \
+            COPYING \
+            README \
+            RELEASE-NOTES \
+            ${destroot}${docdir}
+        xinstall -m 0644 -W ${worksrcpath}/docs \
+            BUGS \
+            CONTRIBUTE \
+            FAQ \
+            FEATURES \
+            HISTORY \
+            INTERNALS \
+            KNOWN_BUGS \
+            MANUAL \
+            RESOURCES \
+            THANKS \
+            TODO \
+            TheArtOfHttpScripting \
+            VERSIONS \
+            ${destroot}${docdir}
+        xinstall -m 0644 ${worksrcpath}/docs/libcurl/libcurl.m4 \
+            ${destroot}${prefix}/share/aclocal/
+        eval xinstall -m 0644 [glob ${worksrcpath}/docs/*.html] ${destroot}${docdir}/html
+        eval xinstall -m 0644 [glob ${worksrcpath}/docs/libcurl/*.html] ${destroot}${docdir}/html/libcurl
+        eval xinstall -m 0644 [glob ${worksrcpath}/docs/*.pdf] ${destroot}${docdir}/pdf
+        eval xinstall -m 0644 [glob ${worksrcpath}/docs/libcurl/*.pdf] ${destroot}${docdir}/pdf/libcurl
     }
-}
 
-global merger_dont_diff merger_configure_env
-set merger_dont_diff "${prefix}/include/curl/curlbuild.h"
+    variant ares description {Add support for resolving names asynchronously} {
+        depends_lib-append      port:c-ares
+        configure.args-delete   --disable-ares
+        configure.args-append   --enable-ares
+    }
 
-post-destroot {
-    set docdir ${prefix}/share/doc/${name}
-    xinstall -d ${destroot}${docdir}/html/libcurl ${destroot}${docdir}/pdf/libcurl \
-        ${destroot}${prefix}/share/aclocal
-    xinstall -m 0644 -W ${worksrcpath} \
-        CHANGES \
-        COPYING \
-        README \
-        RELEASE-NOTES \
-        ${destroot}${docdir}
-    xinstall -m 0644 -W ${worksrcpath}/docs \
-        BUGS \
-        CONTRIBUTE \
-        FAQ \
-        FEATURES \
-        HISTORY \
-        INTERNALS \
-        KNOWN_BUGS \
-        MANUAL \
-        RESOURCES \
-        THANKS \
-        TODO \
-        TheArtOfHttpScripting \
-        VERSIONS \
-        ${destroot}${docdir}
-    xinstall -m 0644 ${worksrcpath}/docs/libcurl/libcurl.m4 \
-        ${destroot}${prefix}/share/aclocal/
-    eval xinstall -m 0644 [glob ${worksrcpath}/docs/*.html] ${destroot}${docdir}/html
-    eval xinstall -m 0644 [glob ${worksrcpath}/docs/libcurl/*.html] ${destroot}${docdir}/html/libcurl
-    eval xinstall -m 0644 [glob ${worksrcpath}/docs/*.pdf] ${destroot}${docdir}/pdf
-    eval xinstall -m 0644 [glob ${worksrcpath}/docs/libcurl/*.pdf] ${destroot}${docdir}/pdf/libcurl
-}
+    variant gnutls conflicts ssl description {Allow secure connections using GNU TLS} {
+        depends_lib-append      port:gnutls
+        configure.args-delete   --without-gnutls
+        configure.args-append   --with-gnutls
+    }
 
-if {![variant_isset gnutls]} {
-    default_variants +ssl
-}
+    variant gss description {Support the Generic Security Service API} {
+        # This needs to use the system's Kerberos, not MacPorts' gss or kerberos5.
+        conflicts-append        gss kerberos5
+        configure.args-delete   --without-gssapi
+        configure.args-append   --with-gssapi
+    }
 
-variant ssl description {Allow secure connections using OpenSSL} {
-    depends_lib-append      port:openssl \
-                            port:curl-ca-bundle
-    configure.args-delete   --without-ssl
-    configure.args-append   --with-ssl \
-                            --with-ca-bundle=${prefix}/share/curl/curl-ca-bundle.crt
-}
+    variant openldap description {Support performing Lightweight Directory Access Protocol queries with OpenLDAP} {
+        depends_lib-append      port:openldap
+        configure.args-delete   --disable-ldap \
+                                --disable-ldaps
+        configure.args-append   --enable-ldap \
+                                --enable-ldaps
+    }
 
-variant ares description {Add support for resolving names asynchronously} {
-    depends_lib-append      port:c-ares
-    configure.args-delete   --disable-ares
-    configure.args-append   --enable-ares
-}
+    variant sftp_scp description {Add SFTP/SCP support via libssh2} {
+        depends_lib-append      port:libssh2
+        configure.args-delete   --without-libssh2
+        configure.args-append   --with-libssh2
+    }
 
-variant spnego description {Enable SPNEGO authentication support} {
-    # kind of broken?
-    depends_lib-append      port:fbopenssl
-    configure.args-delete   --without-spnego
-    configure.args-append   --with-spnego=${prefix}
-}
+    variant spnego description {Enable SPNEGO authentication support} {
+        # kind of broken?
+        depends_lib-append      port:fbopenssl
+        configure.args-delete   --without-spnego
+        configure.args-append   --with-spnego=${prefix}
+    }
 
-variant gnutls conflicts ssl description {Allow secure connections using GNU TLS} {
-    depends_lib-append      port:gnutls
-    configure.args-delete   --without-gnutls
-    configure.args-append   --with-gnutls
-}
+    variant ssl conflicts gnutls description {Allow secure connections using OpenSSL} {
+        depends_lib-append      port:openssl \
+                                port:curl-ca-bundle
+        configure.args-delete   --without-ssl
+        configure.args-append   --with-ssl \
+                                --with-ca-bundle=${prefix}/share/curl/curl-ca-bundle.crt
+    }
 
-variant gss description {Support the Generic Security Service API} {
-    # This needs to use the system's Kerberos, not MacPorts' gss or kerberos5.
-    conflicts-append        gss kerberos5
-    configure.args-delete   --without-gssapi
-    configure.args-append   --with-gssapi
-}
+    if {![variant_isset gnutls]} {
+        default_variants +ssl
+    }
 
-variant openldap description {Support performing Lightweight Directory Access Protocol queries with OpenLDAP} {
-    depends_lib-append      port:openldap
-    configure.args-delete   --disable-ldap \
-                            --disable-ldaps
-    configure.args-append   --enable-ldap \
-                            --enable-ldaps
+    livecheck.type              regex
+    livecheck.url               [lindex ${master_sites} 0]
+    livecheck.regex             ${name}-(\[0-9.\]+)${extract.suffix}
+} else {
+    livecheck.type              none
 }
 
-variant sftp_scp description {Add SFTP/SCP support via libssh2} {
-    depends_lib-append      port:libssh2
-    configure.args-delete   --without-libssh2
-    configure.args-append   --with-libssh2
+subport curl-ca-bundle {
+    categories                  net
+    license                     {MPL-2 LGPL-2.1+}
+    supported_archs             noarch
+    installs_libs               no
+
+    description                 CA certificate bundle for curl
+
+    long_description            Installs a bundle of certification authority certificates \
+                                (CA certs) which curl (when linked with OpenSSL) uses to \
+                                verify the authenticity of secure web and FTP servers.
+
+    depends_build               path:bin/perl:perl5
+
+    set certdata_file           certdata.txt
+    set certdata_version        1.86
+    set certdata_date           2012-10-18
+    set certdata_distfile       certdata-${certdata_version}.txt
+    set certdata_path           security/nss/lib/ckfw/builtins/${certdata_file}
+
+    # Avoid most of the checksum errors that inevitably occur whenever upstream
+    # updates certdata.txt by only using the upstream site if it's within a few
+    # days of the latest update. After that time, use only our mirrors, which
+    # should have copied the file by then. The success of this strategy relies
+    # on me noticing new versions within that time and updating the port, and
+    # on upstream not updating the file again within that time.
+    set days_since_update [expr {[expr {[clock seconds] - [clock format [clock scan ${certdata_date} -gmt yes] -format %s]}] / 86400}]
+    if {${days_since_update} > 3} {
+        master_sites-append http://distfiles.macports.org/curl/:certdata
+    } else {
+        master_sites-append http://mxr.mozilla.org/mozilla/source/${certdata_path}?raw=1&dummy=:certdata
+    }
+
+    extract.only                ${distfiles}
+    extract.post_args-append    ${worksrcdir}/Makefile ${worksrcdir}/lib/mk-ca-bundle.pl
+
+    distfiles-append            ${certdata_distfile}:certdata
+
+    checksums-append            ${certdata_distfile} \
+                                rmd160  5a08a6b50e3d50d3937063c19f783cb0e6ab0ab4 \
+                                sha256  8bfeafa81666dfc630e61acdb61f019070b53af44270d7ddd33b873733dff633
+
+    post-extract {
+        xinstall ${distpath}/${certdata_distfile} ${worksrcpath}/${certdata_file}
+    }
+
+    patchfiles                  patch-no-autodownload.diff
+
+    use_configure               no
+
+    build.target                ca-bundle
+
+    destroot {
+        set ca_bundle_dir ${prefix}/share/curl
+        set openssl_dir ${prefix}/etc/openssl
+        xinstall -d ${destroot}${ca_bundle_dir} ${destroot}${openssl_dir}
+        xinstall -m 644 ${worksrcpath}/lib/ca-bundle.crt ${destroot}${ca_bundle_dir}/curl-ca-bundle.crt
+        ln -s ${ca_bundle_dir}/curl-ca-bundle.crt ${destroot}${openssl_dir}/cert.pem
+    }
+
+    livecheck.type              regex
+    livecheck.url               http://bonsai.mozilla.org/cvsquery.cgi?file=mozilla/${certdata_path}&date=explicit&mindate=${certdata_date}
+    livecheck.version           ${certdata_version}
+    livecheck.regex             '${certdata_file}','(\[0-9.\]+)'
 }
-
-livecheck.type              regex
-livecheck.url               [lindex ${master_sites} 0]
-livecheck.regex             ${name}-(\[0-9.\]+)${extract.suffix}

Copied: trunk/dports/net/curl/files/patch-no-autodownload.diff (from rev 101113, trunk/dports/net/curl-ca-bundle/files/patch-no-autodownload.diff)
===================================================================
--- trunk/dports/net/curl/files/patch-no-autodownload.diff	                        (rev 0)
+++ trunk/dports/net/curl/files/patch-no-autodownload.diff	2013-01-05 21:33:42 UTC (rev 101173)
@@ -0,0 +1,21 @@
+--- Makefile.orig	2011-11-15 13:32:34.000000000 -0600
++++ Makefile	2011-11-16 21:45:51.000000000 -0600
+@@ -288,7 +288,7 @@
+ 
+ ca-bundle: lib/mk-ca-bundle.pl
+ 	@echo "generate a fresh ca-bundle.crt"
+-	@perl $< -b -l -u lib/ca-bundle.crt
++	@perl $< -n lib/ca-bundle.crt
+ 
+ ca-firefox: lib/firefox-db2pem.sh
+ 	@echo "generate a fresh ca-bundle.crt"
+--- lib/mk-ca-bundle.pl.orig	2012-04-23 13:52:44.000000000 -0500
++++ lib/mk-ca-bundle.pl	2012-05-28 15:50:42.000000000 -0500
+@@ -32,7 +32,6 @@
+ #
+ use Getopt::Std;
+ use MIME::Base64;
+-use LWP::UserAgent;
+ use strict;
+ use vars qw($opt_b $opt_h $opt_i $opt_l $opt_n $opt_q $opt_t $opt_u $opt_v);
+ 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130105/eabd2c8a/attachment.html>


More information about the macports-changes mailing list