Skip to content

Instantly share code, notes, and snippets.

@Gottox
Created March 12, 2014 15:39
Show Gist options
  • Save Gottox/9509417 to your computer and use it in GitHub Desktop.
Save Gottox/9509417 to your computer and use it in GitHub Desktop.
diff --git a/common/hooks/do-extract/00-distfiles.sh b/common/hooks/do-extract/00-distfiles.sh
index 48f9852..b49adec 100644
--- a/common/hooks/do-extract/00-distfiles.sh
+++ b/common/hooks/do-extract/00-distfiles.sh
@@ -11,7 +11,7 @@ hook() {
# Check that distfiles are there before anything else.
for f in ${distfiles}; do
- curfile=$(basename $f)
+ curfile=$(basename "${f#*>}")
if [ ! -f $srcdir/$curfile ]; then
msg_error "$pkgver: cannot find ${curfile}, use 'xbps-src fetch' first.\n"
fi
@@ -24,7 +24,7 @@ hook() {
msg_normal "$pkgver: extracting distfile(s), please wait...\n"
for f in ${distfiles}; do
- curfile=$(basename $f)
+ curfile=$(basename "${f#*>}")
for j in ${skip_extraction}; do
if [ "$curfile" = "$j" ]; then
found=1
@@ -36,31 +36,20 @@ hook() {
continue
fi
- if $(echo $f|grep -q '.tar.lzma'); then
- cursufx="txz"
- elif $(echo $f|grep -q '.tar.xz'); then
- cursufx="txz"
- elif $(echo $f|grep -q '.txz'); then
- cursufx="txz"
- elif $(echo $f|grep -q '.tar.bz2'); then
- cursufx="tbz"
- elif $(echo $f|grep -q '.tbz'); then
- cursufx="tbz"
- elif $(echo $f|grep -q '.tar.gz'); then
- cursufx="tgz"
- elif $(echo $f|grep -q '.tgz'); then
- cursufx="tgz"
- elif $(echo $f|grep -q '.gz'); then
- cursufx="gz"
- elif $(echo $f|grep -q '.bz2'); then
- cursufx="bz2"
- elif $(echo $f|grep -q '.tar'); then
- cursufx="tar"
- elif $(echo $f|grep -q '.zip'); then
- cursufx="zip"
- else
- msg_error "$pkgver: unknown distfile suffix for $curfile.\n"
- fi
+ case $curfile in
+ *.tar.lzma) cursufx="txz";;
+ *.tar.xz) cursufx="txz";;
+ *.txz) cursufx="txz";;
+ *.tar.bz2) cursufx="tbz";;
+ *.tbz) cursufx="tbz";;
+ *.tar.gz) cursufx="tgz";;
+ *.tgz) cursufx="tgz";;
+ *.gz) cursufx="gz";;
+ *.bz2) cursufx="bz2";;
+ *.tar) cursufx="tar";;
+ *.zip) cursufx="zip";;
+ *) msg_error "$pkgver: unknown distfile suffix for $curfile.\n";;
+ esac
if [ -n "$create_wrksrc" ]; then
extractdir="$wrksrc"
diff --git a/srcpkgs/chromium-pepper-flash/INSTALL b/srcpkgs/chromium-pepper-flash/INSTALL
index d1c66cf..3056254 100644
--- a/srcpkgs/chromium-pepper-flash/INSTALL
+++ b/srcpkgs/chromium-pepper-flash/INSTALL
@@ -2,10 +2,33 @@
# This script will advise the user to read the license for Chrome
# and to re-login to have environment variables set properly
#
+
+BUILD_DIR="./var/tmp/${PKGNAME}.build"
+
+
case "${ACTION}" in
-pre)
- ;;
post)
+ . /usr/lib/chromium}-pepper-flash/chromium-pepper-vars.sh
+
+ case "$ARCH" in
+ x86_64)
+ filename=google-chrome-${_channel}_${_chromeVersion}_amd64.deb
+ checksum+=" 3329afefce6e1c660c9dafe08bb8371e1ecc73ec84bb0f69d075964fb72c5714"
+ ;;
+ i686)
+ filename=google-chrome-${_channel}_${_chromeVersion}_i386.deb
+ checksum+=" 0c8aaaf90a2b889979c95f69123f2b6f6b8ed36bbcf1c7b3faa5ebd6071f01eb"
+ ;;
+ esac
+ mkdir -p "$BUILD_DIR"
+ (
+ cd "$BUILD_DIR"
+ xbps-uhelper fetch "${CHROME_BASE_URL}/${filename}>$PKGNAME.deb"
+ ar x "$PKGNAME.deb"
+ tar xf data.tar.lzma
+ );
+ mv "$BUILD_DIR/opt/google/chrome/PepperFlash/"* "usr/lib/chromium-pepper-flash"
+ rm -r $BUILD_DIR
cat << _EOF
=====================================================================
diff --git a/srcpkgs/chromium-pepper-flash/template b/srcpkgs/chromium-pepper-flash/template
index 9737150..73d2b4c 100644
--- a/srcpkgs/chromium-pepper-flash/template
+++ b/srcpkgs/chromium-pepper-flash/template
@@ -3,18 +3,11 @@ pkgname=chromium-pepper-flash
version=12.0.0.70
_chromeVersion=33.0.1750.146-1
_channel='stable'
+_baseUrl="http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable"
revision=2
distfiles="http://www.google.com/chrome/intl/en/eula_text.html"
checksum=8dd9b0034b69d523eab459ee3b00379421e4e41b780014b0345aba5697a86bc4
-
-if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
- _filename=google-chrome-${_channel}_${_chromeVersion}_amd64.deb
- checksum+=" 3329afefce6e1c660c9dafe08bb8371e1ecc73ec84bb0f69d075964fb72c5714"
-elif [ "$XBPS_TARGET_MACHINE" = "i686" ]; then
- _filename=google-chrome-${_channel}_${_chromeVersion}_i386.deb
- checksum+=" 0c8aaaf90a2b889979c95f69123f2b6f6b8ed36bbcf1c7b3faa5ebd6071f01eb"
-fi
-distfiles+=" http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/${_filename}"
+client_side_build=yes
short_desc="Pepper Flash plugin for Chromium"
maintainer="Enno Boland <[email protected]>"
homepage="http://www.google.com/chrome"
@@ -25,18 +18,18 @@ only_for_archs="i686 x86_64"
depends="chromium"
makedepends="binutils"
-do_extract() {
- ar x ${XBPS_SRCDISTDIR}/${pkgname}-${version}/${_filename}
- tar xf data.tar.lzma
-}
-
do_build() {
- sed "s|%VERSION%|${version}|" ${FILESDIR}/chromium-pepper-flash.sh.in > chromium-pepper-flash.sh
-}
+ sed -e "s|%VERSION%|${version}|" \
+ ${FILESDIR}/chromium-pepper-flash.sh.in > chromium-pepper-flash.sh
+ sed \
+ -e "s|%CHROME_VERSION%|${_chromeVersion}|" \
+ -e "s|%CHROME_CHANNEL%|${_channel}|" \
+ -e "s|%CHROME_BASE_URL%|${_baseUrl}|" \
+ ${FILESDIR}/chromium-pepper-vars.sh.in > chromium-pepper-vars.sh
do_install() {
vmkdir "usr/lib/chromium-pepper-flash"
- vcopy "opt/google/chrome/PepperFlash/*" "usr/lib/chromium-pepper-flash"
+ vcopy chromium_pepper-vars.sh "usr/lib/chromium-pepper-flash"
vmkdir "usr/share/licenses/chromium-pepper-flash"
cp ${XBPS_SRCDISTDIR}/eula_text.html license.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment