Diff of /debian/rules [52d456] .. [7c5026] Maximize Restore

  Switch to side-by-side view

--- a/debian/rules
+++ b/debian/rules
@@ -1,75 +1,111 @@
 #!/usr/bin/make -f
-# Made with the aid of debmake, by Christoph Lameter,
-# based on the sample debian/rules file for GNU hello by Ian Jackson.
+# Sample debian/rules that uses debhelper.
+# GNU copyright 1997 to 1999 by Joey Hess.
 
-package=libdvdnav
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
 
-version=$(shell expr `pwd` : '.*-\([0-9.]*\)')
-version_major=$(shell expr `pwd` : '.*-\([0-9]*\).[0-9.]*')
+# This is the debhelper compatibility version to use.
+export DH_COMPAT=3
 
-build:
-	$(checkdir)
-	./configure --prefix=/usr
+# These are used for cross-compiling and for saving the configure script
+# from having to guess our platform (since we know it already)
+DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 
-	-mkdir shared static
-	#
-	# First build the shared library
-	#
-	cd shared ; \
-	    $(MAKE) -f ../Makefile VPATH=".." srcdir=".." \
-	        CFLAGS="-O2 -fPIC -pipe" ; \
-	    gcc -shared -Wl,-soname,$(package).so.$(version_major) -o $(package).so.$(version) `ls *.o`
-	#
-	# Build the static library (it does not need Position Independent Code,
-	# which reserves one register; thus, without -fPIC we get more efficient
-	# code).
-	#
-	cd static ; \
-	     $(MAKE) -f ../Makefile VPATH=".." srcdir=".." \
-	          CFLAGS="-O2 -pipe" LDFLAGS="-s" progs
-	touch build
+
+ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
+	CFLAGS += -g
+endif
+ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
+	INSTALL_PROGRAM += -s
+endif
+
+# shared library versions, option 1
+#version=2.0.5
+#major=2
+# option 2, assuming the library is created as src/.libs/libfoo.so.2.0.5 or so
+#version=`ls src/.libs/lib*.so.* | \
+# awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'`
+#major=`ls src/.libs/lib*.so.* | \
+# awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'`
+
+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 --enable-static
+
+
+build: build-stamp
+build-stamp:  config.status
+	dh_testdir
+
+	# Add here commands to compile the package.
+	$(MAKE)
+
+	touch build-stamp
 
 clean:
-	$(checkdir)
-	-rm -rf static shared
-	-rm -f build
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp 
+
+	# Add here commands to clean up after the build process.
 	-$(MAKE) distclean
-	-rm -f `find . -name "*~"`
-	-rm -rf debian/tmp `find debian/* -type d ! -name CVS` debian/files* core
-	-rm -f debian/*substvars
+	-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
 
-binary-indep: checkroot build
-	$(checkdir)
-# There are no architecture-independent files to be uploaded
-# generated by this package.  If there were any they would be
-# made here.
 
-binary-arch: checkroot build
-	$(checkdir)
-	-rm -rf debian/tmp `find debian/* -type d ! -name CVS`
-	install -d debian/tmp
-	cd debian/tmp && install -d `cat ../dirs`
-	install -m644 static/$(package).a debian/tmp/usr/lib/
-	install -m644 static/gdbm.h dbm.h ndbm.h debian/tmp/usr/include/
-	install -m644 gdbm.3 debian/tmp/usr/share/man/man3/gdbm.3gdbm
+	dh_clean
 
-	install -m644 shared/$(package).so.$(version) debian/tmp/usr/lib
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k
+	dh_installdirs
 
-	$(MAKE) install prefix=`pwd`/debian/tmp/usr
-	debstd -m ChangeLog NEWS README 
-	dpkg-gencontrol -isp -plibdvdnav1-dev
-	chown -R root.root debian/tmp
-	chmod -R go=rX debian/tmp
-	dpkg --build debian/tmp ..
+	# Add here commands to install the package into debian/tmp
+	$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
 
-define checkdir
-	test -f debian/rules
-endef
+
+# 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
+	dh_testdir
+	dh_testroot
+	dh_movefiles
+
+#	dh_installdebconf	
+	dh_installdocs
+	dh_installexamples
+#	dh_installmenu
+#	dh_installlogrotate
+#	dh_installemacsen
+#	dh_installpam
+#	dh_installmime
+#	dh_installinit
+#	dh_installcron
+#	dh_installman
+#	dh_installinfo
+#	dh_undocumented
+	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: binary-indep binary-arch
-
-checkroot:
-	$(checkdir)
-	test root = "`whoami`"
-
-.PHONY: binary binary-arch binary-indep clean checkroot
+.PHONY: build clean binary-indep binary-arch binary install