From 5bb2b7f85b57873b975205db13218bbf1f41d143 Mon Sep 17 00:00:00 2001 From: rhatto Date: Sat, 13 Sep 2008 13:23:30 +0000 Subject: backupninja: rebuilt from mkbuild git-svn-id: svn+slack://slack.fluxo.info/var/svn/slackbuilds@1907 370017ae-e619-0410-ac65-c121f96126d4 --- app/backup/backupninja/backupninja-0.9.6.diff | 436 ++++++++++++++++++++++++++ app/backup/backupninja/backupninja.SlackBuild | 45 ++- 2 files changed, 468 insertions(+), 13 deletions(-) create mode 100644 app/backup/backupninja/backupninja-0.9.6.diff (limited to 'app/backup/backupninja') diff --git a/app/backup/backupninja/backupninja-0.9.6.diff b/app/backup/backupninja/backupninja-0.9.6.diff new file mode 100644 index 00000000..74ea8db3 --- /dev/null +++ b/app/backup/backupninja/backupninja-0.9.6.diff @@ -0,0 +1,436 @@ +diff -Naur backupninja-0.9.6.orig/handlers/mysql.in backupninja-0.9.6/handlers/mysql.in +--- backupninja-0.9.6.orig/handlers/mysql.in 2008-06-24 12:55:10.000000000 -0300 ++++ backupninja-0.9.6/handlers/mysql.in 2008-09-13 10:23:20.000000000 -0300 +@@ -88,8 +88,7 @@ + then + if [ $usevserver = yes ] + then +- vhome=`$VSERVER $vsname exec getent passwd "root" | @AWK@ -F: '{print $6}'` +- home="$vroot$vhome" ++ home=`$VSERVER $vsname exec getent passwd "root" | @AWK@ -F: '{print $6}'` + else + home=`getent passwd "root" | @AWK@ -F: '{print $6}'` + fi +@@ -97,18 +96,25 @@ + [ -d $home ] || fatal "Can't find root's home directory ($home)." + + mycnf="$home/.my.cnf" +- +- if [ -f $mycnf ] ++ ++ if [ $usevserver = yes ] ++ then ++ workcnf="$vroot$mycnf" ++ else ++ workcnf="$mycnf" ++ fi ++ ++ if [ -f $workcnf ] + then +- # rename temporarily +- tmpcnf="$home/my.cnf.disable" +- debug "mv $mycnf $tmpcnf" +- mv $mycnf $tmpcnf ++ # rename temporarily ++ tmpcnf="$workcnf.disable" ++ debug "mv $workcnf $tmpcnf" ++ mv $workcnf $tmpcnf + fi + + oldmask=`umask` + umask 077 +- cat > $mycnf < $workcnf < $mycnf <&1` ++ code=$? ++ if [ "$code" == "0" ] ++ then ++ debug $output ++ info "Successfully finished hotcopy of all mysql databases" ++ else ++ warning $output ++ warning "Failed to hotcopy all mysql databases" ++ fi ++ fi ++ else ++ for db in $databases ++ do ++ if [ $usevserver = yes ] ++ then ++ execstr="$VSERVER $vsname exec $MYSQLHOTCOPY --allowold $db $hotdir" ++ else ++ execstr="$MYSQLHOTCOPY --allowold $db $hotdir" ++ fi ++ debug 'su $user -c \"$execstr\"' ++ if [ ! $test ] ++ then ++ output=`su $user -c "$execstr" 2>&1` ++ code=$? ++ if [ "$code" == "0" ] ++ then ++ debug $output ++ info "Successfully finished hotcopy of mysql database $db" ++ else ++ warning $output ++ warning "Failed to hotcopy mysql database $db" ++ fi ++ fi ++ done ++ fi ++fi ++ ++########################################################################## ++## SQL DUMP ++ ++if [ "$sqldump" == "yes" ] ++then ++ info "Initializing SQL dump method" ++ if [ "$databases" == "all" ] ++ then ++ if [ $usevserver = yes ] ++ then ++ debug 'echo show databases | $VSERVER $vsname exec su $user -c \"$MYSQL $defaultsfile\" | grep -v Database' ++ databases=`echo 'show databases' | $VSERVER $vsname exec su $user -c "$MYSQL $defaultsfile" | grep -v Database` ++ if [ $? -ne 0 ] ++ then ++ fatal "Authentication problem, maybe user/password is wrong or mysqld is not running?" ++ fi ++ else ++ databases=$(su $user -c "$MYSQL $defaultsfile -N -B -e 'show databases'" | sed 's/|//g;/\+----/d') ++ if [ $? -ne 0 ] ++ then ++ fatal "Authentication problem, maybe user/password is wrong or mysqld is not running?" ++ fi ++ fi ++ fi ++ ++ for db in $databases ++ do ++ DUMP_BASE="$MYSQLDUMP $defaultsfile --lock-tables --complete-insert --add-drop-table --quick --quote-names" ++ ++ # Dumping structure and data ++ DUMP="$DUMP_BASE $ignore $db" ++ ++ # If requested, dump only the table structure for this database ++ if echo "$nodata" | grep -E '(^|[[:space:]])'"$db\." >/dev/null ++ then ++ # Get the structure of the tables, without data ++ DUMP_STRUCT="$DUMP_BASE --no-data $db" ++ for qualified_table in $nodata ++ do ++ table=$( expr match "$qualified_table" "$db\.\([^\w]*\)" ) ++ DUMP_STRUCT="$DUMP_STRUCT $table" ++ done ++ DUMP="( $DUMP; $DUMP_STRUCT )" ++ fi ++ if [ $usevserver = yes ] ++ then ++ # Test to make sure mysqld is running, if it is not sqldump will not work ++ $VSERVER $vsname exec su $user -c "$MYSQLADMIN $defaultsfile ping" ++ if [ $? -ne 0 ]; then ++ fatal "Either you have an authentication problem, or mysqld doesn't appear to be running!" ++ fi ++ if [ "$compress" == "yes" ]; then ++ execstr="$VSERVER $vsname exec $DUMP | $GZIP > $vroot$dumpdir/${db}.sql.gz" ++ else ++ execstr="$VSERVER $vsname exec $DUMP -r $vroot$dumpdir/${db}.sql" ++ fi ++ else ++ # Test to make sure mysqld is running, if it is not sqldump will not work ++ su $user -c "$MYSQLADMIN $defaultsfile ping" ++ if [ $? -ne 0 ]; then ++ fatal "Either you have an authentication problem, or mysqld doesn't appear to be running!" ++ fi ++ if [ "$compress" == "yes" ]; then ++ execstr="$DUMP | $GZIP > $dumpdir/${db}.sql.gz" ++ else ++ execstr="$DUMP -r $dumpdir/${db}.sql" ++ fi ++ fi ++ debug "su $user -c \"$execstr\"" ++ if [ ! $test ] ++ then ++ output=`su $user -c "$execstr" 2>&1` ++ code=$? ++ if [ "$code" == "0" ] ++ then ++ debug $output ++ info "Successfully finished dump of mysql database $db" ++ else ++ warning $output ++ warning "Failed to dump mysql databases $db" ++ fi ++ fi ++ done ++fi ++ ++# clean up tmp config file ++if [ "$dbusername" != "" -a "$dbpassword" != "" ] ++then ++ ## clean up tmp config file ++ debug "rm $mycnf" ++ rm $mycnf ++ if [ -f "$tmpcnf" ] ++ then ++ debug "mv $tmpcnf $mycnf" ++ mv $tmpcnf $mycnf ++ fi ++fi ++ ++return 0 diff --git a/app/backup/backupninja/backupninja.SlackBuild b/app/backup/backupninja/backupninja.SlackBuild index 3deb32cc..5d8717d6 100755 --- a/app/backup/backupninja/backupninja.SlackBuild +++ b/app/backup/backupninja/backupninja.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 backupninja, by Silvio Rhatto -# requires: -# tested: backupninja-0.9.5 +# requires: +# tested: backupninja-0.9.6 # # Look for slackbuildrc @@ -31,7 +31,7 @@ CWD="$(pwd)" SRC_NAME="backupninja" PKG_NAME="backupninja" ARCH="noarch" -SRC_VERSION=${VERSION:=0.9.5} +SRC_VERSION=${VERSION:=0.9.6} PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')" BUILD=${BUILD:=1rha} SRC_DIR=${SRC_DIR:=$CWD}/$PKG_NAME @@ -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) @@ -83,15 +84,14 @@ 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=`ls -l | awk '/^d/ { print $8 }'` +PKG_SRC="$PWD/`ls -l | awk '/^d/ { print $NF }'`" cd "$PKG_SRC" # Patch source -patches="[[PATCH FILES]] +patches=" $PKG_NAME.diff $PKG_NAME-$PKG_VERSION.diff $PKG_NAME-$PKG_VERSION-$ARCH.diff $PKG_NAME-$ARCH.diff" for patch in $patches; do @@ -99,9 +99,29 @@ for patch in $patches; do 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 ./autogen.sh || exit $ERROR_CONF CFLAGS="$SLKCFLAGS" \ @@ -135,7 +155,6 @@ rm $PKG/etc/backupninja.conf sed -e 's/\/usr\/var\/log/\/var\/log\/backup/g' $PKG/etc/logrotate.d/backupninja > $PKG/etc/logrotate.d/backupninja.new mv $PKG/etc/logrotate.d/backupninja.new $PKG/etc/logrotate.d/backupninja - # Install documentation DOCS="AUTHORS COPYING ChangeLog INSTALL NEWS README TODO" mkdir -p "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION" || exit $ERROR_MKDIR @@ -149,9 +168,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 ':'. -- cgit v1.2.3