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

Last change on this file since 24149 was 24149, checked in by pipping@…, 11 years ago
  • add universal variants

note regarding zlib:

zlib's universal variant is unchanged - it can now savely be readded
because the commands used in the portfile have been included in 1.4.2

note regarding openssl:

the variant universal has been completely rewritten, making use of
fs-traverse (find.c - thanks a lot, Kevin!), backup, lipo (portutil.tcl)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.2 KB
Line 
1# $Id: Portfile 24149 2007-04-17 16:53:05Z pipping@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# port-specific procedure
53    proc clean {} {
54        system "make clean"
55        foreach f [glob lib*.a lib*.*.*.*.dylib] {
56            file delete ${f}
57        }
58    }
59
60# i386
61    # configure
62    pre-configure {
63        cd ${worksrcpath}
64        system "./Configure darwin-i386-cc ${configure.pre_args} ${configure.args}"
65        system "patch < ${filespath}/patch-Makefiles-universal-i386"
66        reinplace "s|^PROCESSOR=.*|PROCESSOR=|" Makefile
67    }
68    # build
69    configure {
70        cd ${worksrcpath}
71        system "make"
72    }
73    # backup, clean up
74    post-configure {
75        cd ${worksrcpath}
76        # get list of files to be backed up - only needs to be done once
77        fs-traverse file . {
78          if {![string equal [string range [file tail $file] end-1 end] .o]} {
79            set type [exec file -b $file]
80            if {[regexp {(Mach-O|ar archive)} $type]} {
81              global universal_filelist
82              lappend universal_filelist $file
83            }
84          }
85        }
86
87        backup i386
88
89        clean
90    }
91# ppc
92    # configure
93    pre-build {
94        cd ${worksrcpath}
95        system "./Configure darwin-ppc-cc ${configure.pre_args} ${configure.args}"
96        system "patch < ${filespath}/patch-Makefiles-universal-ppc"
97    }
98    # build
99    build {
100        cd ${worksrcpath}
101        system "make"
102    }
103    # backup
104    post-build {
105        cd ${worksrcpath}
106        # there's already a list of files to be backed up
107
108        global fileList
109
110        backup ppc
111
112        clean
113    }
114
115# universal
116    pre-destroot {
117        cd ${worksrcpath}
118        global fileList
119        system "make openssl.pc libssl.pc libcrypto.pc"
120        lipo
121        system "patch < ${filespath}/patch-Makefile-universal-install"
122    }
123    destroot.target     install_docs install_sw
124
125    # the test suite can only be run *after* destrooting
126    test.run            yes
127    test.dir            ${worksrcpath}/test
128    test.target         alltests
129}
Note: See TracBrowser for help on using the repository browser.