From: fsLeg Date: Fri, 19 Sep 2014 20:49:53 +0000 (+0400) Subject: Reworked SlackBuild from flavor-specific to unified. Now it can build all three versi... X-Git-Url: https://git.t-rg.ws/?a=commitdiff_plain;h=5ea0236099b9e8febe0aeb8932c522bc0089b321;p=slackbuilds.git 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. --- 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.SlackBuild b/opera-developer/opera-developer.SlackBuild deleted file mode 100755 index 7b2ff2e..0000000 --- a/opera-developer/opera-developer.SlackBuild +++ /dev/null @@ -1,119 +0,0 @@ -#!/bin/sh - -# Slackware build script for Opera Developer - -# Copyright 2014 Vladislav Borisov Moscow, Russia -# All rights reserved. -# -# Redistribution and use of this script, with or without modification, is -# permitted provided that the following conditions are met: -# -# 1. Redistributions of this script must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED -# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -# 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} -BUILD=${BUILD:-1} -TAG=${TAG:-fsleg} - -# Automatically determine the architecture we're building on: -if [ -z "$ARCH" ]; then - case "$( uname -m )" in - i?86) ARCH=i486 ;; - arm*) ARCH=arm ;; - # Unless $ARCH is already set, use uname -m for all other archs: - *) ARCH=$( uname -m ) ;; - esac -fi - -CWD=$(pwd) -TMP=${TMP:-/tmp/SBo} -PKG=$TMP/package-$PRGNAM -OUTPUT=${OUTPUT:-/tmp} - -if [ "$ARCH" = "i486" ]; then - SLKCFLAGS="-O2 -march=i486 -mtune=i686" - LIBDIRSUFFIX="" - BITS="i686" -elif [ "$ARCH" = "i686" ]; then - SLKCFLAGS="-O2 -march=i686 -mtune=i686" - LIBDIRSUFFIX="" - BITS="i686" -elif [ "$ARCH" = "x86_64" ]; then - SLKCFLAGS="-O2 -fPIC" - LIBDIRSUFFIX="64" - BITS="amd64" -else - SLKCFLAGS="-O2" - LIBDIRSUFFIX="" -fi - -# Exit on most errors -set -e - -rm -rf $PKG $TMP/$PRGNAM -mkdir -p $TMP/$PRGNAM $PKG $OUTPUT - -cd $TMP/$PRGNAM -ar p $CWD/${PRGNAM}_${VERSION}_${BITS}.deb data.tar.xz | tar xvJ -chown -R root:root . -find -L . \ - \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ - -o -perm 511 \) -exec chmod 755 {} \; -o \ - \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ - -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; - -# Move libs to a more apropriate place -mkdir -p usr/lib${LIBDIRSUFFIX} -mv usr/lib/x86_64-linux-gnu/opera-developer usr/lib${LIBDIRSUFFIX}/ -rm -rf usr/lib/x86_64-linux-gnu - -# opera_sandbox requires suid -chmod 4755 usr/lib${LIBDIRSUFFIX}/opera-developer/opera_sandbox - -# Fix .desktop file -sed -i 's/TargetEnvironment/X-TargetEnvironment/g' usr/share/applications/opera-developer.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 - -# Add apropriate launcher -rm -rf usr/bin/opera-developer -cat $CWD/opera-developer.sh > usr/bin/opera-developer -chmod 755 usr/bin/opera-developer - -# Move everything to $PKG -mv usr etc $PKG/ - -# 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 - -# Copy program documentation into the package -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 - -# Copy the slack-desc into ./install -mkdir -p $PKG/install -cat $CWD/slack-desc > $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-developer/opera-developer.conf deleted file mode 100644 index 2a347c0..0000000 --- a/opera-developer/opera-developer.conf +++ /dev/null @@ -1,17 +0,0 @@ -# Default settings for opera-developer. -# This file is sourced by /usr/bin/opera-developer - -# Options to pass to opera-developer -OPERA_FLAGS="" - - -# START chromium-pepperflash-plugin -flashso="/usr/lib64/PepperFlash/libpepflashplayer.so" - -if [ -f $flashso ] -then - flashversion=$(strings $flashso|grep ^LNX|sed -e "s/^LNX //"|sed -e "s/,/./g") - OPERA_FLAGS="$OPERA_FLAGS --ppapi-flash-path=$flashso --ppapi-flash-version=$flashversion" -fi -# END chromium-pepperflash-plugin - 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/opera.SlackBuild b/opera/opera.SlackBuild new file mode 100755 index 0000000..2d949c2 --- /dev/null +++ b/opera/opera.SlackBuild @@ -0,0 +1,184 @@ +#!/bin/sh + +# Slackware build script for Opera (Beta and Developer flavours) + +# Copyright 2014 Vladislav Borisov Moscow, Russia +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# 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 + i?86) ARCH=i486 ;; + arm*) ARCH=arm ;; + # Unless $ARCH is already set, use uname -m for all other archs: + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" + LIBDIRSUFFIX="" + BITS="i686" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" + BITS="i686" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" + BITS="amd64" +else + SLKCFLAGS="-O2" + 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 + +rm -rf $PKG $TMP/$PRGNAM +mkdir -p $TMP/$PRGNAM $PKG $OUTPUT + +cd $TMP/$PRGNAM +ar p $CWD/${PRGNAM}_${VERSION}_${BITS}.deb data.tar.xz | tar xvJ +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +# Move libs to a more apropriate place +mkdir -p 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${FLAVOR}/opera_sandbox + +# Fix .desktop file +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.conf > etc/default/opera${FLAVOR}.conf + +# Add apropriate launcher +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 + +# Copy program documentation into the package +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_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/opera.conf b/opera/opera.conf new file mode 100644 index 0000000..41525db --- /dev/null +++ b/opera/opera.conf @@ -0,0 +1,17 @@ +# Default settings for opera-beta. +# This file is sourced by /usr/bin/opera-beta + +# Options to pass to opera-beta +OPERA_FLAGS="" + + +# START chromium-pepperflash-plugin +flashso="/usr/lib_LIBDIRSUFFIX_/PepperFlash/libpepflashplayer.so" + +if [ -f $flashso ] +then + flashversion=$(strings $flashso|grep ^LNX|sed -e "s/^LNX //"|sed -e "s/,/./g") + OPERA_FLAGS="$OPERA_FLAGS --ppapi-flash-path=$flashso --ppapi-flash-version=$flashversion" +fi +# END chromium-pepperflash-plugin + 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: