# $Id: Portfile 22506 2007-03-03 11:56:34Z pipping@macports.org $ PortSystem 1.0 name openssl version 0.9.8e platforms darwin freebsd categories devel security maintainers mww@macports.org homepage http://www.openssl.org/ description OpenSSL SSL/TLS cryptography library long_description \ The OpenSSL Project is a collaborative effort to develop a robust, \ commercial-grade, full-featured, and Open Source toolkit implementing \ the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security \ (TLS v1) protocols as well as a full-strength general purpose \ cryptography library. master_sites http://www.openssl.org/source/ checksums md5 3a7ff24f6ea5cd711984722ad654b927 \ sha1 b429872d2a287714ab37e42296e6a5fbe23d32ff \ rmd160 c1a498606dc0fc7219376b950fab6b53687466db depends_lib port:zlib variant darwin { patchfiles patch-Makefile.org patch-crypto-Makefile } configure.cmd ./config configure.args -L${prefix}/lib --openssldir=${prefix}/etc/openssl zlib no-asm no-krb5 shared platform darwin 6 { depends_lib-append port:dlcompat } platform darwin 8 { build.args CC=/usr/bin/gcc-4.0 } destroot.destdir INSTALL_PREFIX=${destroot} destroot.args MANDIR=${prefix}/share/man test.run yes variant universal { post-configure { cd ${worksrcpath} # prepare building for ppc if [variant_isset darwin_i386] { reinplace "s|PLATFORM=darwin-i386-cc|PLATFORM=darwin-ppc-cc|g" Makefile reinplace "s|DL_ENDIAN|DB_ENDIAN|g" Makefile } reinplace "s|-O3 -DB_ENDIAN$|-O3 -DB_ENDIAN -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk|" Makefile reinplace "s|^LDFLAGS=.*|LDFLAGS=-arch ppc|g" Makefile.shared } build { cd ${worksrcpath} # build for ppc system [command build] # determine which files will need to be lipo'ed together set lList {} foreach s {0.9.8.dylib a} { foreach n {crypto ssl} { lappend lList lib${n}.${s} } } set eList {} foreach f [glob engines/*.so] { lappend eList ${f} } set bList apps/openssl # save the output of the first go in a temporary location set ppcPath ${workpath}/ppc xinstall -d ${ppcPath} foreach l $lList { xinstall ${l} ${ppcPath} } xinstall -d ${ppcPath}/engines foreach e $eList { xinstall ${e} ${ppcPath}/engines } xinstall -d ${ppcPath}/apps foreach b $bList { xinstall ${b} ${ppcPath}/apps } # cleanup the worksrcdir system "make clean" foreach f [glob lib*.0.9.8.dylib] { delete ${f} } # prepare building for i386 reinplace "s|darwin-ppc-cc|darwin-i386-cc|g" ${worksrcpath}/Makefile reinplace "s|DB_ENDIAN|DL_ENDIAN|g" ${worksrcpath}/Makefile reinplace "s|-arch ppc|-arch i386|g" ${worksrcpath}/Makefile reinplace "s|-arch ppc|-arch i386|g" Makefile.shared # build for i386 system [command build] # save the output of the second go in another temporary location set i386Path ${workpath}/i386 xinstall -d ${i386Path} foreach l $lList { xinstall ${l} ${i386Path} } xinstall -d ${i386Path}/engines foreach e $eList { xinstall ${e} ${i386Path}/engines } xinstall -d ${i386Path}/apps foreach b $bList { xinstall ${b} ${i386Path}/apps } # run lipo on the output of both runs foreach l $lList { delete ${l} system "lipo \ -arch i386 ${i386Path}/${l} \ -arch ppc ${ppcPath}/${l} \ -create -output ${l}" } foreach e $eList { delete ${e} system "lipo \ -arch i386 ${i386Path}/${e} \ -arch ppc ${ppcPath}/${e} \ -create -output ${e}" } foreach b $bList { delete ${b} system "lipo \ -arch i386 ${i386Path}/${b} \ -arch ppc ${ppcPath}/${b} \ -create -output ${b}" } # make sure installing won't rebuild reinplace "s|install: all |install: |g" Makefile } # make sure we don't build a third time post-build {} } platform darwin_i386 {}