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

# source: LFS 11.3 updated to BLFS SVN r890
TARBALL=python-$PKGVER-docs-html.tar.bz2
MD5SUM=cdce7b1189bcf52947f3b434ab04d7e2
SRC_URL=https://www.python.org/ftp/python/doc/3.11.4/$TARBALL
#BUNDLE=fatdog-base-11.3.tar
#SRC_URL=http://distro.ibiblio.org/fatdog/source/900/$BUNDLE

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
}
