[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

patch for debian/rules



Am Son, den 01.02.2004 schrieb Ian Murdock um 02:02:
> Hi Gaundenz,
> 
> Gaudenz Steinlin wrote:
> > Am Sam, den 31.01.2004 schrieb imurdock@progeny.com um 02:47:
> > 
> >>Author: imurdock
> >>Date: 2004-01-30 20:47:28 -0500 (Fri, 30 Jan 2004)
> >>New Revision: 4072
> >>
> >>Modified:
> >>   discover/discover/trunk/debian/changelog
> >>Log:
> >>Discover 2.0.2 released.
> > 
> > is there any place where this release can be downloaded? It's not on
> > http://archive.progeny.com/progeny/discover/ and the debian packages
> > there seem to be outdated.
> 
> It's currently sitting on a Progeny-internal machine waiting to be
> rsync'ed out to archive.p.c, which will hopefully happen sometime
> tonight or tomorrow. In the meantime, you can get to Discover 2.0.2 at
> http://hackers.progeny.com/~imurdock/archive.progeny.com/discover/.
> A source tarball is there, and there are now Debian packages as
> well. The packages will be uploaded to Debian shortly, though
> I'll leave it to one of the Debian experts here to make
> sure namespace issues are sorted out prior to the upload etc.
> 
> Discover 2.0.2 is mostly the same as the 2.0.1+cvs.2003.11.03
> snapshot we made available in November. This release is primarily
> intended to serve as a synchronization point for future development
> and collaboration with the d-i folks and other interested parties.
> We hope to do a 2.0.3 release in a few weeks that folds in some
> additional bug fixes we have in the works, and of course,
> we'd be happy to incorporate patches from the d-i team as well.

I send you the patch to debian/rules I currently have. I'm trying to
make a a working package of discover 2 which builds deb and udeb
versions.

Some comments for the patch:
- copied the pcmcia headers to a toplevel directory pcmcia in the
  source.
- introduced the variable UPACKAGE which contains the name of the 
  udeb package.
- build udeb with -Os
- separate the rule for building the udeb and deb packages to make 
  it easier to only build the udeb.

The patch to debian/rules is the most important change I made. I will
send you some other suggestions as soon as I find some time for it. 

These are the major problems the package still has:
- the libdiscover-dev packages does not include any headers. The 
  are not copied by the Makefile in lib.
- We do no longer need the libdiscover2-pic package as the udeb is 
  linked statically to libdiscover2.
- The package needs testing for upgrades and downgrades. I have to check
  if the startup script loads all the modules in the correct order. We
  had problems with this in discover1. If network cards are loaded in a 
  different order (because of sort -u) as in d-i then they change 
  their name.
- The API documentation is in libdiscover2. Doesn't this belong to 
  libdiscover-dev?

Gaudenz

--- discover-progeny/discover-2.0.2/debian/rules	2004-01-31 20:36:19.000000000 +0100
+++ discover-2.0.2/debian/rules	2004-01-31 18:30:42.426494816 +0100
@@ -1,6 +1,6 @@
 #!/usr/bin/make -f
 
-# $Progeny: rules 4023 2003-12-10 22:08:05Z branden $
+# $Progeny$
 
 # Copyright 2002 Hewlett-Packard Company
 # Copyright 2000, 2001, 2002 Progeny Linux Systems, Inc.
@@ -25,10 +25,10 @@
 
 export DH_COMPAT=3
 
-PACKAGE=$(shell dh_listpackages | grep -- -udeb$$)
+UPACKAGE=$(shell dh_listpackages | grep -- -udeb$$)
 VERSION=$(shell dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2)
 ARCH=$(shell dpkg --print-architecture)
-UFILENAME=$(PACKAGE)_$(VERSION)_$(ARCH).udeb
+UFILENAME=$(UPACKAGE)_$(VERSION)_$(ARCH).udeb
 
 # if $DEB_BUILD_OPTIONS *doesn't* contain "noopt"
 ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
@@ -38,25 +38,30 @@
 # Figure out where the kernel PCMCIA headers are, searching the
 # directories in order of modification time (most recent
 # first).
-PCMCIA_HEADERS:=$(shell \
-	for KDIR in $$(ls -dt /usr/src/kernel* /usr/src/linux* 2>/dev/null); \
-	  do \
-	    if [ -d $$KDIR ]; then \
-		for HFILE in $$(find $$KDIR -name version.h); do \
-		    if expr "$$HFILE" : ".*/pcmcia/version\.h" > \
-		      /dev/null 2>&1; then \
-			echo "$${HFILE%/pcmcia/version.h}"; \
-			break 2; \
-		    fi \
-		done \
-	    fi \
-	done)
+#PCMCIA_HEADERS:=$(shell \
+#	for KDIR in $$(ls -dt /usr/src/kernel* /usr/src/linux* 2>/dev/null); \
+#	  do \
+#	    if [ -d $$KDIR ]; then \
+#		for HFILE in $$(find $$KDIR -name version.h); do \
+#		    if expr "$$HFILE" : ".*/pcmcia/version\.h" > \
+#		      /dev/null 2>&1; then \
+#			echo "$${HFILE%/pcmcia/version.h}"; \
+#			break 2; \
+#		    fi \
+#		done \
+#	    fi \
+#	done)
 # if we found some, pass them to configure
+
+#PCMCIA headers are included in the package source
+PCMCIA_HEADERS:=".."
 ifneq ($(PCMCIA_HEADERS),)
 CONFIGURE_PCMCIA:=--with-pcmcia-headers=$(PCMCIA_HEADERS)
 endif
 
-RUN_CONFIGURE=	CFLAGS="-g $(OPTIMIZE)" ../configure $(CONFIGURE_PCMCIA) \
+CFLAGS_DEB=CFLAGS="-g $(OPTIMIZE)"
+CFLAGS_UDEB=CFLAGS="-g -Os" 
+RUN_CONFIGURE=  ../configure $(CONFIGURE_PCMCIA) \
 		--prefix=/usr \
 		--sbindir=/sbin \
 		--sysconfdir=/etc \
@@ -64,27 +69,43 @@
 		--mandir=\$${prefix}/share/man \
 		--infodir=\$${prefix}/share/info
 
-configure: configure-stamp
-configure-stamp:
+configure: configure-deb configure-udeb
+
+configure-deb: configure-deb-stamp
+configure-deb-stamp:
 	dh_testdir
 
 	mkdir builddeb
+	cd builddeb && $(CFLAGS_DEB) $(RUN_CONFIGURE)
+
+	touch $@
+
+configure-udeb: configure-udeb-stamp
+configure-udeb-stamp:
+	dh_testdir
+
 	mkdir buildudeb
-	cd builddeb && $(RUN_CONFIGURE)
-	cd buildudeb && CURL_CONFIG=false $(RUN_CONFIGURE) --disable-shared
+	cd buildudeb && CURL_CONFIG=false $(CFLAGS_UDEB) $(RUN_CONFIGURE) --disable-shared
 
 	touch $@
 
-build: configure-stamp build-stamp
-build-stamp:
+build: build-deb build-udeb
+#only build udeb for now
+#build: build-udeb
+
+build-deb: configure-deb-stamp build-deb-stamp
+build-deb-stamp:
 	dh_testdir
 
 	cd builddeb && $(MAKE)
-	cd buildudeb && $(MAKE)
 
-#	Should be doing this in lib/Makefile.in, preferably
-#	with libtool; this builds the pic library.
-	cd builddeb && ar cqv lib/libdiscover_pic.a lib/*.lo
+	touch $@
+
+build-udeb: configure-udeb-stamp build-udeb-stamp
+build-udeb-stamp:
+	dh_testdir
+
+	cd buildudeb && $(MAKE)
 
 	touch $@
 
@@ -92,14 +113,17 @@
 	dh_testdir
 	dh_testroot
 
-	rm -rf builddeb buildudeb build-stamp configure-stamp
+	rm -rf builddeb buildudeb build-deb-stamp build-udeb-stamp \
+	  configure-deb-stamp configure-udeb-stamp
 
 	dh_clean
 
-install: build
+install: install-deb install-udeb  build
+
+install-deb: build-deb
 	dh_testdir
 	dh_testroot
-	dh_clean -k
+#	dh_clean -k
 	dh_installdirs -v
 
 	cd builddeb && $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
@@ -107,52 +131,58 @@
 	rm -f $(CURDIR)/debian/tmp/etc/discover.conf.example
 	rm -f $(CURDIR)/debian/tmp/etc/discover-modprobe.conf.example
 
-#	libdiscover2-pic
-	mkdir -p debian/libdiscover2-pic/usr/lib
-	cp builddeb/lib/libdiscover_pic.a debian/libdiscover2-pic/usr/lib/
-
+install-udeb: build-udeb
 #	discover-udeb
-	cp buildudeb/discover/discover debian/discover-udeb/usr/bin
-	cp etc/discover.conf $(CURDIR)/debian/discover-udeb/etc
+	dh_testdir
+	dh_testroot
+#	dh_clean -k 
+	dh_installdirs -v -p$(UPACKAGE)
+
+	cp buildudeb/discover/discover debian/$(UPACKAGE)/usr/bin
+	cp etc/discover.conf $(CURDIR)/debian/$(UPACKAGE)/etc
 
 
 # Build architecture-dependent files here.
-binary-arch: build install discover-udeb
+binary-arch: build install discover-deb discover-udeb
+#Only build the udeb for now
+#binary-arch: build-udeb install-udeb discover-udeb
+
+discover-deb:
 	dh_testdir
 	dh_testroot
 	dh_movefiles
 
-	dh_installdocs
-	dh_installchangelogs
+	dh_installdocs -N$(UPACKAGE)
+	dh_installchangelogs -N$(UPACKAGE)
 #	XXX: dh_installinit appears to be busted :-P (see Debian #140881)
 #	dh_installinit -v --no-restart-on-upgrade --update-rcd-params="start 36 S ."
-	dh_strip -Ndiscover-udeb
-	dh_compress -Ndiscover-udeb
-	dh_fixperms -Ndiscover-udeb
-	dh_makeshlibs -Ndiscover-udeb
+	dh_strip -N$(UPACKAGE)
+	dh_compress -N$(UPACKAGE)
+	dh_fixperms -N$(UPACKAGE)
+	dh_makeshlibs -N$(UPACKAGE)
 #	dh_installdebconf
-	dh_installdeb -Ndiscover-udeb
-	dh_shlibdeps -ldebian/libdiscover2/usr/lib -Ndiscover-udeb
-	dh_gencontrol -Ndiscover-udeb
-	dh_md5sums -Ndiscover-udeb
-	dh_builddeb -Ndiscover-udeb
+	dh_installdeb -N$(UPACKAGE)
+	dh_shlibdeps -ldebian/libdiscover2/usr/lib -N$(UPACKAGE)
+	dh_gencontrol -N$(UPACKAGE)
+	dh_md5sums -N$(UPACKAGE)
+	dh_builddeb -N$(UPACKAGE)
 
-discover-udeb: build install
+discover-udeb: build-udeb install-udeb
 	dh_testdir
 	dh_testroot
 
-	dh_strip -pdiscover-udeb
-	dh_compress -pdiscover-udeb
-	dh_fixperms -pdiscover-udeb
+	dh_strip -p$(UPACKAGE)
+	dh_compress -p$(UPACKAGE)
+	dh_fixperms -p$(UPACKAGE)
 #	dh_makeshlibs
-	dh_installdeb -pdiscover-udeb  --filename=discover-udeb.udeb
-	rm -f debian/discover-udeb/DEBIAN/conffiles
-	dh_shlibdeps -ldebian/libdiscover1/usr/lib -pdiscover-udeb
+	dh_installdeb -p$(UPACKAGE)  --filename=$(UPACKAGE).udeb
+	rm -f debian/$(UPACKAGE)/DEBIAN/conffiles
+	dh_shlibdeps -ldebian/libdiscover1/usr/lib -p$(UPACKAGE)
 #	Don't write your stupid guesses to debian/files.
-	dh_gencontrol -pdiscover-udeb -- -fdebian/files~
+	dh_gencontrol -p$(UPACKAGE) -- -fdebian/files~
 #	Register file manually.
-	dpkg-distaddfile $(UFILENAME) debian-installer standard
-	dh_builddeb -pdiscover-udeb --filename=$(UFILENAME)
+	dpkg-distaddfile $(UFILENAME) debian-installer optional
+	dh_builddeb -p$(UPACKAGE) --filename=$(UFILENAME)
 
 binary: binary-arch
 .PHONY: build clean binary-arch binary install configure

Reply to: