Receipt for: libcrypto10-dev

# SliTaz package receipt.

PACKAGE="libcrypto10-dev"
VERSION="1.0.2u"
CATEGORY="development"
SHORT_DESC="General purpose cryptographic shared library devel files."
MAINTAINER="pascal.bellard@slitaz.org"
LICENSE="BSD"
WEB_SITE="https://www.openssl.org/"
HOST_ARCH="i486 arm x86_64"

WANTED="openssl10"
DEPENDS="libcrypto10 pkg-config"

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
	# Crypto dev files land in the SAME isolated OpenSSL 1.0 tree as openssl10-dev
	# (/usr/lib/openssl-1.0), never in generic /usr/lib -> 3.x stays default.
	# See openssl10-dev for the opt-in PKG_CONFIG_PATH scheme.
	mkdir -p $fs/usr/lib/openssl-1.0/pkgconfig

	# static lib + dev symlinks to the versioned soname in /usr/lib
	# (libcrypto10). Two names: the exact soname for the .pc's -l: form,
	# and the plain libcrypto.so so a bare -lcrypto links dynamic too.
	ln -s ../libcrypto.so.1.0.0 $fs/usr/lib/openssl-1.0/
	ln -s ../libcrypto.so.1.0.0 $fs/usr/lib/openssl-1.0/libcrypto.so
	cp -a $install/usr/lib/openssl-1.0/libcrypto.a $fs/usr/lib/openssl-1.0

	# libcrypto.pc repathed to the isolated tree. Link the exact 1.0 soname
	# (-l:libcrypto.so.1.0.0): the shared /usr/lib/openssl-1.0/ tree loses its
	# dev symlinks to the tazpkg-remove sweep, after which bare -lcrypto falls
	# through to the generic OpenSSL 3 lib. See openssl10-dev for details.
	sed -e 's|^libdir=.*|libdir=/usr/lib/openssl-1.0|' \
	    -e 's|^includedir=.*|includedir=/usr/include/openssl-1.0|' \
	    -e 's|-lcrypto|-l:libcrypto.so.1.0.0|g' \
	    $install/usr/lib/openssl-1.0/pkgconfig/libcrypto.pc \
	    > $fs/usr/lib/openssl-1.0/pkgconfig/libcrypto.pc
}