# SliTaz package receipt.

PACKAGE="fetchmail"
VERSION="6.4.1"
CATEGORY="network"
TAGS="email"
SHORT_DESC="Mail retrieval and forwarding utility."
MAINTAINER="erjo@slitaz.org"
LICENSE="GPL2"
WEB_SITE="https://www.fetchmail.info/"

TARBALL="$PACKAGE-$VERSION.tar.xz"
WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"

HANDBOOK_URL="http://fetchmail.berlios.de/fetchmail-man.html"

DEPENDS="openssl"
BUILD_DEPENDS="openssl-dev"

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

# Rules to configure and make the package.
compile_rules()
{
	./configure		\
		--with-ssl	\
		$CONFIGURE_ARGS &&
	make &&
	make DESTDIR=$DESTDIR install
}

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