Create Debian package installation
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Sat, 6 Oct 2001 17:14:17 +0000 (17:14 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Sat, 6 Oct 2001 17:14:17 +0000 (17:14 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@88 fdb21ef1-2011-0410-befe-b5e4ea1792b1

Construct
README
debian/changelog [new file with mode: 0644]
debian/control [new file with mode: 0644]
debian/copyright [new file with mode: 0644]
debian/python-scons.postinst [new file with mode: 0644]
debian/python-scons.prerm [new file with mode: 0644]
debian/python2-scons.postinst [new file with mode: 0644]
debian/python2-scons.prerm [new file with mode: 0644]
debian/rules [new file with mode: 0644]

index 6debc7c2907112e93266de3377906dfcc7c6189f..61a2f9b2fb69f353dc340c9bc8667e8a2dd74046 100644 (file)
--- a/Construct
+++ b/Construct
@@ -56,6 +56,8 @@ $aegis = cons::whereis('aegis');
 $aesub = cons::whereis('aesub');
 $rpm = cons::whereis('rpm');
 $jw = cons::whereis('jw');
+$dh_builddeb = cons::whereis('dh_builddeb');
+$fakeroot = cons::whereis('fakeroot');
 
 #
 # Now grab the information that we "build" into the files (using sed).
@@ -284,7 +286,11 @@ if ($change) {
        chomp(@src_files);
 
        foreach $file (@src_files) {
-           $env->Command("build/$project-src/$file", $file, "%SEDCOM");
+           $env->Command("build/$project-src/$file", 
+                         $file, 
+                         qq(%SEDCOM
+                             chmod --reference=%< %>)
+            );
        }
 
        $env->Command("build/dist/$project-src-$version.tar.gz",
@@ -292,9 +298,42 @@ if ($change) {
                      map("build/$project-src/$_", @src_files),
                      qq(
                rm -rf build/$project-src-$version
-               cp -r build/$project-src build/$project-src-$version
+               cp -rp build/$project-src build/$project-src-$version
                find build/$project-src-$version -name .consign -exec rm {} \\;
                tar zcf %> -C build $project-src-$version
        ));
     }
 }
+
+#
+# Build the Debian packages if debhelper and fakeroot are available
+#
+if ($dh_builddeb && $fakeroot){
+    @deb_targets = ("build/dist/scons_$version-1_all.deb", 
+                   "build/dist/python-scons_$version-1_all.deb",
+                   "build/dist/python2-scons_$version-1_all.deb"
+                  );
+    
+    @deb_deps = ("debian/rules",
+                "debian/control",
+                "debian/changelog",
+                "debian/copyright",
+                "debian/python-scons.postinst",
+                "debian/python-scons.prerm",
+                "debian/python2-scons.postinst",
+                "debian/python2-scons.prerm"
+               );
+    
+    chomp(@engine_files = `cat src/engine/MANIFEST`);
+    chomp(@script_files = `cat src/script/MANIFEST`);
+    
+    $env->Command([@deb_targets], 
+                 @deb_deps,
+                 map("build/engine/$_", @engine_files),
+                 map("build/script/$_", @script_files),
+                 qq(rm -rf build/engine/build build/engine/dist
+                    rm -rf build/script/build build/script/dist
+                    fakeroot debian/rules ENVOKED_BY_CONSTRUCT=1 binary
+                    env DH_COMPAT=3 dh_clean
+    ));
+}
diff --git a/README b/README
index 0ce7716b038a0b83d037754dfe728f2d7366e988..2a04415cb3c809e265a7bd1d1f4b2cfb708c30a0 100644 (file)
--- a/README
+++ b/README
@@ -20,6 +20,13 @@ config
         The Aegis configuration, governing much of how we use Aegis to
         build, test, control source, etc.
 
+debian/
+       Files needed to construct a Debian package. The contents of this
+       directory are dictated by the Debian Policy Manual
+       (http://www.debian.org/doc/debian-policy). The package will not be
+       accepted into the Debian distribution unless the contents of this
+       directory satisfy the relevant Debian policies.
+
 etc/
         A subdirectory for miscellaneous things that we need.  Right
         now, it has copies of Python modules that we use for testing,
diff --git a/debian/changelog b/debian/changelog
new file mode 100644 (file)
index 0000000..1570b26
--- /dev/null
@@ -0,0 +1,7 @@
+scons (0.01-1) unstable; urgency=low
+
+  * Initial Release.
+
+ -- Anthony Roach <aroach@electriceyeball.com>  Mon,  1 Oct 2001 23:24:45 -0500
+
+
diff --git a/debian/control b/debian/control
new file mode 100644 (file)
index 0000000..5a5ae24
--- /dev/null
@@ -0,0 +1,31 @@
+Source: scons
+Section: devel
+Priority: extra
+Maintainer: Anthony Roach <aroach@electriceyeball.com>
+Standards-Version: 3.5.6.0
+Build-Depends: debhelper
+
+Package: scons
+Architecture: all
+Depends: python-scons|python2-scons,python-base(>=1.5.2)|python2-base
+Suggests: python-scons, python2-scons
+Description: An Open Source software construction tool
+ SCons is an Open Source software construction tool--that is, a build tool; an
+ improved substitute for the classic Make utility; a better way to build
+ software.
+
+Package: python-scons
+Architecture: all
+Depends: python-base(<<2.0), python-base(>=1.5.2)
+Description: SCons Python 1.5.2 extension modules
+ SCons is an Open Source software construction tool--that is, a build tool; an
+ improved substitute for the classic Make utility; a better way to build
+ software.
+
+Package: python2-scons
+Architecture: all
+Depends: python2-base(<<2.1), python2-base(>=2.0)
+Description: SCons Python 2.0 extension modules
+ SCons is an Open Source software construction tool--that is, a build tool; an
+ improved substitute for the classic Make utility; a better way to build
+ software.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644 (file)
index 0000000..ec52b3c
--- /dev/null
@@ -0,0 +1,28 @@
+This package was debianized by Anthony Roach <aroach@electriceyeball.com>
+
+The package source can be downloaded from http://www.scons.org/
+
+Upstream Author: Steven Knight <knight@baldmt.com>
+
+Copyright (c) 2001 Steven Knight
+
+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.
+
+
diff --git a/debian/python-scons.postinst b/debian/python-scons.postinst
new file mode 100644 (file)
index 0000000..362860a
--- /dev/null
@@ -0,0 +1,27 @@
+#! /bin/sh -e
+#
+# postinst script for Debian python2 packages.
+# Written 1998 by Gregor Hoffleit <flight@debian.org>.
+# Modified for SCons 2001 by Anthony Roach <aroach@electriceyeball.com>.
+#
+
+PACKAGE=python-scons
+DIRLIST="/usr/lib/python1.5/site-packages/SCons"
+
+case "$1" in
+    configure|abort-upgrade|abort-remove|abort-deconfigure)
+        for i in $DIRLIST ; do
+            python2 -O /usr/lib/python1.5/compileall.py -q $i
+            python2 /usr/lib/python1.5/compileall.py -q $i
+        done
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/python-scons.prerm b/debian/python-scons.prerm
new file mode 100644 (file)
index 0000000..24e558c
--- /dev/null
@@ -0,0 +1,14 @@
+#! /bin/sh -e
+#
+# sample prerm script for Debian python2 packages.
+# Written 1998 by Gregor Hoffleit <flight@debian.org>.
+# Modified for SCons 2001 by Anthony Roach <aroach@electriceyeball.com>.
+#
+
+PACKAGE=python-scons
+
+dpkg --listfiles $PACKAGE |
+       awk '$0~/\.py$/ {print $0"c\n" $0"o"}' |
+       xargs rm -f >&2
+
+#DEBHELPER#
diff --git a/debian/python2-scons.postinst b/debian/python2-scons.postinst
new file mode 100644 (file)
index 0000000..eedb8ab
--- /dev/null
@@ -0,0 +1,27 @@
+#! /bin/sh -e
+#
+# postinst script for Debian python2 packages.
+# Written 1998 by Gregor Hoffleit <flight@debian.org>.
+# Modified for SCons 2001 by Anthony Roach <aroach@electriceyeball.com>.
+#
+
+PACKAGE=python2-scons
+DIRLIST="/usr/lib/python2.0/site-packages/SCons"
+
+case "$1" in
+    configure|abort-upgrade|abort-remove|abort-deconfigure)
+        for i in $DIRLIST ; do
+            python2 -O /usr/lib/python2.0/compileall.py -q $i
+            python2 /usr/lib/python2.0/compileall.py -q $i
+        done
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/python2-scons.prerm b/debian/python2-scons.prerm
new file mode 100644 (file)
index 0000000..2bc8081
--- /dev/null
@@ -0,0 +1,14 @@
+#! /bin/sh -e
+#
+# sample prerm script for Debian python2 packages.
+# Written 1998 by Gregor Hoffleit <flight@debian.org>.
+# Modified for SCons 2001 by Anthony Roach <aroach@electriceyeball.com>.
+#
+
+PACKAGE=python2-scons
+
+dpkg --listfiles $PACKAGE |
+       awk '$0~/\.py$/ {print $0"c\n" $0"o"}' |
+       xargs rm -f >&2
+
+#DEBHELPER#
diff --git a/debian/rules b/debian/rules
new file mode 100644 (file)
index 0000000..6e52b59
--- /dev/null
@@ -0,0 +1,94 @@
+#!/usr/bin/make -f
+
+#
+# This file is more complex than it needs to be to just build binary packages,
+# because it satisfies the relevant Debian policies. See ../README for more
+# information.
+#
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+# This is the debhelper compatability version to use.
+export DH_COMPAT=3
+
+# This has to be exported to make some magic below work.
+export DH_OPTIONS
+
+ifeq ($(ENVOKED_BY_CONSTRUCT),1)
+BUILDDEB_OPTIONS=--destdir=build/dist
+endif
+
+build: build-stamp
+build-stamp:
+ifneq ($(ENVOKED_BY_CONSTRUCT),1)
+       dh_testdir
+       cons
+       touch build-stamp
+endif
+
+clean:
+       dh_testdir
+       dh_testroot
+       rm -f build-stamp configure-stamp
+       rm -rf build
+       find -name .construct -exec rm "{}" ";"
+       dh_clean
+
+install: DH_OPTIONS=
+install: build
+       dh_testdir
+       dh_testroot
+       dh_clean -k
+       dh_installdirs
+       python build/engine/setup.py install \
+--install-purelib=`pwd`/debian/python-scons/usr/lib/python1.5/site-packages --no-compile
+
+       python build/script/setup.py install \
+--install-scripts=`pwd`/debian/scons/usr/bin --no-compile
+
+       python build/engine/setup.py install \
+--install-purelib=`pwd`/debian/python2-scons/usr/lib/python2.0/site-packages --no-compile
+
+
+# This single target is used to build all the packages, all at once, or
+# one at a time. So keep in mind: any options passed to commands here will
+# affect _all_ packages. Anything you want to only affect one package
+# should be put in another target, such as the install target.
+binary-common:
+       dh_testdir
+       dh_testroot
+       dh_installdocs
+       dh_installexamples
+# uncomment the following line once there is a man page:
+#      dh_installman build/doc/MAN/scons.1]
+       dh_installchangelogs 
+       dh_compress
+       dh_fixperms
+       dh_installdeb
+       dh_gencontrol
+       dh_md5sums
+       dh_builddeb $(BUILDDEB_OPTIONS)
+
+# Build architecture independant packages using the common target.
+binary-indep: build install
+       $(MAKE) ENVOKED_BY_CONSTRUCT=$(ENVOKED_BY_CONSTRUCT) -f debian/rules DH_OPTIONS=-i binary-common
+
+# Build architecture dependant packages using the common target.
+binary-arch: build install
+
+# Any other binary targets build just one binary package at a time.
+binary-scons: build install
+       $(MAKE) ENVOKED_BY_CONSTRUCT=$(ENVOKED_BY_CONSTRUCT) -f debian/rules binary-common DH_OPTIONS=-pscons
+
+binary-python-scons: build install
+       $(MAKE) ENVOKED_BY_CONSTRUCT=$(ENVOKED_BY_CONSTRUCT) -f debian/rules binary-common DH_OPTIONS=-ppython-scons
+
+binary-python2-scons: build install
+       $(MAKE) ENVOKED_BY_CONSTRUCT=$(ENVOKED_BY_CONSTRUCT) -f debian/rules binary-common DH_OPTIONS=-ppython2-scons
+
+binary: binary-indep binary-arch
+
+.PHONY: build clean binary-indep binary-arch binary install binary-scons binary-python-scons binary-python2-scons
+
+