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

# source: BLFS 11.3
TARBALL=python-$PKGVER-docs-html.tar.bz2
MD5SUM=eb4132c780b60b5782a4f66b29b08d5c
BUNDLE=fatdog-base-11.3.tar
SRC_URL=http://distro.ibiblio.org/fatdog/source/900/$BUNDLE
#SRC_URL=http://docs.python.org/ftp/python/doc/$PKGVER/$TARBALL

SLACKREQ=python
SLACKDESC="python3-docs: python3-docs $PKGVER (HTML documentation for Python)  
python3-docs:  
python3-docs: This package contains HTML documentation for Python 3.
python3-docs: 
python3-docs: https://www.python.org/
python3-docs: 
python3-docs: 
python3-docs: 
python3-docs: 
python3-docs: 
python3-docs:
"


### override download for LFS sources bundle
# $1-src-dir $2-tarball 
pkg_download() {
	echo downloading $BUNDLE for $TARBALL
	wget -P $1 $SRC_URL
	tar -xf $1/$BUNDLE --strip-components=1 -C $1 
	rm $1/$BUNDLE
}

### prepare
pkg_prepare() {
	pkg_check $SRC_DIR $TARBALL $MD5SUM &&
	cp $SRC_DIR/$TARBALL tmp
}

### default pkg_package
### build
pkg_build() {
	cd /tmp &&
	install -v -dm755 /usr/share/doc/python-$PKGVER &&
	tar --strip-components=1 -C /usr/share/doc/python-$PKGVER \
		-xf python-$PKGVER-docs-html.tar.bz2                      &&
	find /usr/share/doc/python-$PKGVER -type d -exec chmod 0755 {} \; &&
	find /usr/share/doc/python-$PKGVER -type f -exec chmod 0644 {} \; &&

	ln -svfn python-3.11.2 /usr/share/doc/python-3 &&
	# export PYTHONDOCS=/usr/share/doc/python-3/html # later in /etc/profile

	pkg_build_slackdesc
}
