Commits

Anonymous committed 31b28a8

Rework Debian packaging ito incorporate changes from Moshe Zadka, official Debian SCons package maintainer.

Comments (0)

Files changed (18)

HOWTO/release.txt

 
 		# Change the hard-coded package version numbers
 		# in the following files.
-		aecp README SConstruct debian/changelog rpm/scons.spec
+		aecp README SConstruct debian/changelog debian/files rpm/scons.spec
 
-		vi README SConstruct debian/changelog rpm/scons.spec
+		vi README SConstruct debian/changelog debian/files rpm/scons.spec
 
 		# Optionally, do the same in the following:
 		[optional] aecp HOWTO/change.txt
 unzip = whereis('unzip')
 zip = whereis('zip')
 
-# My installation on Red Hat doesn't like any debhelper version
-# beyond 2, so let's use 2 as the default on any non-Debian build.
-if os.path.isfile('/etc/debian_version'):
-    dh_compat = 3
-else:
-    dh_compat = 2
-
 #
 # Now grab the information that we "build" into the files (using sed).
 #
                    DEVELOPER           = developer,
                    REVISION            = revision,
                    VERSION             = version,
-                   DH_COMPAT           = dh_compat,
+                   DH_COMPAT           = 2,
 
                    TAR_HFLAG           = tar_hflag,
 
         'inst_subdir'   : os.path.join('lib', 'python1.5', 'site-packages'),
 
         'debian_deps'   : [
+                            'debian/changelog',
+                            'debian/control',
+                            'debian/copyright',
+                            'debian/dirs',
+                            'debian/docs',
+                            'debian/postinst',
+                            'debian/prerm',
                             'debian/rules',
-                            'debian/control',
-                            'debian/changelog',
-                            'debian/copyright',
-                            'debian/python-scons.postinst',
-                            'debian/python-scons.prerm',
                           ],
 
         'files'         : [ 'LICENSE.txt',
 #        'inst_subdir'  : os.path.join('lib', 'python2.1', 'site-packages'),
 #
 #        'debian_deps'  : [
-#                           'debian/rules',
-#                           'debian/control',
-#                           'debian/changelog',
-#                           'debian/copyright',
-#                           'debian/python2-scons.postinst',
-#                           'debian/python2-scons.prerm',
+#                            'debian/changelog',
+#                            'debian/control',
+#                            'debian/copyright',
+#                            'debian/dirs',
+#                            'debian/docs',
+#                            'debian/postinst',
+#                            'debian/prerm',
+#                            'debian/rules',
 #                          ],
 #
 #        'files'        : [
         'inst_subdir'   : 'bin',
 
         'debian_deps'   : [
+                            'debian/changelog',
+                            'debian/control',
+                            'debian/copyright',
+                            'debian/dirs',
+                            'debian/docs',
+                            'debian/postinst',
+                            'debian/prerm',
                             'debian/rules',
-                            'debian/control',
-                            'debian/changelog',
-                            'debian/copyright',
-                            'debian/python-scons.postinst',
-                            'debian/python-scons.prerm',
                           ],
 
         'files'         : [
         'pkg'           : project,
 
         'debian_deps'   : [ 
+                            'debian/changelog',
+                            'debian/control',
+                            'debian/copyright',
+                            'debian/dirs',
+                            'debian/docs',
+                            'debian/postinst',
+                            'debian/prerm',
                             'debian/rules',
-                            'debian/control',
-                            'debian/changelog',
-                            'debian/copyright',
-                            'debian/scons.postinst',
-                            'debian/scons.prerm',
                           ],
 
         'files'         : [ 
         # Our Debian packaging builds directly into build/dist,
         # so we don't need to add the .debs to install_targets.
         deb = os.path.join('build', 'dist', "%s_%s-1_all.deb" % (pkg, version))
+        for d in p['debian_deps']:
+            b = env.SCons_revision(os.path.join(build, d), d)
+            env.Depends(deb, b)
         env.Command(deb, build_src_files, [
-            "fakeroot make -f debian/rules VERSION=$VERSION DH_COMPAT=$DH_COMPAT ENVOKED_BY_CONSTRUCT=1 binary-$PKG",
-            "env DH_COMPAT=$DH_COMPAT dh_clean"
+            "cd %s && fakeroot make -f debian/rules PYTHON=python BUILDDEB_OPTIONS=--destdir=../../build/dist binary" % build,
                     ])
-        env.Depends(deb, p['debian_deps'])
 
-        dfiles = map(lambda x, d=test_deb_dir: os.path.join(d, 'usr', x),
-                     dst_files)
+        old = os.path.join('lib', 'scons', '')
+        new = os.path.join('lib', 'python2.1', 'site-packages', '')
+        def xxx(s, old=old, new=new):
+            if s[:len(old)] == old:
+                s = new + s[len(old):]
+            return os.path.join('usr', s)
+        dfiles = map(lambda x, t=test_deb_dir: os.path.join(t, x),
+                     map(xxx, dst_files))
         env.Command(dfiles,
                     deb,
                     "dpkg --fsys-tarfile $SOURCES | (cd $TEST_DEB_DIR && tar -xf -)")
 scons (0.07-1) unstable; urgency=low
 
-  * Seventh Release.
+  * Folding uploaded Debian build into SCons source
 
- -- Steven Knight <knight@baldmt.com>  Thu, 28 Mar 2002 01:24:29 -0600
+ -- Steven Knight <knight@baldmt.com>  Tue, 23 Apr 2002 07:04:54 -0500
+
+
+scons (0.05-1) unstable; urgency=low
+
+  * First upload (closes: #140128)
+
+ -- Moshe Zadka <moshez@debian.org>  Wed, 27 Mar 2002 10:40:42 +0200
 
 
 scons (0.06-1) unstable; urgency=low
 Source: scons
 Section: devel
-Priority: extra
-Maintainer: Anthony Roach <aroach@electriceyeball.com>
-Standards-Version: 3.5.6.0
-Build-Depends: debhelper
+Priority: optional
+Maintainer: Moshe Zadka <moshez@debian.org>
+Build-Depends-Indep: debhelper (>> 2.0.0), python2.1
+Standards-Version: 3.2.1
 
 Package: scons
 Architecture: all
-Depends: python-base(>=1.5.2)|python2-base
-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.
-
-Package: scons-script
-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 script
- 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.
+Depends: python2.1
+Description: A replacement for Make
+ Scons is able to build files from other files, based on the
+ dependency DAG.
+This package was debianized by Moshe Zadka <moshez@zadka.site.co.il> on
+Wed, 27 Mar 2002 10:40:28 +0200.
+
+Upstream Author(s): 
+Steven Knight
+knight at baldmt dot com
+http://www.baldmt.com/~knight/
+
+With plenty of help from the SCons Development team:
+        Chad Austin
+        Charles Crain
+        Steve Leblanc
+        Anthony Roach
+
+
+Copyright: 
+
+The software comes with the following notice in the file LICENSE.txt:
+Copyright (c) 2001, 2002 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.
 This package was debianized by Anthony Roach <aroach@electriceyeball.com>
 
 The package source can be downloaded from http://www.scons.org/
+usr/bin
+usr/lib/python2.1/site-packages
+usr/share/doc/scons
+usr/share/man/man1
+usr/share/doc/scons/*
+#!/bin/sh
+set -e
+if [ "$1" = "configure" ]; then
+	if [ -d /usr/doc -a ! -e /usr/doc/scons -a -d /usr/share/doc/scons ]; then
+		ln -sf ../share/doc/scons /usr/doc/scons
+	fi
+fi
+
+NAME=scons
+case "$1" in
+        configure|abort-upgrade|abort-remove|abort-deconfigure)
+                dpkg --listfiles $NAME | grep '\.py$' | \
+                     xargs -n 1 /usr/bin/python -c 'import py_compile,sys;py_compile.compile(sys.argv[1])'
+                dpkg --listfiles $NAME | grep '\.py$' | \
+                     xargs -n 1 /usr/bin/python -O -c 'import py_compile,sys;py_compile.compile(sys.argv[1])'
+        ;;
+esac
+#!/bin/sh
+set -e
+
+NAME=scons
+
+dpkg --listfiles $NAME |
+        awk '$0~/\.py$/ {print $0"c\n" $0"o"}' |
+        xargs rm -f >&2
+
+if [ \( "$1" = "upgrade" -o "$1" = "remove" \) -a -L /usr/doc/scons ]; then
+	rm -f /usr/doc/scons
+fi

debian/python-scons.postinst

-#! /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

debian/python-scons.prerm

-#! /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#

debian/python2-scons.postinst

-#! /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

debian/python2-scons.prerm

-#! /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#
 #!/usr/bin/make -f
+# Sample debian/rules that uses debhelper.
+# GNU copyright 1997 to 1999 by Joey Hess.
 
-#
-# 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.
-#
+########
+# Overridable variables added to support building test .deb files
+# as part of routine SCons builds.  --SK
+BUILDDEB_OPTIONS=
+PYTHON=/usr/bin/python2.1
+#######
 
 # Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
+export DH_VERBOSE=1
 
 # This is the debhelper compatability version to use.
-# We expect this to be provided by the calling build script:
-export DH_COMPAT
-# Here's the previous/"normal" Debian value (?), but it breaks on a
-# converted Red Hat debhelper installation:
-#export DH_COMPAT=3
+export DH_COMPAT=2
 
-# This has to be exported to make some magic below work.
-export DH_OPTIONS
+configure: configure-stamp
+configure-stamp:
+	dh_testdir
+	# Add here commands to configure the package.
+	
 
-ifeq ($(ENVOKED_BY_CONSTRUCT),1)
-BUILDDEB_OPTIONS=--destdir=build/dist
-endif
+	touch configure-stamp
 
-build: build-stamp
+build: configure-stamp build-stamp
 build-stamp:
-ifneq ($(ENVOKED_BY_CONSTRUCT),1)
 	dh_testdir
-	cons
+	$(PYTHON) setup.py build
 	touch build-stamp
-endif
 
 clean:
 	dh_testdir
 	dh_testroot
-	rm -f build-stamp configure-stamp install-common-stamp
-	rm -rf build
-	find -name .construct -exec rm "{}" ";"
+	rm -f build-stamp configure-stamp
+	rm -rf build/
 	dh_clean
 
-install-common: install-common-stamp
-install-common-stamp: DH_OPTIONS=
-install-common-stamp:
+install: build
 	dh_testdir
 	dh_testroot
 	dh_clean -k
 	dh_installdirs
-	touch install-common-stamp
 
-install-scons: build install-common
-	python build/scons/setup.py install \
---install-scripts=`pwd`/debian/scons/usr/bin \
---install-purelib=`pwd`/debian/scons/usr/lib/scons --no-compile
-# Here's how we'd install the build engine in a version-specific directory.
-#--install-purelib=`pwd`/debian/scons/usr/lib/scons-$VERSION --no-compile
+	# Add here commands to install the package into debian/scons.
+	@########
+	@# The SCons project uses Aegis for development, which requires
+	@# that targets be removed explicitly before they're created.
+	@# (They could be symlinks to checked-in read-only copies in the
+	@# repository.)  We also can't assume that the proper directories
+	@# already exist on our non-Debian test build systems.  Hence,
+	@# we do a lot of mkdir -p and rm -f here...  --SK
+	@########
+	mkdir -p debian/scons/usr/lib/python2.1/site-packages/
+	rm -rf debian/scons/usr/lib/python2.1/site-packages/SCons
+	cp -r build/lib/SCons debian/scons/usr/lib/python2.1/site-packages/
 
-install-python-scons: build install-common
-	python build/python-scons/setup.py install \
---install-purelib=`pwd`/debian/python-scons/usr/lib/python1.5/site-packages --no-compile
+	mkdir -p debian/scons/usr/bin/
+	rm -f debian/scons/usr/bin/scons
+ifeq ($(PYTHON),python)
+	cp build/scripts/scons debian/scons/usr/bin/scons
+else
+	sed '1s|.*|#!/usr/bin/python2.1|' build/scripts/scons > debian/scons/usr/bin/scons
+endif
+	chmod +x debian/scons/usr/bin/scons
 
-install-python2-scons: build install-common
-	python build/python2-scons/setup.py install \
---install-purelib=`pwd`/debian/python2-scons/usr/lib/python2.0/site-packages --no-compile
+	mkdir -p debian/scons/usr/share/man/man1/
+	rm -f debian/scons/usr/share/man/man1/scons.1
+	cp scons.1 debian/scons/usr/share/man/man1/
 
-install-scons-script: build install-common
-	python build/scons-script/setup.py install \
---install-scripts=`pwd`/debian/scons/usr/bin --no-compile
+	mkdir -p debian/scons/usr/share/doc/scons
+	rm -f debian/scons/usr/share/doc/scons/changelog
+	rm -f debian/scons/usr/share/doc/scons/README.txt
+	rm -f debian/scons/usr/share/doc/scons/*.gz
+	rm -f debian/scons/usr/share/doc/scons/copyright
 
+	cp README.txt debian/scons/usr/share/doc/scons/
 
-# 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:
+	gzip -9 debian/scons/usr/share/doc/scons/*
+
+	cp debian/changelog debian/scons/usr/share/doc/scons/changelog
+
+	cp debian/copyright debian/scons/usr/share/doc/scons/
+
+# Build architecture-independent files here.
+binary-indep: build install
 	dh_testdir
 	dh_testroot
-	dh_installdocs
-	dh_installexamples
-	dh_installmanpages
+	#dh_installdocs
 	dh_installchangelogs 
+	dh_link
+	dh_strip
 	dh_compress
 	dh_fixperms
 	dh_installdeb
+	dh_shlibdeps
 	dh_gencontrol
 	dh_md5sums
-	dh_builddeb $(BUILDDEB_OPTIONS)
+	DH_COMPAT=$(DH_COMPAT) 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.
+# Build architecture-dependent files here.
 binary-arch: build install
 
-# Any other binary targets build just one binary package at a time.
-binary-scons: build install-scons
-	$(MAKE) ENVOKED_BY_CONSTRUCT=$(ENVOKED_BY_CONSTRUCT) -f debian/rules binary-common DH_OPTIONS=-pscons
-
-binary-python-scons: build install-python-scons
-	$(MAKE) ENVOKED_BY_CONSTRUCT=$(ENVOKED_BY_CONSTRUCT) -f debian/rules binary-common DH_OPTIONS=-ppython-scons
-
-binary-python2-scons: build install-python2-scons
-	$(MAKE) ENVOKED_BY_CONSTRUCT=$(ENVOKED_BY_CONSTRUCT) -f debian/rules binary-common DH_OPTIONS=-ppython2-scons
-
-binary-scons-script: build install-scons-script
-	$(MAKE) ENVOKED_BY_CONSTRUCT=$(ENVOKED_BY_CONSTRUCT) -f debian/rules binary-common DH_OPTIONS=-pscons-script
-
 binary: binary-indep binary-arch
-
-.PHONY: build clean binary-indep binary-arch binary install binary-scons binary-python-scons binary-python2-scons binary-scons-script install-scons install-python-scons install-python2-scons install-scons-script
-
-
+.PHONY: build clean binary-indep binary-arch binary install configure

debian/scons.postinst

-#! /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=scons
-DIRLIST="/usr/lib/scons-0.07"
-
-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

debian/scons.prerm

-#! /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=scons
-
-dpkg --listfiles $PACKAGE |
-	awk '$0~/\.py$/ {print $0"c\n" $0"o"}' |
-	xargs rm -f >&2
-
-#DEBHELPER#
         'zip'        : '',
     }
 
+    lib = {
+        'deb'        : os.path.join('python2.1', 'site-packages')
+    }
+
     if not dir.has_key(package):
         sys.stderr.write("Unknown package '%s'\n" % package)
         sys.exit(2)
         lib_dir = os.path.join(test_dir, dir[package])
     else:
         scons_dir = os.path.join(test_dir, dir[package], 'bin')
-        lib_dir = os.path.join(test_dir, dir[package], 'lib', 'scons')
+        l = lib.get(package, 'scons')
+        lib_dir = os.path.join(test_dir, dir[package], 'lib', l)
 
 else:
 
   - Fixed use of sys.path so Python modules can be imported from
     the SConscript directory.
 
+  From Moshe Zadka:
+  
+  - Changes for official Debian packaging.
+
 
 
 RELEASE 0.06 - Thu, 28 Mar 2002 01:24:29 -0600