Latest opera version compiler

Post links to your 32-bit module repos here. Repo maintainers are responsible for resolving any issues caused by their xzm's.
Post Reply
User avatar
brokenman
Site Admin
Site Admin
Posts: 5456
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v3.2rcX all desktops
Location: Brazil
Contact:

Latest opera version compiler

Post#1 by brokenman » 20 Dec 2012, 20:37

Download it here or paste the code below into a file on your local drive. Run it with: sh /path/to/porteus-opera-compiler.sh

Code: Select all

#!/bin/bash
# Script to build latest opera package for porteus v1.2+
 
. /usr/lib/librokenman
 
## Sanity check
[ `which lynx` ] || fatal=lynx
[ ! -f /etc/porteus-version ] && fatal=porteus
[ "$fatal" ] && echo "This script requires $fatal" && exit
 
## Find porteus modules folder if we can
PDIR=`grep -A1 "data found" /var/log/porteus-livedbg|tail -n1|sed 's@//@/@g'`
BASEDIR=${PDIR%/*}
MDIR=${PDIR}/modules
[ ! -w $MDIR ] && nowrite=1
 
OURL=ftp://ftp.opera.com/pub/opera/linux
if [ ! `uname -m|grep x86_64` ]; then MARCH=i386; else MARCH=x86_64; fi
 
clear
echo "Getting opera version ..."
OPERALATEST=`lynx -dump -nonumbers -listonly $OURL|tail -n1`
OPERALINK=`lynx -dump -nonumbers -listonly $OPERALATEST|grep .rpm|grep $MARCH`
 
## Display version
OFILE=${OPERALINK##*/}
OVER=`awk -F- '{print$2}' <<<$OFILE`
OREV1=`awk -F- '{print$3}' <<<$OFILE`
OREV=`awk -F. '{print$1}' <<<$OREV1`
echo
cyan "#### LATEST OPERA VERSION"
echo "#### Version: $OVER"
echo "#### Revision: $OREV"
echo
echo "Would you like to build the latest version?"
echo "type: y or n"
read buildopera
 
[ "$buildopera" == "n" ] && exit
 
## Make temp dir
OTMP=/tmp/buildopera
rm -rf $OTMP 2>/dev/null
mkdir $OTMP
yellow "Downloading $OFILE"
wget $OPERALINK -P $OTMP
 
## This dumps the slackbuild to working folder.
## Encoding is simply to keep variables intact.
SBUILD=$OTMP/opera.SlackBuild
echo "IyEvYmluL3NoCiM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sed -i "s/$OLDVER/$NEWVER/g" $SBUILD
 
## Add latest revision to slackbuild
OLDREV=`grep "REVISION=" $SBUILD`
NEWREV="REVISION=\${REVISION:-$OREV}"
sed -i "s/$OLDREV/$NEWREV/g" $SBUILD
 
## Dump slack-desc
cat > $OTMP/slack-desc << EOF
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description.  Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in.  You must
# make exactly 11 lines for the formatting to be correct.  It's also
# customary to leave one space after the ':'.
 
       |-----handy-ruler----------------------------------------------------|
opera: Opera (Fast and secure web browser and Internet suite)
opera:
opera: Opera is a small, fast, customizable, powerful, and user-friendly web
opera: browser, as well as an Internet suite, including an  email client, an
opera: IRC client, web developer tools (Opera Dragonfly), and a personal web
opera: server (Opera Unite).
opera:
opera:
opera:
opera:
opera:
EOF
 
cd $OTMP
./opera.SlackBuild
echo
yellow "Converting $OFILE to porteus module"
SPKG=`ls *.txz`
MOD=`sed 's/.txz/.xzm/g' <<<$SPKG`
txz2xzm $SPKG /tmp/$MOD
echo
cyan "Process finished."
cyan "`du -sh /tmp/$MOD`"
echo
## If modules directory is writable advise to move module
if [ -z $nowrite ]; then
    yellow "You should move /tmp/$MOD into $MDIR now"
        else
    yellow "You should move /tmp/$MOD somewhere safe"
fi
exit $?
How do i become super user?
Wear your underpants on the outside and put on a cape.

cttan
Shogun
Shogun
Posts: 332
Joined: 26 Jan 2011, 16:15
Distribution: Porteus 3.2 64bit KDE
Location: Malaysia

Re: Latest opera version compiler

Post#2 by cttan » 10 Jan 2013, 00:12

Hi brokenman,

Pls change uname -r to uname -m in line 18
==> if [ ! `uname -r|grep x86_64` ]; then MARCH=i386; else MARCH=x86_64; fi

Great script. Tested working.

User avatar
brokenman
Site Admin
Site Admin
Posts: 5456
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v3.2rcX all desktops
Location: Brazil
Contact:

Re: Latest opera version compiler

Post#3 by brokenman » 10 Jan 2013, 00:40

Thanks for the catch cttan! All fixed.
How do i become super user?
Wear your underpants on the outside and put on a cape.

Post Reply