diff options
author | rhatto <rhatto@370017ae-e619-0410-ac65-c121f96126d4> | 2009-09-22 01:12:17 +0000 |
---|---|---|
committer | rhatto <rhatto@370017ae-e619-0410-ac65-c121f96126d4> | 2009-09-22 01:12:17 +0000 |
commit | 1341084331ddfc55cb3e78b1413a53d904543408 (patch) | |
tree | 3c1fafe430c4f3f0c5606beee8f9b0179f6aeb1f /net | |
parent | 4aa1e0cdb7e124324f1dc5ffe8f4304da22dc9a4 (diff) | |
download | slackbuilds-1341084331ddfc55cb3e78b1413a53d904543408.tar.gz slackbuilds-1341084331ddfc55cb3e78b1413a53d904543408.tar.bz2 |
azureus: adding azureus (thanks to x-doctor)
git-svn-id: svn+slack://slack.fluxo.info/var/svn/slackbuilds@2246 370017ae-e619-0410-ac65-c121f96126d4
Diffstat (limited to 'net')
-rw-r--r-- | net/p2p/azureus/Manifest | 24 | ||||
-rw-r--r-- | net/p2p/azureus/azureus-3.0.5.2.diff | 12 | ||||
-rwxr-xr-x | net/p2p/azureus/azureus.SlackBuild | 276 |
3 files changed, 230 insertions, 82 deletions
diff --git a/net/p2p/azureus/Manifest b/net/p2p/azureus/Manifest new file mode 100644 index 00000000..5693c3c4 --- /dev/null +++ b/net/p2p/azureus/Manifest @@ -0,0 +1,24 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA256 + +DIST Azureus_3.0.5.2_linux.tar.bz2 11583771 MD5 b64cbcc19569f7267ac30db8326832f3 RMD160 d284cc3b0da319b15961d0b3b74f5c918d222ae3 SHA1 2074ebff8f7301327d35eddfe2149359e2a42a29 SHA256 299311d7a3f8109f7d6fc02b0f821b444583b6ba898be6424a0db50aeeb8fe9e SHA512 2e37831b571085cec1d0c0ad349120e9edf345c611d2d815dc4c1b6f6a101c20d751f74f9ba8a7e772c9a1df7c264101af5301aac8823a623f61a68b9a18f7cf +MKBUILD azureus.mkbuild 5286 MD5 f3180b39dcad370f062b5e188ac2b478 RMD160 412380dd80c5456392b7d68b0c982ee378a3ca0c SHA1 c5fe043b15e7c9413443a66c415ebd96ac0a5699 SHA256 5bb2acfcdd22ad59b5fe19d519074cfd67e6909ee9f19f09c619aa0b5d4cc2a4 SHA512 6bd23a10d430ec7a2b5983e876b53ba67756f112a2997f8ec472bd585ec9b1f70eb35f06fb93b7a898e9deb88af8e85beec4c1fe866654e7afac83940a2380d3 +PATCH azureus-3.0.5.2.diff 696 MD5 6df9df469d3626b5f55f0d18f018c475 RMD160 fbafe3547e888d76059077e3c8007d60d91d1f24 SHA1 f4402871c2b31dc3b7d8f86d568fbec2fd6b5de9 SHA256 7b4a7e0f8765ae7a606bfc59dc07a66dc79caeca62ed89c5601d9a5d796d382d SHA512 5eb300bd082999e7f1e28d8696bbf53d2c38b9dbfb82fbe98427708d24e75a08dc4697b97af0a51ec987bc3c86d8d1ded2de9cf40d91e5e08a3c769f1f7ae648 +SLACKBUILD azureus.SlackBuild 7901 MD5 96c2a87dfd9fc79d8528d601b1563ebb RMD160 95befb451c0359ae03fb80dc1d34a714b7aad3f1 SHA1 89a640de196ff6c9c845970d2b78374d628470d9 SHA256 04b63e3e39f25dbc94bf547078f6e11409ddb6bb05298797a63e5429f87b51f5 SHA512 174f08deddb0d2017b16497dc022e90e01db7696a863f15197e5c74b755d233051232b3dff17279c39025d680032478b1e98fbcc613ff6d1043dfabb0318273d +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.9 (GNU/Linux) + +iQIcBAEBCAAGBQJKuCOyAAoJEEHL93ESzgeibFsQAJVChON/jrYbd2LP8Vua3+pU +WU3JqjI3FNNOHH42Zanyrjir+dEWYkWmmFE10x+m7OZUVhUcNZvEhLOB/npR/EI1 +9aWNb3xczMyc+kYU0u9IOSY95XLkAJjYfjidS8o2p5i5c7G+rJ/8lgdIq3M1luSU +5Q5Y9kiERqTg4DwWTcuQ1ta6XHQv8rzryNE8hGoW5iuFx6BFCNDiKBjl/9ukPSSB +6sIPl6LLnTAr0y9rlBI3dbCPlGJEerGwiHRISjdaXnCR8o1piSvwXNH6AMomvgDD +7ONjCoieLSUTRt6TWXQhGuk13MsSoF3cC/pBBFpvLDB2FBqItpuOPXe8d3UBsrnL +UsHaBvFgrb5anwyEByYdWDfaeV8xjTouVt1rpu1Ju/0JaHRhIQFBtX3r2YvmYGKQ +L1oXpsGz4XC426ZCNUiP5SqJq5e8DKIf1RKDgSoki1zVfgRoKmAS+rOPbdKmFqvY +J7qGa3lK0zS8SzK19+cL8KQvy+nR1SYKH7HuNNGkpjTy88I6/IDz60yVk01X8tYK +yqhqd6hznncFL1OTNGPC0mfobKNiTX9Fr2G4KDERN1JYJOQmw1NlG0PwgLqt19GS +OB+jTeTURWFG1haX71dnCGZzGAYkAvxL4yCAUbPvGsPvPwHI5DFwebXTqBw973Go +RNvQXaHgZuiV2gPrTAK5 +=/1DQ +-----END PGP SIGNATURE----- diff --git a/net/p2p/azureus/azureus-3.0.5.2.diff b/net/p2p/azureus/azureus-3.0.5.2.diff new file mode 100644 index 00000000..1968d1f5 --- /dev/null +++ b/net/p2p/azureus/azureus-3.0.5.2.diff @@ -0,0 +1,12 @@ +diff -Naur azureus.orig/azureus azureus/azureus +--- azureus.orig/azureus 2007-09-20 20:54:27.000000000 -0300 ++++ azureus/azureus 2009-09-21 21:52:33.000000000 -0300 +@@ -3,7 +3,7 @@ + ######## CONFIGURATION OPTIONS ######## + SCRIPT_NOT_CHANGED=0 # change this to 1 if you don't want your script overwritten! + JAVA_PROGRAM_DIR="" # use full path to java bin dir, ex. "/usr/java/j2sdk1.4.2/bin/" +-#PROGRAM_DIR="/home/username/apps/azureus" # use full path to Azureus bin dir ++PROGRAM_DIR="/usr/share/azureus" # use full path to Azureus bin dir + JAVA_ARGS="-Xmx128m" + + #export MOZILLA_FIVE_HOME="/path/to/gre" # Full path to GRE/Mozilla. When commenting out this line, also comment out the next line diff --git a/net/p2p/azureus/azureus.SlackBuild b/net/p2p/azureus/azureus.SlackBuild index 565f2c66..bcf1fbb5 100755 --- a/net/p2p/azureus/azureus.SlackBuild +++ b/net/p2p/azureus/azureus.SlackBuild @@ -1,112 +1,220 @@ #!/bin/bash # -# azureus.SlackBuild is free software; you can redistribute it and/or modify it under the -# terms of the GNU General Public License as published by the Free Software -# Foundation; either version 2 of the License, or any later version. +# azureus.SlackBuild is free software; you can redistribute +# it and/or modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of the License, +# or any later version. # -# azureus.SlackBuild is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR -# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# azureus.SlackBuild is distributed in the hope that it will +# be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. # -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., 59 Temple -# Place - Suite 330, Boston, MA 02111-1307, USA +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA +# +# slackbuild for azureus, by Silvio Rhatto +# requires: +# tested: azureus-3.0.5.2 +# model: generic.mkSlackBuild $Rev: 808 $ # -# slackbuild for azureus -# by rhatto at riseup.net -# - -CWD="`pwd`" +# Look for slackbuildrc if [ -f ~/.slackbuildrc ]; then source ~/.slackbuildrc elif [ -f /etc/slackbuildrc ]; then source /etc/slackbuildrc fi -# default settings -PRGNAM="azureus" -PACKAGE="$PRGNAM" -VERSION=${VERSION:=3.0.5.2} +# Set variables +CWD="$(pwd)" +SRC_NAME="Azureus" +PKG_NAME="azureus" ARCH=${ARCH:=i486} +SRC_VERSION=${VERSION:=3.0.5.2} +PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')" BUILD=${BUILD:=1rha} +SRC_DIR=${SRC_DIR:=$CWD}/$PKG_NAME TMP=${TMP:=/tmp} -SRC_DIR=${SRC:=$CWD} -TMP=${TMP:=/tmp} +PKG=${PKG:=$TMP/package-$PKG_NAME} REPOS=${REPOS:=$TMP} -INSTALL_FOLDER="opt" # change to usr/local if you want - -if [ "$ARCH" == "x86_64" ]; then - LIBDIR=/usr/lib64 -else - LIBDIR=/usr/lib +SLACKBUILD_PATH=${SLACKBUILD_PATH:="net/p2p/azureus"} +PREFIX=${PREFIX:=/usr} +PKG_WORK="$TMP/$SRC_NAME" +CONF_OPTIONS=${CONF_OPTIONS:=""} +NUMJOBS=${NUMJOBS:=""} + +# Set system libraries' path and optmization flags based on $ARCH +LIBDIR="$PREFIX/lib" + +if [ "$ARCH" = "i386" ]; then + SLKCFLAGS="-O2 -march=i386 -mtune=i686" +elif [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686" +elif [ "$ARCH" = "s390" ]; then + SLKCFLAGS="-O2" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIR="$PREFIX/lib64" + LDFLAGS="-L/lib64 -L/usr/lib64" fi -# ------- error codes for createpkg -------------- +# Set error codes (used by createpkg) ERROR_WGET=31; ERROR_MAKE=32; ERROR_INSTALL=33 ERROR_MD5=34; ERROR_CONF=35; ERROR_HELP=36 ERROR_TAR=37; ERROR_MKPKG=38; ERROR_GPG=39 -ERROR_PATCH=40 +ERROR_PATCH=40; ERROR_VCS=41; ERROR_MKDIR=42 +ERROR_MANIFEST=43; -PACKAGE_EXT="bz2" +# Clean up any leftovers of previous builds +rm -rf "$PKG_WORK" 2> /dev/null +rm -rf "$PKG" 2> /dev/null -if [ "$ARCH" == "i486" ] || [ "$ARCH" == "i386" ]; then - SRC="Azureus_$VERSION"_"linux.tar.$PACKAGE_EXT" -else - SRC="Azureus_$VERSION"_"linux-$ARCH.tar.$PACKAGE_EXT" -fi - -URL="http://easynews.dl.sourceforge.net/sourceforge/$PACKAGE/$SRC" -RTOOL="wget" +# Create directories if necessary +mkdir -p "$SRC_DIR" || exit $ERROR_MKDIR +mkdir -p "$PKG" || exit $ERROR_MKDIR +mkdir -p "$REPOS" || exit $ERROR_MKDIR +mkdir -p "$PKG_WORK" || exit $ERROR_MKDIR -SRC_DIR="$SRC_DIR/$PACKAGE" -mkdir -p $SRC_DIR +# Dowload source if necessary +SRC="${SRC_NAME}_${VERSION}_linux.tar.bz2" +URL="http://downloads.sourceforge.net/project/azureus/x_obsolete/azureus-3.0.5.2/$SRC" -if [ "$RTOOL" == "wget" ] && [ ! -f "$SRC_DIR/$SRC" ]; then - wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET +if [ ! -s "$SRC_DIR/$SRC" ] || ! bunzip2 -t "$SRC_DIR/$SRC" 2> /dev/null; then + wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET fi -TMP="$TMP/$PACKAGE" -rm -rf $TMP -mkdir -p $TMP -cd $TMP - -rm -rf $PACKAGE-$VERSION $PACKAGE-$VERSION-$ARCH-$BUILD.tgz -rm -rf $TMP/package-$PACKAGE -mkdir -p $TMP/package-$PACKAGE/install -cd $TMP/package-$PACKAGE - -mkdir -p $INSTALL_FOLDER -cd $INSTALL_FOLDER - -tar xvf $SRC_DIR/$SRC || exit $ERORR_TAR -cd $TMP/package-$PACKAGE - -if [ "$VERSION" == "2.4.0.2" ]; then - rm $INSTALL_FOLDER/azureus/plugins/azplugins/* - wget "http://azureus.sourceforge.net/plugins/azplugins_2.0.jar" -O "$INSTALL_FOLDER/azureus/plugins/azplugins/azplugins_2.0.jar" -elif [ "$VERSION" == "2.5.0.4" ]; then - rm $INSTALL_FOLDER/azureus/plugins/azplugins/* - wget "http://azureus.sourceforge.net/plugins/azplugins_2.1.4.jar" -O "$INSTALL_FOLDER/azureus/plugins/azplugins/azplugins_2.1.4.jar" -elif [ "$VERSION" == "3.0.3.4" ]; then - rm $INSTALL_FOLDER/azureus/plugins/azupnpav/* - wget "http://azureus.sourceforge.net/plugins/azupnpav_0.1.7.zip" -O "$INSTALL_FOLDER/azureus/plugins/azupnpav/azupnpav_0.1.7.zip" - cd $INSTALL_FOLDER/azureus/plugins/azupnpav/ - unzip azupnpav_0.1.7.zip && rm azupnpav_0.1.7.zip - cd - -elif [ "$VERSION" == "3.0.5.0" ]; then - rm $INSTALL_FOLDER/azureus/plugins/azupnpav/* - wget "http://azureus.sourceforge.net/plugins/azupnpav_0.2.0.zip" -O "$INSTALL_FOLDER/azureus/plugins/azupnpav/azupnpav_0.2.0.zip" - cd $INSTALL_FOLDER/azureus/plugins/azupnpav/ - unzip azupnpav_0.2.0.zip && rm azupnpav_0.2.0.zip - cd - +# Check Manifest file +if [ -e "$CWD/Manifest" ]; then + + # Manifest signature checking + if grep -q -- "-----BEGIN PGP SIGNED MESSAGE-----" $CWD/Manifest; then + echo "Checking Manifest signature..." + gpg --verify $CWD/Manifest + if [ "$?" != "0" ]; then + exit $ERROR_MANIFEST + fi + fi + + MANIFEST_LINES="`grep -E -v "^(MKBUILD|SLACKBUILD)" $CWD/Manifest | wc -l`" + + for ((MANIFEST_COUNT=1; MANIFEST_COUNT <= $MANIFEST_LINES; MANIFEST_COUNT++)); do + + MANIFEST_LINE="`grep -E -v "^(MKBUILD|SLACKBUILD)" $CWD/Manifest | head -n $MANIFEST_COUNT | tail -n 1`" + MANIFEST_FILE="`echo $MANIFEST_LINE | awk '{ print $2 }'`" + MANIFEST_FILE_TYPE="`echo $MANIFEST_LINE | awk '{ print $1 }'`" + + if [ -e "$SRC_DIR/$MANIFEST_FILE" ]; then + MANIFEST_FILE="$SRC_DIR/$MANIFEST_FILE" + else + MANIFEST_FILE="`find $CWD -name $MANIFEST_FILE`" + fi + + if [ ! -e "$MANIFEST_FILE" ] || [ -d "$MANIFEST_FILE" ]; then + continue + fi + + echo "Checking Manifest for $MANIFEST_FILE_TYPE $MANIFEST_FILE integrity..." + + SIZE_SRC="`wc -c $MANIFEST_FILE | awk '{ print $1 }'`" + SIZE_MANIFEST="`echo $MANIFEST_LINE | awk '{ print $3 }'`" + + # Check source code size + if [ "$SIZE_SRC" != "$SIZE_MANIFEST" ]; then + echo "SIZE Manifest: $SIZE_MANIFEST; SIZE $SRC: $SIZE_SRC" + exit $ERROR_MANIFEST + else + echo "Size match." + fi + + # Check source code integrity + for ALGO in md5 rmd160 sha1 sha256 sha512; do + if [ $ALGO = "rmd160" ]; then + ALGO_SRC="`openssl rmd160 $MANIFEST_FILE | awk '{ print $2 }'`" + else + ALGO_SRC="`"$ALGO"sum $MANIFEST_FILE | awk '{ print $1 }'`" + fi + ALGO="`echo $ALGO | tr '[:lower:]' '[:upper:]'`" + ALGO_MANIFEST=$(echo $MANIFEST_LINE | sed "s/.* $ALGO //" | awk '{ print $1 }') + if [ "$ALGO_SRC" != "$ALGO_MANIFEST" ]; then + echo "$ALGO Manifest: $ALGO_MANIFEST; $ALGO $SRC: $ALGO_SRC" + exit $ERROR_MANIFEST + else + echo "$ALGO match." + fi + done + + done + +else + exit $ERROR_MANIFEST fi -cat << EOF > install/slack-desc +# Untar +cd "$PKG_WORK" +tar --no-same-owner --no-same-permissions -xvf "$SRC_DIR/$SRC" || exit $ERROR_TAR +PKG_SRC="$PWD/`ls -l | awk '/^d/ { print $NF }'`" +cd "$PKG_SRC" + +# Patch source +patches=" [[PATCH URLS]] + $PKG_NAME.diff $PKG_NAME-$PKG_VERSION.diff + $PKG_NAME-$PKG_VERSION-$ARCH.diff $PKG_NAME-$ARCH.diff" +for patch in $patches; do + patch="`basename $patch`" + if [ -f "$CWD/$patch" ]; then + patch -Np1 < "$CWD/$patch" || exit $ERROR_PATCH + elif [ -f "$CWD/patches/$patch" ]; then + patch -Np1 < "$CWD/patches/$patch" || exit $ERROR_PATCH + elif [ -f "$CWD/$patch.gz" ]; then + gzip -dc "$CWD/$patch.gz" | patch -Np1 || exit $ERROR_PATCH + elif [ -f "$CWD/patches/$patch.gz" ]; then + gzip -dc "$CWD/patches/$patch.gz" | patch -Np1 || exit $ERROR_PATCH + elif [ -f "$SRC_DIR/$patch" ]; then + if [ "`basename $patch .gz`" != "$patch" ]; then + gzip -dc $SRC_DIR/$patch | patch -Np1 || exit $ERROR_PATCH + elif [ "`basename $patch .bz2`" != "$patch" ]; then + bzip2 -dc $SRC_DIR/$patch | patch -Np1 || exit $ERROR_PATCH + else + patch -Np1 < "$SRC_DIR/$patch" || exit $ERROR_PATCH + fi + fi +done + +# Create and directory files +mkdir -p $PKG/usr/{bin,share/azureus} +cp -r plugins $PKG/usr/share/azureus +cp Azureus2.jar $PKG/usr/share/azureus +cp swt.jar $PKG/usr/share/azureus +cp azureus $PKG/usr/bin + +# Strip binaries +( cd "$PKG" + find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | \ + xargs strip --strip-unneeded 2> /dev/null + find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | \ + xargs strip --strip-unneeded 2> /dev/null +) + +# Install documentation +DOCS="GPL.txt README.txt TOS.txt" +mkdir -p "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION" || exit $ERROR_MKDIR +for doc in $DOCS; do + if [ -f "$doc" ]; then + cp -a $doc "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION" + fi +done + +# Add package description (slack-desc) +mkdir -p "$PKG/install" || exit $ERROR_MKDIR +cat << EODESC > "$PKG/install/slack-desc" # HOW TO EDIT THIS FILE: -# The "handy ruler" below makes it easier to edit a package description. Line +# 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 +# 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 ':'. @@ -122,10 +230,14 @@ azureus: azureus: azureus: azureus: -EOF +EODESC -makepkg -c y $REPOS/$PACKAGE-$VERSION-$ARCH-$BUILD.tgz || exit $ERROR_MKPKG +# Build the package +cd "$PKG" +mkdir -p $REPOS/$SLACKBUILD_PATH +makepkg -l y -c n "$REPOS/$SLACKBUILD_PATH/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG -if [ "$CLEANUP" == "yes" ]; then - rm -rf $TMP +# Delete source and build directories if requested +if [ "$CLEANUP" == "yes" ] || [ "$1" = "--cleanup" ]; then + rm -rf "$PKG_WORK" "$PKG" fi |