[Pkg-jed-commit] r313 - trunk/packages/jed-extra/debian

Jörg Sommer jo-guest at costa.debian.org
Fri Jun 2 16:45:35 UTC 2006


Author: jo-guest
Date: 2006-06-02 16:45:34 +0000 (Fri, 02 Jun 2006)
New Revision: 313

Modified:
   trunk/packages/jed-extra/debian/rules
Log:
* jed-extra/debian/rules:
  + Replaced sort-mode.sl by awk. This makes the build process more
    transparent, because you see in the build output what happend and
    creating a config file for dh_install at build time is not a sane way.

  + Renamed VER by UPSTREAM_VERSION. This is a more speaking variable.

  + Removed the difficult expression of initializing UPSTREAM_VERSION.
    This was a workaround for the case the script is not called from a
    debian directory e.g. for get-orig-source.

  + Fixed the appending of other modes to the archive -- no duplicate
    directories.

  + The find expression to find documentation files would also find files
    in debian/ which is not intended. Fixed.


Modified: trunk/packages/jed-extra/debian/rules
===================================================================
--- trunk/packages/jed-extra/debian/rules	2006-06-02 08:45:04 UTC (rev 312)
+++ trunk/packages/jed-extra/debian/rules	2006-06-02 16:45:34 UTC (rev 313)
@@ -9,32 +9,43 @@
 
 include /usr/share/dpatch/dpatch.make
 
+CONTENTS_FILE = debian/contents.txt
+
+ADDITION = $(shell awk '/^A/ { print $$2"/*"; }' $(CONTENTS_FILE))
+COLOR = $(shell awk '/^C/ { print $$2"/*"; }' $(CONTENTS_FILE))
+DROP_IN = $(shell awk '/^D/ { print $$2"/*"; }' $(CONTENTS_FILE))
+ENHANCEMENT = $(shell awk '/^E/ { print $$2"/*"; }' $(CONTENTS_FILE))
+UTILS = $(shell awk '/^U/ { print $$2"/*"; }' $(CONTENTS_FILE))
+EXPERIMENTAL = $(shell awk '/^X/ { print $$2"/*"; }' $(CONTENTS_FILE))
+
 debroot = $(PWD)/debian/jed-extra
+libdir = /usr/share/jed/jed-extra
+
+dh_inst_excl = -X.html -X.otl -X.example -XREADME
+
 # upstream version
-VER = $(shell perl -ne '/([\d.]+)-/; print $$1; exit' < \
-		      $(dir $(firstword $(MAKEFILE_LIST)))/changelog)
+UPSTREAM_VERSION ?= $(shell perl -ne '/([\d.]+)-/; print $$1; exit' < debian/changelog)
 
-
 build:
 	# nothing to do, but required by debian policy
 
-get-orig-source: 
+get-orig-source:
 	# latest non-released source tarball
-	wget  http://jedmodes.sourceforge.net/cvs/jedmodes-$(VER).tgz;
+	wget http://jedmodes.sourceforge.net/cvs/jedmodes-$(UPSTREAM_VERSION).tgz
 	# officially released CVS tarball directly from a download mirror
 	# wget http://kent.dl.sourceforge.net/sourceforge/jedmodes/jedmodes-$(VER).tgz
-	
-	mv jedmodes-$(VER).tgz jed-extra_$(VER).orig.tar.gz
-	
+
+	mv jedmodes-$(UPSTREAM_VERSION).tgz jed-extra_$(UPSTREAM_VERSION).orig.tar.gz
+
 	# additional modes from other sources
-	# FIXME: this creates 2 jedmodes-$(VER) directories in the archive!
-	mkdir --parents jedmodes-$(VER)/boxquote
-	cd jedmodes-$(VER)/boxquote; \
+	mkdir --parents jedmodes-$(UPSTREAM_VERSION)/boxquote
+	cd jedmodes-$(UPSTREAM_VERSION)/boxquote; \
 	    wget http://www.cis.fu-berlin.de/~phgrau/slang/boxquote.sl
-	gunzip jed-extra_$(VER).orig.tar.gz
-	tar --append --file jed-extra_$(VER).orig.tar jedmodes-$(VER)/*
-	gzip -9 jed-extra_$(VER).orig.tar
-	
+	gunzip jed-extra_$(UPSTREAM_VERSION).orig.tar.gz
+	tar --append --file jed-extra_$(UPSTREAM_VERSION).orig.tar \
+	    jedmodes-$(UPSTREAM_VERSION)/*
+	gzip -9 jed-extra_$(UPSTREAM_VERSION).orig.tar
+
 clean: unpatch
 	dh_testdir
 	dh_clean
@@ -50,20 +61,29 @@
 
 	# install modes
 	# -------------
-			
-	# install using jed-extra.install
-	dh_install -X.html -X.otl -X.example -XREADME
-	
-	# Install package documentation
-        # check:
-	# find . -name \*.html -o -name \*.otl -name \*.example \
-	#                 -o -name README\*
-	# !! dh_install installs the files in jed-extra.install again !!
-	install -d $(debroot)/usr/share/doc/jed-extra/mode-doc/
-	install README $$(find . -name \*.html -o -name \*.otl -o \
-	                  -name \*.example -o -name \*-README) \
-		$(debroot)/usr/share/doc/jed-extra/mode-doc/
 
+	# install mode documentation in /usr/share/doc/jed-extra/mode-doc/
+	dh_install $$(find . -wholename ./debian -prune -o \( -name \*.html \
+	    -o -name \*.otl -name \*.example -o -name README \) -print) \
+	    usr/share/doc/jed-extra/mode-doc/
+
+ifneq ($(ADDITION)$(ENHANCEMENT), )
+	dh_install $(dh_inst_excl) $(ADDITION) $(ENHANCEMENT) $(libdir)
+endif
+ifneq ($(COLOR), )
+	dh_install $(dh_inst_excl) $(COLOR) $(libdir)/colors
+endif
+ifneq ($(DROP_IN), )
+	dh_install $(dh_inst_excl) $(DROP_IN) $(libdir)/drop-in
+endif
+ifneq ($(UTILS), )
+	dh_install $(dh_inst_excl) $(UTILS) $(libdir)/utils
+endif
+ifneq ($(EXPERIMENTAL), )
+	dh_install $(dh_inst_excl) $(EXPERIMENTAL) $(libdir)/extra
+endif
+
+        # install package documentation
 	dh_installdocs debian/contents.txt
 
 	# Install examples
@@ -72,11 +92,11 @@
 	# fix some names (as dh_install* cannot change filenames)
 	mv $(debroot)/usr/share/jed/compile/compile \
 	   $(debroot)/usr/share/jed/compile/jed-extra
-	
+
 	chmod +x $(debroot)/usr/share/jed/compile/jed-extra
 
 	#dh_installdebconf
-
+	
 	dh_installchangelogs
 	dh_compress
 	dh_fixperms




More information about the Pkg-jed-commit mailing list