Here's a new patch.  It's a bit cleaner, and it also makes use of --disable-nls
to make the udebs even smaller.

-- 
Robert Millan

My spam trap is [EMAIL PROTECTED]  Note: this address is only intended
for spam harvesters.  Writing to it will get you added to my black list.
diff -ur gnu-fdisk-0.9.4.old/debian/control gnu-fdisk-0.9.4/debian/control
--- gnu-fdisk-0.9.4.old/debian/control	2007-06-21 21:51:30.000000000 +0200
+++ gnu-fdisk-0.9.4/debian/control	2007-06-21 22:20:34.000000000 +0200
@@ -20,3 +20,17 @@
  .
  GNU fdisk also intend to be a valid replacement for mac-fdisk and FreeBSD
  fdisk.
+
+Package: gnu-fdisk-udeb
+XC-Package-Type: udeb
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Conflicts: fdisk-udeb
+Description: linux fdisk replacement based on libparted
+
+Package: gnu-cfdisk-udeb
+XC-Package-Type: udeb
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Conflicts: cfdisk-udeb
+Description: linux cfdisk replacement based on libparted
diff -ur gnu-fdisk-0.9.4.old/debian/rules gnu-fdisk-0.9.4/debian/rules
--- gnu-fdisk-0.9.4.old/debian/rules	2007-06-21 21:51:30.000000000 +0200
+++ gnu-fdisk-0.9.4/debian/rules	2007-06-22 08:39:25.000000000 +0200
@@ -6,6 +6,8 @@
 # dh-make output file, you may use that output file without restriction.
 # This special exception was added by Craig Small in version 0.37 of dh-make.
 
+SHELL = bash
+
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
@@ -25,30 +27,53 @@
 	CFLAGS += -O2
 endif
 
-config.status: configure
+CONFIGURE_FLAGS = --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --exec-prefix=/ --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info LDFLAGS="-Wl,-z,defs"
+
+build-deb/config.status: configure
 	dh_testdir
 	# Add here commands to configure the package.
-	./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --exec-prefix=/ --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info CFLAGS="$(CFLAGS)" LDFLAGS="-Wl,-z,defs"
+	mkdir -p build-deb
+	cd build-deb && $(CURDIR)/configure $(CONFIGURE_FLAGS) CFLAGS="$(CFLAGS)"
+
+build-udeb/config.status: configure
+	dh_testdir
+	# Add here commands to configure the package.
+	mkdir -p build-udeb
+	cd build-udeb && $(CURDIR)/configure $(CONFIGURE_FLAGS) CFLAGS="$(CFLAGS) -Os" --disable-nls
 
 configure: patch
 
-build: build-stamp
+build-deb: build-deb-stamp
+
+build-deb-stamp:  build-deb/config.status
+	dh_testdir
+
+	# Add here commands to compile the package.
+	$(MAKE) -C build-deb
+	#docbook-to-man debian/fdisk.sgml > fdisk.1
 
-build-stamp:  config.status
+	touch $@
+
+build-udeb: build-udeb-stamp
+
+build-udeb-stamp:  build-udeb/config.status
 	dh_testdir
 
 	# Add here commands to compile the package.
-	$(MAKE)
+	$(MAKE) -C build-udeb
 	#docbook-to-man debian/fdisk.sgml > fdisk.1
 
 	touch $@
 
+build: build-deb build-udeb
+
 clean: clean1 unpatch
 
 clean1:
 	dh_testdir
 	dh_testroot
-	rm -f build-stamp 
+	rm -f build-deb-stamp build-udeb-stamp
+	rm -rf build-deb build-udeb
 
 	# Add here commands to clean up after the build process.
 	-$(MAKE) distclean
@@ -69,7 +94,11 @@
 	dh_installdirs
 
 	# Add here commands to install the package into debian/fdisk.
-	$(MAKE) DESTDIR=$(CURDIR)/debian/gnu-fdisk install
+	$(MAKE) -C build-deb	DESTDIR=$(CURDIR)/debian/gnu-fdisk	install
+	mkdir -p $(CURDIR)/debian/gnu-{,c}fdisk-udeb/sbin
+	for i in fdisk cfdisk ; do \
+		install -s -m 755 build-udeb/src/$$i $(CURDIR)/debian/gnu-$$i-udeb/sbin/$$i ; \
+	done
 #	rm $(CURDIR)/debian/gnu-fdisk/sbin/lfdisk
 #	rm $(CURDIR)/debian/gnu-fdisk/sbin/gfdisk
 #	mv $(CURDIR)/debian/gnu-fdisk/usr/share/info/cfdisk.info \
@@ -102,4 +131,4 @@
 	dh_builddeb
 
 binary: binary-indep binary-arch
-.PHONY: build clean clean1 binary-indep binary-arch binary install 
+.PHONY: build build-deb build-udeb clean clean1 binary-indep binary-arch binary install 

Reply via email to