From 90a82697be9767440954f3f98ed8c29be2ce6459 Mon Sep 17 00:00:00 2001 From: rhatto Date: Wed, 25 Mar 2009 17:21:33 +0000 Subject: httrack: adding httrack git-svn-id: svn+slack://slack.fluxo.info/var/svn/slackbuilds@2125 370017ae-e619-0410-ac65-c121f96126d4 --- www/client/Manifest | 25 +++++ www/client/httrack.SlackBuild | 223 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 248 insertions(+) create mode 100644 www/client/Manifest create mode 100644 www/client/httrack.SlackBuild (limited to 'www') diff --git a/www/client/Manifest b/www/client/Manifest new file mode 100644 index 00000000..6705b0d5 --- /dev/null +++ b/www/client/Manifest @@ -0,0 +1,25 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +DIST httrack-3.43-3.43-4.tar.gz +DIST httrack-3.43-4.tar.gz 1675341 MD5 17ac212312c09cd2544701fc9925fa0d RMD160 4e194539ac17f8f64277c05289048ca4966f85cc SHA1 835304a73e1558714d4798dbcb434536e0de5d2e SHA256 d5dcf999e84a828015678efb8085c43a55b717762cd79733280d457a1fe95000 SHA512 349d2e5fc9a1408b6585e61f26e1e84bbff62c7e641d7e174e6779c2df4a393958391e2c9828728b4affd9e498a4c6c2100148dc9c2c77d0b487a7218256406f +MKBUILD httrack.mkbuild 4820 MD5 4b424b1f2e2e56e62642ef33d199288a RMD160 fb150eb93ec329d26d5503fea0f8064c68abb7da SHA1 5c1debc973e66cc5cdf6362f4b9262dbf3fe5c76 SHA256 cfe65c16ae6b08b8d687019466c5ed6b651a7844bdea3979de08410dae4ab92d SHA512 33723e41abd9c9be376a168af3f208aaca5449e3b8f301746e85005fdd577551763214d8e533f3a5d9e488e4e0198296e3019c0c6daadd364e110f2557dbffcc +SLACKBUILD httrack-3.43.SlackBuild 6904 MD5 9b372820720079df9fd9f58d18762ae7 RMD160 2c9224fdecd948ff8b3dd5180c7f0808a0f488a9 SHA1 0b2ab0d85440fad48149a0c7c57ef680c2e5bbb3 SHA256 dbecaeae793efaa66742ae300acbb2bdb6ea8a89999a1185fc2bac1cc2cfa393 SHA512 3cdbed5a66d522fba2527fa8ea7afce88c852d823fda8737ac74cca7465279f759c22226f2c5be7d8963dfe0784bebdc62114c1edcef9da39fe766f903060716 +SLACKBUILD httrack.SlackBuild 6871 MD5 4f08eeb4a84b86758a80d5b48a54dcdd RMD160 cb1ce34f76cb40e644a5997cf8f6546a552edac2 SHA1 2cb41b62ec58f7c4d0c6d6a7dca4d6258515c4b1 SHA256 90e7f6bb22cb712c86550c702994349e7f5787775662b00eea80cb72aa6212f7 SHA512 eec07ae22bcbae3e2519025c9d34a0d3e91ecf718fb05fe2c6b6088b0d780062c616e9b32a6dbbd5b468c84da86be934a6628035317cd8a484c1e4c72a3ca6ff +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.9 (GNU/Linux) + +iQIcBAEBAgAGBQJJymcnAAoJEEHL93ESzgei9WcQAIadjynSphm1bTsABuqyXF8b +aT4rE4WLrzwKTFjeNzF9W4I3mAuZ7dIS3VM3cPzPLASA8agsdAdiPLiXBTuoGQmZ +T0NfQ/TAZ1u28dwMma4kCkCHR6ldan/nwly5fkApUq3sgR1pnDwkDoYInaodz8iU +lVAuHwpG9VFXUeeVnYK7gL9FKrkDjVkEAbGMe9/eQ5mMxraXEUkxos32LDjW5JyU +rhE9/qu/biBD1fXbg26QeEb9KsDHXFKqsmz6I1kDDg6opvtUXZBcbkrer3VA/hgr +TjhhJz3rWYz7vqcHvkgC0fruNNsJGcKYK39UUATXhoi7MRepTqjaRt/mNT22kU5/ +bQfv1JASVHyquw0ifo5YY3rAP2b5pNVI2U6/O3tW0TQmIWcwsA7vbEzvNtewfJ9J +75qqG7eixxNJpbQzlGzD1cj2mxpe7NyIspEXuhwc4PDfHFgNzhbk4nXXQBip6+gL +wI7S06vsOitmIoJX1ErO0wlNpbS9knNSYdOFV7Pau/mIhEi3TT/JfMO2/QciLtpa +frOhkhSlYtjyQtmGmoyBb+OyMmHbsQR1MDgH/XJ1blelF70pTxp8YkXeD2M9lHFs +GZtXYydFx35AWeRL65Oy7JMUw00+c1qRvbtrkHK5KrxyColBvYEN18XSyhle1hSa +OaGL273MmMyjnOEl16g5 +=tdNU +-----END PGP SIGNATURE----- diff --git a/www/client/httrack.SlackBuild b/www/client/httrack.SlackBuild new file mode 100644 index 00000000..659a42be --- /dev/null +++ b/www/client/httrack.SlackBuild @@ -0,0 +1,223 @@ +#!/bin/bash +# +# httrack.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. +# +# httrack.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 httrack, by Silvio Rhatto +# requires: +# tested: httrack-3.43-4 +# model: generic.mkSlackBuild $Rev: 796 $ +# + +# Look for slackbuildrc +if [ -f ~/.slackbuildrc ]; then + source ~/.slackbuildrc +elif [ -f /etc/slackbuildrc ]; then + source /etc/slackbuildrc +fi + +# Set variables +CWD="$(pwd)" +SRC_NAME="httrack" +PKG_NAME="httrack" +ARCH=${ARCH:=i486} +SRC_VERSION=${VERSION:=3.43-4} +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} +SLACKBUILD_PATH=${SLACKBUILD_PATH:="www/client"} +PREFIX=${PREFIX:=/usr} +PKG_WORK="$TMP/$SRC_NAME" +CONF_OPTIONS=${CONF_OPTIONS:=""} +NUMJOBS=${NUMJOBS:=""} + +# Set system libraries' path and optmization flags based on $ARCH +LIBDIR="$PREFIX/lib" + +if [ "$ARCH" = "i386" ]; then + SLKCFLAGS="-O2 -march=i386 -mtune=i686" +elif [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686" +elif [ "$ARCH" = "s390" ]; then + SLKCFLAGS="-O2" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIR="$PREFIX/lib64" + LDFLAGS="-L/lib64 -L/usr/lib64" +fi + +# 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 +ERROR_MANIFEST=43; + +# 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.gz" +URL="http://www.httrack.com/$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 + +# Check Manifest file +if [ -e "$CWD/Manifest" ]; then + + # Manifest signature checking + if grep -q -- "-----BEGIN PGP SIGNED MESSAGE-----" $CWD/Manifest; then + echo "Checking Manifest signature..." + gpg --verify $CWD/Manifest + if [ "$?" != "0" ]; then + exit $ERROR_MANIFEST + fi + fi + + MANIFEST_LINES="`grep -E -v "^(MKBUILD|SLACKBUILD)" $CWD/Manifest | wc -l`" + + for ((MANIFEST_COUNT=1; MANIFEST_COUNT <= $MANIFEST_LINES; MANIFEST_COUNT++)); do + + MANIFEST_LINE="`grep -E -v "^(MKBUILD|SLACKBUILD)" $CWD/Manifest | head -n $MANIFEST_COUNT | tail -n 1`" + MANIFEST_FILE="`echo $MANIFEST_LINE | awk '{ print $2 }'`" + MANIFEST_FILE_TYPE="`echo $MANIFEST_LINE | awk '{ print $1 }'`" + + if [ -e "$SRC_DIR/$MANIFEST_FILE" ]; then + MANIFEST_FILE="$SRC_DIR/$MANIFEST_FILE" + else + MANIFEST_FILE="`find $CWD -name $MANIFEST_FILE`" + fi + + if [ ! -e "$MANIFEST_FILE" ] || [ -d "$MANIFEST_FILE" ]; then + continue + fi + + echo "Checking Manifest for $MANIFEST_FILE_TYPE $MANIFEST_FILE integrity..." + + SIZE_SRC="`wc -c $MANIFEST_FILE | awk '{ print $1 }'`" + SIZE_MANIFEST="`echo $MANIFEST_LINE | awk '{ print $3 }'`" + + # Check source code size + if [ "$SIZE_SRC" != "$SIZE_MANIFEST" ]; then + echo "SIZE Manifest: $SIZE_MANIFEST; SIZE $SRC: $SIZE_SRC" + exit $ERROR_MANIFEST + else + echo "Size match." + fi + + # Check source code integrity + for ALGO in md5 rmd160 sha1 sha256 sha512; do + if [ $ALGO = "rmd160" ]; then + ALGO_SRC="`openssl rmd160 $MANIFEST_FILE | awk '{ print $2 }'`" + else + ALGO_SRC="`"$ALGO"sum $MANIFEST_FILE | awk '{ print $1 }'`" + fi + ALGO="`echo $ALGO | tr '[:lower:]' '[:upper:]'`" + ALGO_MANIFEST=$(echo $MANIFEST_LINE | sed "s/.* $ALGO //" | awk '{ print $1 }') + if [ "$ALGO_SRC" != "$ALGO_MANIFEST" ]; then + echo "$ALGO Manifest: $ALGO_MANIFEST; $ALGO $SRC: $ALGO_SRC" + exit $ERROR_MANIFEST + else + echo "$ALGO match." + fi + done + + done + +else + exit $ERROR_MANIFEST +fi + +# 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="NEWS TODO README AUTHORS INSTALL ChangeLog MAINTAINERS COPYING LICENSE SIGNATURE 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------------------------------------------------------| +httrack: httrack +httrack: +httrack: HTTrack is a free (GPL, libre/free software) +httrack: and easy-to-use offline browser utility. +httrack: +httrack: +httrack: +httrack: +httrack: +httrack: +httrack: +EODESC + +# Build the package +cd "$PKG" +mkdir -p $REPOS/$SLACKBUILD_PATH +makepkg -l y -c n "$REPOS/$SLACKBUILD_PATH/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG + +# Delete source and build directories if requested +if [ "$CLEANUP" == "yes" ] || [ "$1" = "--cleanup" ]; then + rm -rf "$PKG_WORK" "$PKG" +fi -- cgit v1.2.3