]> gitweb.fluxo.info Git - slackbuilds.git/commitdiff
rdiff-backup: rebuilt from mkbuild
authorrhatto <rhatto@370017ae-e619-0410-ac65-c121f96126d4>
Mon, 21 Apr 2008 02:52:57 +0000 (02:52 +0000)
committerrhatto <rhatto@370017ae-e619-0410-ac65-c121f96126d4>
Mon, 21 Apr 2008 02:52:57 +0000 (02:52 +0000)
git-svn-id: svn+slack://slack.fluxo.info/var/svn/slackbuilds@1709 370017ae-e619-0410-ac65-c121f96126d4

app/backup/rdiff-backup/rdiff-backup.SlackBuild
app/backup/rdiff-backup/rdiff-backup.build [deleted file]
app/backup/rdiff-backup/slack-required

index 466af7dba5928f5ce7e769c90d4890a8418bfe59..6479b3f0f4c5d6081b16803b93ad1ce1cbf17c26 100755 (executable)
 #!/bin/bash
 #
-#  rdiff-backup.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.
+#  rdiff-backup.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.
 #
-#  rdiff-backup.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.
+#  rdiff-backup.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 script to call rdiff.build with correct settings
+# slackbuild for rdiff-backup, by Silvio Rhatto
+# requires: librsync 
+# tested: rdiff-backup-1.0.5
 #
 
-CWD="`pwd`"
-
+# Look for slackbuildrc
 if [ -f ~/.slackbuildrc ]; then
   source ~/.slackbuildrc
 elif [ -f /etc/slackbuildrc ]; then
   source /etc/slackbuildrc
 fi
 
-# default settings
-PACKAGE="rdiff-backup"
-VERSION=${VERSION:=1.0.5}
-ARCH=${ARCH:=i386}
+# Set variables
+CWD="$(pwd)"
+SRC_NAME="rdiff-backup"
+PKG_NAME="rdiff-backup"
+ARCH=${ARCH:=i486}
+SRC_VERSION=${VERSION:=1.0.5}
+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"
+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.gz"
+URL="http://savannah.nongnu.org/download/rdiff-backup/$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 $8 }'`"
+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
+)
+
+# 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-------------------------------------------------|
+rdiff-backup: rdiff-backup (remote incremental backup tool)
+rdiff-backup:
+rdiff-backup: rdiff-backup backs up one directory to another. The target directory
+rdiff-backup: ends up a copy of the source directory, but extra reverse diffs are
+rdiff-backup: stored in a special directory so you can still recover files lost
+rdiff-backup: some time ago. The idea is to combine the best features of a mirror
+rdiff-backup: and an incremental backup. rdiff-backup can also operate in a
+rdiff-backup: bandwidth- efficient manner over a pipe, like rsync. Thus you can
+rdiff-backup: use rdiff-backup and ssh to securely back up to a remote location,
+rdiff-backup: and only the differences will be transmitted. It can also handle
+rdiff-backup: symlinks, device files, permissions, ownership, etc.
+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/app/backup/rdiff-backup/rdiff-backup.build b/app/backup/rdiff-backup/rdiff-backup.build
deleted file mode 100755 (executable)
index 88ac2a7..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-#!/bin/bash
-#
-#  rdiff-backup.build 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.
-#
-#  rdiff-backup.build 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
-#
-# build script for rdiff-backup
-# by rhatto at riseup.net by rhatto | gpl
-# build it with slacktrack, example:
-#
-#   ARCH=x86_64 slacktrack -jefkzp "rdiff-backup-1.0.5-x86_64-1rha.tgz" "./rdiff-backup.build"
-# 
-
-CWD="`pwd`"
-
-if [ -s "slack-required" ]; then
-  echo Recomended and required packages for building ekiga 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
-
-if [ -f "/etc/slackbuildrc" ]; then
-  source /etc/slackbuildrc
-fi
-
-if [ -f "~/.slackbuildrc" ]; then
-  source ~/.slackbuildrc
-fi
-
-# default settings
-PACKAGE="rdiff-backup"
-TMP=${TMP:=/tmp}
-VERSION=${VERSION:=1.0.5}
-ARCH=${ARCH:=i386}
-BUILD=${BUILD:=1rha}
-SRC_DIR=${SRC:=$CWD}
-
-# -------  error codes for 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
-
-if [ "$ARCH" == "x86_64" ]; then
-  LIBDIR=/usr/lib64
-else
-  LIBDIR=/usr/lib
-fi
-
-RTOOL="wget"
-PACKAGE_EXT="gz"
-SRC="$PACKAGE-$VERSION.tar.$PACKAGE_EXT"
-URL="http://savannah.nongnu.org/download/rdiff-backup/$SRC"
-
-SRC_DIR="$SRC_DIR/$PACKAGE"
-
-if [ ! -d "$SRC_DIR" ]; then
-  mkdir -p $SRC_DIR
-fi
-
-if [ "$RTOOL" == "wget" ] && [ ! -f "$SRC_DIR/$SRC" ]; then
- wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET
-fi
-
-TMP="$TMP/$PACKAGE"
-
-if [ ! -d "$TMP" ]; then
-  mkdir -p $TMP
-fi
-
-tar xvf $SRC_DIR/$SRC || exit $ERROR_TAR
-cd $PACKAGE-$VERSION
-
-# config and install!
-mkdir -p /install
-
-python setup.py install --prefix=/usr/ || exit $ERROR_INSTALL
-
-# make the package
-
-cat << EOF > /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-----------------------------------------------------|
-rdiff-backup: rdiff-backup (remote incremental backup tool)
-rdiff-backup:
-rdiff-backup: rdiff-backup backs up one directory to another. The target directory
-rdiff-backup: ends up a copy of the source directory, but extra reverse diffs are
-rdiff-backup: stored in a special directory so you can still recover files lost
-rdiff-backup: some time ago. The idea is to combine the best features of a mirror
-rdiff-backup: and an incremental backup. rdiff-backup can also operate in a
-rdiff-backup: bandwidth- efficient manner over a pipe, like rsync. Thus you can
-rdiff-backup: use rdiff-backup and ssh to securely back up to a remote location,
-rdiff-backup: and only the differences will be transmitted. It can also handle
-rdiff-backup: symlinks, device files, permissions, ownership, etc.
-EOF
-
index 891f956799718135e67cabe05e268d8cd8282461..3226a3da23307baea4afefc94bf4af0f519d67eb 100644 (file)
@@ -1 +1,4 @@
-librsync
+# Dependency list to rdiff-backup
+#
+# dependency [condition] [version]]
+librsync