[Pkg-ocaml-maint-commits] [SCM] mldonkey packaging branch, master, updated. debian/2.9.5-2-54-gf9ed93f

Mehdi Dogguy dogguy at pps.jussieu.fr
Thu Jan 22 18:57:38 UTC 2009


The following commit has been merged in the master branch:
commit 3aaac4e8577ee085e5388869c12be0aa571ec24b
Author: Mehdi Dogguy <dogguy at pps.jussieu.fr>
Date:   Thu Jan 22 19:31:27 2009 +0100

    Shorten debian/rules

diff --git a/debian/rules b/debian/rules
index e92bd1d..e528cc3 100755
--- a/debian/rules
+++ b/debian/rules
@@ -7,6 +7,7 @@
 # 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)
+DEB_BUILD_ARCH      ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
 
 ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
   confflags += --build $(DEB_HOST_GNU_TYPE)
@@ -15,6 +16,10 @@ else
 endif
 
 CFLAGS = -Wall -g
+ifeq ($(DEB_BUILD_ARCH),i386)
+CFLAGS += -msse2
+endif
+
 
 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
         CFLAGS += -O0
@@ -22,13 +27,12 @@ else
         CFLAGS += -O2
 endif
 
-# Include patch-speficic rules
-PACKAGE=mldonkey
 include /usr/share/dpatch/dpatch.make
 
 MANCHECK=mlnet mlgui mlguistarter
 OCAMLABI=$(shell ocamlc -version)
-
+IS_NATIVE:= $(wildcard /usr/bin/ocamlopt)
+TARGET   := $(if $(IS_NATIVE),opt,byte)
 
 doc-check: doc-check-stamp
 doc-check-stamp: build
@@ -49,6 +53,19 @@ clean-doc-check:
 	-cd debian/xml-man && $(RM) *.new *.diff
 	-$(RM) doc-check-stamp
 
+clean: unpatch clean-doc-check
+	dh clean
+# Update the PO, as suggested in "man 7 po-debconf"
+	debconf-updatepo
+# Add here commands to clean up after the build process.
+	$(MAKE) clean distclean
+	$(MAKE) -C debian/xml-man clean
+	$(MAKE) -C debian/utils clean
+	-$(RM) config/trying
+	-$(RM) packages/rpm/Makefile
+	-$(RM) *.ini *.ini.old
+	-$(RM) config/confdefs.h
+
 configure: configure-stamp
 configure-stamp:
 	dh_testdir
@@ -60,119 +77,42 @@ configure-stamp:
 	  --disable-fasttrack
 	touch configure-stamp
 
-build-arch: build-arch-stamp
-build-arch-stamp: configure-stamp
+build: build-stamp
+build-stamp: patch-stamp configure-stamp
 	dh_testdir
-
-	if ([ -x /usr/bin/ocamlopt ] || [ -x /usr/bin/ocamlopt.opt ]) && $(MAKE) utils opt; then \
-		touch build-arch-opt; \
-	else \
-		$(MAKE) utils.byte byte; \
+	$(MAKE) utils.$(TARGET) $(TARGET)
+	if [ "$(TARGET)" = "byte" ]; then \
 		cp mlnet.byte mlnet; \
 		cp mlgui.byte mlgui; \
 		cp mlguistarter.byte mlguistarter; \
-		touch build-arch-byte; \
 	fi
-	# Check that the compilation has succeeded
+# Check that the compilation has succeeded
 	test -x mlnet
 	test -x mlgui
