openssl: make it parallel installable with openssl 3.0.x

This commit is contained in:
Tom G. Christensen 2021-11-27 17:53:38 +01:00
parent 4ed1cc68e4
commit be5c408ecd
5 changed files with 62 additions and 31 deletions

View File

@ -7,7 +7,7 @@
# Check the following 4 variables before running the script # Check the following 4 variables before running the script
topdir=openssl topdir=openssl
version=1.0.2u version=1.0.2u
pkgver=6 pkgver=7
source[0]=https://openssl.org/source/$topdir-$version.tar.gz source[0]=https://openssl.org/source/$topdir-$version.tar.gz
# If there are no patches, simply comment this # If there are no patches, simply comment this
#patch[0]= #patch[0]=
@ -19,11 +19,12 @@ source[0]=https://openssl.org/source/$topdir-$version.tar.gz
. ${BUILDPKG_BASE}/gcc/build.sh.gcc.cpu . ${BUILDPKG_BASE}/gcc/build.sh.gcc.cpu
# Global settings # Global settings
abbrev_ver=$(echo $version|${__sed} -e 's/\.//g') sover=1.0.0
baseversion=$(echo $version|${__sed} -e 's/[a-zA-Z]//g') shortver=102
pname=openssl${shortver}
make_check_target="test" make_check_target="test"
__configure="./Configure" __configure="./Configure"
configure_args=(--prefix=$prefix --openssldir=${prefix}/${_sharedir}/ssl zlib-dynamic shared) configure_args=(--prefix=$prefix --openssldir=${prefix}/${_sharedir}/ssl zlib shared)
if [ "$arch" = "sparc" ]; then if [ "$arch" = "sparc" ]; then
configure_args+=(solaris-sparc${gcc_arch}-gcc) configure_args+=(solaris-sparc${gcc_arch}-gcc)
else else
@ -58,11 +59,11 @@ prep()
reg build reg build
build() build()
{ {
setdir source
echo $__configure "${configure_args[@]}" echo $__configure "${configure_args[@]}"
$__configure "${configure_args[@]}" $__configure "${configure_args[@]}"
setdir source
${__make} SHARED_LDFLAGS="-shared -R${prefix}/${_libdir}" depend ${__make} SHARED_LDFLAGS="-shared -R${prefix}/${_libdir}" depend
${__make} SHARED_LDFLAGS="-shared -R${prefix}/${_libdir}" ${__make} SHARED_LDFLAGS="-shared -R${prefix}/${_libdir}"
} }
@ -79,21 +80,36 @@ install()
clean stage clean stage
setdir source setdir source
${__make} INSTALL_PREFIX=$stagedir MANDIR=${prefix}/${_mandir} install ${__make} INSTALL_PREFIX=$stagedir MANDIR=${prefix}/${_mandir} install
setdir ${stagedir}${prefix}/${_mandir} # Relocate
for j in $(${__ls} -1d man?) mkdir -p ${stagedir}${prefix}/{${_includedir},${_libdir}}/$pname
${__mv} ${stagedir}${prefix}/${_includedir}/{openssl,$pname/openssl}
${__mv} ${stagedir}${prefix}/${_bindir}/{openssl,$pname}
${__rm} -rf ${stagedir}${prefix}/{${_sharedir}/ssl/misc,{${_bindir},${_mandir}/man1}/{CA.pl,c_rehash,*tsget}*}
${__rm} -f ${stagedir}${prefix}/${_sharedir}/ssl/openssl.cnf
${__rm} -f ${stagedir}${prefix}/${_libdir}/*.so
ln -s ../libcrypto.so.${sover} ${stagedir}${prefix}/${_libdir}/${pname}/libcrypto.so
ln -s ../libssl.so.${sover} ${stagedir}${prefix}/${_libdir}/${pname}/libssl.so
for pc in libcrypto libssl openssl
do do
cd $j ${__sed} -e "s@\(Libs: -L\${libdir}\)@\1 -L\${libdir}/$pname@" \
for manpage in * -e "s@\(Cflags: -I\${includedir}\)@\1 -I\${includedir}/$pname@" \
do -e "s@\(Requires.*:.*\)\(libssl\)@\1\2$shortver@g" \
if [ -L "${manpage}" ]; then -e "s@\(Requires.*:.*\)\(libcrypto\)@\1\2$shortver@g" \
TARGET=$(${__ls} -l "${manpage}" | ${__awk} '{ print $NF }') ${stagedir}${prefix}/${_libdir}/pkgconfig/${pc}.pc > ${stagedir}${prefix}/${_libdir}/pkgconfig/${pc}${shortver}.pc
${__ln} -snf "${TARGET}"ssl "${manpage}"ssl rm -f ${stagedir}${prefix}/${_libdir}/pkgconfig/${pc}.pc
${__rm} -f "${manpage}" done
else setdir ${stagedir}${prefix}/${_mandir}
${__mv} "$manpage" "$manpage""ssl" ${__mv} man1/{openssl.1,${pname}.1}
fi for manpage in man*/*
done do
cd .. [ "${manpage}" = "man1/${pname}.1" ] && continue
if [ -L "${manpage}" ]; then
TARGET=$(${__ls} -l ${manpage} | ${__awk} '{ print $NF }')
${__ln} -snf ${TARGET}ssl${shortver} ${manpage}ssl${shortver}
${__rm} -f ${manpage}
else
${__mv} $manpage ${manpage}ssl${shortver}
fi
done done
# Make .sos writable # Make .sos writable
chmod 755 ${stagedir}${prefix}/${_libdir}/*.so.* chmod 755 ${stagedir}${prefix}/${_libdir}/*.so.*
@ -112,6 +128,7 @@ install()
compat openssl 1.0.2o 1 3 compat openssl 1.0.2o 1 3
compat openssl 1.0.2p 1 4 compat openssl 1.0.2p 1 4
compat openssl 1.0.2r 1 5 compat openssl 1.0.2r 1 5
compat openssl 1.0.2u 1 6
} }
reg pack reg pack

View File

@ -1,5 +1,9 @@
CHANGELOG CHANGELOG
--------- ---------
* Sat Nov 20 2021 Tom G. Christensen <swpkg@jupiterrise.com> - 1.0.2u-7
- Rebuild as parallel installable with OpenSSL 3.0
- Move utils into their own package
* Tue Jan 28 2020 Tom G. Christensen <swpkg@jupiterrise.com> - 1.0.2u-6 * Tue Jan 28 2020 Tom G. Christensen <swpkg@jupiterrise.com> - 1.0.2u-6
- Update to 1.0.2u - Update to 1.0.2u

View File

@ -1 +1,3 @@
TGCossl TGCprngd auto TGCossl TGCprngd auto
TGCossld openssl auto
TGCosslu openssl auto

View File

@ -1,28 +1,37 @@
[openssl] [openssl]
pkgname="${pkgprefix}ossl" pkgname="${pkgprefix}ossl"
name="openssl - Secure Sockets Layer" name="openssl - OpenSSL shared libraries"
pkgcat="system" pkgcat="system"
pkgvendor="https://www.openssl.org" pkgvendor="https://www.openssl.org"
pkgdesc="Cryptography and SSL/TLS Toolkit" pkgdesc="Cryptography and SSL/TLS Toolkit"
pkgver="$pkgver" pkgver="$pkgver"
files(-,root,bin) files(-,root,bin)
default_docs default_docs
$_bindir
$_libdir/*.so.* $_libdir/*.so.*
$_libdir/engines/*.so $_libdir/engines/*.so
$_mandir/man{1,5,7}
$_sharedir/ssl $_sharedir/ssl
[openssl-utils]
pkgname="${pkgprefix}osslu"
name="openssl-utils - OpenSSL utilities and manpages"
pkgcat="system"
pkgvendor="https://www.openssl.org"
pkgdesc="Cryptography and SSL/TLS Toolkit"
pkgver="$pkgver"
files(-,root,bin)
$_bindir
$_mandir/man{1,5,7}
[openssl-devel] [openssl-devel]
pkgname="${pkgprefix}ossld" pkgname="${pkgprefix}ossld"
name="openssl-devel - Development support for openssl" name="openssl-devel - Development support for OpenSSL"
pkgcat="system" pkgcat="system"
pkgvendor="http://www.openssl.org" pkgvendor="https://www.openssl.org"
pkgdesc="Files needed for developing with openssl" pkgdesc="Files needed for developing with OpenSSL"
pkgver="$pkgver" pkgver="$pkgver"
files(-,root,bin) files(-,root,bin)
$_includedir $_includedir/$pname
$_libdir/*.so $_libdir/$pname/*.so
$_libdir/pkgconfig $_libdir/pkgconfig
[openssl-devel-manpages] [openssl-devel-manpages]

View File

@ -25,8 +25,7 @@ KNOWN DEPENDENCIES
ERRORS/MISCELLANEOUS ERRORS/MISCELLANEOUS
-------------------- --------------------
Note that all manpages has had 'ssl' added to their name. Note that all manpages has had 'ssl102' added to their name.
This means that you might have to specify the whole name This means that you might have to specify the whole name
if there's another manpage by the same name. if there's another manpage by the same name.
ie. man x509 vs man x509.1ssl ie. man x509 vs man x509.1ssl102