Build a Debian source package
authorDavid Schleef <ds@schleef.org>
Mon, 11 Feb 2002 09:34:57 +0000 (09:34 +0000)
committerDavid Schleef <ds@schleef.org>
Mon, 11 Feb 2002 09:34:57 +0000 (09:34 +0000)
debian/changelog [new file with mode: 0644]
debian/comedi-source.postinst [new file with mode: 0644]
debian/comedi-source.prerm [new file with mode: 0644]
debian/control [new file with mode: 0644]
debian/copyright [new file with mode: 0644]
debian/genchanges.sh [new file with mode: 0644]
debian/rules [new file with mode: 0755]

diff --git a/debian/changelog b/debian/changelog
new file mode 100644 (file)
index 0000000..21e4560
--- /dev/null
@@ -0,0 +1,6 @@
+comedi (0.7.63-cvs20020210-1) unstable; urgency=low
+
+  * Initial Release.
+
+ -- David Schleef <ds@schleef.org>  Mon, 11 Feb 2002 00:08:02 -0800
+
diff --git a/debian/comedi-source.postinst b/debian/comedi-source.postinst
new file mode 100644 (file)
index 0000000..2506c87
--- /dev/null
@@ -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 (file)
index 0000000..e1d7f03
--- /dev/null
@@ -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 (file)
index 0000000..5990d16
--- /dev/null
@@ -0,0 +1,15 @@
+Source: comedi
+Priority: optional
+Maintainer: David Schleef <ds@schleef.org>
+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 (file)
index 0000000..dc71e82
--- /dev/null
@@ -0,0 +1,18 @@
+This package was debianized by David Schleef <ds@schleef.org> 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 <ds@schleef.org>.  Questions
+about Comedi should be addressed to the Comedi mailing list, 
+<comedi@stm.lbl.gov>
+
+Copyright:
+
+  GPL
+
diff --git a/debian/genchanges.sh b/debian/genchanges.sh
new file mode 100644 (file)
index 0000000..5199dfa
--- /dev/null
@@ -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 (executable)
index 0000000..0419eaf
--- /dev/null
@@ -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