[Pkg-kde-commits] rev 2206 - scripts

Josh Metzler jdmetz-guest at costa.debian.org
Fri Nov 11 16:35:37 UTC 2005


Author: jdmetz-guest
Date: 2005-11-11 16:35:36 +0000 (Fri, 11 Nov 2005)
New Revision: 2206

Added:
   scripts/create-buildprep
Log:
Import bash script to create 98_buildprep.diff

Added: scripts/create-buildprep
===================================================================
--- scripts/create-buildprep	2005-11-11 16:34:24 UTC (rev 2205)
+++ scripts/create-buildprep	2005-11-11 16:35:36 UTC (rev 2206)
@@ -0,0 +1,56 @@
+#! /bin/bash
+
+# Usage: create-buildprep $PACKAGE_$UPSTREAMVERSION
+
+# Script to create a buildprep patch.
+# It starts with a .orig tarball (e.g. kdetoys_3.5-rc1.orig.tar.gz)
+# and ends with two directories - one (e.g. kdetoys-3.5-rc1)
+# ready for building with a fresh svn export of the debian directory,
+# but with the new 98_buildprep.diff, and the other (e.g.
+# kdetoys-3.5-rc1.orig) just the extracted tarball.
+
+# Notes:
+#  - this script does an svn export from svn.debian.org
+#  - this script depends on the filter-buildprep script
+
+# (C) 2005, Josh Metzler <joshdeb at metzlers.org>
+# GPL'ed code follow.
+
+FILTERBP=`which filter-buildprep` || FILTERBP=`which ./filter-buildprep` || ( echo "Failed to find filter-buildprep" && exit 1 )
+
+# untar the source
+tar -xzf $1.orig.tar.gz || exit 1
+echo "Untarred the source"
+
+# dirname has hyphen rather than underscore between package and version
+DIRNAME=${1/_/-}
+# strip everything after the first underscore to get the base name
+BASENAME=${1%%_*}
+
+# make a hardlinked backup copy
+# autotools does the *right thing* with hardlinks
+cp -lr $DIRNAME $DIRNAME.orig
+echo "Made a copy of the original source"
+
+# if the debian directory exists, remove it
+test -e $DIRNAME/debian && rm -rf $DIRNAME/debian
+
+# export a fresh copy of svn/trunk's debian directory for this package
+# use force to make it write into an existing directory
+svn --force export svn://svn.debian.org/pkg-kde/trunk/packages/$BASENAME $DIRNAME || exit 1
+
+# remove the current buildprep patch
+rm $DIRNAME/debian/patches/98_buildprep.diff
+
+# run the buildprep
+cd $DIRNAME && fakeroot debian/rules buildprep
+cd ..
+
+# create the new buildprep patch where it belongs
+diff -x debian -Nrua $DIRNAME.orig $DIRNAME | $FILTERBP > $DIRNAME/debian/patches/98_buildprep.diff
+echo "Created the buildprep patch"
+
+# unapply the patch
+cd $DIRNAME && patch -p0 -R < debian/patches/98_buildprep.diff
+
+


Property changes on: scripts/create-buildprep
___________________________________________________________________
Name: svn:executable
   + *




More information about the pkg-kde-commits mailing list