### this file is sourced not run
PKGVER=2024.05.14 # last commit date
PKGBUILD=1
PKGARCH=x86_64

# source: james
TARBALL=autoconf-archive-$PKGVER.tar.gz
MD5SUM=84dd76e29cab974f2124ea7da38824fb
SRC_URL=https://github.com/autoconf-archive/autoconf-archive/archive/c673b0d795f2c4da83cb14afdb64e5df773c3ec3.tar.gz
BUNDLE=

GNULIB_SRC_URL="http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=snapshot;h=63107d9788769e4a6769f0bdfcb49817ca7d882a;sf=tgz"
GNULIB_TARBALL=gnulib-2024.09.03.tar.gz # pull date

# https://www.gnu.org/software/autoconf-archive/
# http://ftpmirror.gnu.org/autoconf-archive/autoconf-archive-2023.02.20.tar.xz # latest tarball
# http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git # primary source
# https://github.com/autoconf-archive/autoconf-archive       # mirror, but newer than primary

SLACKREQ=
SLACKDESC="autoconf-archive: autoconf-archive $PKGVER (extra autoconf macros)
autoconf-archive: 
autoconf-archive: The GNU Autoconf Archive is a collection of more than 500 macros for 
autoconf-archive: GNU Autoconf that have been contributed as free software by friendly 
autoconf-archive: supporters of the cause from all over the Internet.
autoconf-archive: 
autoconf-archive: https://www.gnu.org/software/autoconf-archive/
autoconf-archive: 
autoconf-archive: 
autoconf-archive: 
autoconf-archive: 
"

### download
pkg_download() {
	pkg_check "$SRC_DIR" "$TARBALL" "$MD5SUM" "$SRC_URL" &&
	pkg_check "$SRC_DIR" "$GNULIB_TARBALL" "" "$GNULIB_SRC_URL"
}

### prepare
pkg_prepare() {
	if pkg_prepare_default; then
		echo extracting $GNULIB_TARBALL ...
		tar -xf "$SRC_DIR/$GNULIB_TARBALL" -C tmp/autoconf-archive* &&
		cd tmp/autoconf-archive* &&
		mv gnulib* gnulib &&
		patch -Np1 -i ../pkg/git-ftbfs.patch
	fi
}

### default pkg_package
### build
pkg_build() {
	cd /tmp/autoconf-archive* &&
	sh bootstrap.sh &&
	./configure $CONFFLAGS &&
	make maintainer-all &&
	make && make install &&
	pkg_build_slackdesc
}


