Receipt for: uemacs

source
# SliTaz package receipt.

PACKAGE="uemacs"
VERSION="20141208"
CATEGORY="editors"
TAGS="editor"
SHORT_DESC="Tiny emacs clone."
MAINTAINER="pascal.bellard@slitaz.org"
LICENSE="other"
WEB_SITE="https://git.kernel.org/pub/scm/editors/uemacs/uemacs.git"

TARBALL="$PACKAGE-$VERSION.tar.xz"
WGET_URL="https://sourceforge.net/projects/slackbuildsdirectlinks/files/$PACKAGE/$PACKAGE$VERSION.tar.xz"

DEPENDS="ncurses"
BUILD_DEPENDS="ncurses-dev"

# x86_64 ships the wide ncursesw: curses.h and the terminfo symbols live in
# ncursesw-dev/libncursesw, not the narrow ncurses-dev.
case "$ARCH" in
	x86_64) DEPENDS="ncursesw"; BUILD_DEPENDS="ncursesw-dev" ;;
esac

# What is the latest version available today?
current_version()
{
	wget -O - https://sourceforge.net/projects/slackbuildsdirectlinks/files/uemacs/ 2>/dev/null | \
	sed '/scope="row/!d;s|.*/uemacs||;s|.tar.*||;q'
}

# Rules to configure and make the package.
compile_rules()
{
	case "$ARCH" in
		# x86_64 libcurses lacks the terminfo symbols (no split libtinfo);
		# link libncursesw instead, after the objects (Makefile $LIBS slot)
		x86_64) make LIBS="-lncursesw" ;;
		# libtinfo is a static archive here: it must sit AFTER the objects
		# (Makefile $LIBS slot), not in LDFLAGS (before them) or tputs/tgoto
		# stay unresolved.
		*)      make LIBS="-ltinfo" ;;
	esac
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
	mkdir -p $fs/usr/bin

	cp -a $src/em	$fs/usr/bin
	ln -s em	$fs/usr/bin/uemacs
}