void-packages/srcpkgs/snowball/template

58 lines
1.8 KiB
Bash

# Template file for 'snowball'
pkgname=snowball
version=2.2.0
revision=1
build_style=gnu-makefile
build_helper=qemu
make_check_target=check_stemtest # other checks are missing targets in the makefile
hostmakedepends="perl"
short_desc="Small string processing language for creating stemming algorithms"
maintainer="Orphaned <orphan@voidlinux.org>"
license="BSD-3-Clause"
homepage="https://snowballstem.org/"
distfiles="https://github.com/snowballstem/snowball/archive/refs/tags/v${version}.tar.gz"
checksum=425cdb5fba13a01db59a1713780f0662e984204f402d3dae1525bda9e6d30f1a
post_patch() {
if [ -n "$CROSS_BUILD" ]; then
vsed -i GNUmakefile \
-e 's|\t\./snowball|\tqemu-${XBPS_TARGET_QEMU_MACHINE}-static ./snowball|'
fi
}
do_install() {
vbin snowball
vbin stemwords
vinstall include/libstemmer.h 644 usr/include
vinstall libstemmer.a 644 usr/lib
vinstall libstemmer.so.$version 644 usr/lib
ln -s libstemmer.so.$version ${DESTDIR}/usr/lib/libstemmer.so
ln -s libstemmer.so.$version ${DESTDIR}/usr/lib/libstemmer.so.${version%.*.*}
vlicense COPYING
}
# XXX: upstream doesn't generate a dynamic library for libstemmer
# each distribution patches this on their own:
# Arch: https://github.com/archlinux/svntogit-packages/tree/packages/snowball/trunk
# Alpine: https://gitlab.alpinelinux.org/alpine/aports/-/tree/master/community/snowball
# Gentoo: https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-libs/snowball-stemmer
libstemmer_package() {
short_desc="Stemming algorithm library"
pkg_install() {
vmove "usr/lib/libstemmer.so.*"
}
}
libstemmer-devel_package() {
depends="libstemmer>=${version}_${revision}"
short_desc="Stemming algorithm library - development files"
pkg_install() {
vmove usr/lib/libstemmer.a
vmove usr/lib/libstemmer.so
vmove usr/include
}
}