### this file is sourced not run
PKGVER=32.0.0.465
PKGBUILD=1
PKGARCH=i686

# source: james
TARBALL=flash_player_npapi_linux-$PKGVER.i386.tar.gz
MD5SUM=d5630852001c5ddabdb2fa1915728e3a
#SRC_URL="http://fpdownload.adobe.com/get/flashplayer/pdc/$PKGVER/flash_player_npapi_linux.i386.tar.gz"
SRC_URL=http://distro.ibiblio.org/fatdog/source/900/flash_player_npapi_linux-${PKGVER}.i386.tar.gz
BUNDLE=

SLACKREQ=
SLACKDESC="flash-plugin32: flash-plugin32 $PKGVER (Adobe Flash Player)  
flash-plugin32:  
flash-plugin32: This is the Flash player plugin for Mozilla-based browsers, such 
flash-plugin32: as Firefox and Seamonkey. This is the latest version but it does
flash-plugin32: not support DRM.
flash-plugin32:
flash-plugin32: IMPORTANT: Adobe stopped supporting Flash Player beginning 31/12/2020.
flash-plugin32: The plugin in this package has not received security updates since then
flash-plugin32: and never will. Fatdog64 team recommends uninstalling or not installing
flash-plugin32: flash player.
flash-plugin32: More info: https://www.adobe.com/products/flashplayer/end-of-life.html
"
SLACKINSTALL='
# patch to disable killswitch https://gist.github.com/KuromeSan/56d8b724c0696b54f9f81994ae3591d1
printf "\0\0\0\0\0\0\377\177" | dd of=usr/lib/mozilla/plugins/libflashplayer.so bs=1 seek=$((0xb6edd0)) conv=notrunc
'

### default pkg_download
### default pkg_prepare
pkg_prepare() {
	pkg_check $SRC_DIR $TARBALL $MD5SUM &&
	mkdir -p tmp/flash-plugin &&
	tar -xf $SRC_DIR/$TARBALL -C tmp/flash-plugin
}

### package - only collect the libraries
pkg_package() {
	rm -rf bin sbin usr/bin usr/sbin usr/include usr/share
	mkdir -p usr/bin
	mv -v tmp/*-$USE_ARCH usr/bin
}

### build
pkg_build() {
	cd /tmp/flash-plugin &&
	mkdir -p /usr/$LIBDIR/mozilla/plugins &&
	cp libflashplayer.so /usr/$LIBDIR/mozilla/plugins &&
	cp usr/bin/flash-player-properties /usr/bin &&
	cp -a usr/share/icons usr/share/pixmaps usr/share/applications /usr/share &&
	pkg_build_slackdesc &&
	
	# multilib
	mv -v /usr/bin/flash-player-properties /tmp/flash-player-properties-$USE_ARCH
}


