Added first version of debian packaging files.
authorRoland Bauerschmidt <rb@debian.org>
Mon, 8 Apr 2002 08:49:42 +0000 (08:49 +0000)
committerRoland Bauerschmidt <rb@debian.org>
Mon, 8 Apr 2002 08:49:42 +0000 (08:49 +0000)
29 files changed:
debian/README.Debian [new file with mode: 0644]
debian/changelog [new file with mode: 0644]
debian/control [new file with mode: 0644]
debian/copyright [new file with mode: 0644]
debian/dirs [new file with mode: 0644]
debian/docs [new file with mode: 0644]
debian/fuse-module.control [new file with mode: 0644]
debian/fuse-module.postinst [new file with mode: 0644]
debian/fuse-module.prerm [new file with mode: 0644]
debian/fuse-perl.dirs [new file with mode: 0644]
debian/fuse-perl.examples [new file with mode: 0644]
debian/fuse-perl.files [new file with mode: 0644]
debian/fuse-python.dirs [new file with mode: 0644]
debian/fuse-python.examples [new file with mode: 0644]
debian/fuse-python.files [new file with mode: 0644]
debian/fuse-python.postinst [new file with mode: 0644]
debian/fuse-python.prerm [new file with mode: 0644]
debian/fuse-source.dirs [new file with mode: 0644]
debian/fuse-source.files [new file with mode: 0644]
debian/fuse-utils.dirs [new file with mode: 0644]
debian/fuse-utils.files [new file with mode: 0644]
debian/fuse.control [new file with mode: 0644]
debian/genchanges.sh [new file with mode: 0644]
debian/libfuse-dev.dirs [new file with mode: 0644]
debian/libfuse-dev.examples [new file with mode: 0644]
debian/libfuse-dev.files [new file with mode: 0644]
debian/rules [new file with mode: 0755]
debian/setvers.sh [new file with mode: 0644]
debian/source.control [new file with mode: 0644]