-
-	# Build utilities
-	if [ -e build-arch-opt ]; then \
-		cd debian/utils && $(MAKE) opt; \
-	else \
-		cd debian/utils && $(MAKE) byte; \
-	fi
-	touch build-arch-stamp
-
-build-indep: build-indep-stamp
-build-indep-stamp:
-	dh_testdir
-	cd debian/xml-man && $(MAKE) all
-	touch build-indep-stamp
-
-build: patch-stamp build-arch build-indep
-
-maintainer-clean:
-	# Prevent the rebuild of configure
-	$(MAKE) distclean
-	-$(RM) config/confdefs.h
-
-unpatch: maintainer-clean
-
-clean: maintainer-clean unpatch clean-doc-check
-	dh_testdir
-	dh_testroot
-	# Update the PO, as suggested in "man 7 po-debconf"
-	debconf-updatepo
-	# Add here commands to clean up after the build process.
-	$(MAKE) clean
-	cd debian/xml-man && $(MAKE) clean
-	cd debian/utils && $(MAKE) clean
-	-$(RM) config/trying
-	-$(RM) packages/rpm/Makefile
-	-$(RM) *.ini *.ini.old
-	-$(RM) configure-stamp build-arch-stamp build-indep-stamp build-arch-opt build-arch-byte
-	dh_clean
-
-install: DH_OPTIONS=
-install: build
+# Make manpages
+	$(MAKE) -C debian/xml-man all
+# Build utilities
+	make -C debian/utils TARGET=$(TARGET)
+	touch build-stamp
+
+install: build install-stamp
+install-stamp:
 	dh_testdir
 	dh_testroot
-	dh_clean -k
+	dh_prep
 	dh_installdirs
 	dh_install
 
-install-indep: DH_OPTIONS=
-install-indep: build
-	dh_testdir
-	dh_testroot
-	dh_clean -k
-	dh_installdirs
-	dh_install
+binary-indep: build install-stamp
 
-# Build architecture-independent files here.
-# Pass -i to all debhelper commands in this target to reduce clutter.
-binary-indep: build install-indep
-	dh_testdir -i
-	dh_testroot -i
-	dh_installdebconf -i
-	dh_installdocs -i
-	dh_installexamples -i
-	dh_installmenu -i
-	dh_desktop -i
-	dh_installinit -i
-	dh_installman -i
-	dh_installchangelogs distrib/ChangeLog -i
-	dh_link -i
-	dh_compress -i
-	dh_fixperms -i
-	dh_installdeb -i
-	dh_gencontrol -i
-	dh_md5sums -i
-	dh_builddeb -i
-
-# Build architecture-dependent files here.
-binary-arch: build install
-	dh_testdir -a
-	dh_testroot -a
-	dh_installdebconf -a
-	dh_installdocs -a
+binary-arch: build install-stamp
+	dh binary-arch --until=installdocs
 	$(RM) $(CURDIR)/debian/mldonkey-server/usr/share/doc/mldonkey-server/distrib/Copying.txt
 	$(RM) $(CURDIR)/debian/mldonkey-server/usr/share/doc/mldonkey-server/distrib/GeoIP_LICENSE.txt
-	dh_installexamples -a
-	dh_installmenu -a
-	dh_desktop -a
+	dh binary-arch --after=installdocs --before=installinit
 	dh_installinit -a -pmldonkey-server --error-handler=init_error -- start 98 2 3 4 5 . stop 20 0 1 6 .
-	dh_installcron -a
-	dh_installman -a
-	dh_installchangelogs distrib/ChangeLog -a
-	dh_link -a
-	dh_compress -a
-	dh_fixperms -a
-	dh_installdeb -a
-	dh_shlibdeps -a
-	if [ -e build-arch-opt ]; then \
+	dh binary-arch --after=installinit --before=strip
+	if [ "$(TARGET)" = "opt" ]; then \
 		echo "interpreter:Depends=" >> debian/mldonkey-server.substvars; \
 		echo "interpreter:Depends=" >> debian/mldonkey-gui.substvars; \
 		dh_strip -a; \
@@ -180,9 +120,7 @@ binary-arch: build install
 		echo "interpreter:Depends=ocaml-base-nox-$(OCAMLABI)" >> debian/mldonkey-server.substvars; \
 		echo "interpreter:Depends=ocaml-base-nox-$(OCAMLABI)" >> debian/mldonkey-gui.substvars; \
 	fi
-	dh_gencontrol -a -- -VF:OCamlABI="$(OCAMLABI)"
-	dh_md5sums -a
-	dh_builddeb -a
+	dh binary-arch --after=strip
 
 # For now we have no binary-indep
 binary: binary-arch

-- 
mldonkey packaging



More information about the Pkg-ocaml-maint-commits mailing list