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

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

SLACKREQ=
SLACKDESC="flash-plugin: flash-plugin $PKGVER (Adobe Flash Player)  
flash-plugin:  
flash-plugin: This is the Flash player plugin for Mozilla-based browsers, such 
flash-plugin: as Firefox and Seamonkey. This is the latest version but it does
flash-plugin: not support DRM.
flash-plugin: 
flash-plugin: IMPORTANT: Adobe stopped supporting Flash Player beginning 31/12/2020.
flash-plugin: The plugin in this package has not received security updates since then
flash-plugin: and never will. Fatdog64 team recommends uninstalling or not installing
flash-plugin: flash player.
flash-plugin: 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/lib64/mozilla/plugins/libflashplayer.so bs=1 seek=$((0xc3fce8)) 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
}

### default pkg_package
### 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{,-64} &&
	ln -sfv multiarch_wrapper /usr/bin/flash-player-properties
}


