[Pkg-ocaml-maint-commits] [SCM] advi packaging branch, sid/master, updated. debian/1.6.0-13-21-g3f5614a

Stephane Glondu steph at glondu.net
Mon Jul 13 16:55:19 UTC 2009


The following commit has been merged in the sid/master branch:
commit 1eefd27c15a02347624fb6d6c69673231c12811e
Author: Stephane Glondu <steph at glondu.net>
Date:   Mon Jul 13 17:04:01 2009 +0200

    Rewrite debian/rules using dh, bump debhelper compat to 7

diff --git a/debian/advi-examples.examples b/debian/advi-examples.examples
index 7b21621..c5b20c2 100644
--- a/debian/advi-examples.examples
+++ b/debian/advi-examples.examples
@@ -1,3 +1,3 @@
-examples
+examples/*
 test
 Makefile.config
diff --git a/debian/advi.install b/debian/advi.install
new file mode 100644
index 0000000..2b80b32
--- /dev/null
+++ b/debian/advi.install
@@ -0,0 +1,7 @@
+debian/utils/zadvi              /usr/bin
+doc/advi_remote.dvi             /usr/share/doc/advi/manual
+doc/manual.pdf                  /usr/share/doc/advi/manual
+doc/scratch_write_splash.dvi    /usr/share/doc/advi/manual
+doc/splash.dvi                  /usr/share/doc/advi/manual
+doc/mathmode.dvi                /usr/share/doc/advi/manual
+doc/scratch_draw_splash.dvi     /usr/share/doc/advi/manual
diff --git a/debian/advi.manpages b/debian/advi.manpages
new file mode 100644
index 0000000..4891c79
--- /dev/null
+++ b/debian/advi.manpages
@@ -0,0 +1 @@
+doc/advi.1
diff --git a/debian/compat b/debian/compat
index 7ed6ff8..7f8f011 100644
--- a/debian/compat
+++ b/debian/compat
@@ -1 +1 @@
-5
+7
diff --git a/debian/control b/debian/control
index c6f83b3..20ce55e 100644
--- a/debian/control
+++ b/debian/control
@@ -11,7 +11,9 @@ Uploaders:
  Stephane Glondu <steph at glondu.net>
 DM-Upload-Allowed: yes
 Build-Depends:
- debhelper (>= 5),
+ debhelper (>= 7.0.52),
+ quilt (>= 0.46-7),
+ dh-ocaml,
  texlive,
  texlive-pictures,
  texlive-pstricks,
@@ -19,7 +21,6 @@ Build-Depends:
  ocaml,
  libcamlimages-ocaml-dev,
  zlib1g-dev,
- quilt,
  ocaml-best-compilers,
  hevea,
  x11proto-core-dev,
diff --git a/debian/rules b/debian/rules
index 3fe9386..6bb5a61 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,81 +1,46 @@
 #!/usr/bin/make -f
-# Sample debian/rules that uses debhelper.
-# GNU copyright 1997 to 1999 by Joey Hess.
+# -*- makefile -*-
 
-# We want to use quilt.
-include /usr/share/quilt/quilt.make
-PACKAGE = advi
-VERSION = 1.6.0
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
 
-export DH_VERBOSE=1
+include /usr/share/ocaml/ocamlvars.mk
+OCAML_HAVE_OPTOPT ?= $(if $(wildcard /usr/bin/ocamlopt.opt),yes,no)
+DH := dh --with quilt
 
-# 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)
-DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
+PACKAGE := advi
+VERSION := 1.6.0
+DIRS_TO_BACKUP := doc test
 
-BACKUP_SOURCE = doc/manual.dvi \
-		doc/manual.ps          \
-		doc/manual.pdf         \
-		doc/splash.dvi         \
-		test/background.dvi    \
-		test/color.dvi         \
-		test/demo.dvi          \
-		test/demo2.dvi         \
-		test/demo_raw.dvi      \
-		test/jpdemo.dvi        \
-		test/trans.dvi         \
-		test/trans2.dvi        \
-		test/trans3.dvi        \
-		test/trigo_source.dvi
+%:
+	$(DH) $@
 
-OPTOPT = $(shell test -x /usr/bin/ocamlopt.opt && echo true)
-OPT = $(shell test -x /usr/bin/ocamlopt && echo true)
-# the native compiler is b0rked on arm, don't try to use it
-ifeq ($(DEB_BUILD_ARCH),arm)
-	OPT = false
-	OPTOPT = false
+.PHONY: override_dh_auto_clean
+override_dh_auto_clean:
+	[ ! -f Makefile.config ] || $(MAKE) veryclean
+ifneq ($(wildcard backup),)
+	for u in $(DIRS_TO_BACKUP); do \
+	  if [ -d backup/$$u ]; then rm -Rf $$u; mv backup/$$u .; fi; \
+	done
+	rm -Rf backup
 endif
 
-CFLAGS = -Wall -g
-
-ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
-	CFLAGS += -O0
-else
-	CFLAGS += -O2
+.PHONY: override_dh_auto_configure
+override_dh_auto_configure:
+ifeq ($(wildcard backup),)
+	mkdir backup	
+	for u in $(DIRS_TO_BACKUP); do cp -a $$u backup; done
 endif
-ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
-	INSTALL_PROGRAM += -s
-endif
-
-config.status: configure
-	dh_testdir
-	./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
-	  --prefix=/usr --mandir=\$${prefix}/share/man \
-	  --infodir=\$${prefix}/share/info
-
-backup: backup-stamp
-backup-stamp:
-	#for i in $(BACKUP_SOURCE); do /bin/cp -f $$i $$i.back; done
-	touch backup-stamp
-backup-clean:
-	#if [ -e backup-stamp ]; then \
-	#   for i in $(BACKUP_SOURCE); do /bin/cp -f $$i.back $$i; /bin/rm $$i.back; done;\
-	#fi
-	$(RM) backup-stamp
-
-build: build-stamp
-build-stamp: $(QUILT_STAMPFN) config.status
-	dh_testdir
+	dh_auto_configure
 
+.PHONY: override_dh_auto_build
+override_dh_auto_build:
 	$(MAKE) dep
-ifeq ($(OPTOPT),true)
+ifeq ($(OCAML_HAVE_OPTOPT),yes)
 	@echo "Building the native code version with the native compilers"
 	$(MAKE) HAVE_OPT=".opt" bin
 	touch opt-built-stamp
-else
-ifeq ($(OPT),true)
+else ifeq ($(OCAML_HAVE_OCAMLOPT),yes)
 	@echo "Building the native code version"
 	$(MAKE) HAVE_OPT="" bin
 	touch opt-built-stamp
@@ -83,111 +48,44 @@ else
 	@echo "Building the bytecode version"
 	$(MAKE) byt
 endif
-endif
 	$(MAKE) doc
-	ln -s tex/advilogo.eps test/
-	#ln -s tex/bar.eps test/
-	cd test && $(MAKE)
-	rm test/advilogo.eps
-	#rm test/bar.eps
-	cd test && rm -fR *~ *.aux *.cmi *.cmo *.log *.out *.ps *.toc a.out adviclock test_cursors test_gpic.tex .advi/*
-
-	ln -s tex/bar.eps examples/basics/
-	cd examples && $(MAKE)
-	rm examples/basics/bar.eps
-
-	#We copy the man file manually
-# FIXME We need to replace $Version (because we use the src, not the build one). Should we hardcode to the one found in
-#       the pre-build version? Right now simply copy if make clean killed it (on freshly unpacked source, we use the
-#       original; in the long run make clean has to be fixed
-	#if [ ! -e doc/advi.1 ]; then cp -p doc_src/advi.man doc/advi.1; fi
-	if [ ! -e doc/advi.1 ]; then cat doc_src/advi.man|sed 's/$$version/$(VERSION)/' > doc/advi.1; fi
-
-	cd doc && $(MAKE)
-
-	touch build-stamp
-
-clean: realclean unpatch backup-clean
-
-backup-clean: realclean
-unpatch: realclean
-realclean: $(QUILT_STAMPFN) backup
-	dh_testdir
-	dh_testroot
-	rm -f build-stamp opt-built-stamp
-	rm -f doc/advi.1
-	[ ! -f Makefile.config ] || $(MAKE) veryclean
-	rm -f .depend
-	rm -f doc/*.bdvi doc/*.png doc/*.eps test/*.eps
-	dh_clean
-
-install: build
-	dh_testdir
-	dh_testroot
-	dh_clean -k
-	dh_installdirs
+	$(MAKE) -C examples
+# We don't compile test as this would make advi-examples depend on
+# ocaml-base-nox-$(OCAML_ABI), and make the whole package not
+# binNMU-able
 
+.PHONY: override_dh_auto_install
+override_dh_auto_install: doc/advi.1
 	if [ -e opt-built-stamp ]; then \
 		$(MAKE) installbin DESTDIR=$(CURDIR)/debian/advi; \
 	else \
 		$(MAKE) installbyt DESTDIR=$(CURDIR)/debian/advi \
 			INSTALLTARGET=advi; \
 	fi
-	cp debian/utils/zadvi $(CURDIR)/debian/advi/usr/bin/zadvi
 	echo "-cache-dir ~/.advi-cache" >> $(CURDIR)/debian/advi/etc/advirc
 
-
-# Build architecture-independent files here.
-binary-indep: build install
-	dh_testdir -i
-	dh_testroot -i 
-	dh_installdocs -i
-	dh_installexamples -i -X.aux -X.cmi -X.cmo -X.log -X.out -X.toc
-	mkdir -p $(CURDIR)/debian/advi/usr/share/doc/advi/manual
-	cd doc && cp -ivp mathmode.dvi splash.dvi scratch_write_splash.dvi scratch_draw_splash.dvi advi_remote.dvi manual.pdf $(CURDIR)/debian/advi/usr/share/doc/advi/manual
-	mv $(CURDIR)/debian/advi-examples/usr/share/doc/advi-examples/examples/examples \
-	   $(CURDIR)/debian/advi-examples/usr/share/doc/advi-examples/examples/upstream-examples
-	rm $(CURDIR)/debian/advi-examples/usr/share/doc/advi-examples/examples/upstream-examples/seminar/a14/fig/*.png
-	rm $(CURDIR)/debian/advi-examples/usr/share/doc/advi-examples/examples/upstream-examples/seminar/a14/fig/*.gif
-	dh_installchangelogs -i
-	dh_compress -i -Xadviback.ppm -X.mp3 -Xtaquin -Xfumicamltrans.ppm -Xinria.ps -Xmanual.pdf
-	cd $(CURDIR)/debian/advi-examples/usr/share/doc/advi-examples/examples/upstream-examples/seminar/a14/fig/ && gunzip *.eps.gz
-	cd $(CURDIR)/debian/advi-examples/usr/share/doc/advi-examples/examples/upstream-examples/seminar/clock/ && gunzip *.eps.gz
-	cd $(CURDIR)/debian/advi-examples/usr/share/doc/advi-examples/examples/upstream-examples/slitex/skin_detection/ && gunzip *.eps.gz
-	rm $(CURDIR)/debian/advi-examples/usr/share/doc/advi-examples/examples/upstream-examples/slitex/caml/inria.ps
-	dh_fixperms -i
-	chmod 644 $(CURDIR)/debian/advi-examples/usr/share/doc/advi-examples/examples/upstream-examples/prosper/LL/pdfrotate.pl
-	chmod 644 $(CURDIR)/debian/advi-examples/usr/share/doc/advi-examples/examples/upstream-examples/basics/alltt.sty
-	chmod 644 $(CURDIR)/debian/advi-examples/usr/share/doc/advi-examples/examples/test/mmm.anim.gif
-	chmod 644 $(CURDIR)/debian/advi-examples/usr/share/doc/advi-examples/examples/test/music.mp3
-# FIXME Also for ./examples/upstream-examples/seminar/a14/putimage ?
-	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_installdocs -a
-	#dh_installexamples
-	dh_installmenu -a
-	dh_installman -a doc/advi.1
-	dh_installchangelogs -a
-	dh_link -a
-	if [ -e opt-built-stamp ]; then \
-		dh_strip -a; \
-	else \
-		dh_strip -a -Xadvi; \
-	fi
-	dh_compress -a 
-	dh_fixperms -a
-	dh_installdeb -a
-	dh_shlibdeps -a
-	dh_gencontrol -a
-	dh_md5sums -a
-	dh_builddeb -a
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install 
+.PHONY: override_dh_installexamples
+override_dh_installexamples:
+	dh_installexamples -X.log -X.aux -X.out
+	-cd debian/advi-examples/usr/share/doc/advi-examples/examples/seminar/a14/fig && \
+	  rm -f *.png *.gif
+	-cd debian/advi-examples/usr/share/doc/advi-examples/examples/ && \
+	  gunzip seminar/clock/*.eps.gz
+
+.PHONY: override_dh_compress
+override_dh_compress:
+	dh_compress -X.eps -X.mp3 -X.ppm -X.ml -X.ps
+
+.PHONY: override_dh_fixperms
+override_dh_fixperms:
+	dh_fixperms
+# Files forgotten by dh_fixperms because they are examples
+	-cd debian/advi-examples/usr/share/doc/advi-examples/examples && \
+	  chmod -f 0644 \
+	    test/music.mp3 \
+	    prosper/LL/pdfrotate.pl \
+            basics/alltt.sty \
+	    test/mmm.anim.gif
+
+doc/advi.1: doc_src/advi.man
+	sed 's/$$version/$(VERSION)/' $< > $@

-- 
advi packaging



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