# $Id: Portfile 31959 2007-12-12 18:52:41Z mww@macports.org $ PortSystem 1.0 name openssl version 0.9.8g platforms darwin freebsd categories devel security maintainers mww 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 acf70a16359bf3658bdfb74bda1c4419 \ sha1 4e9c5ced466715d18fd924de79bde5c15da80fa1 \ rmd160 f080a32da9becdc8b98c38744d62c6fd8664f603 depends_lib port:zlib platform darwin { patchfiles patch-Makefile.org patch-crypto-Makefile patch-Configure } 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 } variant rfc3779 { configure.args-append enable-rfc3779 } destroot.destdir INSTALL_PREFIX=${destroot} destroot.args MANDIR=${prefix}/share/man test.run yes livecheck.check regex livecheck.url ${master_sites} livecheck.regex ${name}-(0.9.8\[a-z\]) #make 4-way universal build ready variant universal { post-patch { # foreach arch {i386 x86_64 ppc ppc64} foreach arch {i386 ppc} { file copy ${worksrcpath} ${workpath}/${arch} } } configure { foreach arch {i386 ppc} { system "cd ${workpath}/${arch} && ./Configure darwin-${arch}-cc ${configure.pre_args} ${configure.args}" } # system "cd ${workpath}/x86_64 && ./Configure darwin64-x86_64-cc ${configure.pre_args} ${configure.args}" # system "cd ${workpath}/ppc64 && ./Configure darwin64-ppc-cc ${configure.pre_args} ${configure.args}" } build { # foreach arch {i386 x86_64 ppc ppc64} foreach arch {i386 ppc} { system "cd ${workpath}/${arch} && make all" } } destroot { # in port 1.7, just call: # merge "${workpath}/pre-dest" # till then, do this: # foreach arch {i386 x86_64 ppc ppc64} foreach arch {i386 ppc} { xinstall -d ${workpath}/pre-dest/${arch} system "cd ${workpath}/${arch} && make install INSTALL_PREFIX=${workpath}/pre-dest/${arch} MANDIR=${prefix}/share/man" } set basepath "${workpath}/pre-dest/i386" fs-traverse file "${basepath}" { set fpath [string range "${file}" [string length "${basepath}"] [string length "${file}"]] if {${fpath} != ""} { ui_debug ":: ${fpath}" switch -exact [file type "${basepath}${fpath}"] { directory { # just create directories ui_debug "-- dir:: ${fpath}" file mkdir "${destroot}${fpath}" } link { # copy symlinks (TODO: check if target matches) ui_debug "-- lnk:: ${fpath}" file copy "${basepath}${fpath}" "${destroot}${fpath}" } file { # treat files depending on their filetype ui_debug "-- file:: ${fpath}" set filetype [exec "/usr/bin/file" "-b" "${basepath}${fpath}"] switch -regexp ${filetype} { Mach-O.* { # Mach-O binaries get lipo-ed ui_debug "Mach-O file -- lipo-ing" # system "lipo -arch i386 ${workpath}/pre-dest/i386/${fpath} -arch x86_64 ${workpath}/pre-dest/x86_64/${fpath} -arch ppc ${workpath}/pre-dest/ppc/${fpath} -arch ppc64 ${workpath}/pre-dest/ppc64/${fpath} -create -output ${destroot}${fpath}" system "lipo -arch i386 ${workpath}/pre-dest/i386/${fpath} -arch ppc ${workpath}/pre-dest/ppc/${fpath} -create -output ${destroot}${fpath}" } current\ ar\ archive { # ar archives get lipo-ed ui_debug "ar archive -- lipo-ing" # system "lipo -arch i386 ${workpath}/pre-dest/i386/${fpath} -arch x86_64 ${workpath}/pre-dest/x86_64/${fpath} -arch ppc ${workpath}/pre-dest/ppc/${fpath} -arch ppc64 ${workpath}/pre-dest/ppc64/${fpath} -create -output ${destroot}${fpath}" system "lipo -arch i386 ${workpath}/pre-dest/i386/${fpath} -arch ppc ${workpath}/pre-dest/ppc/${fpath} -create -output ${destroot}${fpath}" } default { # unknown file types are copied IF they do not differ across ALL architectures -- if they do: This is an error! ui_debug "unknown filetype: ${filetype}" set differ1 [exec "/usr/bin/diff" "-q" "${workpath}/pre-dest/i386/${fpath}" "${workpath}/pre-dest/ppc/${fpath}"] # set differ2 [exec "/usr/bin/diff" "-q" "${workpath}/pre-dest/i386/${fpath}" "${workpath}/pre-dest/x86_64/${fpath}"] # set differ3 [exec "/usr/bin/diff" "-q" "${workpath}/pre-dest/i386/${fpath}" "${workpath}/pre-dest/ppc64/${fpath}"] if {${differ1} != ""} { ui_debug "ERROR" } else { ui_debug "files match, just copying" file copy "${basepath}${fpath}" "${destroot}${fpath}" } } } } default { ui_debug "serious error" } } } } } } # the test suite can only be run *after* destrooting # test.run yes # test.dir ${worksrcpath}/test # test.target alltests