source: trunk/dports/devel/openssl/Portfile @ 22546

Last change on this file since 22546 was 22546, checked in by mww@…, 12 years ago

add livecheck (regex)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.0 KB
Line 
1# $Id: Portfile 22546 2007-03-04 20:25:33Z mww@macports.org $
2
3PortSystem 1.0
4name                    openssl
5version                 0.9.8e
6platforms               darwin freebsd
7categories              devel security
8maintainers             mww@macports.org
9homepage                http://www.openssl.org/
10description             OpenSSL SSL/TLS cryptography library
11
12long_description \
13        The OpenSSL Project is a collaborative effort to develop a robust, \
14        commercial-grade, full-featured, and Open Source toolkit implementing \
15        the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security \
16        (TLS v1) protocols as well as a full-strength general purpose \
17        cryptography library.
18
19master_sites    http://www.openssl.org/source/
20checksums               md5 3a7ff24f6ea5cd711984722ad654b927 \
21                                sha1 b429872d2a287714ab37e42296e6a5fbe23d32ff \
22                                rmd160 c1a498606dc0fc7219376b950fab6b53687466db
23
24depends_lib             port:zlib
25
26variant darwin {
27        patchfiles      patch-Makefile.org patch-crypto-Makefile
28}
29
30configure.cmd   ./config
31configure.args  -L${prefix}/lib --openssldir=${prefix}/etc/openssl zlib no-asm no-krb5 shared
32
33platform darwin 6 {
34        depends_lib-append      port:dlcompat
35}
36
37platform darwin 8 {
38        build.args      CC=/usr/bin/gcc-4.0
39}
40
41destroot.destdir        INSTALL_PREFIX=${destroot}
42destroot.args           MANDIR=${prefix}/share/man
43
44test.run                yes
45
46livecheck.check regex
47livecheck.url   ${master_sites}
48livecheck.regex ${name}-(0.9.8\[a-z\])
49
50variant universal {
51
52    post-configure {
53        cd ${worksrcpath}
54
55        # prepare building for ppc
56        if [variant_isset darwin_i386] {
57            reinplace "s|PLATFORM=darwin-i386-cc|PLATFORM=darwin-ppc-cc|g" Makefile
58            reinplace "s|DL_ENDIAN|DB_ENDIAN|g" Makefile
59        }
60        reinplace "s|-O3 -DB_ENDIAN$|-O3 -DB_ENDIAN -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk|" Makefile
61        reinplace "s|^LDFLAGS=.*|LDFLAGS=-arch ppc|g" Makefile.shared
62    }
63
64    build {
65        cd ${worksrcpath}
66
67        # build for ppc
68        system [command build]
69
70        # determine which files will need to be lipo'ed together
71        set lList {}
72        foreach s {0.9.8.dylib a} {
73            foreach n {crypto ssl} {
74                lappend lList lib${n}.${s}
75            }
76        }
77        set eList {}
78        foreach f [glob engines/*.so] {
79            lappend eList ${f}
80        }
81        set bList apps/openssl
82        set tList {}
83        foreach f [glob test/*test] {
84            lappend tList ${f}
85        }
86        lappend tList test/sha256t
87        lappend tList test/sha512t
88
89        # define a backup procedure to a temporary location
90        proc backup {bakPath} {
91            xinstall -d ${bakPath}   
92            foreach a {l e b t} b {. engines apps test} {
93                upvar 1 [set a]List [set a]List
94                xinstall -d ${bakPath}/$b
95                foreach n [set [set a]List] {
96                    xinstall ${n} ${bakPath}/${b}
97                }
98            }
99        }
100        # backup the output of the first run (ppc)
101        set ppcPath ${workpath}/ppc
102        backup ${ppcPath}
103
104        # cleanup the worksrcdir
105        system "make clean"
106        foreach f [glob lib*.0.9.8.dylib] {
107            delete ${f}
108        }
109
110        # prepare building for i386
111        reinplace "s|darwin-ppc-cc|darwin-i386-cc|g" ${worksrcpath}/Makefile
112        reinplace "s|DB_ENDIAN|DL_ENDIAN|g" ${worksrcpath}/Makefile
113        reinplace "s|-arch ppc|-arch i386|g" ${worksrcpath}/Makefile
114        reinplace "s|-arch ppc|-arch i386|g" Makefile.shared
115
116        # build for i386
117        system [command build]
118
119        # backup the output of the second run (i386)
120        set i386Path ${workpath}/i386
121        backup ${i386Path}
122
123        # run lipo on the output of both runs
124        foreach n {l e b t} {
125            foreach m [set [set n]List] {
126                delete ${m}
127                system "lipo \
128                -arch i386 ${i386Path}/${m} \
129                -arch  ppc  ${ppcPath}/${m} \
130                -create -output ${m}"
131            }
132        }
133
134        # make sure installing won't rebuild
135        reinplace "s|install: all |install: |g" Makefile
136    }
137
138    # make sure we don't build a third time
139    post-build {}
140}
141
142platform darwin_i386 {}
Note: See TracBrowser for help on using the repository browser.