From 7b1cae9eeafb58b2e9ca522deeca6c45bfe548d6 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Mon, 11 Feb 2002 09:34:57 +0000 Subject: [PATCH] Build a Debian source package --- debian/changelog | 6 ++ debian/comedi-source.postinst | 7 +++ debian/comedi-source.prerm | 5 ++ debian/control | 15 +++++ debian/copyright | 18 ++++++ debian/genchanges.sh | 37 ++++++++++++ debian/rules | 102 ++++++++++++++++++++++++++++++++++ 7 files changed, 190 insertions(+) create mode 100644 debian/changelog create mode 100644 debian/comedi-source.postinst create mode 100644 debian/comedi-source.prerm create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/genchanges.sh create mode 100755 debian/rules diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 00000000..21e4560a --- /dev/null +++ b/debian/changelog @@ -0,0 +1,6 @@ +comedi (0.7.63-cvs20020210-1) unstable; urgency=low + + * Initial Release. + + -- David Schleef Mon, 11 Feb 2002 00:08:02 -0800 + diff --git a/debian/comedi-source.postinst b/debian/comedi-source.postinst new file mode 100644 index 00000000..2506c87b --- /dev/null +++ b/debian/comedi-source.postinst @@ -0,0 +1,7 @@ +#!/bin/sh + +if [ "$1" = "configure" ]; then + if [ -d /usr/doc -a ! -e /usr/doc/comedi-source -a -d /usr/share/doc/comedi-source ]; then + ln -sf ../share/doc/comedi-source /usr/doc/comedi-source + fi +fi diff --git a/debian/comedi-source.prerm b/debian/comedi-source.prerm new file mode 100644 index 00000000..e1d7f03e --- /dev/null +++ b/debian/comedi-source.prerm @@ -0,0 +1,5 @@ +#!/bin/sh + +if [ \( "$1" = "upgrade" -o "$1" = "remove" \) -a -L /usr/doc/comedi-source ]; then + rm -f /usr/doc/comedi-source +fi diff --git a/debian/control b/debian/control new file mode 100644 index 00000000..5990d168 --- /dev/null +++ b/debian/control @@ -0,0 +1,15 @@ +Source: comedi +Priority: optional +Maintainer: David Schleef +Build-Depends: debhelper (>> 2.0.0) +Standards-Version: 3.5.6 + +Package: comedi-source +Section: admin +Architecture: all +Recommends: dpkg-dev, c-compiler, make +Suggests: kpkg-build +Description: Comedi source + This package provides the source code for Comedi. The kernel source + is required to compile these modules. + diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 00000000..dc71e82b --- /dev/null +++ b/debian/copyright @@ -0,0 +1,18 @@ +This package was debianized by David Schleef on +Mon, 11 Feb 2002 00:10:56 -0800. + + +Comedi releases can be found at ftp://stm.lbl.gov/pub/comedi. + +Comedi CVS is at + + :pserver:oss.lineo.com:/var/cvs + +The upstream maintainer is David Schleef . Questions +about Comedi should be addressed to the Comedi mailing list, + + +Copyright: + + GPL + diff --git a/debian/genchanges.sh b/debian/genchanges.sh new file mode 100644 index 00000000..5199dfae --- /dev/null +++ b/debian/genchanges.sh @@ -0,0 +1,37 @@ +#!/bin/sh +# genchanges.sh - generate a changes file for a deb file generated via +# the make-kpkg utility + +# KSRC KMAINT and KEMAIL are expected to be passed through the environment + +set -e +umask 022 + +KVERS=`cat debian/KVERS` +MODVERS=`cat debian/MODVERS` +ARCH=`dpkg --print-architecture` + +# determine the maintainer's name +for name in "$KMAINT" "$DEBFULLNAME" "$DEBNAME" +do test -n "$name" && break; done +for email in "$KEMAIL" "$DEBEMAIL" +do test -n "$email" && break; done +if [ "$name" -a "$email" ]; then maint="$name <$email>" +elif [ "$email" ]; then maint="$email" +else maint=""; fi + +dpkg-genchanges -b ${maint:+-e"$maint"} -u"$KSRC/.." \ + +# the changes file's name +chfile="$KSRC/../pcmcia-modules-${KVERS}_${MODVERS}_${ARCH}.changes" + +dpkg-genchanges -b ${KMAINT:+-e"$maint"} -u"$KSRC/.." \ + -cdebian/control.tmp > "$chfile.pt" +if test -e "${GNUPGHOME:-$HOME/.gnupg/secring.gpg}"; then + gpg -ast ${email:+-u"$email"} \ + --clearsign < "$chfile.pt" > "$chfile" +else + pgp -fast ${email:+-u"$email"} +clearsig=on \ + < "$chfile.pt" > "$chfile" +fi +rm "$chfile.pt" diff --git a/debian/rules b/debian/rules new file mode 100755 index 00000000..0419eaf3 --- /dev/null +++ b/debian/rules @@ -0,0 +1,102 @@ +#!/usr/bin/make -f +# Sample debian/rules that uses debhelper. +# GNU copyright 1997 by Joey Hess. +# +# This version is for a hypothetical package that builds an +# architecture-dependant package, as well as an architecture-independent +# package. + + +kdist_image: checkroot + $(RM) debian/files + for CONFLOC in ~/.kernel-pkg.conf /etc/kernel-pkg.conf; \ + do test -f $$CONFLOC && break; done; \ + $(MAKE) -f debian/rules \ + MOD_DIR=$(KSRC) CONFLOC=$$CONFLOC \ + clean-modules binary-modules + +kdist_changes: + +kdist_configure: + ./configure --linuxdir $(KSRC) + +kdist: kdist_image + KSRC="$(KSRC)" KMAINT="$(KMAINT)" KEMAIL="$(KEMAIL)" \ + sh -v debian/genchanges.sh + +kdist_clean clean: + $(MAKE) distclean + $(RM) -r debian/tmp debian/src debian/*~ \ + debian/files debian/control.tmp debian/substvars + +build: + +clean-modules: + -umask 022; $(MAKE) DEB_MOD=yes clean + $(RM) build-modules + +binary-modules: + $(RM) -r debian/tmp-modules + install -d debian/tmp-modules debian/tmp-modules/DEBIAN + KSRC="$(KSRC)" KVERS="$(KVERS)" KDREV="$(KDREV)" \ + sh -v debian/setvers.sh + cat debian/comedi.templates >>debian/tmp-modules/DEBIAN/templates + install -d "debian/tmp-modules/usr/share/doc/comedi-modules-$(kvers)" + install debian/comedi-modules.postrm debian/tmp-modules/DEBIAN/postrm + umask 022; $(MAKE) \ + DEB_MOD=yes PREFIX=`pwd`/debian/tmp-modules install + install -m644 debian/changelog \ + debian/tmp-modules/usr/share/doc/comedi-modules-$(kvers)/changelog.Debian + gzip -9v debian/tmp-modules/usr/share/doc/comedi-modules-*/* + install -m644 debian/copyright \ + debian/tmp-modules/usr/share/doc/comedi-modules-$(kvers)/copyright + cat COPYING \ + >> debian/tmp-modules/usr/share/doc/comedi-modules-$(kvers)/copyright + chown -R root.root debian/tmp-modules + chmod -R g-ws debian/tmp-modules + if test -d debian/tmp-modules/lib/modules; then \ + dpkg-deb --build debian/tmp-modules $(MOD_DIR)/..; fi + +binary-source: checkroot + $(RM) -r debian/src + install -d debian/src debian/src/DEBIAN + install debian/comedi-source.postinst debian/src/DEBIAN/postinst + install debian/comedi-source.prerm debian/src/DEBIAN/prerm + install -d debian/src/usr/src/modules/comedi + install -d debian/src/usr/share/doc/comedi-source + + find . \( -path ./debian/src -o -name 'tmp*' \) -prune -o -print | \ + cpio -admp debian/src/usr/src/modules/comedi + cd debian/src/usr/src/modules/comedi && \ + $(MAKE) -f debian/rules clean + chown -R root.src debian/src/usr/src + find debian/src -type d | xargs chmod 775 + find debian/src -type f -perm -100 | xargs chmod 775 + find debian/src -type f -not -perm -100 | xargs chmod 664 + cd debian/src/usr/src && \ + tar cf comedi.tar modules && \ + $(RM) -r modules + gzip -9 debian/src/usr/src/comedi.tar + install -m 644 README \ + debian/src/usr/share/doc/comedi-source/README + install -m 644 debian/changelog \ + debian/src/usr/share/doc/comedi-source/changelog.Debian + gzip -9v debian/src/usr/share/doc/comedi-source/* + install -m 644 debian/copyright \ + debian/src/usr/share/doc/comedi-source/copyright + + chown -R root.root debian/src + chmod -R g-ws debian/src + dpkg-gencontrol -pcomedi-source -Pdebian/src -isp + dpkg-deb --build debian/src .. + +binary-arch: + +binary-indep: binary-source + +checkroot: + test root = "`whoami`" + +binary: binary-indep + +.PHONY: build clean binary-indep binary-arch binary install configure -- 2.26.2