[Pkg-haskell-commits] pkg-haskell: Added script to build packages.

Marco Túlio Gontijo e Silva marcot at holoscopio.com
Sat Jul 4 13:01:31 UTC 2009


Sat Jul  4 12:56:44 UTC 2009  Marco T[_\c3_][_\ba_]lio Gontijo e Silva <marcot at holoscopio.com>
  * Added script to build packages.
  Ignore-this: 28cac2392cd47b8ebb56f7c6860453ff

    A ./build-pkg-haskell

Sat Jul  4 12:56:44 UTC 2009  Marco Túlio Gontijo e Silva <marcot at holoscopio.com>
  * Added script to build packages.
  Ignore-this: 28cac2392cd47b8ebb56f7c6860453ff
diff -rN -u old-pkg-haskell/build-pkg-haskell new-pkg-haskell/build-pkg-haskell
--- old-pkg-haskell/build-pkg-haskell	1970-01-01 00:00:00.000000000 +0000
+++ new-pkg-haskell/build-pkg-haskell	2009-07-04 13:01:31.028218721 +0000
@@ -0,0 +1,87 @@
+#!/bin/sh
+# Copyright (c) 2009 Marco Túlio Gontijo e Silva <marcot at holoscopio.com>
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+# Usage:
+# build-pkg-haskell
+#     [--build]
+#     [--pkg-haskell=PKG_HASKELL]
+#     [--pkg-haskell-build=PKG_HASKELL_BUILD]
+#     [PACKAGE ...]
+
+# Where PKG_HASKELL is the directory of the darcs pkg-haskell repository,
+# PKG_HASKELL_BUILD is the directory where the build should be made.  --build
+# will call debuild after extracting the source.  You can also set the
+# environment variables BUILD, PKG_HASKELL and PKG_HASKELL_BUILD to define
+# these values.
+
+set -e
+
+until [ -z "$1" ]
+do
+    case "$1" in
+        --build)
+            BUILD=True
+            ;;
+
+        --pkg-haskell=*)
+            PKG_HASKELL=${1##--pkg-haskell=}
+            ;;
+
+        --pkg-haskell-build=*)
+            PKG_HASKELL_BUILD=${1##--pkg-haskell=}
+            ;;
+
+        *)
+            PACKAGES="$PACKAGES $1"
+            ;;
+    esac
+    shift
+done
+
+[ -z "$PACKAGES" ] && PACKAGES=$PWD
+
+for DEBIAN in $PACKAGES
+do
+    [ -n $PKG_HASKELL ] && DEBIAN=$PKG_HASKELL/$DEBIAN
+    [ -z "$PKG_HASKELL_BUILD" ] \
+        && PKG_HASKELL_BUILD=$DEBIAN/../../pkg-haskell-build
+    CHANGELOG=`head -1 $DEBIAN/changelog`
+    PACKAGE=`echo $CHANGELOG | cut -d\  -f1`
+    UPSTREAM=`echo $CHANGELOG | cut -d\(  -f2 | cut -d- -f1`
+    TARBALL=${PACKAGE}_$UPSTREAM.orig.tar.gz
+    mkdir -p $PKG_HASKELL_BUILD
+    [ ! -e $TARBALL ] \
+        && uscan \
+        --destdir $PKG_HASKELL_BUILD \
+        --force-download \
+        --package $PACKAGE \
+        --watchfile $DEBIAN/watch \
+        --upstream-version $UPSTREAM
+    PACKAGEDIR=`readlink $TARBALL | xargs -I TARGET basename TARGET .tar.gz`
+    [ ! -e $PACKAGEDIR ] \
+        && tar xzf $PKG_HASKELL_BUILD/$TARBALL -C $PKG_HASKELL_BUILD
+    cp -a $DEBIAN $PACKAGEDIR/debian
+    if [ -n "$BUILD" ]
+    then
+        cd $PACKAGEDIR
+        debuild
+    fi
+done





More information about the Pkg-haskell-commits mailing list