--- /dev/null
+#!/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"
--- /dev/null
+#!/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