From dda36349496e0987f0ccf4f23929f7870ba11813 Mon Sep 17 00:00:00 2001 From: rhatto Date: Wed, 3 Sep 2008 03:50:43 +0000 Subject: merging with changes made since 21th May git-svn-id: svn+slack://slack.fluxo.info/var/svn/slackbuilds@1903 370017ae-e619-0410-ac65-c121f96126d4 --- .../nagios-plugins/nagios-plugins.SlackBuild | 5 +- net/analyzer/nagios/nagios.SlackBuild | 19 +- .../arno-iptables-firewall.SlackBuild | 2 +- net/im/bitlbee/bitlbee-1.2.1-x86_64.diff | 12 + net/im/bitlbee/bitlbee.SlackBuild | 50 +++- net/im/feast/feast.SlackBuild | 212 ++++++++------ net/im/feast/slack-required | 7 +- net/im/pidgin/pidgin.SlackBuild | 153 +++++++++++ net/libs/libsoup/libsoup.SlackBuild | 6 +- net/libs/libsoup/slack-required | 1 + net/mail-filter/bogofilter/bogofilter.SlackBuild | 194 +++++++------ net/mail-filter/bogofilter/slack-required | 4 + net/mail/mairix/mairix.SlackBuild | 303 +++++++++----------- net/mail/offlineimap/offlineimap.SlackBuild | 176 ++++++++++++ net/misc/tor/slack-required | 5 +- net/misc/tor/tor.SlackBuild | 306 +++++++++++++++------ net/p2p/nicotine+/nicotine+.SlackBuild | 144 ++++++++++ net/p2p/nicotine/nicotine.SlackBuild | 156 ++++++++--- net/proxy/privoxy/privoxy.SlackBuild | 250 +++++++++++++++-- net/proxy/tsocks/tsocks.SlackBuild | 225 +++++++++------ net/www/gnash/gnash-0.8.3.diff | 69 +++++ net/www/gnash/gnash.SlackBuild | 61 +++- net/www/gnash/slack-required | 6 + net/www/mplayerplug-in/mplayerplug-in.SlackBuild | 235 +++++++++------- 24 files changed, 1886 insertions(+), 715 deletions(-) create mode 100644 net/im/bitlbee/bitlbee-1.2.1-x86_64.diff create mode 100644 net/im/pidgin/pidgin.SlackBuild create mode 100644 net/libs/libsoup/slack-required create mode 100644 net/mail-filter/bogofilter/slack-required create mode 100755 net/mail/offlineimap/offlineimap.SlackBuild create mode 100755 net/p2p/nicotine+/nicotine+.SlackBuild create mode 100644 net/www/gnash/gnash-0.8.3.diff create mode 100644 net/www/gnash/slack-required (limited to 'net') diff --git a/net/analyzer/nagios-plugins/nagios-plugins.SlackBuild b/net/analyzer/nagios-plugins/nagios-plugins.SlackBuild index ccb7da5a..7ec8a42f 100755 --- a/net/analyzer/nagios-plugins/nagios-plugins.SlackBuild +++ b/net/analyzer/nagios-plugins/nagios-plugins.SlackBuild @@ -15,7 +15,8 @@ # Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, # MA 02111-1307, USA # -# SlackBuild for Nagios Plugins (http://nagiosplugins.org/) +# SlackBuild for Nagios Plugins +# http://nagiosplugins.org/ # # Author: Luis ( luis at riseup d0t net ) # @@ -32,7 +33,7 @@ CWD="$(pwd)" SRC_NAME="nagios-plugins" PKG_NAME="nagios-plugins" ARCH=${ARCH:=i486} -SRC_VERSION=${VERSION:=1.4.11} +SRC_VERSION=${VERSION:=1.4.12} PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')" BUILD=${BUILD:=1ls} SRC_DIR=${SRC_DIR:=$CWD}/$PKG_NAME diff --git a/net/analyzer/nagios/nagios.SlackBuild b/net/analyzer/nagios/nagios.SlackBuild index 6a6f00e0..46b9c5a4 100755 --- a/net/analyzer/nagios/nagios.SlackBuild +++ b/net/analyzer/nagios/nagios.SlackBuild @@ -15,7 +15,8 @@ # Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, # MA 02111-1307, USA # -# SlackBuild for Nagios (http://www.nagios.org/) +# SlackBuild for Nagios +# http://www.nagios.org/ # # Author: Luis ( luis at riseup d0t net ) # @@ -32,7 +33,7 @@ CWD="$(pwd)" SRC_NAME="nagios" PKG_NAME="nagios" ARCH=${ARCH:=i486} -SRC_VERSION=${VERSION:=2.11} +SRC_VERSION=${VERSION:=3.0.3} PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')" BUILD=${BUILD:=1ls} SRC_DIR=${SRC_DIR:=$CWD}/$PKG_NAME @@ -103,9 +104,17 @@ make install-commandmode DESTDIR="$PKG" || exit $ERROR_INSTALL make install-config DESTDIR="$PKG" || exit $ERROR_INSTALL mv "$PKG/etc/rc.d/init.d/nagios" "$PKG/etc/rc.d/rc.nagios.new" rmdir "$PKG/etc/rc.d/init.d" -for file in $(ls -1 "$PKG/$PREFIX"/etc/*); do - mv "$file" "$file".new -done +( cd "$PKG/$PREFIX"/etc + for file in $(ls -1); do + if [ -f "$file" ]; then + mv "$file" "$file".new + fi + done + cd objects + for file in $(ls -1); do + mv "$file" "$file".new + done +) # Strip binaries ( cd "$PKG" diff --git a/net/firewall/arno-iptables-firewall/arno-iptables-firewall.SlackBuild b/net/firewall/arno-iptables-firewall/arno-iptables-firewall.SlackBuild index 478680d5..a4f3f3eb 100755 --- a/net/firewall/arno-iptables-firewall/arno-iptables-firewall.SlackBuild +++ b/net/firewall/arno-iptables-firewall/arno-iptables-firewall.SlackBuild @@ -43,7 +43,7 @@ REPOS=${REPOS:=$TMP} PREFIX=${PREFIX:=/usr} PKG_WORK="$TMP/$SRC_NAME" CONF_OPTIONS=${CONF_OPTIONS:=} -NUMJOBS=${NUMJOBS:=-j3} +NUMJOBS=${NUMJOBS:=} # Set error codes (used by createpkg) ERROR_WGET=31; ERROR_MAKE=32; ERROR_INSTALL=33 diff --git a/net/im/bitlbee/bitlbee-1.2.1-x86_64.diff b/net/im/bitlbee/bitlbee-1.2.1-x86_64.diff new file mode 100644 index 00000000..ce2dcb5b --- /dev/null +++ b/net/im/bitlbee/bitlbee-1.2.1-x86_64.diff @@ -0,0 +1,12 @@ +diff -Naur bitlbee-1.2.1.orig/configure bitlbee-1.2.1/configure +--- bitlbee-1.2.1.orig/configure 2008-06-09 20:09:06.000000000 -0300 ++++ bitlbee-1.2.1/configure 2008-07-15 12:40:40.000000000 -0300 +@@ -340,7 +340,7 @@ + + echo 'SSL_CLIENT=ssl_'$ssl'.o' >> Makefile.settings + +-for i in /lib /usr/lib /usr/local/lib; do ++for i in /lib64 /usr/lib64 /usr/local/lib64 /lib /usr/lib /usr/local/lib; do + if [ -f $i/libresolv.a ]; then + echo '#define HAVE_RESOLV_A' >> config.h + echo 'EFLAGS+='$i'/libresolv.a' >> Makefile.settings diff --git a/net/im/bitlbee/bitlbee.SlackBuild b/net/im/bitlbee/bitlbee.SlackBuild index b95db515..66c52acf 100755 --- a/net/im/bitlbee/bitlbee.SlackBuild +++ b/net/im/bitlbee/bitlbee.SlackBuild @@ -10,13 +10,13 @@ # 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 bitlbee, by Silvio Rhatto # requires: gnutls -# tested: bitlbee-1.2 +# tested: bitlbee-1.2.1 # # Look for slackbuildrc @@ -31,7 +31,7 @@ CWD="$(pwd)" SRC_NAME="bitlbee" PKG_NAME="bitlbee" ARCH=${ARCH:=i486} -SRC_VERSION=${VERSION:=1.2} +SRC_VERSION=${VERSION:=1.2.1} PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')" BUILD=${BUILD:=1rha} SRC_DIR=${SRC_DIR:=$CWD}/$PKG_NAME @@ -87,9 +87,41 @@ fi # 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 $8 }'`" +PKG_SRC="$PWD/`ls -l | awk '/^d/ { print $NF }'`" cd "$PKG_SRC" +# Patch source +patches=" + $PKG_NAME.diff $PKG_NAME-$PKG_VERSION.diff + $PKG_NAME-$PKG_VERSION-$ARCH.diff $PKG_NAME-$ARCH.diff" +for patch in $patches; do + 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 + fi +done + +if echo [[PATCH URLS]] | grep -q -v "PATCH URLS"; then + for patch_url in [[PATCH URLS]]; do + patch="`basename $patch_url`" + if [ ! -s "$SRC_DIR/$patch" ]; then + wget "$patch_url" -O "$SRC_DIR/$patch" || exit $ERROR_WGET + fi + 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 + done +fi + # Configure CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ @@ -123,9 +155,9 @@ done 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 ':'. @@ -168,7 +200,7 @@ mkgroup() { if ! grep -qe "^\$GROUP:" etc/group; then echo Creating group \$GROUP... chroot . /usr/sbin/groupadd \$GROUP - fi + fi } mkuser() { diff --git a/net/im/feast/feast.SlackBuild b/net/im/feast/feast.SlackBuild index c5f8abe0..300296cd 100755 --- a/net/im/feast/feast.SlackBuild +++ b/net/im/feast/feast.SlackBuild @@ -1,118 +1,130 @@ #!/bin/bash # -# feast.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. +# feast.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. # -# feast.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. +# feast.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 script for feast -# by rhatto at riseup.net +# slackbuild for feast, by Silvio Rhatto +# requires: libiconv silc-toolkit +# tested: feast-03b # -if [ -s "slack-required" ]; then - echo Recomended and required packages for building feast are: - cat slack-required | sed -e 's/^/\t/' - if [ "$INTERACT" != "no" ]; then - echo If you dont have those installed, press Ctrl-C. Otherwise, hit ENTER. - read crap -# else -# echo Sleeping 3 seconds... -# sleep 3 - fi -fi - -CWD="`pwd`" - +# Look for slackbuildrc if [ -f ~/.slackbuildrc ]; then source ~/.slackbuildrc elif [ -f /etc/slackbuildrc ]; then source /etc/slackbuildrc fi -# default settings -PACKAGE="feast" +# Set variables +CWD="$(pwd)" +SRC_NAME="feast" +PKG_NAME="feast" ARCH=${ARCH:=i486} -VERSION=${VERSION:=03b} +SRC_VERSION=${VERSION:=03b} +PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')" BUILD=${BUILD:=1rha} -SRC_DIR=${SRC:=$CWD} +SRC_DIR=${SRC_DIR:=$CWD}/$PKG_NAME TMP=${TMP:=/tmp} +PKG=${PKG:=$TMP/package-$PKG_NAME} REPOS=${REPOS:=$TMP} - -if [ "$ARCH" == "x86_64" ]; then - export LDFLAGS="-L/lib64 -L/usr/lib64" - LIBDIR=/usr/lib64 -else - LIBDIR=/usr/lib +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 -mcpu=i686" +elif [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mcpu=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 -RTOOL="wget" -PACKAGE_EXT="tgz" -SRC="$PACKAGE"_"$VERSION.$PACKAGE_EXT" -URL="http://www.hick.org/~raffi/download/$SRC" +# Clean up any leftovers of previous builds +rm -rf "$PKG_WORK" 2> /dev/null +rm -rf "$PKG" 2> /dev/null + +# 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.tgz" +URL="http://www.hick.org/~raffi/download/$SRC" -if [ "$RTOOL" == "wget" ] && [ ! -f "$SRC_DIR/$SRC" ]; then +if [ ! -s "$SRC_DIR/$SRC" ] || ! gzip -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 - -tar xvf $SRC_DIR/$SRC || exit $ERROR_TAR -cd "$PACKAGE"_"$VERSION" - -if [ -f "$CWD/$PACKAGE-$VERSION.diff" ]; then - patch -p1 < $CWD/$PACKAGE-$VERSION.diff || exit $ERROR_PATCH -fi +# 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" +# Compile if [ "$ARC" == "x86_64" ]; then sed -e 's/\/usr\/lib/\/usr\/lib64/' Makefile > Makefile.tmp mv Makefile.tmp Makefile fi +make $NUMJOBS || exit $ERROR_MAKE -make || exit $ERROR_MAKE - -CWD="`pwd`" - -mkdir -p $TMP/package-$PACKAGE -cd $TMP/package-$PACKAGE - +# Install +strip feast mkdir -p usr/bin cp $CWD/feast usr/bin mkdir -p etc/feast cp $CWD/feast.conf etc/feast.conf.new -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="license.txt readme.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 -mkdir install -cat << EOF > install/slack-desc +# 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 ':'. - |-----handy-ruler-----------------------------------------------------| + |-----handy-ruler--------------------------------------------------------| feast: feast (silc to irc translator) feast: feast: SILC stands for Secure Internet Live Conferencing. @@ -124,23 +136,55 @@ feast: feast: feast: feast: -EOF - -# docs -mkdir -p usr/doc/$PACKAGE-$VERSION - -DOCS="license.txt readme.txt" - -for file in $DOCS; do - cp $CWD/$file* usr/doc/$PACKAGE-$VERSION/ -done +EODESC + +# Add a post-installation script (doinst.sh) +cat << EOSCRIPT > "$PKG/install/doinst.sh" +config() { + NEW="\$1" + OLD="\$(dirname \$NEW)/\$(basename \$NEW .new)" + OLD="\$(dirname \$NEW)/\$(basename \$OLD .sample)" + OLD="\$(dirname \$NEW)/\$(basename \$OLD .dist)" + + # If there's no config file by that name, mv it over: + if [ ! -r \$OLD ]; then + mv \$NEW \$OLD + elif [ "\$(cat \$OLD | md5sum)" = "\$(cat \$NEW | md5sum)" ]; then + # toss the redundant copy + rm \$NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +mkgroup() { + GROUP="\$1" + if ! grep -qe "^\$GROUP:" etc/group; then + echo Creating group \$GROUP... + chroot . /usr/sbin/groupadd \$GROUP + fi +} + +mkuser() { + USER="\$1" + if [ ! -z "\$2" ]; then + GROUP="\$2" + else + GROUP="\$USER" + fi + if ! grep -qe "^\$USER:" etc/passwd; then + echo Creating user \$USER... + chroot . /usr/sbin/useradd \$USER -g \$GROUP + fi +} -# install script -echo '( if [ ! -f "etc/feast.conf" ]; then mv etc/feast.conf.new etc/feast.conf; fi )' > install/doinst.sh +config etc/feast.conf.new +EOSCRIPT -makepkg -c y -l y $REPOS/$PACKAGE-$VERSION-$ARCH-$BUILD.tgz || exit $ERROR_MKPKG +# Build the package +cd "$PKG" +makepkg -l y -c n "$REPOS/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG +# Delete source and build directories if requested if [ "$CLEANUP" == "yes" ]; then - rm -rf $TMP + rm -rf "$PKG_WORK" "$PKG" fi - diff --git a/net/im/feast/slack-required b/net/im/feast/slack-required index a22b636a..948dca18 100644 --- a/net/im/feast/slack-required +++ b/net/im/feast/slack-required @@ -1,2 +1,5 @@ -libiconv -silc-toolkit +# Dependency list to feast +# +# dependency [condition] [version]] +libiconv +silc-toolkit diff --git a/net/im/pidgin/pidgin.SlackBuild b/net/im/pidgin/pidgin.SlackBuild new file mode 100644 index 00000000..d030db2a --- /dev/null +++ b/net/im/pidgin/pidgin.SlackBuild @@ -0,0 +1,153 @@ +#!/bin/bash +# +# pidgin.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. +# +# pidgin.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 +# +# slackbuild for pidgin, by Rudson R. Alves +# requires: +# tested: pidgin-2.4.3 +# + +# Look for slackbuildrc +if [ -f ~/.slackbuildrc ]; then + source ~/.slackbuildrc +elif [ -f /etc/slackbuildrc ]; then + source /etc/slackbuildrc +fi + +# Set variables +CWD="$(pwd)" +SRC_NAME="pidgin" +PKG_NAME="pidgin" +ARCH=${ARCH:=i486} +SRC_VERSION=${VERSION:=2.4.3} +PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')" +BUILD=${BUILD:=1rra} +SRC_DIR=${SRC_DIR:=$CWD}/$PKG_NAME +TMP=${TMP:=/tmp} +PKG=${PKG:=$TMP/package-$PKG_NAME} +REPOS=${REPOS:=$TMP} +PREFIX=${PREFIX:=/usr} +PKG_WORK="$TMP/$SRC_NAME" +CONF_OPTIONS=${CONF_OPTIONS:="--disable-gtkspell --disable-gstreamer --disable-meanwhile --disable-avahi"} +NUMJOBS=${NUMJOBS:="-j4"} + +# Set system libraries' path and optmization flags based on $ARCH +LIBDIR="$PREFIX/lib" + +if [ "$ARCH" = "i386" ]; then + SLKCFLAGS="-O2 -march=i386 -mcpu=i686" +elif [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mcpu=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 + +# 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_VCS=41; ERROR_MKDIR=42 + +# Clean up any leftovers of previous builds +rm -rf "$PKG_WORK" 2> /dev/null +rm -rf "$PKG" 2> /dev/null + +# 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 + +# Dowload source if necessary +SRC="$SRC_NAME-$VERSION.tar.bz2" +URL="http://downloads.sourceforge.net/pidgin/$SRC" + +if [ ! -s "$SRC_DIR/$SRC" ] || ! bunzip2 -t "$SRC_DIR/$SRC" 2> /dev/null; then + wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET +fi + +# 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" + +# Configure +CFLAGS="$SLKCFLAGS" \ + CXXFLAGS="$SLKCFLAGS" \ + ./configure \ + --prefix="$PREFIX" --libdir="$LIBDIR" $CONF_OPTIONS || exit $ERROR_CONF + +# Compile +make $NUMJOBS || exit $ERROR_MAKE + +# Install +make install DESTDIR="$PKG" || exit $ERROR_INSTALL + +# 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="AUTHORS COPYING COPYRIGHT ChangeLog ChangeLog.API ChangeLog.win32 HACKING INSTALL PLUGIN_HOWTO README README.MTN README.mingw NEWS" +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 +# 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-------------------------------------------------------| +pidgin: pidgin by Slack.Sarava +pidgin: +pidgin: Pidgin is a multi-protocol Instant Messaging client that +pidgin: allows you to use all of your IM accounts at once. +pidgin: +pidgin: Pidgin is free software. It is licensed under the GNU +pidgin: General Public License (GPL) version 2. +pidgin: +pidgin: +pidgin: +pidgin: +EODESC + +# Build the package +cd "$PKG" +makepkg -l y -c n "$REPOS/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG + +# Delete source and build directories if requested +if [ "$CLEANUP" == "yes" ]; then + rm -rf "$PKG_WORK" "$PKG" +fi diff --git a/net/libs/libsoup/libsoup.SlackBuild b/net/libs/libsoup/libsoup.SlackBuild index 1d707216..3fd81069 100755 --- a/net/libs/libsoup/libsoup.SlackBuild +++ b/net/libs/libsoup/libsoup.SlackBuild @@ -39,7 +39,7 @@ fi # default settings PACKAGE="libsoup" ARCH=${ARCH:=i486} -VERSION=${VERSION:=2.2.98} +VERSION=${VERSION:=2.4.1} BUILD=${BUILD:=1rha} SRC_DIR=${SRC:=$CWD} TMP=${TMP:=/tmp} @@ -60,8 +60,8 @@ ERROR_PATCH=40 RTOOL="wget" PACKAGE_EXT="gz" -SRC="$PACKAGE"_"$VERSION.orig.tar.$PACKAGE_EXT" -URL="http://ftp.debian.org/debian/pool/main/libs/libsoup/$SRC" +SRC=$PACKAGE-$VERSION.tar.$PACKAGE_EXT +URL="http://ftp.acc.umu.se/pub/gnome/sources/libsoup/2.4/$SRC" SRC_DIR="$SRC_DIR/$PACKAGE" mkdir -p $SRC_DIR diff --git a/net/libs/libsoup/slack-required b/net/libs/libsoup/slack-required new file mode 100644 index 00000000..db5ab1b3 --- /dev/null +++ b/net/libs/libsoup/slack-required @@ -0,0 +1 @@ +glib2 >= 2.15.3 diff --git a/net/mail-filter/bogofilter/bogofilter.SlackBuild b/net/mail-filter/bogofilter/bogofilter.SlackBuild index cfc7f69b..3d893452 100755 --- a/net/mail-filter/bogofilter/bogofilter.SlackBuild +++ b/net/mail-filter/bogofilter/bogofilter.SlackBuild @@ -1,108 +1,135 @@ #!/bin/bash # -# bogofilter.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. +# bogofilter.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. # -# bogofilter.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. +# bogofilter.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 script for bogofilter -# by rhatto at riseup.net +# slackbuild for bogofilter, by Rudson R. Alves +# requires: sqlite +# tested: bogofilter-1.1.7 # -if [ -s "slack-required" ]; then - echo Recomended and required packages for building bogofilter are: - cat slack-required | sed -e 's/^/\t/' - if [ "$INTERACT" != "no" ]; then - echo If you dont have those installed, press Ctrl-C. Otherwise, hit ENTER. - read crap -# else -# echo Sleeping 3 seconds... -# sleep 3 - fi -fi - -CWD="`pwd`" - +# Look for slackbuildrc if [ -f ~/.slackbuildrc ]; then source ~/.slackbuildrc elif [ -f /etc/slackbuildrc ]; then source /etc/slackbuildrc fi -# default settings -PACKAGE="bogofilter" +# Set variables +CWD="$(pwd)" +SRC_NAME="bogofilter" +PKG_NAME="bogofilter" ARCH=${ARCH:=i486} -VERSION=${VERSION:=1.1.1} -BUILD=${BUILD:=1rha} -SRC_DIR=${SRC:=$CWD} +SRC_VERSION=${VERSION:=1.1.7} +PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')" +BUILD=${BUILD:=1srv} +SRC_DIR=${SRC_DIR:=$CWD}/$PKG_NAME TMP=${TMP:=/tmp} +PKG=${PKG:=$TMP/package-$PKG_NAME} REPOS=${REPOS:=$TMP} - -if [ "$ARCH" == "x86_64" ]; then - export LDFLAGS="-L/lib64 -L/usr/lib64" - LIBDIR=/usr/lib64 -else - LIBDIR=/usr/lib +PREFIX=${PREFIX:=/usr} +PKG_WORK="$TMP/$SRC_NAME" +CONF_OPTIONS=${CONF_OPTIONS:="--sysconfdir=/etc"} +NUMJOBS=${NUMJOBS:="-j4"} + +# Set system libraries' path and optmization flags based on $ARCH +LIBDIR="$PREFIX/lib" + +if [ "$ARCH" = "i386" ]; then + SLKCFLAGS="-O2 -march=i386 -mcpu=i686" +elif [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mcpu=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 -RTOOL="wget" -PACKAGE_EXT="gz" -SRC="$PACKAGE-$VERSION.tar.$PACKAGE_EXT" -URL="http://easynews.dl.sourceforge.net/sourceforge/bogofilter/$SRC" +# 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_VCS=41; ERROR_MKDIR=42 -SRC_DIR="$SRC_DIR/$PACKAGE" -mkdir -p $SRC_DIR - -if [ "$PACKAGE_EXT" == "bz2" ]; then - tarflag="j" -else - tarflag="z" -fi - -if [ "$RTOOL" == "wget" ] && [ ! -f "$SRC_DIR/$SRC" ]; then - wget "$URL" -O "$SRC_DIR/$SRC" -fi +# Clean up any leftovers of previous builds +rm -rf "$PKG_WORK" 2> /dev/null +rm -rf "$PKG" 2> /dev/null -TMP="$TMP/$PACKAGE" -rm -rf $TMP -mkdir -p $TMP -cd $TMP +# 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 -tar xvf$tarflag $SRC_DIR/$SRC -cd $PACKAGE-$VERSION +# Dowload source if necessary +SRC="$SRC_NAME-$VERSION.tar.bz2" +URL="http://downloads.sourceforge.net/bogofilter/$SRC" -if [ -f "$CWD/$PACKAGE-$VERSION.diff" ]; then - patch -p1 < $CWD/$PACKAGE-$VERSION.diff +if [ ! -s "$SRC_DIR/$SRC" ] || ! bunzip2 -t "$SRC_DIR/$SRC" 2> /dev/null; then + wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET fi -./configure --prefix=/usr --sysconfdir=/etc --libdir=$LIBDIR -make || exit 32 -make DESTDIR=$TMP/package-$PACKAGE install - -CWD="`pwd`" - -cd $TMP/package-$PACKAGE - -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 +# 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" + +# Configure +CFLAGS="$SLKCFLAGS" \ + CXXFLAGS="$SLKCFLAGS" \ + ./configure \ + --prefix="$PREFIX" --libdir="$LIBDIR" $CONF_OPTIONS || exit $ERROR_CONF + +# Compile +make $NUMJOBS || exit $ERROR_MAKE + +# Install +make install DESTDIR="$PKG" || exit $ERROR_INSTALL + +# 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="AUTHORS COPYING GETTING.STARTED INSTALL NEWS NEWS.0 README README.svn RELEASE.NOTES TODO" +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 -mkdir install -cat << EOF > install/slack-desc +# 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 ':'. - |-----handy-ruler-----------------------------------------------------| + |-----handy-ruler---------------------------------------------------| bogofilter: bogofilter (bayesian spam filter) bogofilter: bogofilter: Bogofilter is a mail filter that classifies mail as spam or ham @@ -114,18 +141,13 @@ bogofilter: bogofilter: bogofilter: bogofilter: -EOF +EODESC -# docs -mkdir -p usr/doc/$PACKAGE-$VERSION - -for file in AUTHORS COPYING Doxyfile GETTING.STARTED INSTALL NEWS* README README.cvs RELEASE.NOTES TODO; do - cp $CWD/$file* usr/doc/$PACKAGE-$VERSION/ -done - -makepkg -c y -l y $REPOS/$PACKAGE-$VERSION-$ARCH-$BUILD.tgz +# Build the package +cd "$PKG" +makepkg -l y -c n "$REPOS/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG +# Delete source and build directories if requested if [ "$CLEANUP" == "yes" ]; then - rm -rf $TMP + rm -rf "$PKG_WORK" "$PKG" fi - diff --git a/net/mail-filter/bogofilter/slack-required b/net/mail-filter/bogofilter/slack-required new file mode 100644 index 00000000..32a3aea1 --- /dev/null +++ b/net/mail-filter/bogofilter/slack-required @@ -0,0 +1,4 @@ +# Dependency list to bogofilter +# +# dependency [condition] [version]] +sqlite diff --git a/net/mail/mairix/mairix.SlackBuild b/net/mail/mairix/mairix.SlackBuild index 97e78cc3..2aa850ae 100755 --- a/net/mail/mairix/mairix.SlackBuild +++ b/net/mail/mairix/mairix.SlackBuild @@ -1,195 +1,167 @@ #!/bin/bash # -# mairix.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. +# mairix.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. # -# mairix.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. +# mairix.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 script for mairix -# by rhatto at riseup.net +# slackbuild for mairix, by Silvio Rhatto +# requires: +# tested: mairix-0.21 # -if [ -s "slack-required" ]; then - echo Recomended and required packages for building mairix are: - cat slack-required | sed -e 's/^/\t/' - if [ "$INTERACT" != "no" ]; then - echo If you dont have those installed, press Ctrl-C. Otherwise, hit ENTER. - read crap -# else -# echo Sleeping 3 seconds... -# sleep 3 - fi -fi - -CWD="`pwd`" - +# Look for slackbuildrc if [ -f ~/.slackbuildrc ]; then source ~/.slackbuildrc elif [ -f /etc/slackbuildrc ]; then source /etc/slackbuildrc fi -# default settings -PACKAGE="mairix" +# Set variables +CWD="$(pwd)" +SRC_NAME="mairix" +PKG_NAME="mairix" ARCH=${ARCH:=i486} -VERSION=${VERSION:=0.19} +SRC_VERSION=${VERSION:=0.21} +PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')" BUILD=${BUILD:=1rha} -SRC_DIR=${SRC:=$CWD} +SRC_DIR=${SRC_DIR:=$CWD}/$PKG_NAME TMP=${TMP:=/tmp} +PKG=${PKG:=$TMP/package-$PKG_NAME} REPOS=${REPOS:=$TMP} - -if [ "$ARCH" == "x86_64" ]; then - export LDFLAGS="-L/lib64 -L/usr/lib64" - LIBDIR=/usr/lib64 -else - LIBDIR=/usr/lib +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 -mcpu=i686" +elif [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mcpu=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 - -RTOOL="wget" -PACKAGE_EXT="gz" -SRC="$PACKAGE-$VERSION.tar.$PACKAGE_EXT" -URL="http://easynews.dl.sourceforge.net/sourceforge/mairix/$SRC" -SIG="$PACKAGE-$VERSION-tar-gz-asc.txt" -SIG_URL="http://www.rpcurnow.force9.co.uk/mairix/$SIG" - -gpg --import << EOF ------BEGIN PGP PUBLIC KEY BLOCK----- -Version: GnuPG v1.2.3 (GNU/Linux) - -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 -iyEQhSCBS+wk6SoOgg== -=yT3y ------END PGP PUBLIC KEY BLOCK----- -EOF - -SRC_DIR="$SRC_DIR/$PACKAGE" -mkdir -p $SRC_DIR - -if [ "$RTOOL" == "wget" ]; then - if [ ! -f "$SRC_DIR/$SRC" ]; then - wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET - fi - if [ ! -f "$SRC_DIR/$SIG" ]; then - wget "$SIG_URL" -O "$SRC_DIR/$SIG" || exit $ERROR_WGET - fi -fi +ERROR_PATCH=40; ERROR_VCS=41; ERROR_MKDIR=42 -gpg --verify $SRC_DIR/$SIG $SRC_DIR/$SRC || exit $ERROR_GPG +# Clean up any leftovers of previous builds +rm -rf "$PKG_WORK" 2> /dev/null +rm -rf "$PKG" 2> /dev/null -TMP="$TMP/$PACKAGE" -rm -rf $TMP -mkdir -p $TMP -cd $TMP +# 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 -tar xvf $SRC_DIR/$SRC || exit $ERROR_TAR -cd $PACKAGE-$VERSION +# Dowload source if necessary +SRC="$SRC_NAME-$VERSION.tar.gz" +URL="http://downloads.sourceforge.net/mairix/$SRC" -if [ -f "$CWD/$PACKAGE-$VERSION.diff" ]; then - patch -p1 < $CWD/$PACKAGE-$VERSION.diff || exit $ERROR_PATCH +if [ ! -s "$SRC_DIR/$SRC" ] || ! gunzip -t "$SRC_DIR/$SRC" 2> /dev/null; then + wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET fi -./configure --prefix=/usr || exit $ERROR_CONF -make || exit $ERROR_MAKE -make DESTDIR=$TMP/package-$PACKAGE install || exit $ERROR_INSTALL - -CWD="`pwd`" +# 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=" + $PKG_NAME.diff $PKG_NAME-$PKG_VERSION.diff + $PKG_NAME-$PKG_VERSION-$ARCH.diff $PKG_NAME-$ARCH.diff" +for patch in $patches; do + 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 + fi +done -cd $TMP/package-$PACKAGE +if echo [[PATCH URLS]] | grep -q -v "PATCH URLS"; then + for patch_url in [[PATCH URLS]]; do + patch="`basename $patch_url`" + if [ ! -s "$SRC_DIR/$patch" ]; then + wget "$patch_url" -O "$SRC_DIR/$patch" || exit $ERROR_WGET + fi + 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 + done +fi -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 +# Configure +CFLAGS="$SLKCFLAGS" \ + CXXFLAGS="$SLKCFLAGS" \ + ./configure \ + --prefix="$PREFIX" $CONF_OPTIONS || exit $ERROR_CONF + +# Compile +make $NUMJOBS || exit $ERROR_MAKE + +# Install +make install DESTDIR="$PKG" || exit $ERROR_INSTALL + +# 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="ACKNOWLEDGEMENTS COPYING NEWS README" +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 -mkdir install -cat << EOF > install/slack-desc +# 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 ':'. - |-----handy-ruler-----------------------------------------------------| + |-----handy-ruler-------------------------------------------------------| mairix: mairix (index and search engine for mail folders) mairix: mairix: Mairix is a program for indexing and searching email messages stored @@ -201,20 +173,13 @@ mairix: mairix: mairix: mairix: -EOF - -# docs -mkdir -p usr/doc/$PACKAGE-$VERSION +EODESC -DOCS="ACKNOWLEDGEMENTS COPYING INSTALL NEWS README" - -for file in $DOCS; do - cp $CWD/$file* usr/doc/$PACKAGE-$VERSION/ -done - -makepkg -c y -l y $REPOS/$PACKAGE-$VERSION-$ARCH-$BUILD.tgz || exit $ERROR_MKPKG +# Build the package +cd "$PKG" +makepkg -l y -c n "$REPOS/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG +# Delete source and build directories if requested if [ "$CLEANUP" == "yes" ]; then - rm -rf $TMP + rm -rf "$PKG_WORK" "$PKG" fi - diff --git a/net/mail/offlineimap/offlineimap.SlackBuild b/net/mail/offlineimap/offlineimap.SlackBuild new file mode 100755 index 00000000..8f6dadd1 --- /dev/null +++ b/net/mail/offlineimap/offlineimap.SlackBuild @@ -0,0 +1,176 @@ +#!/bin/bash +# +# offlineimap.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. +# +# offlineimap.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 +# +# slackbuild for offlineimap, by Silvio Rhatto +# requires: +# tested: offlineimap-6.0.2 +# + +# Look for slackbuildrc +if [ -f ~/.slackbuildrc ]; then + source ~/.slackbuildrc +elif [ -f /etc/slackbuildrc ]; then + source /etc/slackbuildrc +fi + +# Set variables +CWD="$(pwd)" +SRC_NAME="offlineimap" +PKG_NAME="offlineimap" +ARCH=${ARCH:=i486} +SRC_VERSION=${VERSION:=6.0.2} +PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')" +BUILD=${BUILD:=1rha} +SRC_DIR=${SRC_DIR:=$CWD}/$PKG_NAME +TMP=${TMP:=/tmp} +PKG=${PKG:=$TMP/package-$PKG_NAME} +REPOS=${REPOS:=$TMP} +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 -mcpu=i686" +elif [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mcpu=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 + +# 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_VCS=41; ERROR_MKDIR=42 + +# Clean up any leftovers of previous builds +rm -rf "$PKG_WORK" 2> /dev/null +rm -rf "$PKG" 2> /dev/null + +# 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 + +# Dowload source if necessary +SRC="241?attachment_id=332" +URL="http://software.complete.org/software/versions/download/$SRC" + +if [ ! -s "$SRC_DIR/$SRC" ] || ! gunzip -t "$SRC_DIR/$SRC" 2> /dev/null; then + wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET +fi + +# 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=" + $PKG_NAME.diff $PKG_NAME-$PKG_VERSION.diff + $PKG_NAME-$PKG_VERSION-$ARCH.diff $PKG_NAME-$ARCH.diff" +for patch in $patches; do + 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 + fi +done + +if echo [[PATCH URLS]] | grep -q -v "PATCH URLS"; then + for patch_url in [[PATCH URLS]]; do + patch="`basename $patch_url`" + if [ ! -s "$SRC_DIR/$patch" ]; then + wget "$patch_url" -O "$SRC_DIR/$patch" || exit $ERROR_WGET + fi + 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 + done +fi + +# Build and install package +python setup.py build install --root=$PKG + +# 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="COPYING COPYRIGHT FAQ.html README UPGRADING" +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 +# 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--------------------------------------------------| +offlineimap: offlineimap +offlineimap: +offlineimap: OfflineIMAP is a tool to simplify your e-mail reading. +offlineimap: With OfflineIMAP, you can read the same mailbox from multiple +offlineimap: computers. You get a current copy of your messages on each computer, +offlineimap: and changes you make one place will be visible on all other systems. +offlineimap: For instance, you can delete a message on your home computer, and it +offlineimap: will appear deleted on your work computer as well. OfflineIMAP is +offlineimap: also useful if you want to use a mail reader that does not have IMAP +offlineimap: support, has poor IMAP support, or does not provide disconnected +offlineimap: operation. +EODESC + +# Build the package +cd "$PKG" +makepkg -l y -c n "$REPOS/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG + +# Delete source and build directories if requested +if [ "$CLEANUP" == "yes" ]; then + rm -rf "$PKG_WORK" "$PKG" +fi diff --git a/net/misc/tor/slack-required b/net/misc/tor/slack-required index dd6fade5..a5db2a01 100644 --- a/net/misc/tor/slack-required +++ b/net/misc/tor/slack-required @@ -1 +1,4 @@ -libevent +# Dependency list to tor +# +# dependency [condition] [version]] +libevent diff --git a/net/misc/tor/tor.SlackBuild b/net/misc/tor/tor.SlackBuild index 8c04b2fc..3dae6fa8 100755 --- a/net/misc/tor/tor.SlackBuild +++ b/net/misc/tor/tor.SlackBuild @@ -1,123 +1,215 @@ #!/bin/bash # -# tor.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. +# tor.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. # -# tor.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. +# tor.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 script for tor -# by rhatto at riseup.net +# slackbuild for tor, by Silvio Rhatto +# requires: libevent +# tested: tor-0.2.0.30 # -if [ -s "slack-required" ]; then - echo Recomended and required packages for building tor are: - cat slack-required | sed -e 's/^/\t/' - if [ "$INTERACT" != "no" ]; then - echo If you dont have those installed, press Ctrl-C. Otherwise, hit ENTER. - read crap -# else -# echo Sleeping 3 seconds... -# sleep 3 - fi -fi - -CWD="`pwd`" - +# Look for slackbuildrc if [ -f ~/.slackbuildrc ]; then source ~/.slackbuildrc elif [ -f /etc/slackbuildrc ]; then source /etc/slackbuildrc fi -# default settings -PACKAGE="tor" +# Set variables +CWD="$(pwd)" +SRC_NAME="tor" +PKG_NAME="tor" ARCH=${ARCH:=i486} -VERSION=${VERSION:=0.1.1.23} +SRC_VERSION=${VERSION:=0.2.0.30} +PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')" BUILD=${BUILD:=1rha} -SRC_DIR=${SRC:=$CWD} +SRC_DIR=${SRC_DIR:=$CWD}/$PKG_NAME TMP=${TMP:=/tmp} +PKG=${PKG:=$TMP/package-$PKG_NAME} REPOS=${REPOS:=$TMP} +PREFIX=${PREFIX:=/usr} +PKG_WORK="$TMP/$SRC_NAME" +CONF_OPTIONS=${CONF_OPTIONS:="--sysconfdir=/etc"} +NUMJOBS=${NUMJOBS:=""} -# ------- error codes for createpkg -------------- +# Set system libraries' path and optmization flags based on $ARCH +LIBDIR="$PREFIX/lib" + +if [ "$ARCH" = "i386" ]; then + SLKCFLAGS="-O2 -march=i386 -mcpu=i686" +elif [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mcpu=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 + +# 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 -if [ "$ARCH" == "x86_64" ]; then - LIBDIR=/usr/lib64 -else - LIBDIR=/usr/lib -fi +# Clean up any leftovers of previous builds +rm -rf "$PKG_WORK" 2> /dev/null +rm -rf "$PKG" 2> /dev/null + +# 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 -RTOOL="wget" -PACKAGE_EXT="gz" -SRC="$PACKAGE-$VERSION.tar.$PACKAGE_EXT" -URL="http://tor.eff.org/dist/$SRC" +# Dowload source if necessary +SRC="$SRC_NAME-$VERSION.tar.gz" +URL="http://www.torproject.org/dist/$SRC" -SRC_DIR="$SRC_DIR/$PACKAGE" -mkdir -p $SRC_DIR +if [ ! -s "$SRC_DIR/$SRC" ] || ! gunzip -t "$SRC_DIR/$SRC" 2> /dev/null; then + wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET +fi -if [ "$PACKAGE_EXT" == "bz2" ]; then - tarflag="j" +# Import minimized signing key from +if echo [[SIGNING KEY URL]] | grep -q -v "SIGNING KEY URL"; then + lynx -dump [[SIGNING KEY URL]] | gpg --import || exit $ERROR_GPG +elif echo 0x28988BF5 0x165733EA | grep -q -v "SIGNING KEY ID"; then + gpg --recv-keys 0x28988BF5 0x165733EA || exit $ERROR_GPG else - tarflag="z" + gpg --import << EOKEY || exit $ERROR_GPG +[[SIGNING KEY]] +EOKEY fi -if [ "$RTOOL" == "wget" ] && [ ! -f "$SRC_DIR/$SRC" ]; then - wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET - wget "$URL.asc" -O "$SRC_DIR/$SRC.asc" || exit $ERROR_WGET +# Download source's signature if necessary and check it +if echo [[SIGNING URL]] | grep -q -v "SIGNING URL"; then + SIGNATURE="`basename [[SIGNING URL]]`" + if [ ! -s "$SRC_DIR/$SIGNATURE" ]; then + wget "[[SIGNING URL]]" -O "$SRC_DIR/$SIGNATURE" || exit $ERROR_WGET + fi +else + if [ -s "$SRC_DIR/$SRC.sig" ]; then + SIGNATURE="$SRC.sig" + elif [ -s "$SRC_DIR/$SRC.asc" ]; then + SIGNATURE="$SRC.asc" + else + echo Trying to get signature file from $URL.sig... + if wget "$URL.sig" -O "$SRC_DIR/$SRC.sig"; then + SIGNATURE="$SRC.sig" + else + rm $SRC_DIR/$SRC.sig + echo Trying to get signature file from $URL.asc... + if wget "$URL.asc" -O "$SRC_DIR/$SRC.asc"; then + SIGNATURE="$SRC.asc" + else + rm $SRC_DIR/$SRC.asc + echo "Error getting source's signature file" + exit $ERROR_GPG + fi + fi + fi fi -gpg --keyserver subkeys.pgp.net --recv-keys 0x28988BF5 -gpg --keyserver subkeys.pgp.net --recv-keys 0x165733EA -gpg --verify $SRC_DIR/$SRC.asc $SRC_DIR/$SRC || exit $ERROR_GPG -sleep 3 +echo Checking $SRC_DIR/$SRC with gpg using $SRC_DIR/$SIGNATURE... +gpg --verify "$SRC_DIR/$SIGNATURE" "$SRC_DIR/$SRC" || exit $ERROR_GPG +echo Success. -TMP="$TMP/$PACKAGE" -rm -rf $TMP -mkdir -p $TMP -cd $TMP +# 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" -tar xvf$tarflag $SRC_DIR/$SRC || exit $ERROR_TAR -cd $PACKAGE-$VERSION +# Patch source +patches=" + $PKG_NAME.diff $PKG_NAME-$PKG_VERSION.diff + $PKG_NAME-$PKG_VERSION-$ARCH.diff $PKG_NAME-$ARCH.diff" +for patch in $patches; do + 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 + fi +done -if [ -f "$CWD/$PACKAGE-$VERSION.diff" ]; then - patch -p1 < $CWD/$PACKAGE-$VERSION.diff || exit $ERROR_PATCH +if echo [[PATCH URLS]] | grep -q -v "PATCH URLS"; then + for patch_url in [[PATCH URLS]]; do + patch="`basename $patch_url`" + if [ ! -s "$SRC_DIR/$patch" ]; then + wget "$patch_url" -O "$SRC_DIR/$patch" || exit $ERROR_WGET + fi + 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 + done fi -./configure --prefix=/usr --sysconfdir=/etc --libdir=$LIBDIR || exit $ERROR_CONF -make || exit $ERROR_MAKE -make DESTDIR=$TMP/package-$PACKAGE install || exit $ERROR_INSTALL +# Configure +CFLAGS="$SLKCFLAGS" \ + CXXFLAGS="$SLKCFLAGS" \ + ./configure \ + --prefix="$PREFIX" --libdir="$LIBDIR" $CONF_OPTIONS || exit $ERROR_CONF -mkdir $TMP/package-$PACKAGE/etc/rc.d -cp $CWD/rc.tor.new $TMP/package-$PACKAGE/etc/rc.d +# Compile +make $NUMJOBS || exit $ERROR_MAKE -CWD="`pwd`" -cd $TMP/package-$PACKAGE +# Install +make install DESTDIR="$PKG" || exit $ERROR_INSTALL -mv etc/tor/tor-tsocks.conf etc/tor/tor-tsocks.conf.sample +# 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 +) -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 +# Copy init scripts +mkdir -p $PKG/etc/rc.d +cp $CWD/rc.* $PKG/etc/rc.d/ + +# Install documentation +DOCS="AUTHORS ChangeLog LICENSE README" +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 -mkdir install -cat << EOF > install/slack-desc +# 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 ':'. - |-----handy-ruler-----------------------------------------------------| + |-----handy-ruler----------------------------------------------------------| tor: tor (An anonymous Internet communication system) tor: tor: Tor is a toolset for a wide range of organizations and people that @@ -129,24 +221,60 @@ tor: can build new applications with built-in anonymity, safety, and tor: privacy features. tor: tor: -EOF - -# docs -mkdir -p usr/doc/$PACKAGE-$VERSION +EODESC -for file in AUTHORS ChangeLog INSTALL LICENSE README; do - cp $CWD/$file* usr/doc/$PACKAGE-$VERSION/ +# Move config files to .new to avoid overwriting any system config +for config_file in etc/tor/tor-tsocks.conf; do + mv $PKG/$config_file $PKG/$config_file.new done -# install script -echo '( chroot . /sbin/ldconfig )' > install/doinst.sh -echo '( if [ ! -f "etc/rc.d/rc.tor" ]; then mv etc/rc.d/rc.tor.new etc/rc.d/rc.tor ; fi )' >> install/doinst.sh -echo '( if [ ! -f "etc/tor/torrc" ]; then mv etc/tor/torrc.sample etc/tor/torrc ; fi )' >> install/doinst.sh -echo '( if [ ! -f "etc/tor/tor-tsocks.conf" ]; then mv etc/tor/tor-tsocks.conf.sample etc/tor/tor-tsocks.conf ; fi )' >> install/doinst.sh +# Add a post-installation script (doinst.sh) +cat << EOSCRIPT > "$PKG/install/doinst.sh" +config() { + NEW="\$1" + OLD="\$(dirname \$NEW)/\$(basename \$NEW .new)" + OLD="\$(dirname \$NEW)/\$(basename \$OLD .sample)" + OLD="\$(dirname \$NEW)/\$(basename \$OLD .dist)" -makepkg -c y -l y $REPOS/$PACKAGE-$VERSION-$ARCH-$BUILD.tgz || exit $ERROR_MKPKG + # If there's no config file by that name, mv it over: + if [ ! -r \$OLD ]; then + mv \$NEW \$OLD + elif [ "\$(cat \$OLD | md5sum)" = "\$(cat \$NEW | md5sum)" ]; then + # toss the redundant copy + rm \$NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} +mkgroup() { + GROUP="\$1" + if ! grep -qe "^\$GROUP:" etc/group; then + echo Creating group \$GROUP... + chroot . /usr/sbin/groupadd \$GROUP + fi +} + +mkuser() { + USER="\$1" + if [ ! -z "\$2" ]; then + GROUP="\$2" + else + GROUP="\$USER" + fi + if ! grep -qe "^\$USER:" etc/passwd; then + echo Creating user \$USER... + chroot . /usr/sbin/useradd \$USER -g \$GROUP + fi +} + +config etc/rc.d/rc.tor.new ; config etc/tor/torrc.sample ; config etc/tor/tor-tsocks.conf.new +EOSCRIPT + +# Build the package +cd "$PKG" +makepkg -l y -c n "$REPOS/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG + +# Delete source and build directories if requested if [ "$CLEANUP" == "yes" ]; then - rm -rf $TMP + rm -rf "$PKG_WORK" "$PKG" fi - diff --git a/net/p2p/nicotine+/nicotine+.SlackBuild b/net/p2p/nicotine+/nicotine+.SlackBuild new file mode 100755 index 00000000..3fa17a48 --- /dev/null +++ b/net/p2p/nicotine+/nicotine+.SlackBuild @@ -0,0 +1,144 @@ +#!/bin/bash +# +# nicotine+.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. +# +# nicotine+.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 +# +# slackbuild for nicotine+, by Silvio Rhatto +# requires: +# tested: nicotine+-1.2.9 +# + +# Look for slackbuildrc +if [ -f ~/.slackbuildrc ]; then + source ~/.slackbuildrc +elif [ -f /etc/slackbuildrc ]; then + source /etc/slackbuildrc +fi + +# Set variables +CWD="$(pwd)" +SRC_NAME="nicotine+" +PKG_NAME="nicotine+" +ARCH=${ARCH:=i486} +SRC_VERSION=${VERSION:=1.2.9} +PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')" +BUILD=${BUILD:=1rha} +SRC_DIR=${SRC_DIR:=$CWD}/$PKG_NAME +TMP=${TMP:=/tmp} +PKG=${PKG:=$TMP/package-$PKG_NAME} +REPOS=${REPOS:=$TMP} +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 -mcpu=i686" +elif [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mcpu=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 + +# 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_VCS=41; ERROR_MKDIR=42 + +# Clean up any leftovers of previous builds +rm -rf "$PKG_WORK" 2> /dev/null +rm -rf "$PKG" 2> /dev/null + +# 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 + +# Dowload source if necessary +SRC="$SRC_NAME-$VERSION.tar.bz2" +URL="http://downloads.sourceforge.net/nicotine-plus/$SRC" + +if [ ! -s "$SRC_DIR/$SRC" ] || ! bunzip2 -t "$SRC_DIR/$SRC" 2> /dev/null; then + wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET +fi + +# 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" + +# Build and install package +python setup.py build install --root=$PKG + +# 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="COPYING MANIFEST" +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 +# 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----------------------------------------------------| +nicotine+: nicotine+ (soulseek client clone) +nicotine+: +nicotine+: Nicotine is a SoulSeek client written in Python, based on the +nicotine+: PySoulSeek project by Alexander Kanavin. It features, among other +nicotine+: things, a completely rewritten graphical user interface which uses +nicotine+: the PyGTK-2 toolkit and a less strict user request policy. +nicotine+: +nicotine+: This version is the forked one distributed at +nicotine+: http://nicotine-plus.sourceforge.net +nicotine+: +nicotine+: +EODESC + +# Build the package +cd "$PKG" +makepkg -l y -c n "$REPOS/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG + +# Delete source and build directories if requested +if [ "$CLEANUP" == "yes" ]; then + rm -rf "$PKG_WORK" "$PKG" +fi diff --git a/net/p2p/nicotine/nicotine.SlackBuild b/net/p2p/nicotine/nicotine.SlackBuild index 800e29e8..64cb000a 100755 --- a/net/p2p/nicotine/nicotine.SlackBuild +++ b/net/p2p/nicotine/nicotine.SlackBuild @@ -1,60 +1,144 @@ #!/bin/bash # -# nicotine.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. +# nicotine.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. # -# nicotine.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. +# nicotine.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 script to call nicotine.build with correct settings +# slackbuild for nicotine, by Silvio Rhatto +# requires: +# tested: nicotine-1.0.8 # -if [ -s "slack-required" ]; then - echo Recomended and required packages for building nicotine are: - cat slack-required | sed -e 's/^/\t/' - if [ "$INTERACT" != "no" ]; then - echo If you dont have those installed, press Ctrl-C. Otherwise, hit ENTER. - read crap -# else -# echo Sleeping 3 seconds... -# sleep 3 - fi -fi - -CWD="`pwd`" - +# Look for slackbuildrc if [ -f ~/.slackbuildrc ]; then source ~/.slackbuildrc elif [ -f /etc/slackbuildrc ]; then source /etc/slackbuildrc fi -# default settings -PACKAGE="nicotine" -VERSION=${VERSION:=1.0.8} +# Set variables +CWD="$(pwd)" +SRC_NAME="nicotine" +PKG_NAME="nicotine" ARCH=${ARCH:=i486} +SRC_VERSION=${VERSION:=1.0.8} +PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')" BUILD=${BUILD:=1rha} -SRC_DIR=${SRC:=$CWD} +SRC_DIR=${SRC_DIR:=$CWD}/$PKG_NAME TMP=${TMP:=/tmp} +PKG=${PKG:=$TMP/package-$PKG_NAME} REPOS=${REPOS:=$TMP} +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 -mcpu=i686" +elif [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mcpu=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 + +# 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_VCS=41; ERROR_MKDIR=42 + +# Clean up any leftovers of previous builds +rm -rf "$PKG_WORK" 2> /dev/null +rm -rf "$PKG" 2> /dev/null -rm -rf $TMP/$PACKAGE -mkdir -p $SRC_DIR/$PACKAGE $TMP/$PACKAGE $REPOS +# 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 -export PACKAGE VERSION ARCH BUILD SRC_DIR TMP REPOS +# Dowload source if necessary +SRC="$SRC_NAME-$VERSION.tar.bz2" +URL="http://nicotine.thegraveyard.org/$SRC" -if which simpletrack &> /dev/null; then - simpletrack $PACKAGE.build -else - slacktrack -b $REPOS -x $TMP,$SRC_DIR,/dev -jefkzp "$PACKAGE-$VERSION-$ARCH-$BUILD.tgz" "./$PACKAGE.build" +if [ ! -s "$SRC_DIR/$SRC" ] || ! bunzip2 -t "$SRC_DIR/$SRC" 2> /dev/null; then + wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET fi +# 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" + +# Build and install package +python setup.py build install --root=$PKG + +# 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="CHANGELOG COPYING KNOWN_BUGS MAINTAINERS MANIFEST PKG-INFO README README.import-winconfig TODO TRANSLATORS" +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 +# 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-----------------------------------------------------| +nicotine: nicotine (soulseek client clone) +nicotine: +nicotine: Nicotine is a SoulSeek client written in Python, based on the +nicotine: PySoulSeek project by Alexander Kanavin. It features, among other +nicotine: things, a completely rewritten graphical user interface which uses +nicotine: the PyGTK-2 toolkit and a less strict user request policy. +nicotine: +nicotine: +nicotine: +nicotine: +nicotine: +EODESC + +# Build the package +cd "$PKG" +makepkg -l y -c n "$REPOS/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG + +# Delete source and build directories if requested if [ "$CLEANUP" == "yes" ]; then - rm -rf $TMP/$PACKAGE + rm -rf "$PKG_WORK" "$PKG" fi diff --git a/net/proxy/privoxy/privoxy.SlackBuild b/net/proxy/privoxy/privoxy.SlackBuild index 58b169fd..2f0a34b5 100755 --- a/net/proxy/privoxy/privoxy.SlackBuild +++ b/net/proxy/privoxy/privoxy.SlackBuild @@ -1,48 +1,246 @@ #!/bin/bash # -# privoxy.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. +# privoxy.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. # -# privoxy.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. +# privoxy.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 script to call privoxy.build with correct settings +# slackbuild for privoxy, by Silvio Rhatto +# requires: +# tested: privoxy-3.0.9-beta # -CWD="`pwd`" - +# Look for slackbuildrc if [ -f ~/.slackbuildrc ]; then source ~/.slackbuildrc elif [ -f /etc/slackbuildrc ]; then source /etc/slackbuildrc fi -# default settings -PACKAGE="privoxy" -VERSION=${VERSION:=3.0.3} -ARCH="${ARCH:=i486}" -BUILD=${BUILD:=2rha} -SRC_DIR=${SRC:=$CWD} +# Set variables +CWD="$(pwd)" +SRC_NAME="privoxy" +PKG_NAME="privoxy" +ARCH=${ARCH:=i486} +SRC_VERSION=${VERSION:=3.0.9-beta} +PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')" +BUILD=${BUILD:=1rha} +SRC_DIR=${SRC_DIR:=$CWD}/$PKG_NAME TMP=${TMP:=/tmp} +PKG=${PKG:=$TMP/package-$PKG_NAME} REPOS=${REPOS:=$TMP} +PREFIX=${PREFIX:=/usr} +PKG_WORK="$TMP/$SRC_NAME" +CONF_OPTIONS=${CONF_OPTIONS:="--sysconfdir=/etc/privoxy"} +NUMJOBS=${NUMJOBS:=""} + +# Set system libraries' path and optmization flags based on $ARCH +LIBDIR="$PREFIX/lib" + +if [ "$ARCH" = "i386" ]; then + SLKCFLAGS="-O2 -march=i386 -mcpu=i686" +elif [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mcpu=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 + +# 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_VCS=41; ERROR_MKDIR=42 + +# Clean up any leftovers of previous builds +rm -rf "$PKG_WORK" 2> /dev/null +rm -rf "$PKG" 2> /dev/null + +# 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 -rm -rf $TMP/$PACKAGE -mkdir -p $SRC_DIR/$PACKAGE $TMP/$PACKAGE +# Creating build user and group +if ! grep -qe "^$PKG_NAME:" /etc/group; then + groupadd $PKG_NAME +fi +if ! grep -qe "^$PKG_NAME:" /etc/passwd; then + useradd $PKG_NAME -g $PKG_NAME +fi -export PACKAGE VERSION ARCH BUILD SRC_DIR TMP REPOS +# Dowload source if necessary +SRC="$SRC_NAME-$VERSION-src.tar.gz" +URL="http://downloads.sourceforge.net/ijbswa/$SRC" -if which simpletrack &> /dev/null; then - simpletrack $PACKAGE.build -else - slacktrack -b $REPOS -x $TMP,$SRC_DIR,/dev -jefkzp "$PACKAGE-$VERSION-$ARCH-$BUILD.tgz" "./$PACKAGE.build" +if [ ! -s "$SRC_DIR/$SRC" ] || ! gunzip -t "$SRC_DIR/$SRC" 2> /dev/null; then + wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET fi +# 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=" + $PKG_NAME.diff $PKG_NAME-$PKG_VERSION.diff + $PKG_NAME-$PKG_VERSION-$ARCH.diff $PKG_NAME-$ARCH.diff" +for patch in $patches; do + 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 + fi +done + +if echo [[PATCH URLS]] | grep -q -v "PATCH URLS"; then + for patch_url in [[PATCH URLS]]; do + patch="`basename $patch_url`" + if [ ! -s "$SRC_DIR/$patch" ]; then + wget "$patch_url" -O "$SRC_DIR/$patch" || exit $ERROR_WGET + fi + 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 + done +fi + +# Configure +autoheader || exit $ERROR_CONF +autoconf || exit $ERROR_CONF +CFLAGS="$SLKCFLAGS" \ + CXXFLAGS="$SLKCFLAGS" \ + ./configure \ + --prefix="$PREFIX" --libdir="$LIBDIR" $CONF_OPTIONS || exit $ERROR_CONF + +# Compile +make $NUMJOBS || exit $ERROR_MAKE + +# Install +make install DESTDIR="$PKG" || exit $ERROR_INSTALL + +# 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 +) + +# Copy init scripts +mkdir -p $PKG/etc/rc.d +cp $CWD/rc.* $PKG/etc/rc.d/ + +# Install documentation +DOCS="AUTHORS ChangeLog LICENSE Makefile README" +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 +# 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------------------------------------------------------| +privoxy: privoxy (A Web proxy with advanced filtering capabilities) +privoxy: +privoxy: Privoxy is a Web proxy based on Internet Junkbuster with advanced +privoxy: filtering capabilities for protecting privacy, filtering Web page +privoxy: content, managing cookies, controlling access, and removing ads, +privoxy: banners, pop-ups, and other obnoxious Internet junk. Privoxy has a +privoxy: very flexible configuration and can be customized to suit individual +privoxy: needs and tastes. Privoxy is useful for both stand-alone systems and +privoxy: multi-user networks. +privoxy: +privoxy: +EODESC + +# Move config files to .new to avoid overwriting any system config +for config_file in etc/privoxy/config etc/privoxy/trust; do + mv $PKG/$config_file $PKG/$config_file.new +done + +# Add a post-installation script (doinst.sh) +cat << EOSCRIPT > "$PKG/install/doinst.sh" +config() { + NEW="\$1" + OLD="\$(dirname \$NEW)/\$(basename \$NEW .new)" + OLD="\$(dirname \$NEW)/\$(basename \$OLD .sample)" + OLD="\$(dirname \$NEW)/\$(basename \$OLD .dist)" + + # If there's no config file by that name, mv it over: + if [ ! -r \$OLD ]; then + mv \$NEW \$OLD + elif [ "\$(cat \$OLD | md5sum)" = "\$(cat \$NEW | md5sum)" ]; then + # toss the redundant copy + rm \$NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +mkgroup() { + GROUP="\$1" + if ! grep -qe "^\$GROUP:" etc/group; then + echo Creating group \$GROUP... + chroot . /usr/sbin/groupadd \$GROUP + fi +} + +mkuser() { + USER="\$1" + if [ ! -z "\$2" ]; then + GROUP="\$2" + else + GROUP="\$USER" + fi + if ! grep -qe "^\$USER:" etc/passwd; then + echo Creating user \$USER... + chroot . /usr/sbin/useradd \$USER -g \$GROUP + fi +} + +mkgroup privoxy ; mkuser privoxy ; config etc/privoxy/config.new ; config etc/privoxy/trust.new +EOSCRIPT + +# Build the package +cd "$PKG" +makepkg -l y -c n "$REPOS/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG + +# Delete source and build directories if requested if [ "$CLEANUP" == "yes" ]; then - rm -rf $TMP/$PACKAGE + rm -rf "$PKG_WORK" "$PKG" fi diff --git a/net/proxy/tsocks/tsocks.SlackBuild b/net/proxy/tsocks/tsocks.SlackBuild index 63b7e303..971803ad 100755 --- a/net/proxy/tsocks/tsocks.SlackBuild +++ b/net/proxy/tsocks/tsocks.SlackBuild @@ -1,117 +1,167 @@ #!/bin/bash # -# tsocks.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. +# tsocks.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. # -# tsocks.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. +# tsocks.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 script for tsocks -# by rhatto at riseup.net +# slackbuild for tsocks, by Silvio Rhatto +# requires: +# tested: tsocks-1.8beta5 # -if [ -s "slack-required" ]; then - echo Recomended and required packages for building tsocks are: - cat slack-required | sed -e 's/^/\t/' - if [ "$INTERACT" != "no" ]; then - echo If you dont have those installed, press Ctrl-C. Otherwise, hit ENTER. - read crap -# else -# echo Sleeping 3 seconds... -# sleep 3 - fi -fi - -CWD="`pwd`" - +# Look for slackbuildrc if [ -f ~/.slackbuildrc ]; then source ~/.slackbuildrc elif [ -f /etc/slackbuildrc ]; then source /etc/slackbuildrc fi -# default settings -PACKAGE="tsocks" +# Set variables +CWD="$(pwd)" +SRC_NAME="tsocks" +PKG_NAME="tsocks" ARCH=${ARCH:=i486} -VERSION=${VERSION:=1.8beta5} -BUILD=${BUILD:=2rha} -SRC_DIR=${SRC:=$CWD} +SRC_VERSION=${VERSION:=1.8beta5} +PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')" +BUILD=${BUILD:=1rha} +SRC_DIR=${SRC_DIR:=$CWD}/$PKG_NAME TMP=${TMP:=/tmp} +PKG=${PKG:=$TMP/package-$PKG_NAME} REPOS=${REPOS:=$TMP} - -if [ "$ARCH" == "x86_64" ]; then - export LDFLAGS="-L/lib64 -L/usr/lib64" - LIBDIR=/usr/lib64 -else - LIBDIR=/usr/lib +PREFIX=${PREFIX:=/usr} +PKG_WORK="$TMP/$SRC_NAME" +CONF_OPTIONS=${CONF_OPTIONS:="--sysconfdir=/etc"} +NUMJOBS=${NUMJOBS:=""} + +# Set system libraries' path and optmization flags based on $ARCH +LIBDIR="$PREFIX/lib" + +if [ "$ARCH" = "i386" ]; then + SLKCFLAGS="-O2 -march=i386 -mcpu=i686" +elif [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mcpu=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 - -RTOOL="wget" -PACKAGE_EXT="gz" -SRC="$PACKAGE-$VERSION.tar.$PACKAGE_EXT" -URL="http://ftp1.sourceforge.net/tsocks/$SRC" +ERROR_PATCH=40; ERROR_VCS=41; ERROR_MKDIR=42 -SRC_DIR="$SRC_DIR/$PACKAGE" -mkdir -p $SRC_DIR +# Clean up any leftovers of previous builds +rm -rf "$PKG_WORK" 2> /dev/null +rm -rf "$PKG" 2> /dev/null -if [ "$RTOOL" == "wget" ] && [ ! -f "$SRC_DIR/$SRC" ]; then - wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET -fi - -TMP="$TMP/$PACKAGE" -rm -rf $TMP -mkdir -p $TMP -cd $TMP +# 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 -tar xvf $SRC_DIR/$SRC || exit $ERROR_TAR +# Dowload source if necessary +SRC="$SRC_NAME-$VERSION.tar.gz" +URL="http://downloads.sourceforge.net/tsocks/$SRC" -if echo $VERSION | grep -q "beta"; then - cd $PACKAGE-`echo $VERSION | sed -e 's/beta.*//'` -else - cd $PACKAGE-$VERSION +if [ ! -s "$SRC_DIR/$SRC" ] || ! gunzip -t "$SRC_DIR/$SRC" 2> /dev/null; then + wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET fi -if [ -f "$CWD/$PACKAGE-$VERSION.diff" ]; then - patch -p1 < $CWD/$PACKAGE-$VERSION.diff || exit $ERROR_PATCH -fi +# 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=" + $PKG_NAME.diff $PKG_NAME-$PKG_VERSION.diff + $PKG_NAME-$PKG_VERSION-$ARCH.diff $PKG_NAME-$ARCH.diff" +for patch in $patches; do + 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 + fi +done -if [ -f "$CWD/$PACKAGE-$VERSION-$ARCH.diff" ]; then - patch -p1 < $CWD/$PACKAGE-$VERSION-$ARCH.diff || exit $ERROR_PATCH +if echo [[PATCH URLS]] | grep -q -v "PATCH URLS"; then + for patch_url in [[PATCH URLS]]; do + patch="`basename $patch_url`" + if [ ! -s "$SRC_DIR/$patch" ]; then + wget "$patch_url" -O "$SRC_DIR/$patch" || exit $ERROR_WGET + fi + 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 + done fi -./configure --prefix=/usr --sysconfdir=/etc --libdir=$LIBDIR || exit $ERROR_CONF -make || exit $ERROR_MAKE -make DESTDIR=$TMP/package-$PACKAGE install || exit $ERROR_INSTALL - -CWD="`pwd`" - -cd $TMP/package-$PACKAGE - -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 +# Configure +CFLAGS="$SLKCFLAGS" \ + CXXFLAGS="$SLKCFLAGS" \ + ./configure \ + --prefix="$PREFIX" --libdir="$LIBDIR" $CONF_OPTIONS || exit $ERROR_CONF + +# Compile +make $NUMJOBS || exit $ERROR_MAKE + +# Install +make install DESTDIR="$PKG" || exit $ERROR_INSTALL + +# 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="COPYING ChangeLog FAQ TODO" +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 -mkdir install -cat << EOF > install/slack-desc +# 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 ':'. - |-----handy-ruler-----------------------------------------------------| + |-----handy-ruler-------------------------------------------------------| tsocks: tsocks (a transparent SOCKS proxying library) tsocks: tsocks: tsocks' role is to allow these non SOCKS aware applications (e.g @@ -123,20 +173,13 @@ tsocks: tsocks: tsocks: tsocks: -EOF +EODESC -# docs -mkdir -p usr/doc/$PACKAGE-$VERSION - -DOCS="COPYING ChangeLog FAQ INSTALL TODO" - -for file in $DOCS; do - cp $CWD/$file* usr/doc/$PACKAGE-$VERSION/ -done - -makepkg -c y -l y $REPOS/$PACKAGE-$VERSION-$ARCH-$BUILD.tgz || exit $ERROR_MKPKG +# Build the package +cd "$PKG" +makepkg -l y -c n "$REPOS/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG +# Delete source and build directories if requested if [ "$CLEANUP" == "yes" ]; then - rm -rf $TMP + rm -rf "$PKG_WORK" "$PKG" fi - diff --git a/net/www/gnash/gnash-0.8.3.diff b/net/www/gnash/gnash-0.8.3.diff new file mode 100644 index 00000000..7e9eb16d --- /dev/null +++ b/net/www/gnash/gnash-0.8.3.diff @@ -0,0 +1,69 @@ +--- configure.old 2008-07-01 00:28:27.000000000 -0300 ++++ configure 2008-07-01 00:34:13.000000000 -0300 +@@ -36489,38 +36489,38 @@ + if test x"${nspr}" = x"yes"; then + + # Check whether --with-nspr_lib was given. +-if test "${with_nspr_lib+set}" = set; then +- withval=$with_nspr_lib; with_nspr_lib=${withval} +-fi +- +- if test "${ac_cv_path_nspr_lib+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- +- if test x"${with_nspr_lib}" != x ; then +- { echo "$as_me:$LINENO: checking for libnspr library in specified directory" >&5 +-echo $ECHO_N "checking for libnspr library in specified directory... $ECHO_C" >&6; } +- if test -f ${with_nspr_lib}/lib$name.a -o -f ${with_nspr_lib}/lib$name.${shlibext}; then +- tmp="`(cd ${with_nspr_lib}; pwd)`" +- ac_cv_path_nspr_lib="-L${tmp} -l$name" +- { echo "$as_me:$LINENO: result: yes" >&5 +-echo "${ECHO_T}yes" >&6; } +- else +- { { echo "$as_me:$LINENO: error: ${with_nspr_lib} directory doesn't contain library $name." >&5 +-echo "$as_me: error: ${with_nspr_lib} directory doesn't contain library $name." >&2;} +- { (exit 1); exit 1; }; } +- { echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6; } +- fi +- fi +- +-fi +- ++#if test "${with_nspr_lib+set}" = set; then ++# withval=$with_nspr_lib; with_nspr_lib=${withval} ++#fi ++# ++# if test "${ac_cv_path_nspr_lib+set}" = set; then ++# echo $ECHO_N "(cached) $ECHO_C" >&6 ++#else ++# ++# if test x"${with_nspr_lib}" != x ; then ++# { echo "$as_me:$LINENO: checking for libnspr library in specified directory" >&5 ++#echo $ECHO_N "checking for libnspr library in specified directory... $ECHO_C" >&6; } ++# if test -f ${with_nspr_lib}/lib$name.a -o -f ${with_nspr_lib}/lib$name.${shlibext}; then ++# tmp="`(cd ${with_nspr_lib}; pwd)`" ++# ++# { echo "$as_me:$LINENO: result: yes" >&5 ++#echo "${ECHO_T}yes" >&6; } ++# else ++# { { echo "$as_me:$LINENO: error: ${with_nspr_lib} directory doesn't contain library $name." >&5 ++#echo "$as_me: error: ${with_nspr_lib} directory doesn't contain library $name." >&2;} ++# { (exit 1); exit 1; }; } ++# { echo "$as_me:$LINENO: result: no" >&5 ++#echo "${ECHO_T}no" >&6; } ++# fi ++# fi# ++# ++#fi ++ ac_cv_path_nspr_lib="-L/usr/lib/seamonkey -lplds4 -lplc4 -lnspr4 -lpthread -ldl" + + if test x$cross_compiling = xno; then + if test x"$PKG_CONFIG" != x -a x"${ac_cv_path_nspr_lib}" = x; then + $PKG_CONFIG --exists libDOWN && ac_cv_path_nspr_lib="`$PKG_CONFIG --libs-only-l libDOWN`" +- $PKG_CONFIG --exists nspr && ac_cv_path_nspr_lib="`$PKG_CONFIG --libs-only-l nspr`" ++ $PKG_CONFIG --exists seamonkey-nspr && ac_cv_path_nspr_lib="`$PKG_CONFIG --libs-only-l seamonkey-nspr`" + $PKG_CONFIG --exists lib$name && ac_cv_path_nspr_lib="`$PKG_CONFIG --libs-only-l lib$name`" + $PKG_CONFIG --exists $name && ac_cv_path_nspr_lib="`$PKG_CONFIG --libs-only-l $name`" + { echo "$as_me:$LINENO: checking for libnspr library" >&5 diff --git a/net/www/gnash/gnash.SlackBuild b/net/www/gnash/gnash.SlackBuild index 3809e9bb..dc62ae2f 100755 --- a/net/www/gnash/gnash.SlackBuild +++ b/net/www/gnash/gnash.SlackBuild @@ -10,13 +10,13 @@ # 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 gnash, by Rudson R. Alves -# requires: -# tested: gnash-0.8.2 +# requires: agg boost ffmpeg +# tested: gnash-0.8.3 # # Look for slackbuildrc @@ -31,7 +31,7 @@ CWD="$(pwd)" SRC_NAME="gnash" PKG_NAME="gnash" ARCH=${ARCH:=i486} -SRC_VERSION=${VERSION:=0.8.2} +SRC_VERSION=${VERSION:=0.8.3} PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')" BUILD=${BUILD:=1rra} SRC_DIR=${SRC_DIR:=$CWD}/$PKG_NAME @@ -40,8 +40,8 @@ PKG=${PKG:=$TMP/package-$PKG_NAME} REPOS=${REPOS:=$TMP} PREFIX=${PREFIX:=/usr} PKG_WORK="$TMP/$SRC_NAME" -CONF_OPTIONS=${CONF_OPTIONS:="--sysconfdir=/etc --with-plugindir=$LIBDIR/mozilla/plugins --x-libraries=$LIBDIR"} -NUMJOBS=${NUMJOBS:="-j4"} +CONF_OPTIONS=${CONF_OPTIONS:="--sysconfdir=/etc --with-plugindir=$LIBDIR/mozilla/plugins --x-libraries=$LIBDIR --enable-nspr --enable-media=ffmpeg --with-ffmpeg-incl=/usr/include --with-nspr-incl=/usr/include/seamonkey/nspr --with-nspr-lib=/usr/lib/seamonkey --with-boost-incl=/usr/include/boost/boost "} +NUMJOBS=${NUMJOBS:="-j3"} # Set system libraries' path and optmization flags based on $ARCH LIBDIR="$PREFIX/lib" @@ -55,8 +55,9 @@ elif [ "$ARCH" = "i686" ]; then elif [ "$ARCH" = "s390" ]; then SLKCFLAGS="-O2" elif [ "$ARCH" = "x86_64" ]; then - SLKCFLAGS="-O2" + SLKCFLAGS="-O2 -fPIC" LIBDIR="$PREFIX/lib64" + LDFLAGS="-L/lib64 -L/usr/lib64" fi # Set error codes (used by createpkg) @@ -77,7 +78,7 @@ mkdir -p "$PKG_WORK" || exit $ERROR_MKDIR # Dowload source if necessary SRC="$SRC_NAME-$VERSION.tar.bz2" -URL="ftp://mirrors.kernel.org/gnu/gnash/0.8.2/$SRC" +URL="ftp://mirrors.kernel.org/gnu/gnash/0.8.3/$SRC" if [ ! -s "$SRC_DIR/$SRC" ] || ! bunzip2 -t "$SRC_DIR/$SRC" 2> /dev/null; then wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET @@ -86,9 +87,41 @@ fi # 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 $8 }'`" +PKG_SRC="$PWD/`ls -l | awk '/^d/ { print $NF }'`" cd "$PKG_SRC" +# Patch source +patches=" + $PKG_NAME.diff $PKG_NAME-$PKG_VERSION.diff + $PKG_NAME-$PKG_VERSION-$ARCH.diff $PKG_NAME-$ARCH.diff" +for patch in $patches; do + if [ -f "$CWD/$patch" ]; then + patch -Np0 < "$CWD/$patch" || exit $ERROR_PATCH + elif [ -f "$CWD/patches/$patch" ]; then + patch -Np0 < "$CWD/patches/$patch" || exit $ERROR_PATCH + elif [ -f "$CWD/$patch.gz" ]; then + gzip -dc "$CWD/$patch.gz" | patch -Np0 || exit $ERROR_PATCH + elif [ -f "$CWD/patches/$patch.gz" ]; then + gzip -dc "$CWD/patches/$patch.gz" | patch -Np0 || exit $ERROR_PATCH + fi +done + +if echo [[PATCH URLS]] | grep -q -v "PATCH URLS"; then + for patch_url in [[PATCH URLS]]; do + patch="`basename $patch_url`" + if [ ! -s "$SRC_DIR/$patch" ]; then + wget "$patch_url" -O "$SRC_DIR/$patch" || exit $ERROR_WGET + fi + if [ "`basename $patch .gz`" != "$patch" ]; then + gzip -dc $SRC_DIR/$patch | patch -Np0 || exit $ERROR_PATCH + elif [ "`basename $patch .bz2`" != "$patch" ]; then + bzip2 -dc $SRC_DIR/$patch | patch -Np0 || exit $ERROR_PATCH + else + patch -Np0 < "$SRC_DIR/$patch" || exit $ERROR_PATCH + fi + done +fi + # Configure CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ @@ -110,7 +143,7 @@ make install DESTDIR="$PKG" || exit $ERROR_INSTALL ) # Install documentation -DOCS="ABOUT-NLS AUTHORS COPYING ChangeLog ChangeLog-0.8.0 ChangeLog-0.8.1 INSTALL NEWS README TODO" +DOCS="ABOUT-NLS AUTHORS COPYING ChangeLog ChangeLog-0.8.0 ChangeLog-0.8.1 ChangeLog-0.8.2 ChangeLog-0.8.3 INSTALL NEWS README TODO" mkdir -p "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION" || exit $ERROR_MKDIR for doc in $DOCS; do if [ -f "$doc" ]; then @@ -122,9 +155,9 @@ done 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 ':'. diff --git a/net/www/gnash/slack-required b/net/www/gnash/slack-required new file mode 100644 index 00000000..28c07572 --- /dev/null +++ b/net/www/gnash/slack-required @@ -0,0 +1,6 @@ +# Dependency list to gnash +# +# dependency [condition] [version]] +agg +boost +ffmpeg diff --git a/net/www/mplayerplug-in/mplayerplug-in.SlackBuild b/net/www/mplayerplug-in/mplayerplug-in.SlackBuild index 6afe3d0d..0dbdc797 100755 --- a/net/www/mplayerplug-in/mplayerplug-in.SlackBuild +++ b/net/www/mplayerplug-in/mplayerplug-in.SlackBuild @@ -1,144 +1,185 @@ #!/bin/bash # -# mplayerplug-in.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. +# mplayerplug-in.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. # -# mplayerplug-in.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. +# mplayerplug-in.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 script for mplayerplug-in -# by rhatto at riseup.net +# slackbuild for mplayerplug-in, by Silvio Rhatto +# requires: +# tested: mplayerplug-in-3.55 # -if [ -s "slack-required" ]; then - echo Recomended and required packages for building mplayerplug-in are: - cat slack-required | sed -e 's/^/\t/' - if [ "$INTERACT" != "no" ]; then - echo If you dont have those installed, press Ctrl-C. Otherwise, hit ENTER. - read crap -# else -# echo Sleeping 3 seconds... -# sleep 3 - fi -fi - -CWD="`pwd`" - +# Look for slackbuildrc if [ -f ~/.slackbuildrc ]; then source ~/.slackbuildrc elif [ -f /etc/slackbuildrc ]; then source /etc/slackbuildrc fi -# default settings -PACKAGE="mplayerplug-in" +# Set variables +CWD="$(pwd)" +SRC_NAME="mplayerplug-in" +PKG_NAME="mplayerplug-in" ARCH=${ARCH:=i486} -VERSION=${VERSION:=3.31} +SRC_VERSION=${VERSION:=3.55} +PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')" BUILD=${BUILD:=1rha} -SRC_DIR=${SRC:=$CWD} +SRC_DIR=${SRC_DIR:=$CWD}/$PKG_NAME TMP=${TMP:=/tmp} +PKG=${PKG:=$TMP/package-$PKG_NAME} REPOS=${REPOS:=$TMP} -GECKO_VERSION=${GECKO_VERSION:=1.7.13} - -if [ "$ARCH" == "x86_64" ]; then - export LDFLAGS="-L/lib64 -L/usr/lib64" - LIBDIR=/usr/lib64 -else - LIBDIR=/usr/lib +PREFIX=${PREFIX:=/usr} +PKG_WORK="$TMP/$SRC_NAME" +CONF_OPTIONS=${CONF_OPTIONS:="--sysconfdir=/etc --localstatedir=/var --enable-gmp"} +NUMJOBS=${NUMJOBS:=""} + +# Set system libraries' path and optmization flags based on $ARCH +LIBDIR="$PREFIX/lib" + +if [ "$ARCH" = "i386" ]; then + SLKCFLAGS="-O2 -march=i386 -mcpu=i686" +elif [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mcpu=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 -RTOOL="wget" -PACKAGE_EXT="gz" -SRC="$PACKAGE-$VERSION.tar.$PACKAGE_EXT" -URL="http://easynews.dl.sourceforge.net/sourceforge/$PACKAGE/$SRC" +# Clean up any leftovers of previous builds +rm -rf "$PKG_WORK" 2> /dev/null +rm -rf "$PKG" 2> /dev/null -GECKO="gecko-sdk-i686-pc-linux-gnu-$GECKO_VERSION.tar.gz" -GECKO_URL="http://releases.mozilla.org/pub/mozilla.org/mozilla/releases/mozilla1.7.13/gecko-sdk-i686-pc-linux-gnu-1.7.13.tar.gz" +# 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.tar.gz" +URL="http://downloads.sourceforge.net/mplayerplug-in/$SRC" -if [ "$RTOOL" == "wget" ]; then - if [ ! -f "$SRC_DIR/$SRC" ]; then - wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET - fi - if [ ! -f "$SRC_DIR/$GECKO" ]; then - wget "$GECKO_URL" -O "$SRC_DIR/$GECKO" || exit $ERROR_WGET - fi +if [ ! -s "$SRC_DIR/$SRC" ] || ! gunzip -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 - -tar xvf $SRC_DIR/$GECKO || exit $ERROR_TAR - -tar xvf $SRC_DIR/$SRC || exit $ERROR_TAR -cd $PACKAGE +# 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=" + $PKG_NAME.diff $PKG_NAME-$PKG_VERSION.diff + $PKG_NAME-$PKG_VERSION-$ARCH.diff $PKG_NAME-$ARCH.diff" +for patch in $patches; do + 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 + fi +done -if [ -f "$CWD/$PACKAGE-$VERSION.diff" ]; then - patch -p1 < $CWD/$PACKAGE-$VERSION.diff || exit $ERROR_PATCH +if echo [[PATCH URLS]] | grep -q -v "PATCH URLS"; then + for patch_url in [[PATCH URLS]]; do + patch="`basename $patch_url`" + if [ ! -s "$SRC_DIR/$patch" ]; then + wget "$patch_url" -O "$SRC_DIR/$patch" || exit $ERROR_WGET + fi + 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 + done fi -./configure --prefix=/usr --libdir=$LIBDIR --with-gecko-sdk=../gecko-sdk || exit $ERROR_CONF -make || exit $ERROR_MAKE -make DESTDIR=$TMP/package-$PACKAGE install || exit $ERROR_INSTALL - -CWD="`pwd`" - -cd $TMP/package-$PACKAGE - -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 +# Configure +CFLAGS="$SLKCFLAGS" \ + CXXFLAGS="$SLKCFLAGS" \ + ./configure \ + --prefix="$PREFIX" --libdir="$LIBDIR" $CONF_OPTIONS || exit $ERROR_CONF + +# Compile +make $NUMJOBS || exit $ERROR_MAKE + +# Install +make install DESTDIR="$PKG" || exit $ERROR_INSTALL + +# 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="ChangeLog DOCS LICENSE README" +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 -mkdir install -cat << EOF > install/slack-desc +# 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 ':'. - |-----handy-ruler-----------------------------------------------------| -mplayerplug-in: mplayerplug-in -mplayerplug-in: -mplayerplug-in: -mplayerplug-in: + |-----handy-ruler-----------------------------------------------| +mplayerplug-in: mplayerplug-in (browser plugin to play media from websites) mplayerplug-in: +mplayerplug-in: This plug-in gives Mozilla the ability to play media from a website +mplayerplug-in: the net without reading the source html and getting the url manually. +mplayerplug-in: Media is played embedded in the page or in a separate window depending +mplayerplug-in: on how the author of the webpage intended the media to be seen. mplayerplug-in: mplayerplug-in: mplayerplug-in: mplayerplug-in: mplayerplug-in: -mplayerplug-in: -EOF - -# docs -mkdir -p usr/doc/$PACKAGE-$VERSION - -DOCS="ChangeLog DOCS INSTALL LICENSE README" +EODESC -for file in $DOCS; do - cp $CWD/$file* usr/doc/$PACKAGE-$VERSION/ -done - -makepkg -c y -l y $REPOS/$PACKAGE-$VERSION-$ARCH-$BUILD.tgz || exit $ERROR_MKPKG +# Build the package +cd "$PKG" +makepkg -l y -c n "$REPOS/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG +# Delete source and build directories if requested if [ "$CLEANUP" == "yes" ]; then - rm -rf $TMP + rm -rf "$PKG_WORK" "$PKG" fi - -- cgit v1.2.3