### this file is sourced not run
PKGVER=0.63
PKGBUILD=1
PKGARCH=x86_64

# source: step
TARBALL=moreutils-$PKGVER.tar.gz
MD5SUM=0af12becbed31dc5d57c4a880ef398fc
SRC_URL=https://git.joeyh.name/index.cgi/moreutils.git/snapshot/$TARBALL
BUNDLE=

SLACKREQ=
SLACKSUG=perl
SLACKDESC="moreutils: moreutils $PKGVER (shell tools)
moreutils: Moreutils is a growing collection of the unix tools that nobody thought to
moreutils: write long ago when unix was young. The author is always interested to add
moreutils: more to the collection, as long as they're suitably general-purpose, and
moreutils: don't duplicate other well-known tools.
moreutils: 
moreutils: NOTE: Some tools in this package need the perl package.
moreutils: 
moreutils: License: GNU GPL2
moreutils: 
moreutils: Homepage: https://joeyh.name/code/moreutils/
"

### default pkg_download
### prepare
pkg_prepare() {
	pkg_prepare_default &&
	cd tmp/moreutils* &&
	stylesheet=$(find /usr/share/xml/docbook -path */manpages/docbook.xsl -print -quit) &&
		[ "$stylesheet" ] &&
		right=${stylesheet#/usr/share/xml/docbook} &&
		middle=${right%/manpages/docbook.xsl} &&
		sed -i -e "s@stylesheet/docbook-xsl@$middle@" \
			-e "s@PREFIX?=/usr@PREFIX?=/usr/local@" Makefile
			# changed prefix so as not to conflict with package 'parallel'
}
### default pkg_package
### build
pkg_build() {
	cd /tmp/moreutils* &&
	make &&

	# fix manual pages
	sed -e 's/^[[:space:]]\+\././' -i *.1 &&

	make install &&
	pkg_build_slackdesc
}

# vim:ft=sh:

