diff options
author | Jeremy Olexa <darkside@gentoo.org> | 2010-09-28 14:04:54 +0000 |
---|---|---|
committer | Jeremy Olexa <darkside@gentoo.org> | 2010-09-28 14:04:54 +0000 |
commit | 031c00432f3984134ee2290bdfb428afeaf78bf3 (patch) | |
tree | 1194d9093a40e567ac393e3cfd3d9636c7b256c7 /dev-libs | |
parent | ppc64 stable wrt #327777 (diff) | |
download | historical-031c00432f3984134ee2290bdfb428afeaf78bf3.tar.gz historical-031c00432f3984134ee2290bdfb428afeaf78bf3.tar.bz2 historical-031c00432f3984134ee2290bdfb428afeaf78bf3.zip |
QA: Fix SRC_URI of c_rehash and move it to FILESDIR, bug 339027
Package-Manager: portage-2.1.9.9/cvs/Linux x86_64
Diffstat (limited to 'dev-libs')
-rw-r--r-- | dev-libs/openssl/ChangeLog | 6 | ||||
-rw-r--r-- | dev-libs/openssl/Manifest | 6 | ||||
-rw-r--r-- | dev-libs/openssl/files/openssl-c_rehash.sh-rev-1.7 | 210 | ||||
-rw-r--r-- | dev-libs/openssl/openssl-1.0.0a-r3.ebuild | 10 |
4 files changed, 222 insertions, 10 deletions
diff --git a/dev-libs/openssl/ChangeLog b/dev-libs/openssl/ChangeLog index 77c310ad7c12..6eddbc456a2d 100644 --- a/dev-libs/openssl/ChangeLog +++ b/dev-libs/openssl/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for dev-libs/openssl # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-libs/openssl/ChangeLog,v 1.353 2010/09/28 11:02:13 ssuominen Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-libs/openssl/ChangeLog,v 1.354 2010/09/28 14:04:54 darkside Exp $ + + 28 Sep 2010; Jeremy Olexa <darkside@gentoo.org> openssl-1.0.0a-r3.ebuild, + +files/openssl-c_rehash.sh-rev-1.7: + QA: Fix SRC_URI of c_rehash and move it to FILESDIR, bug 339027 28 Sep 2010; Samuli Suominen <ssuominen@gentoo.org> openssl-0.9.8o-r2.ebuild, openssl-1.0.0a-r3.ebuild: diff --git a/dev-libs/openssl/Manifest b/dev-libs/openssl/Manifest index 6dfd6766df35..4812b52b5f17 100644 --- a/dev-libs/openssl/Manifest +++ b/dev-libs/openssl/Manifest @@ -10,13 +10,13 @@ AUX openssl-1.0.0a-alpha-mont.patch 2635 RMD160 6559e94693f62cf3c65c4318936566d8 AUX openssl-1.0.0a-alphacpuid.patch 342 RMD160 98c6ad7e6b643c4adb13dc566a54faa3d0235807 SHA1 0f093ab2015727fe675d971a4ff2a3cdea633590 SHA256 6f9bf3284204c363295e735a8b23752274e5de90229ece8df2595f6651aa6fa1 AUX openssl-1.0.0a-fix-double-free.patch 252 RMD160 4cf11701c503eb28ce2cea834523b9ec3e38bd4a SHA1 4006be947a41f77c471504d4770dbf8b36b315b8 SHA256 a179daada4021897dc2759e9555b22f5dcb511c1d011bbab8106b35fd2332b96 AUX openssl-1.0.0a-ldflags.patch 914 RMD160 1e057330b3fc84d7f799976c0ba5cce02f505f57 SHA1 9bada0fb576b4f78b046b77b77248b352e1953a6 SHA256 33f5d39e2b6464ed33654214a0148a6f6546fe319793ae04f54d2106422ddba1 +AUX openssl-c_rehash.sh-rev-1.7 4167 RMD160 c87f12c5421593d160f0cc650921c2e3412869ab SHA1 54493c80be245f2da9b7d303e49d613d376d9609 SHA256 4999ee79892f52bd6a4a7baba9fac62262454d573bbffd72685d3aae9e48cee0 DIST openssl-0.9.8o.tar.gz 3772542 RMD160 c2e455a17bce59c8a54522ffaa26c3a5cb26b510 SHA1 80c73afc7dca790cd26936cb392a4dfd14d4e4d7 SHA256 befada1ac3819b1d317df8197b5e82ec768b39d250fcbef81e2b1cb7f165d448 DIST openssl-1.0.0a.tar.gz 4015794 RMD160 f46ea1d0875ef523662e652f22faf0f0f261f354 SHA1 b837a9f75a51f456bd533690cf04d3d5714812dc SHA256 18a9bd1fc02b8ef90dded34fafaa9089baaafef278a19fc4e89c2ab0dcf70f63 -DIST openssl-c_rehash.sh?rev=1.7 4167 RMD160 c87f12c5421593d160f0cc650921c2e3412869ab SHA1 54493c80be245f2da9b7d303e49d613d376d9609 SHA256 4999ee79892f52bd6a4a7baba9fac62262454d573bbffd72685d3aae9e48cee0 EBUILD openssl-0.9.8o-r1.ebuild 4251 RMD160 ba06206d1d8a6d0109fe2b53f05f2a363fac1d91 SHA1 325676bb3cf3f14dea68d0c6aa9d0fe304a9f39d SHA256 7a7f2332bd226b0ee7719e3fcc3683897a0536731cdef18073c8ca46b7d69cda EBUILD openssl-0.9.8o-r2.ebuild 4315 RMD160 76910825e57f7135edb531a079f2d40bc9fffe29 SHA1 76eb7a700cb26a45bbe60e52b7e3f1e21aaa7f79 SHA256 24cf23ebfa497fcbe703ecf86c492137043cf3148f35f845e249922319357d9b EBUILD openssl-0.9.8o.ebuild 5355 RMD160 944bcef12c47a34a29f9d41c071e084daec2e715 SHA1 8984a9f092d75365e9506999edab77a042dbd1d9 SHA256 aafeacde45a423a2ef7a43fff95dcc22776371ca9a5dd475ebf8fdf992d96786 EBUILD openssl-1.0.0a-r1.ebuild 5608 RMD160 73338932e4f1b8447957a9b4b58351775f2d9c7f SHA1 03cb9241ca0b452f653a0b6922dfb0c05f99ae83 SHA256 798a8e68b20b305967eeb143a0310866b43b24f6eb11fbacdea402d752168d9c -EBUILD openssl-1.0.0a-r3.ebuild 6016 RMD160 8c8ec2cf8bff6ed737846918d9a32e0e88e1e017 SHA1 3ecf295513bf9218d72ca12a2831c890ed85bee2 SHA256 3892513d4aa4ebed8d84e80dddfac283ef95d1d51d5188db9f998e405ce8af41 -MISC ChangeLog 53255 RMD160 fd1e8d0c59f644e908fa1b784d59ec591778263e SHA1 743e70919e7cb792d319e88c79378787067acdcf SHA256 c51946c8e0a6c6c64c2f6769242b1ad6b4f2c6c0f99a81de241fba301dc97616 +EBUILD openssl-1.0.0a-r3.ebuild 5874 RMD160 66df315133d091d3e3222b4f31a8d0c9024ab0b5 SHA1 8ce4c27f6d8808aec215cae7f22d6c33df342dac SHA256 3d10046308929e759acceb4cb7ed76de0e79083f08e3d747018efb394bda2437 +MISC ChangeLog 53435 RMD160 e9c17956f3d1dc895098ebf639510c0d251400ca SHA1 2d546f03b0a10cc4b26266a93f5a668a09a0199f SHA256 9ae08ed0ce1bcf4e55a60d9fba2a2ed42890fecba711446723ec24b14ce7d573 MISC metadata.xml 290 RMD160 5aee06348916e9fbcdab233e8babb0ed08260ca5 SHA1 f798e6a59f370931dc151fcff9a473eabda44ab9 SHA256 828c7b974fc1bbac92f75490c85897b27cd3cacce021f56ad1b4ef06d28fe7bd diff --git a/dev-libs/openssl/files/openssl-c_rehash.sh-rev-1.7 b/dev-libs/openssl/files/openssl-c_rehash.sh-rev-1.7 new file mode 100644 index 000000000000..75a774945cf7 --- /dev/null +++ b/dev-libs/openssl/files/openssl-c_rehash.sh-rev-1.7 @@ -0,0 +1,210 @@ +#!/bin/sh +# +# Ben Secrest <blsecres@gmail.com> +# +# sh c_rehash script, scan all files in a directory +# and add symbolic links to their hash values. +# +# based on the c_rehash perl script distributed with openssl +# +# LICENSE: See OpenSSL license +# ^^acceptable?^^ +# + +# default certificate location +DIR=/etc/openssl + +# for filetype bitfield +IS_CERT=$(( 1 << 0 )) +IS_CRL=$(( 1 << 1 )) + + +# check to see if a file is a certificate file or a CRL file +# arguments: +# 1. the filename to be scanned +# returns: +# bitfield of file type; uses ${IS_CERT} and ${IS_CRL} +# +check_file() +{ + local IS_TYPE=0 + + # make IFS a newline so we can process grep output line by line + local OLDIFS=${IFS} + IFS=$( printf "\n" ) + + # XXX: could be more efficient to have two 'grep -m' but is -m portable? + for LINE in $( grep '^-----BEGIN .*-----' ${1} ) + do + if echo ${LINE} \ + | grep -q -E '^-----BEGIN (X509 |TRUSTED )?CERTIFICATE-----' + then + IS_TYPE=$(( ${IS_TYPE} | ${IS_CERT} )) + + if [ $(( ${IS_TYPE} & ${IS_CRL} )) -ne 0 ] + then + break + fi + elif echo ${LINE} | grep -q '^-----BEGIN X509 CRL-----' + then + IS_TYPE=$(( ${IS_TYPE} | ${IS_CRL} )) + + if [ $(( ${IS_TYPE} & ${IS_CERT} )) -ne 0 ] + then + break + fi + fi + done + + # restore IFS + IFS=${OLDIFS} + + return ${IS_TYPE} +} + + +# +# use openssl to fingerprint a file +# arguments: +# 1. the filename to fingerprint +# 2. the method to use (x509, crl) +# returns: +# none +# assumptions: +# user will capture output from last stage of pipeline +# +fingerprint() +{ + ${SSL_CMD} ${2} -fingerprint -noout -in ${1} | sed 's/^.*=//' | tr -d ':' +} + + +# +# link_hash - create links to certificate files +# arguments: +# 1. the filename to create a link for +# 2. the type of certificate being linked (x509, crl) +# returns: +# 0 on success, 1 otherwise +# +link_hash() +{ + local FINGERPRINT=$( fingerprint ${1} ${2} ) + local HASH=$( ${SSL_CMD} ${2} -hash -noout -in ${1} ) + local SUFFIX=0 + local LINKFILE='' + local TAG='' + + if [ ${2} = "crl" ] + then + TAG='r' + fi + + LINKFILE=${HASH}.${TAG}${SUFFIX} + + while [ -f ${LINKFILE} ] + do + if [ ${FINGERPRINT} = $( fingerprint ${LINKFILE} ${2} ) ] + then + echo "WARNING: Skipping duplicate file ${1}" >&2 + return 1 + fi + + SUFFIX=$(( ${SUFFIX} + 1 )) + LINKFILE=${HASH}.${TAG}${SUFFIX} + done + + echo "${1} => ${LINKFILE}" + + # assume any system with a POSIX shell will either support symlinks or + # do something to handle this gracefully + ln -s ${1} ${LINKFILE} + + return 0 +} + + +# hash_dir create hash links in a given directory +hash_dir() +{ + echo "Doing ${1}" + + cd ${1} + + ls -1 * 2>/dev/null | while read FILE + do + if echo ${FILE} | grep -q -E '^[[:xdigit:]]{8}\.r?[[:digit:]]+$' \ + && [ -h "${FILE}" ] + then + rm ${FILE} + fi + done + + ls -1 *.pem 2>/dev/null | while read FILE + do + check_file ${FILE} + local FILE_TYPE=${?} + local TYPE_STR='' + + if [ $(( ${FILE_TYPE} & ${IS_CERT} )) -ne 0 ] + then + TYPE_STR='x509' + elif [ $(( ${FILE_TYPE} & ${IS_CRL} )) -ne 0 ] + then + TYPE_STR='crl' + else + echo "WARNING: ${FILE} does not contain a certificate or CRL: skipping" >&2 + continue + fi + + link_hash ${FILE} ${TYPE_STR} + done +} + + +# choose the name of an ssl application +if [ -n "${OPENSSL}" ] +then + SSL_CMD=$(which ${OPENSSL} 2>/dev/null) +else + SSL_CMD=/usr/bin/openssl + OPENSSL=${SSL_CMD} + export OPENSSL +fi + +# fix paths +PATH=${PATH}:${DIR}/bin +export PATH + +# confirm existance/executability of ssl command +if ! [ -x ${SSL_CMD} ] +then + echo "${0}: rehashing skipped ('openssl' program not available)" >&2 + exit 0 +fi + +# determine which directories to process +old_IFS=$IFS +if [ ${#} -gt 0 ] +then + IFS=':' + DIRLIST=${*} +elif [ -n "${SSL_CERT_DIR}" ] +then + DIRLIST=$SSL_CERT_DIR +else + DIRLIST=${DIR}/certs +fi + +IFS=':' + +# process directories +for CERT_DIR in ${DIRLIST} +do + if [ -d ${CERT_DIR} -a -w ${CERT_DIR} ] + then + IFS=$old_IFS + hash_dir ${CERT_DIR} + IFS=':' + fi +done diff --git a/dev-libs/openssl/openssl-1.0.0a-r3.ebuild b/dev-libs/openssl/openssl-1.0.0a-r3.ebuild index 5163f10c366a..ae7dec3668ea 100644 --- a/dev-libs/openssl/openssl-1.0.0a-r3.ebuild +++ b/dev-libs/openssl/openssl-1.0.0a-r3.ebuild @@ -1,13 +1,12 @@ # Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-libs/openssl/openssl-1.0.0a-r3.ebuild,v 1.7 2010/09/28 11:02:13 ssuominen Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-libs/openssl/openssl-1.0.0a-r3.ebuild,v 1.8 2010/09/28 14:04:54 darkside Exp $ inherit eutils flag-o-matic toolchain-funcs DESCRIPTION="full-strength general purpose cryptography library (including SSL v2/v3 and TLS v1)" HOMEPAGE="http://www.openssl.org/" -SRC_URI="mirror://openssl/source/${P}.tar.gz - http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/~checkout~/packages/${PN}/${PN}-c_rehash.sh?rev=1.7" +SRC_URI="mirror://openssl/source/${P}.tar.gz" LICENSE="openssl" SLOT="0" @@ -24,8 +23,7 @@ DEPEND="${RDEPEND} PDEPEND="app-misc/ca-certificates" src_unpack() { - unpack ${P}.tar.gz - cp "${DISTDIR}"/openssl-c_rehash.sh* "${WORKDIR}"/c_rehash || die + unpack ${A} cd "${S}" epatch "${FILESDIR}"/${PN}-0.9.7e-gentoo.patch @@ -131,7 +129,7 @@ src_test() { src_install() { emake -j1 INSTALL_PREFIX="${D}" install || die - dobin "${WORKDIR}"/c_rehash || die #333117 + newbin "${FILESDIR}"/openssl-c_rehash.sh-rev-1.7 c_rehash || die #333117 dodoc CHANGES* FAQ NEWS README doc/*.txt doc/c-indentation.el dohtml -r doc/* |