From 5ea0236099b9e8febe0aeb8932c522bc0089b321 Mon Sep 17 00:00:00 2001 From: fsLeg Date: Sat, 20 Sep 2014 00:49:53 +0400 Subject: [PATCH] Reworked SlackBuild from flavor-specific to unified. Now it can build all three versions of Opera: stable (not tested due to it not being released yet), beta and developer. Also added an option to build local ffmpeg libraries for more complete audio/video support in HTML5 players. --- opera-developer/README | 1 - opera-developer/opera-developer.info | 10 --- opera-developer/opera-developer.sh | 17 ---- opera-developer/slack-desc | 11 --- opera/README | 16 ++++ .../opera.SlackBuild | 87 ++++++++++++++++--- .../opera-developer.conf => opera/opera.conf | 8 +- opera/opera.info | 10 +++ opera/opera.sh | 20 +++++ opera/slack-desc | 11 +++ 10 files changed, 137 insertions(+), 54 deletions(-) delete mode 100644 opera-developer/README delete mode 100644 opera-developer/opera-developer.info delete mode 100755 opera-developer/opera-developer.sh delete mode 100644 opera-developer/slack-desc create mode 100644 opera/README rename opera-developer/opera-developer.SlackBuild => opera/opera.SlackBuild (55%) rename opera-developer/opera-developer.conf => opera/opera.conf (61%) create mode 100644 opera/opera.info create mode 100755 opera/opera.sh create mode 100644 opera/slack-desc diff --git a/opera-developer/README b/opera-developer/README deleted file mode 100644 index e93230a..0000000 --- a/opera-developer/README +++ /dev/null @@ -1 +0,0 @@ -Opera is the fastest and free (as in free beer) alternative browser. diff --git a/opera-developer/opera-developer.info b/opera-developer/opera-developer.info deleted file mode 100644 index 9fbd3e0..0000000 --- a/opera-developer/opera-developer.info +++ /dev/null @@ -1,10 +0,0 @@ -PRGNAM="opera-developer" -VERSION="25.0.1614.5" -HOMEPAGE="http://www.opera.com/" -DOWNLOAD="UNSUPPORTED" -MD5SUM="" -DOWNLOAD_x86_64="http://get.geo.opera.com/pub/opera-developer/25.0.1614.5/linux/opera-developer_25.0.1614.5_amd64.deb" -MD5SUM_x86_64="b7d3420af60056b69e9295070195ecc9" -REQUIRES="" -MAINTAINER="Vladislav Borisov" -EMAIL="fsleg@t-rg.ws" diff --git a/opera-developer/opera-developer.sh b/opera-developer/opera-developer.sh deleted file mode 100755 index 0d6de0f..0000000 --- a/opera-developer/opera-developer.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# Allow users to override command-line options -# Based on Gentoo's chromium package (and by extension, Debian's) -if [[ -f /etc/default/opera-developer ]]; then - . /etc/default/opera-developer -fi - -# Prefer user defined OPERA_USER_FLAGS (from env) over system -# default OPERA_FLAGS (from /etc/default/opera-developer) -OPERA_FLAGS=${OPERA_USER_FLAGS:-$OPERA_FLAGS} - -export CHROME_WRAPPER=$(readlink -f "$0") -export CHROME_DESKTOP=opera-developer.desktop - -exec /usr/lib64/opera-developer/opera-developer $OPERA_FLAGS "$@" - diff --git a/opera-developer/slack-desc b/opera-developer/slack-desc deleted file mode 100644 index d8d3926..0000000 --- a/opera-developer/slack-desc +++ /dev/null @@ -1,11 +0,0 @@ -opera-developer: Opera Developer (web browser, development version) -opera-developer: -opera-developer: Opera is the fastest and free (as in free beer) -opera-developer: alternative browser. -opera-developer: -opera-developer: Website: http://www.opera.com/ -opera-developer: -opera-developer: -opera-developer: -opera-developer: -opera-developer: diff --git a/opera/README b/opera/README new file mode 100644 index 0000000..638d882 --- /dev/null +++ b/opera/README @@ -0,0 +1,16 @@ +Opera is the fastest and free (as in free beer) alternative browser. + +This is a unified SlackBuild that can make packages for all three Opera flavors: +stable (not yet released at the moment of writing), beta and developer. By +default beta version is built. If you want other flavor, specify it in a +FLAVOR variable. Possible values: "stable", "beta" and "developer". Don't +forget to adjust VERSION variable accrodingly. + +This package makes use of AlienBOB's chromium-pepperflash-plugin package. If you +have it installed, you'll have Adobe FlashPlayer. + +By default Opera can only play WebM and Ogg Vorbis files in HTML5. To make it +play other formats as well you need ffmpeg libraries of specific version. If you +already have ffmpeg installed and it works with Opera, all is good. If not, you +can specify FFMPEG=yes to build local libraries that work with Opera. It is safe +for your ffmpeg installation, if you have one. diff --git a/opera-developer/opera-developer.SlackBuild b/opera/opera.SlackBuild similarity index 55% rename from opera-developer/opera-developer.SlackBuild rename to opera/opera.SlackBuild index 7b2ff2e..2d949c2 100755 --- a/opera-developer/opera-developer.SlackBuild +++ b/opera/opera.SlackBuild @@ -1,6 +1,6 @@ #!/bin/sh -# Slackware build script for Opera Developer +# Slackware build script for Opera (Beta and Developer flavours) # Copyright 2014 Vladislav Borisov Moscow, Russia # All rights reserved. @@ -22,11 +22,29 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -PRGNAM=opera-developer -VERSION=${VERSION:-25.0.1614.5} +# If your want to make a different flavour of Opera, change this variable. +# For now there are two valid choices: "beta" and "developer". +FLAVOR=-${FLAVOR:-beta} + +if [ "${FLAVOR}" == "-stable" ]; then + FLAVOR="" +fi + +# You can build local version of ffmpeg if you want H.264 and MP3 decoding support +FFMPEG=${FFMPEG:-no} +FFMPEG_VERSION="2.3.3" + +PRGNAM_BASE=opera +PRGNAM=${PRGNAM_BASE}${FLAVOR} +VERSION=${VERSION:-25.0.1614.11} BUILD=${BUILD:-1} TAG=${TAG:-fsleg} +# Use parallel building if possible +if [ -z "$NUMJOBS" ]; then + NUMJOBS=$( lscpu | egrep '^CPU\(s\):' | tr -s ' ' | cut -d ' ' -f 2 ) +fi + # Automatically determine the architecture we're building on: if [ -z "$ARCH" ]; then case "$( uname -m )" in @@ -59,6 +77,41 @@ else LIBDIRSUFFIX="" fi +build_ffmpeg() { + FFMPEG_SRC="http://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2" + FFMPEG_DIR="/usr/lib${LIBDIRSUFFIX}/opera${FLAVOR}/ffmpeg" + mkdir ffmpeg-build + cd ffmpeg-build + wget ${FFMPEG_SRC} + tar xfjv ffmpeg-${FFMPEG_VERSION}.tar.bz2 + cd ffmpeg-${FFMPEG_VERSION} + + CFLAGS="$SLKCFLAGS" \ + CXXFLAGS="$SLKCFLAGS" \ + ./configure \ + --prefix=${FFMPEG_DIR} \ + --libdir=${FFMPEG_DIR} \ + --shlibdir=${FFMPEG_DIR} \ + --arch=${ARCH} \ + --disable-static \ + --enable-shared \ + --disable-programs \ + --disable-doc \ + --disable-debug \ + --disable-encoders \ + --disable-muxers \ + --disable-filters \ + --extra-ldflags="-Wl,-rpath,${FFMPEG_DIR},-enable-new-dtags" + make -j${NUMJOBS} + make DESTDIR=${PKG} install + + # Remove not needed files + rm -rf ${PKG}${FFMPEG_DIR}/{pkgconfig,include} + + # Add path to ffmpeg libs to launcher + sed -i "s/PATH_TO_FFMPEG/$(echo ${FFMPEG_DIR} | sed 's/\//\\\//g')/" /${PKG}/usr/bin/opera${FLAVOR} +} + # Exit on most errors set -e @@ -76,30 +129,37 @@ find -L . \ # Move libs to a more apropriate place mkdir -p usr/lib${LIBDIRSUFFIX} -mv usr/lib/x86_64-linux-gnu/opera-developer usr/lib${LIBDIRSUFFIX}/ +mv usr/lib/x86_64-linux-gnu/opera${FLAVOR} usr/lib${LIBDIRSUFFIX}/ rm -rf usr/lib/x86_64-linux-gnu # opera_sandbox requires suid -chmod 4755 usr/lib${LIBDIRSUFFIX}/opera-developer/opera_sandbox +chmod 4755 usr/lib${LIBDIRSUFFIX}/opera${FLAVOR}/opera_sandbox # Fix .desktop file -sed -i 's/TargetEnvironment/X-TargetEnvironment/g' usr/share/applications/opera-developer.desktop +sed -i 's/TargetEnvironment/X-TargetEnvironment/g' usr/share/applications/opera${FLAVOR}.desktop # Remove unneeded stuff rm -rf usr/share/{lintian,menu} # Add support for the alienBOB's chromium-pepperflash package mkdir -p etc/default -cat $CWD/opera-developer.conf > etc/default/opera-developer +cat $CWD/opera.conf > etc/default/opera${FLAVOR}.conf # Add apropriate launcher -rm -rf usr/bin/opera-developer -cat $CWD/opera-developer.sh > usr/bin/opera-developer -chmod 755 usr/bin/opera-developer +rm -rf usr/bin/opera${FLAVOR} +cat $CWD/opera.sh > usr/bin/opera${FLAVOR} +sed -i "s/_LIBDIRSUFFIX_/${LIBDIRSUFFIX}/" \ + usr/bin/opera${FLAVOR} \ + etc/default/opera${FLAVOR}.conf +chmod 755 usr/bin/opera${FLAVOR} # Move everything to $PKG mv usr etc $PKG/ +if [ "${FFMPEG}" == "yes" ]; then + build_ffmpeg +fi + # Strip binaries and libraries find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true @@ -109,11 +169,16 @@ mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION mv $PKG/usr/share/doc/$PRGNAM/copyright $PKG/usr/doc/$PRGNAM-$VERSION/ zcat $PKG/usr/share/doc/$PRGNAM/changelog.gz > $PKG/usr/doc/$PRGNAM-$VERSION/changelog rm -rf $PKG/usr/share/doc -cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild +cat $CWD/$PRGNAM_BASE.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild # Copy the slack-desc into ./install mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc +# Change Opera flavour in some files +sed -i "s/opera-beta/opera${FLAVOR}/g" $PKG/usr/bin/opera${FLAVOR} \ + $PKG/etc/default/opera${FLAVOR}.conf \ + $PKG/install/slack-desc + cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-txz} diff --git a/opera-developer/opera-developer.conf b/opera/opera.conf similarity index 61% rename from opera-developer/opera-developer.conf rename to opera/opera.conf index 2a347c0..41525db 100644 --- a/opera-developer/opera-developer.conf +++ b/opera/opera.conf @@ -1,12 +1,12 @@ -# Default settings for opera-developer. -# This file is sourced by /usr/bin/opera-developer +# Default settings for opera-beta. +# This file is sourced by /usr/bin/opera-beta -# Options to pass to opera-developer +# Options to pass to opera-beta OPERA_FLAGS="" # START chromium-pepperflash-plugin -flashso="/usr/lib64/PepperFlash/libpepflashplayer.so" +flashso="/usr/lib_LIBDIRSUFFIX_/PepperFlash/libpepflashplayer.so" if [ -f $flashso ] then diff --git a/opera/opera.info b/opera/opera.info new file mode 100644 index 0000000..d5c7faa --- /dev/null +++ b/opera/opera.info @@ -0,0 +1,10 @@ +PRGNAM="opera-beta" +VERSION="25.0.1614.11" +HOMEPAGE="http://www.opera.com/" +DOWNLOAD="UNSUPPORTED" +MD5SUM="" +DOWNLOAD_x86_64="http://get.geo.opera.com/pub/opera-beta/25.0.1614.11/linux/opera-beta_25.0.1614.11_amd64.deb" +MD5SUM_x86_64="ebb937b5b6d56ee386d980a3445950a5" +REQUIRES="" +MAINTAINER="Vladislav Borisov" +EMAIL="fsleg@t-rg.ws" diff --git a/opera/opera.sh b/opera/opera.sh new file mode 100755 index 0000000..7052268 --- /dev/null +++ b/opera/opera.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# Allow users to override command-line options +# Based on Gentoo's chromium package (and by extension, Debian's) +if [[ -f /etc/default/opera-beta ]]; then + . /etc/default/opera-beta +fi + +# Prefer user defined OPERA_USER_FLAGS (from env) over system +# default OPERA_FLAGS (from /etc/default/opera-beta) +OPERA_FLAGS=${OPERA_USER_FLAGS:-$OPERA_FLAGS} + +export CHROME_WRAPPER=$(readlink -f "$0") +export CHROME_DESKTOP=opera-beta.desktop + +# Use ffmpeg libs +export LD_LIBRARY_PATH="PATH_TO_FFMPEG:${LD_LIBRARY_PATH}" + +exec /usr/lib_LIBDIRSUFFIX_/opera-beta/opera-beta $OPERA_FLAGS "$@" + diff --git a/opera/slack-desc b/opera/slack-desc new file mode 100644 index 0000000..27b57e7 --- /dev/null +++ b/opera/slack-desc @@ -0,0 +1,11 @@ +opera-beta: Opera (web browser) +opera-beta: +opera-beta: Opera is the fastest and free (as in free beer) +opera-beta: alternative browser. +opera-beta: +opera-beta: Website: http://www.opera.com/ +opera-beta: +opera-beta: +opera-beta: +opera-beta: +opera-beta: -- 2.46.3