diff --git a/debian/README.Debian b/debian/README.Debian
new file mode 100644 (file)
index 0000000..9282c8c
--- /dev/null
@@ -0,0 +1,11 @@
+fuse for Debian
+---------------
+
+To be able to use fuse, you need to install the appropriate fuse-module
+package for your kernel version. For a self-compiled kernel, install
+fuse-source, unpack the tarball /usr/src/fuse.tar, and run
+make-kpkg modules from your kernel source tree. You should end up having
+a fuse-module package in /usr/src/modules which you need to install with
+dpkg -i fuse-module-...deb.
+
+ -- Roland Bauerschmidt <rb@debian.org>, Fri,  5 Apr 2002 16:56:10 +0200
diff --git a/debian/changelog b/debian/changelog
new file mode 100644 (file)
index 0000000..f40ef58
--- /dev/null
@@ -0,0 +1,8 @@
+fuse (0.95-1) unstable; urgency=low
+
+  * Initial Release.
+  * Adapted lots of stuff from the pcmcia-cs package to build module
+    packages properly.
+
+ -- Roland Bauerschmidt <rb@debian.org>  Sun,  7 Apr 2002 19:56:20 +0200
+
diff --git a/debian/control b/debian/control
new file mode 100644 (file)
index 0000000..5fd9235
--- /dev/null
@@ -0,0 +1,62 @@
+Source: fuse
+Section: utils
+Priority: optional
+Maintainer: Roland Bauerschmidt <rb@debian.org>
+Build-Depends: debhelper (>> 3.0.0), automake, autoconf, python2.1-dev, perl
+Standards-Version: 3.5.6.1
+
+Package: libfuse-dev
+Section: devel
+Architecture: any
+Suggests: fuse-utils (= ${Source-Version}), fuse-module
+Description: Filesystem in USErspace (development files)
+ Simple interface for userspace programs to export a virtual
+ filesystem to the linux kernel.
+ .
+ This package contains the files necessary to write applications in C
+ or C++ using fuse.
+
+Package: fuse-utils
+Section: utils
+Architecture: any
+Depends: ${shlibs:Depends}
+Suggests: fuse-module
+Description: Filesystem in USErspace (utilities)
+ Simple interface for userspace programs to export a virtual
+ filesystem to the linux kernel.
+ .
+ This package contains the fusermount utility which is necessary to
+ mount fuse filesystems.
+
+Package: fuse-source
+Section: utils
+Architecture: all
+Depends: make, gcc | c-compiler
+Recommends: dpkg-dev, kernel-package
+Suggests: devscripts
+Description: Filesystem in USErspace (source for kernel module)
+ Simple interface for userspace programs to export a virtual
+ filesystem to the linux kernel. 
+ .
+ This package contains the source code for the fuse module. It is
+ required to use fuse with a self-compiled kernel.
+
+Package: fuse-python
+Section: utils
+Architecture: any
+Depends: ${shlibs:Depends}, python (>= 2.2), fuse-utils (= ${Source-Version})
+Description: Filesystem in USErspace (python bindings)
+ Simple interface for userspace programs to export a virtual
+ filesystem to the linux kernel. 
+ .
+ This package contains the python bindings for fuse.
+
+Package: fuse-perl
+Section: utils
+Architecture: any
+Depends: ${shlibs:Depends}, ${perl:Depends}, fuse-utils (= ${Source-Version})
+Description: Filesystem in USErspace (perl bindings)
+ Simple interface for userspace programs to export a virtual
+ filesystem to the linux kernel.
+ .
+ This package contains the perl bindings for fuse.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644 (file)
index 0000000..38907bb
--- /dev/null
@@ -0,0 +1,11 @@
+This package was debianized by Roland Bauerschmidt <rb@debian.org> on
+Fri,  5 Apr 2002 16:56:10 +0200.
+
+It was downloaded from http://sourceforge.net/projects/avf/
+
+Upstream Authors: Miklos Szeredi <mszeredi@inf.bme.hu> (core)
+                  Jeff Epler <jepler@unpythonic.dhs.org> (Python bindings)
+                 Mark Glines <mark@glines.org> (Perl bindings)
+
+FUSE is licensed under the terms of the GPL. On Debian systems, the full
+text can be found in /usr/share/common-licenses/GPL.
diff --git a/debian/dirs b/debian/dirs
new file mode 100644 (file)
index 0000000..ca882bb
--- /dev/null
@@ -0,0 +1,2 @@
+usr/bin
+usr/sbin
diff --git a/debian/docs b/debian/docs
new file mode 100644 (file)
index 0000000..b5c7362
--- /dev/null
@@ -0,0 +1,4 @@
+BUGS
+NEWS
+README
+TODO
diff --git a/debian/fuse-module.control b/debian/fuse-module.control
new file mode 100644 (file)
index 0000000..805efd1
--- /dev/null
@@ -0,0 +1,10 @@
+Package: fuse-module-${kvers}
+Section: misc
+Architecture: any
+Provides: fule-module
+Depends: kernel-image-${kvers} (= ${kversdeb})
+Recommends: fuse-utils
+Description: Filesystem in USErspace (kernel module)
+ Simple interface for userspace programs to export a virtual
+ filesystem to the linux kernel. 
+
diff --git a/debian/fuse-module.postinst b/debian/fuse-module.postinst
new file mode 100644 (file)
index 0000000..74d4e93
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh -e
+
+if [ "$1" = "configure" -a "`uname -r`" = "${kvers}" ]; then
+       depmod -a || true
+fi
+
+#DEBHELPER#
diff --git a/debian/fuse-module.prerm b/debian/fuse-module.prerm
new file mode 100644 (file)
index 0000000..e745f4d
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh -e
+
+if [ "`uname -r`" = "${kvers}" ]; then
+       depmod -a || true
+fi
+
+#DEBHELPER#
diff --git a/debian/fuse-perl.dirs b/debian/fuse-perl.dirs
new file mode 100644 (file)
index 0000000..0d0f0f6
--- /dev/null
@@ -0,0 +1,2 @@
+usr/lib/perl5
+usr/share/man/man3
diff --git a/debian/fuse-perl.examples b/debian/fuse-perl.examples
new file mode 100644 (file)
index 0000000..083b9bf
--- /dev/null
@@ -0,0 +1,2 @@
+perl/example.pl
+perl/loopback.pl
diff --git a/debian/fuse-perl.files b/debian/fuse-perl.files
new file mode 100644 (file)
index 0000000..a3d3dd6
--- /dev/null
@@ -0,0 +1,2 @@
+usr/lib/perl5
+usr/share/man/man3/Fuse.3pm
diff --git a/debian/fuse-python.dirs b/debian/fuse-python.dirs
new file mode 100644 (file)
index 0000000..d8db3b9
--- /dev/null
@@ -0,0 +1 @@
+usr/lib/site-python
diff --git a/debian/fuse-python.examples b/debian/fuse-python.examples
new file mode 100644 (file)
index 0000000..1df4484
--- /dev/null
@@ -0,0 +1 @@
+python/xmp.py
diff --git a/debian/fuse-python.files b/debian/fuse-python.files
new file mode 100644 (file)
index 0000000..715883e
--- /dev/null
@@ -0,0 +1 @@
+usr/lib/site-python/*
diff --git a/debian/fuse-python.postinst b/debian/fuse-python.postinst
new file mode 100644 (file)
index 0000000..8afbe69
--- /dev/null
@@ -0,0 +1,31 @@
+#! /bin/sh -e
+#
+# postinst script for Debian python packages.
+# Written 1998 by Gregor Hoffleit <flight@debian.org>.
+# Modified 2001 by Matthias Klose <doko@debian.org>
+
+PACKAGE=`basename $0 .postinst`
+PV=`dpkg --listfiles $PACKAGE | sed -n -e '/^\/usr\/lib\/python.*\//{
+  s,/usr/lib/python\([0-9][0-9.]*\)/.*,\1,p
+  q
+}'`
+PYTHON=python$PV
+DIRLIST="/usr/lib/python$PV/site-packages/extension"
+
+case "$1" in
+    configure|abort-upgrade|abort-remove|abort-deconfigure)
+        for i in $DIRLIST ; do
+            /usr/bin/$PYTHON -O /usr/lib/python$PV/compileall.py -q $i
+            /usr/bin/$PYTHON /usr/lib/python$PV/compileall.py -q $i
+        done
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/fuse-python.prerm b/debian/fuse-python.prerm
new file mode 100644 (file)
index 0000000..c81d33b
--- /dev/null
@@ -0,0 +1,13 @@
+#! /bin/sh -e
+#
+# sample prerm script for Debian python packages.
+# Written 1998 by Gregor Hoffleit <flight@debian.org>.
+#
+
+PACKAGE=`basename $0 .prerm`
+
+dpkg --listfiles $PACKAGE |
+       awk '$0~/\.py$/ {print $0"c\n" $0"o"}' |
+       xargs rm -f >&2
+
+#DEBHELPER#
diff --git a/debian/fuse-source.dirs b/debian/fuse-source.dirs
new file mode 100644 (file)
index 0000000..b601f22
--- /dev/null
@@ -0,0 +1 @@
+usr/src
diff --git a/debian/fuse-source.files b/debian/fuse-source.files
new file mode 100644 (file)
index 0000000..132681b
--- /dev/null
@@ -0,0 +1 @@
+usr/src/*
diff --git a/debian/fuse-utils.dirs b/debian/fuse-utils.dirs
new file mode 100644 (file)
index 0000000..e772481
--- /dev/null
@@ -0,0 +1 @@
+usr/bin
diff --git a/debian/fuse-utils.files b/debian/fuse-utils.files
new file mode 100644 (file)
index 0000000..1df36c6
--- /dev/null
@@ -0,0 +1 @@
+usr/bin/*
diff --git a/debian/fuse.control b/debian/fuse.control
new file mode 100644 (file)
index 0000000..de6a8e1
--- /dev/null
@@ -0,0 +1,42 @@
+Package: libfuse-dev
+Section: devel
+Architecture: any
+Suggests: fuse-utils (= ${Source-Version}), fuse-module
+Description: Filesystem in USErspace (development files)
+ Simple interface for userspace programs to export a virtual
+ filesystem to the linux kernel. 
+
+Package: fuse-utils
+Section: utils
+Architecture: any
+Depends: ${shlibs:Depends}
+Suggests: fuse-module
+Description: Filesystem in USErspace (utilities)
+ Simple interface for userspace programs to export a virtual
+ filesystem to the linux kernel. 
+
+Package: fuse-source
+Section: utils
+Architecture: all
+Depends: make, gcc | c-compiler
+Recommends: dpkg-dev, kernel-package
+Suggests: devscripts
+Description: Filesystem in USErspace (source for kernel module)
+ Simple interface for userspace programs to export a virtual
+ filesystem to the linux kernel. 
+
+Package: fuse-python
+Section: utils
+Architecture: any
+Depends: ${shlibs:Depends}, python (>= 2.2), fuse-utils (= ${Source-Version})
+Description: Filesystem in USErspace (python bindings)
+ Simple interface for userspace programs to export a virtual
+ filesystem to the linux kernel. 
+
+Package: fuse-perl
+Section: utils
+Architecture: any
+Depends: ${shlibs:Depends}, ${perl:Depends}, fuse-utils (= ${Source-Version})
+Description: Filesystem in USErspace (perl bindings)
+ Simple interface for userspace programs to export a virtual
+ filesystem to the linux kernel.
diff --git a/debian/genchanges.sh b/debian/genchanges.sh
new file mode 100644 (file)
index 0000000..4d8eb20
--- /dev/null
@@ -0,0 +1,43 @@
+#!/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`
+
+{ head -2 debian/changelog
+  echo "  * Built for kernel-image-${KVERS}."
+  echo
+  sed -ne '/^ -- / { p; q; }' debian/changelog
+} > debian/changelog.tmp
+
+# 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
+    
+# the changes file's name
+chfile="$KSRC/../fuse-module-${KVERS}_${MODVERS}_${ARCH}.changes"
+
+dpkg-genchanges -b ${maint:+-e"$maint"} -u"$KSRC/.." \
+       -ldebian/changelog.tmp \
+       -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 debian/changelog.tmp
+rm "$chfile.pt"
diff --git a/debian/libfuse-dev.dirs b/debian/libfuse-dev.dirs
new file mode 100644 (file)
index 0000000..4418816
--- /dev/null
@@ -0,0 +1,2 @@
+usr/lib
+usr/include
diff --git a/debian/libfuse-dev.examples b/debian/libfuse-dev.examples
new file mode 100644 (file)
index 0000000..9579334
--- /dev/null
@@ -0,0 +1,3 @@
+example/hello.c
+example/null.c
+example/fusexmp.c
diff --git a/debian/libfuse-dev.files b/debian/libfuse-dev.files
new file mode 100644 (file)
index 0000000..d1bffed
--- /dev/null
@@ -0,0 +1,3 @@
+usr/include/*
+usr/lib/lib*.a
+usr/lib/lib*.so
diff --git a/debian/rules b/debian/rules
new file mode 100755 (executable)
index 0000000..73cfe68
--- /dev/null
@@ -0,0 +1,189 @@
+#!/usr/bin/make -f
+# Sample debian/rules that uses debhelper.
+# GNU copyright 1997 to 1999 by Joey Hess.
+
+#export DH_VERBOSE=1
+export DH_COMPAT=3
+
+DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+
+KSRC ?= /usr/src/linux
+MOD_DIR ?= '.'
+
+ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
+       CFLAGS += -g
+endif
+ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
+       INSTALL_PROGRAM += -s
+endif
+ifndef PERL
+PERL=/usr/bin/perl
+endif
+
+
+build: build-stamp
+build-stamp:
+       $(checkdir)
+
+       ./makeconf.sh
+       ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --disable-kernel-module --disable-example
+       $(MAKE)
+       
+       (cd perl; $(PERL) Makefile.PL INSTALLDIRS=vendor)
+       $(MAKE) -C perl
+
+       touch build-stamp
+
+clean: kdist_clean
+       $(checkdir)
+       $(checkroot)
+       rm -f build-stamp
+
+       -$(MAKE) distclean
+       -test -r /usr/share/misc/config.sub && \
+         cp -f /usr/share/misc/config.sub config.sub
+       -test -r /usr/share/misc/config.guess && \
+         cp -f /usr/share/misc/config.guess config.guess
+
+       -$(MAKE) -C perl distclean
+       
+       find -name '*.o' -o -name '*.so' -o -name fusermount -type f -o \
+               -name 'Makefile' | xargs rm -f
+
+       rm -f debian/control
+       cat debian/source.control debian/fuse.control > debian/control
+       
+       dh_clean
+
+clean-modules:
+       $(checkdir)
+       $(checkroot)
+       rm -f build-modules-stamp
+       rm -rf debian/fuse-module-*
+       rm -f debian/KVERS debian/MODVERS debian/control.tmp
+
+       -$(MAKE) distclean
+
+       dh_clean
+       
+install: build
+       $(checkdir)
+       $(checkroot)
+
+       dh_clean -k
+       dh_installdirs
+
+       $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
+
+       # python bindings
+       install -d $(CURDIR)/debian/tmp/usr/lib/site-python
+       install -m 0644 python/_fusemodule.so python/fuse.py \
+               $(CURDIR)/debian/tmp/usr/lib/site-python
+
+       # perl bindings
+       $(MAKE) -C perl install PREFIX=$(CURDIR)/debian/tmp/usr
+       find $(CURDIR)/debian/tmp/usr/lib -name '*.pl' | xargs rm -f
+
+       # -source package
+       find . \( -name \*.o -path ./debian/tmp \) -prune -o -print | \
+               cpio -admp debian/tmp/usr/src/modules/fuse
+       cd debian/tmp/usr/src/modules/fuse && \
+               $(MAKE) -f debian/rules clean
+       cd debian/tmp/usr/src && \
+               tar cf fuse.tar modules && \
+               rm -r modules
+       gzip -9 debian/tmp/usr/src/fuse.tar
+
+build-modules: build-modules-stamp
+build-modules-stamp:
+       $(checkdir)
+
+       ./makeconf.sh
+       ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --disable-lib --disable-util --disable-example --disable-python --with-kernel=$(KSRC)
+
+       $(MAKE)
+
+       touch build-modules-stamp
+
+install-modules: build-modules
+       $(checkdir)
+       $(checkroot)
+
+       install -d $(CURDIR)/debian/fuse-module-$(KVERS)/lib/modules/$(KVERS)/kernel/fs/fuse
+       install -m 0644 kernel/fuse.o $(CURDIR)/debian/fuse-module-$(KVERS)/lib/modules/$(KVERS)/kernel/fs/fuse/fuse.o
+
+binary-fuse: build install
+       $(checkdir)
+       $(checkroot)
+       dh_movefiles
+       find debian/ -type d | xargs rmdir --ignore-fail-on-non-empty -p
+
+       dh_installdocs
+       dh_installexamples
+       dh_installchangelogs ChangeLog
+       dh_link
+       dh_strip
+       dh_compress
+       dh_fixperms
+       dh_makeshlibs
+       dh_installdeb
+       dh_perl
+       dh_shlibdeps
+       dh_gencontrol
+       dh_md5sums
+       dh_builddeb
+
+binary-modules: build-modules install-modules
+       $(checkdir)
+       $(checkroot)
+
+       KSRC="$(KSRC)" KVERS="$(KVERS)" KDREV="$(KDREV)" sh -v debian/setvers.sh
+       DH_OPTIONS="-pfuse-module-$(KVERS)"
+
+       dh_installdocs $(DH_OPTIONS)
+       dh_installexamples $(DH_OPTIONS)
+       dh_installchangelogs ChangeLog $(DH_OPTIONS)
+       dh_strip $(DH_OPTIONS)
+       dh_compress $(DH_OPTIONS)
+       dh_fixperms $(DH_OPTIONS)
+       dh_md5sums $(DH_OPTIONS)
+       dh_builddeb --destdir=$(MOD_DIR)/.. -pfuse-module-$(KVERS)
+
+binary-arch: binary-fuse
+       $(checkdir)
+       $(checkroot)
+       set -e; KPATH=$(KPATH); \
+       if [ "$$KPATH" ]; then \
+               for k in `IFS=':'; echo $$KPATH`; do \
+                       test ! -d $$d || \
+                       $(MAKE) -f debian/rules KSRC="$$k" clean-modules binary-modules; \
+               done; \
+       fi
+
+binary: binary-arch
+
+kdist_clean: clean-modules
+
+kdist_image:
+       $(checkdir)
+       $(checkroot)
+       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: kdist_image
+       KSRC="$(KSRC)" KMAINT="$(KMAINT)" KEMAIL="$(KEMAIL)" \
+               sh -v debian/genchanges.sh
+
+define checkdir
+       test -f debian/rules -a -f debian/changelog
+endef
+
+define checkroot
+       test root = "`whoami`"
+endef
+
+.PHONY: build clean binary-indep binary-arch binary install 
diff --git a/debian/setvers.sh b/debian/setvers.sh
new file mode 100644 (file)
index 0000000..303b04f
--- /dev/null
@@ -0,0 +1,113 @@
+#!/bin/sh
+
+# setvers.sh - extract version numbers from the changelog and kernel
+#      source and build the control file and prerm script for the
+#      pcmcia-modules package
+
+# KSRC is expected to be passed through the environment
+
+# adapted for fuse by Roland Bauerschmidt <rb@debian.org>
+
+set -e
+umask 022
+
+# define some sed scripts for extracting the upstream version number
+# and Debian revision number from a Debian changelog
+up_vers_sed='
+       1{
+         s/^[^(]*(//
+         s/)[^)]*$//
+         /-[A-Za-z0-9.+]*$/{
+           s///
+           b enddeb
+         }
+         /-/q
+         :enddeb
+         /^[A-Za-z0-9.+:-]\{1,\}$/p
+         q
+       }'
+fuse_vers_sed='
+       /AM_INIT_AUTOMAKE(fuse, \([.0-9]*\))/{
+         s//\1/p
+         q
+       }'
+deb_rev_sed='
+       1{
+         s/^[^(]*(//
+         s/)[^)]*$//
+         s/^.*-\([A-Za-z0-9.+]*\)$/\1/p
+         q
+       }'
+test "$KVERS" || \
+       KVERS=`sed -ne '/UTS_RELEASE=/{
+                        s///
+                        p
+                        q
+                       }' config.mk`
+
+# extract the upstream version number and debian revision number
+UPVERS=`sed -ne "$fuse_vers_sed" configure.in`
+DEBREV=`sed -ne "$deb_rev_sed" debian/changelog`
+NEXTVERS=${UPVERS%.*}.`expr ${UPVERS##*.} + 1`
+
+# determine the version numbers for the kernel source
+# use a Debian changelog if it exists, otherwise use the kernel version
+# number determined by the PCMCIA configure script
+if [ "$KDREV" ]; then
+       case "$KDREV" in
+       *-*)    KDEBREV=${KDREV##*-} ;;
+       *)      KDEBREV="" ;;
+       esac
+       KVERSDEB=${KDREV%-*}
+elif test -r "$KSRC/debian/changelog"; then
+       KDEBREV=`sed -ne "$deb_rev_sed" "$KSRC/debian/changelog"`
+       KVERSDEB=`sed -ne "$up_vers_sed" "$KSRC/debian/changelog"`
+else
+       KDEBREV=""
+       KVERSDEB="$KVERS"
+fi
+
+# remove the epoch number (if any)
+KVERSDEBNE="${KVERSDEB##*:}"
+
+# test whether we have successfully determined the version numbers
+test "$KVERS" -a "$UPVERS" -a "$DEBREV" || exit 1
+
+echo "$KVERS" > debian/KVERS
+if [ "${KVERS%%-*}" = "$KVERSDEBNE" ]; then
+       MODVERS="$UPVERS-${DEBREV}${KDEBREV:+k$KDEBREV}"
+else
+       MODVERS="$UPVERS-${DEBREV}+"`echo "$KVERSDEBNE" | tr - +`${KDEBREV:+"+$KDEBREV"}
+fi
+echo "$MODVERS" > debian/MODVERS
+
+# Generate a correct control file and prerm script for the modules package
+#for script in preinst postinst prerm config templates; do
+#    sed -e 's/\${kvers}/'"$KVERS"'/g
+#       s/\${kversdeb}/'"$KVERSDEB"'/g' \
+#      debian/pcmcia-modules.$script.in > debian/tmp-modules/DEBIAN/$script
+#    chmod +x debian/tmp-modules/DEBIAN/$script
+#done
+
+cat debian/source.control > debian/control.tmp
+filter='s/\${kvers}/'"$KVERS"'/g
+       s/\${kversdeb}/'"$KVERSDEB${KDEBREV:+-$KDEBREV}"'/g'
+if ! [ "${KVERS%%-*}" = "$KVERSDEBNE" -a "$KDEBREV" ]; then
+    filter="$filter"'
+       s/Depends: kernel-image[^)]*),/Depends:/'
+fi
+sed -e "$filter" debian/fuse-module.control | \
+    tee -a debian/control >> debian/control.tmp
+
+mkdir -p debian/fuse-module-$KVERS/DEBIAN
+dpkg-gencontrol        -isp -v"$MODVERS" \
+       -Vcurvers="$UPVERS" -Vnextvers="$NEXTVERS" \
+       -p"fuse-module-$KVERS" -Pdebian/fuse-module-$KVERS \
+       -cdebian/control.tmp
+
+for i in postinst prerm; do
+       sed -e "$filter" debian/fuse-module.$i > \
+               debian/fuse-module-$KVERS.$i
+done
+
+exit 0
diff --git a/debian/source.control b/debian/source.control
new file mode 100644 (file)
index 0000000..b4db41d
--- /dev/null
@@ -0,0 +1,6 @@
+Source: fuse
+Priority: optional
+Maintainer: Roland Bauerschmidt <rb@debian.org>
+Build-Depends: debhelper (>> 3.0.0), automake, autoconf, python2.1-dev, perl
+Standards-Version: 3.5.6.1
+