[Pkg-ocaml-maint-commits] r1274 - trunk/tools/opkg-buildpackage

Thomas Petazzoni tpetazzo-guest@costa.debian.org
Sat, 16 Apr 2005 13:09:48 +0000


Author: tpetazzo-guest
Date: 2005-04-16 13:09:47 +0000 (Sat, 16 Apr 2005)
New Revision: 1274

Added:
   trunk/tools/opkg-buildpackage/opkg-cleanpackage
   trunk/tools/opkg-buildpackage/opkg-editpatch
Log:
Add opkg-cleanpackage and opkg-editpatch

Added: trunk/tools/opkg-buildpackage/opkg-cleanpackage
===================================================================
--- trunk/tools/opkg-buildpackage/opkg-cleanpackage	2005-04-16 12:57:46 UTC (rev 1273)
+++ trunk/tools/opkg-buildpackage/opkg-cleanpackage	2005-04-16 13:09:47 UTC (rev 1274)
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+# opkg-cleanpackage, Version 0.1
+# Copyright (C) 2005 Thomas Petazzoni <thomas.petazzoni@enix.org>
+#
+# simple shell script to clean a debian package following the
+# pkg-ocaml-maint structure of original source tarball and separate
+# debian dir containing the patches.
+
+#    This program 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; version 2 of the License.
+#
+#    This program 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
+
+if [ ! -f debian/changelog ] ; then
+  echo "Not in package directory"
+  exit 1
+fi
+
+LINE=$(cat debian/changelog | head -1)
+
+# Separate package name and version
+PACKAGE=$(echo $LINE | sed 's/^\([^\ ]*\)\ .*$/\1/')
+DEBVERSION=$(echo $LINE | sed 's/^\([^\ ]*\) (\([0-9\.\-]*\))\ .*$/\2/')
+UPSTREAMVERSION=$(echo $DEBVERSION | cut -f 1 -d '-')
+
+rm -rf ${PACKAGE}-${UPSTREAMVERSION}
+rm -f ${PACKAGE}_${DEBVERSION}.diff.gz
+rm -f ${PACKAGE}_${DEBVERSION}.dsc
+rm -f ${PACKAGE}_${DEBVERSION}_*.changes
+rm -f *.deb


Property changes on: trunk/tools/opkg-buildpackage/opkg-cleanpackage
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/tools/opkg-buildpackage/opkg-editpatch
===================================================================
--- trunk/tools/opkg-buildpackage/opkg-editpatch	2005-04-16 12:57:46 UTC (rev 1273)
+++ trunk/tools/opkg-buildpackage/opkg-editpatch	2005-04-16 13:09:47 UTC (rev 1274)
@@ -0,0 +1,63 @@
+#!/bin/sh
+
+# opkg-editpatch, Version 0.1
+# Copyright (C) 2005 Thomas Petazzoni <thomas.petazzoni@enix.org>
+#
+# simple shell script to edit a patch (using dpatch tools) in a debian
+# package following the pkg-ocaml-maint structure of original source
+# tarball and separate debian dir containing the patches.
+
+#    This program 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; version 2 of the License.
+#
+#    This program 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
+
+if [ ! -f debian/changelog ] ; then
+  echo "Not in package directory"
+  exit 1
+fi
+
+LINE=$(cat debian/changelog | head -1)
+
+# Separate package name and version
+PACKAGE=$(echo $LINE | sed 's/^\([^\ ]*\)\ .*$/\1/')
+DEBVERSION=$(echo $LINE | sed 's/^\([^\ ]*\) (\([0-9\.\-]*\))\ .*$/\2/')
+UPSTREAMVERSION=$(echo $DEBVERSION | cut -f 1 -d '-')
+
+TARBALL=${PACKAGE}_${UPSTREAMVERSION}.orig.tar.gz
+
+# First of all clean up everything
+opkg-cleanpackage
+
+# Uncompress orig
+tar xvzf $TARBALL
+
+# Rename to correct thing
+mv ${PACKAGE}-${UPSTREAMVERSION}.orig ${PACKAGE}-${UPSTREAMVERSION}
+
+# Copy Debian directory
+cp -a debian/ ${PACKAGE}-${UPSTREAMVERSION}
+
+# Go into the directory
+cd ${PACKAGE}-${UPSTREAMVERSION}
+
+# Edit the patch
+dpatch-edit-patch $1
+
+if [ $? -eq 230 ] ; then 
+   cd ..
+   rm -rf ${PACKAGE}-${UPSTREAMVERSION}
+fi
+
+cd ..
+rm -rf debian
+cp -a ${PACKAGE}-${UPSTREAMVERSION}/debian .
+rm -rf ${PACKAGE}-${UPSTREAMVERSION}


Property changes on: trunk/tools/opkg-buildpackage/opkg-editpatch
___________________________________________________________________
Name: svn:executable
   + *