### this file is sourced not run
PKGVER=2.9.1
PKGBUILD=1
PKGARCH=noarch

# source: james
TARBALL= # see below
MD5SUM=  # see below
SRC_URL= # see below

TARBALL1="http://pari.math.u-bordeaux.fr/pub/pari/packages/elldata.tgz|\
0ae49b7aa6a012ccd2804bfb831d3686"

TARBALL2="http://pari.math.u-bordeaux.fr/pub/pari/packages/galpol.tgz|\
c241b3b40267f640df4d45ed2d604442"

TARBALL3="http://pari.math.u-bordeaux.fr/pub/pari/packages/seadata.tgz|\
6e9c119ccb3c65916a48e1a8cd899558"

TARBALL4="http://pari.math.u-bordeaux.fr/pub/pari/packages/nftables.tgz|\
82788524f36bbbba886785c940c859db"

TARBALL5="http://pari.math.u-bordeaux.fr/pub/pari/packages/galdata.tgz|\
f9f61b2930757a785b568e5d307a7d75"

SLACKREQ='libpari'
SLACKDESC="libpari-extra: libpari-extra $PKGVER (Extra packages for libpari)
libpari-extra: 
libpari-extra: This package contains optional PARI/GP packages. These packages use 
libpari-extra: up a nonnegligible amount of disk space and will be useless for most 
libpari-extra: users, hence they are distributed separately. Contains Elliptic Curve 
libpari-extra: data, Galois rationals, large primes, megrez numbers, and 
libpari-extra: higher-order Galois data.
libpari-extra: Note: seadata-small is included, seadata-big is not.
libpari-extra: 
libpari-extra: http://pari.math.u-bordeaux.fr/packages.html
libpari-extra:
"

PARI_DATADIR=/usr/share/pari
PKG_NOBUILD=yes

### default pkg_download
### prepare
pkg_prepare() {
	local x y
	
	mkdir -p ./$PARI # this is the pari datadir
	
	for p in $(seq 1 5); do
		# get filename, md5sum and tarball name
		eval x="\$TARBALL$p"
		SRC_URL=${x%%|*}
		MD5SUM=${x##*|}
		y=${SRC_URL##*/}
		TARBALL="pari-extra-${y%.tgz}-$PKGVER.tgz"
		#echo $TARBALL
		
		# download and extract
		if pkg_check $SRC_DIR $TARBALL $MD5SUM; then
			case $TARBALL in
				*nftables*)
				   tar -xf $SRC_DIR/$TARBALL -C ./$PARI_DATADIR ;;
				*) tar -xf $SRC_DIR/$TARBALL -C ./$PARI_DATADIR --strip-components=1 ;;
			esac
		else 
			return 1
		fi
	done &&
	
	pkg_build_slackdesc .
}

### default pkg_package
### build
pkg_build() {
	: nothing to do
}


