[PATCH]: libdetect for debian-installer
Package: libdetect0
Version: 0.9.72-4
Hi,
I'd like to use libdetect for debian-installer. To make that possible here's a
patch that makes libdetect generate a udeb (small, non-policy conforming
packages meant to be used in debian-installer).
Thanks,
David
diff -uwdar detect-0.9.72/debian/control detect-0.9.72-udeb/debian/control
--- detect-0.9.72/debian/control Tue Jan 2 10:15:19 2001
+++ detect-0.9.72-udeb/debian/control Sat Dec 30 17:56:57 2000
@@ -25,3 +25,12 @@
The following hardware can be detected: CPU, memory, disks,
partitions, ethernet cards, floppy drives, modems, mice, SCSI,
sound cards, and video cards.
+
+Package: libdetect0-udeb
+Section: libs
+Architecture: i386 alpha powerpc sparc
+Depends: ${shlibs:Depends}
+Description: Detect is a library for automatic hardware detection.
+ libdetect0-udeb is a minimal package used by the debian-installer.
+ This library package contains only the symbols needed to detect the hardware
+ that the debian-installer is interested in: ethernet cards.
diff -uwdar detect-0.9.72/debian/rules detect-0.9.72-udeb/debian/rules
--- detect-0.9.72/debian/rules Tue Jan 2 10:15:19 2001
+++ detect-0.9.72-udeb/debian/rules Tue Jan 2 21:30:27 2001
@@ -17,6 +17,9 @@
major=`ls src/.libs/lib*.so.* | \
awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'`
+topdir=$(shell pwd)
+udebbuild=$(topdir)
+
build: build-stamp
build-stamp:
dh_testdir
@@ -37,10 +40,24 @@
touch build-stamp
+UDEB_MAKE_VARS=libdetect_la_OBJECTS="ethernet.lo conv.lo modem.lo serial.lo utils.lo disk.lo cdrom.lo lst.lo" sbin_PROGRAMS= SUBDIRS= libdetect_la_LIBADD= libdetect_la_DEPENDENCIES=
+
+build-udeb: build-udeb-stamp
+build-udeb-stamp:
+ dh_testdir
+ [ -d $(udebbuild) ] || mkdir -p $(udebbuild)
+ chmod +x $(topdir)/autogen.sh
+ (cd $(udebbuild); \
+ $(topdir)/autogen.sh --with-kernel-source=/usr/src/kernel-headers-2.2.17 --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info)
+
+ (cd $(udebbuild)/src; $(MAKE) clean; $(MAKE) $(UDEB_MAKE_VARS) )
+ touch $@
+
+
clean:
dh_testdir
dh_testroot
- rm -f build-stamp
+ rm -f build-stamp build-udeb-stamp
# Add here commands to clean up after the build process.
-$(MAKE) distclean
@@ -57,13 +74,23 @@
# Add here commands to install the package into debian/tmp.
$(MAKE) install prefix=`pwd`/debian/tmp/usr
+install-udeb: build-udeb
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+ (cd $(udebbuild)/src; \
+ $(MAKE) install prefix=`pwd`/debian/libdetect0-udeb/usr $(UDEB_MAKE_VARS) )
+
# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.
# Build architecture-dependent files here.
-binary-arch: build install
+binary-arch: libdetect0 libdetect0-udeb
+
+libdetect0: build install
# dh_testversion
dh_testdir
dh_testroot
@@ -105,6 +132,38 @@
dh_gencontrol
dh_md5sums
dh_builddeb
+
+PACKAGE=libdetect0-udeb
+VERSION=$(shell dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2)
+ARCH=$(shell dpkg --print-architecture)
+FILENAME=$(PACKAGE)_$(VERSION)_$(ARCH).udeb
+PRIORITY=$(shell grep ^Priority: debian/control | cut -d ' ' -f 2)
+
+
+libdetect0-udeb: build-udeb install-udeb
+ mkdir -p debian/$@
+ @echo "Building $@"
+ dh_testdir
+ rm -rf debian/$@/usr/share/locale/ debian/$@/usr/share/man/ \
+ debian/$@/usr/lib/libdetect.a \
+ debian/$@/usr/lib/libdetect.la \
+ debian/$@/usr/sbin \
+ debian/$@/usr/sbin/detect debian/$@/usr/include/ \
+ dh_testroot
+ dh_installdirs
+ dh_strip -p$@
+ dh_compress -p$@
+ dh_fixperms -p$@
+ dh_installdeb -p$@
+ dh_shlibdeps -p$@
+ # Don't write your stupid guesses to debian/files.
+ dh_gencontrol -p$@ -- -fdebian/files~
+ # Register # file # manually.
+ dpkg-distaddfile $(FILENAME) debian-installer $(PRIORITY)
+ dh_md5sums -p$@
+ dh_builddeb -p$@ --filename=$(FILENAME)
+
+
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
Reply to: