Receipt for: smx

source
# SliTaz package receipt.

PACKAGE="smx"
VERSION="1.1.4-454"
CATEGORY="development"
SHORT_DESC="text-embedded macro processing language."
MAINTAINER="pascal.bellard@slitaz.org"
LICENSE="GPL2"
TARBALL="$PACKAGE-$VERSION.tar.gz"
WEB_SITE="https://web.archive.org/web/20180323014153/http://www.smxlang.org/"
WGET_URL="https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/$PACKAGE/$TARBALL"

DEPENDS="unixODBC sqlite libgd libcrypto10 gcc-lib-base zlib tiff libjpeg"
BUILD_DEPENDS="apache-dev apr-dev apr-util-dev unixODBC-dev \
sqlite tiff-dev libgd-dev openssl10-dev perl-dev libtool"

# What is the latest version available today?
current_version()
{
	wget -O - https://github.com/earonesty/smx/releases 2>/dev/null | \
	sed '/tag\//!d;s|.*tag/v*||;s|".*||;q'
}

# Rules to configure and make the package.
compile_rules()
{
	# openssl10: build against the isolated OpenSSL 1.0 tree -- system openssl
	# is 3.x which dropped the 1.0 APIs/struct layout openssh 9.3p1 needs.
	# --with-ssl-dir derives the lib path from a single dir, but the 1.0
	# headers (/usr/include/openssl-1.0) and libs (/usr/lib/openssl-1.0) live
	# apart, so it linked the system 3.x lib instead. Feed both via flags and
	# -L the 1.0 dir so -lcrypto resolves to the versioned 1.0 lib.
	export CFLAGS="$CFLAGS -I/usr/include/openssl-1.0"
	export CPPFLAGS="$CPPFLAGS -I/usr/include/openssl-1.0"
	export LDFLAGS="$LDFLAGS -L/usr/lib/openssl-1.0"
	export PKG_CONFIG_PATH=/usr/lib/openssl-1.0/pkgconfig:$PKG_CONFIG_PATH

	sed -i	-e 's/ap_get_server_version/ap_get_server_banner/' \
		-e 's/remote_ip/client_ip/' modsmx/modsmx.h
	sed -i 's/modsmx.h"/&\n#ifdef APLOG_USE_MODULE\nAPLOG_USE_MODULE(smx);\n#undef APLOG_MARK\n#define APLOG_MARK __FILE__, __LINE__, APLOG_MODULE_INDEX\n#endif/' modsmx/modsmx.cpp
	./configure \
		--prefix=/usr \
		--mandir=/usr/share/man \
		$CONFIGURE_ARGS &&
	make &&
	make DESTDIR=$DESTDIR install
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
	mkdir -p $fs/usr/lib
	cp -a $install/usr/bin $fs/usr
	cp -a $install/usr/lib/*.so* $fs/usr/lib
}