[Pkg-ocaml-maint-commits] [SCM] unison packaging branch, master, updated. debian/2.27.57-4

Sylvain Le Gall gildor at debian.org
Thu Feb 25 01:04:05 UTC 2010


The following commit has been merged in the master branch:
commit 3c18f196f4184e9bdae3e957e023bb10d10cd7a5
Author: Sylvain Le Gall <gildor at debian.org>
Date:   Thu Feb 25 01:46:40 2010 +0100

    Enhance templating for unison and unison-gtk common files

diff --git a/debian/changelog b/debian/changelog
index 8c3b127..00eeff5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -12,6 +12,7 @@ unison (2.27.57-4) UNRELEASED; urgency=low
     -silent is set (Closes: #497729, #551199)
   * Auto generate conflicts with unisonX.Y.Z or unison (X.Y.Z) package
     (Closes: #570910)
+  * Enhance templating for unison and unison-gtk common files
 
  -- Sylvain Le Gall <gildor at debian.org>  Tue, 23 Feb 2010 00:42:07 +0000
 
diff --git a/debian/rules b/debian/rules
index 26354f0..a7547b4 100755
--- a/debian/rules
+++ b/debian/rules
@@ -54,23 +54,11 @@ UNISON_GTK_VERSIONNO=unison-$(VERSIONNO)-gtk
 UNISON_GTK_VAR=$(call TR,$(UNISON_GTK))
 
 RENAME := debian/unison.1.in 
-RENAME += debian/unison.dirs.in 
 RENAME += debian/unison.doc-base.in
-RENAME += debian/unison.postinst.in
-RENAME += debian/unison.prerm.in
-RENAME += debian/unison.preinst.in
-RENAME += debian/unison.manpages.in
-RENAME += debian/unison-gtk.dirs.in
 RENAME += debian/unison-gtk.menu.in
-RENAME += debian/unison-gtk.postinst.in
-RENAME += debian/unison-gtk.prerm.in
-RENAME += debian/unison-gtk.preinst.in
-RENAME += debian/unison-gtk.manpages.in
 RENAME += debian/unison-gtk.svg.in
 RENAME += debian/unison-gtk.install.in
 RENAME += debian/unison.install.in
-RENAME += debian/unison-gtk.links.in
-RENAME += debian/unison.links.in
 RENAME += debian/unison-gtk.desktop.in
 
 ifeq ($(DEB_SOURCE_PACKAGE),unison)
@@ -164,9 +152,10 @@ SED_REPLACE += -e "s/@UNISON_SELF_PACKAGE@/$(UNISON_SELF_PACKAGE)/g"
 SED_REPLACE += -e "s/@UNISON_SELF_ALTERNATIVE@/$(UNISON_SELF_ALTERNATIVE)/g"
 SED_REPLACE += -e "s/@UNISON_SELF_VERSIONNO@/$(UNISON_SELF_VERSIONNO)/g"
 SED_REPLACE += -e "s/@UNISON_SELF_VAR@/$(UNISON_SELF_VAR)/g"
+SED_REPLACE += -e "s/@IS_GTK@/$(IS_GTK)/g"
 
-%-template-stamp:
-	for i in $(wildcard debian/templates/*); do   \
+%-template-stamp: $(wildcard debian/templates/*)
+	for i in $^ ; do   \
 	   sed $(SED_REPLACE) $$i > debian/$(UNISON_SELF_PACKAGE).$$(basename $$i); \
 	done;
 	touch $@
@@ -184,6 +173,7 @@ unison-gtk-template-stamp: UNISON_SELF_PACKAGE = $(UNISON_GTK_PACKAGE)
 unison-gtk-template-stamp: UNISON_SELF_ALTERNATIVE = $(UNISON_GTK_ALTERNATIVE)
 unison-gtk-template-stamp: UNISON_SELF_VERSIONNO = $(UNISON_GTK_VERSIONNO)
 unison-gtk-template-stamp: UNISON_SELF_VAR = $(UNISON_GTK_VAR)
+unison-gtk-template-stamp: IS_GTK=true
 
 unison-template-stamp: PRIORITY_SELF = $(PRIORITY)
 unison-template-stamp: UNISON_SELF = $(UNISON)
@@ -191,36 +181,26 @@ unison-template-stamp: UNISON_SELF_PACKAGE = $(UNISON_PACKAGE)
 unison-template-stamp: UNISON_SELF_ALTERNATIVE = $(UNISON_ALTERNATIVE)
 unison-template-stamp: UNISON_SELF_VERSIONNO = $(UNISON_VERSIONNO)
 unison-template-stamp: UNISON_SELF_VAR = $(UNISON_VAR)
+unison-template-stamp: IS_GTK=false
 
 template: unison-template-stamp unison-gtk-template-stamp
 
 .PHONY: template
 
+common-binary-indep:: template
+common-binary-arch:: template
+
 #
 # Rename and substitute files
 #
 
-unison-rename: template unison-rename-stamp 
-unison-rename-stamp:	
+unison-rename: unison-rename-stamp 
+unison-rename-stamp: $(RENAME)
 	# Rename all the debhelper files needed and substitue the @XXX@
 	# string
-	for i in $(RENAME); do \
+	for i in $^ ; do \
 	  DST=`echo $$i | sed -e "s/unison/${UNISON_PACKAGE}/" -e "s/\\.in\\$$//"`; \
-	  sed \
-	    -e "s/@VERSION@/$(VERSION)/g"                               \
-	    -e "s/@PACKAGE_VERSION@/$(PACKAGE_VERSION)/g"               \
-	    -e "s/@PRIORITY@/$(PRIORITY)/g"                             \
-	    -e "s/@PRIORITY_GTK@/$(PRIORITY_GTK)/g"                     \
-	    -e "s/@UNISON@/$(UNISON)/g"                                 \
-	    -e "s/@UNISON_MAJ@/$(UNISON_MAJ)/g"                         \
-	    -e "s/@UNISON_PACKAGE@/$(UNISON_PACKAGE)/g"                 \
-	    -e "s/@UNISON_ALTERNATIVE@/$(UNISON_ALTERNATIVE)/g"         \
-	    -e "s/@UNISON_VERSIONNO@/$(UNISON_VERSIONNO)/g"             \
-	    -e "s/@UNISON_GTK@/$(UNISON_GTK)/g"                         \
-	    -e "s/@UNISON_GTK_PACKAGE@/$(UNISON_GTK_PACKAGE)/g"         \
-	    -e "s/@UNISON_GTK_ALTERNATIVE@/$(UNISON_GTK_ALTERNATIVE)/g" \
-	    -e "s/@UNISON_GTK_VERSIONNO@/$(UNISON_GTK_VERSIONNO)/g"     \
-	    "$$i" > "$(CURDIR)/$$DST"; \
+	  sed $(SED_REPLACE) $$i > "$(CURDIR)/$$DST"; \
 	done
 	
 	# We always need to rename the manual 
@@ -230,11 +210,6 @@ unison-rename-stamp:
 	
 	touch $@
 
-.PHONY: unison-rename
-
-common-binary-indep:: unison-rename
-common-binary-arch:: unison-rename
-
 clean::
 	# Remove the renamed files
 	-for i in $(RENAME); do \
@@ -244,3 +219,8 @@ clean::
 	-$(RM) '$(CURDIR)/debian/$(UNISON).1' 
 	-$(RM) '$(CURDIR)/debian/$(UNISON_GTK).1'
 	-$(RM) '$(CURDIR)/unison-rename-stamp'
+
+.PHONY: unison-rename
+
+common-binary-indep:: unison-rename template
+common-binary-arch:: unison-rename template
diff --git a/debian/unison.dirs.in b/debian/templates/dirs
similarity index 100%
rename from debian/unison.dirs.in
rename to debian/templates/dirs
diff --git a/debian/templates/links b/debian/templates/links
new file mode 100644
index 0000000..8f5d7ac
--- /dev/null
+++ b/debian/templates/links
@@ -0,0 +1,4 @@
+usr/bin/@UNISON_SELF@                 usr/bin/@UNISON_SELF_ALTERNATIVE@
+usr/bin/@UNISON_SELF@                 usr/bin/@UNISON_SELF_VERSIONNO@
+usr/share/man/man1/@UNISON_SELF at .1.gz usr/share/man/man1/@UNISON_SELF_ALTERNATIVE at .1.gz 
+usr/share/man/man1/@UNISON_SELF at .1.gz usr/share/man/man1/@UNISON_SELF_VERSIONNO at .1.gz 
diff --git a/debian/templates/manpages b/debian/templates/manpages
new file mode 100644
index 0000000..6fdba74
--- /dev/null
+++ b/debian/templates/manpages
@@ -0,0 +1 @@
+debian/@UNISON_SELF at .1 
diff --git a/debian/templates/postinst b/debian/templates/postinst
new file mode 100644
index 0000000..d47a67c
--- /dev/null
+++ b/debian/templates/postinst
@@ -0,0 +1,15 @@
+#!/bin/sh -e
+
+# This file is common between unison and unison-gtk package
+if @IS_GTK@; then
+  update-alternatives --install /usr/bin/unison-gtk unison-gtk /usr/bin/@UNISON_GTK_ALTERNATIVE@ @PRIORITY@ \
+    --slave /usr/share/man/man1/unison-gtk.1.gz unison-gtk.1.gz /usr/share/man/man1/@UNISON_GTK_ALTERNATIVE at .1.gz 
+
+  update-alternatives --install /usr/bin/unison unison /usr/bin/@UNISON_GTK_ALTERNATIVE@ @PRIORITY@ \
+    --slave /usr/share/man/man1/unison.1.gz unison.1.gz /usr/share/man/man1/@UNISON_GTK_ALTERNATIVE at .1.gz 
+else
+  update-alternatives --install /usr/bin/unison unison /usr/bin/@UNISON_ALTERNATIVE@ @PRIORITY@ \
+    --slave /usr/share/man/man1/unison.1.gz unison.1.gz /usr/share/man/man1/@UNISON_ALTERNATIVE at .1.gz 
+fi
+
+#DEBHELPER#
diff --git a/debian/templates/preinst b/debian/templates/preinst
new file mode 100644
index 0000000..334352e
--- /dev/null
+++ b/debian/templates/preinst
@@ -0,0 +1,18 @@
+#!/bin/sh -e 
+
+case "$1" in
+  upgrade)
+    if dpkg --compare-versions "$2" lt "2.13.16-1" && dpkg --compare-versions "$2" ge "2.10.2-1"; then
+      # This file is common between unison and unison-gtk package
+      if @IS_GTK@; then
+        echo "Deleting alternatives to unison2.10.2-gtk"
+        update-alternatives --remove unison-gtk /usr/bin/unison2.10.2-gtk
+      else
+        echo "Deleting alternatives to unison2.10.2"
+        update-alternatives --remove unison /usr/bin/unison2.10.2
+      fi
+    fi
+  ;;
+esac
+
+#DEBHELPER#
diff --git a/debian/templates/prerm b/debian/templates/prerm
new file mode 100644
index 0000000..517f758
--- /dev/null
+++ b/debian/templates/prerm
@@ -0,0 +1,7 @@
+#!/bin/sh -e
+
+if [ "$1" = "remove" ]; then
+	update-alternatives --remove unison /usr/bin/@UNISON_SELF_ALTERNATIVE@
+fi
+
+#DEBHELPER#
diff --git a/debian/unison-gtk.dirs.in b/debian/unison-gtk.dirs.in
deleted file mode 100644
index e029724..0000000
--- a/debian/unison-gtk.dirs.in
+++ /dev/null
@@ -1,4 +0,0 @@
-usr/bin
-usr/share/doc
-usr/share/man/man1
-etc/bash_completion.d
diff --git a/debian/unison-gtk.links.in b/debian/unison-gtk.links.in
deleted file mode 100644
index e32cd9b..0000000
--- a/debian/unison-gtk.links.in
+++ /dev/null
@@ -1,4 +0,0 @@
-usr/bin/@UNISON_GTK@                 usr/bin/@UNISON_GTK_ALTERNATIVE@ 
-usr/bin/@UNISON_GTK@                 usr/bin/@UNISON_GTK_VERSIONNO@ 
-usr/share/man/man1/@UNISON_GTK at .1.gz usr/share/man/man1/@UNISON_GTK_ALTERNATIVE at .1.gz 
-usr/share/man/man1/@UNISON_GTK at .1.gz usr/share/man/man1/@UNISON_GTK_VERSIONNO at .1.gz 
diff --git a/debian/unison-gtk.manpages.in b/debian/unison-gtk.manpages.in
deleted file mode 100644
index 51b828c..0000000
--- a/debian/unison-gtk.manpages.in
+++ /dev/null
@@ -1 +0,0 @@
-debian/@UNISON_GTK at .1
diff --git a/debian/unison-gtk.postinst.in b/debian/unison-gtk.postinst.in
deleted file mode 100644
index e6335b2..0000000
--- a/debian/unison-gtk.postinst.in
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh -e
-
-update-alternatives --install /usr/bin/unison-gtk unison-gtk /usr/bin/@UNISON_GTK_ALTERNATIVE@ @PRIORITY@ \
-  --slave /usr/share/man/man1/unison-gtk.1.gz unison-gtk.1.gz /usr/share/man/man1/@UNISON_GTK_ALTERNATIVE at .1.gz 
-
-update-alternatives --install /usr/bin/unison unison /usr/bin/@UNISON_GTK_ALTERNATIVE@ @PRIORITY@ \
-  --slave /usr/share/man/man1/unison.1.gz unison.1.gz /usr/share/man/man1/@UNISON_GTK_ALTERNATIVE at .1.gz 
-
-#DEBHELPER#
diff --git a/debian/unison-gtk.preinst.in b/debian/unison-gtk.preinst.in
deleted file mode 100644
index dda2304..0000000
--- a/debian/unison-gtk.preinst.in
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh -e 
-
-case "$1" in
-  upgrade)
-    if dpkg --compare-versions "$2" lt "2.13.16-1" && dpkg --compare-versions "$2" ge "2.10.2-1"; then
-      echo "Deleting alternatives to unison2.10.2-gtk"
-      update-alternatives --remove unison-gtk /usr/bin/unison2.10.2-gtk
-    fi
-  ;;
-esac
-
-#DEBHELPER#
diff --git a/debian/unison-gtk.prerm.in b/debian/unison-gtk.prerm.in
deleted file mode 100644
index 6c81761..0000000
--- a/debian/unison-gtk.prerm.in
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh -e
-
-if [ "$1" = "remove" ];  then
-	update-alternatives --remove unison-gtk /usr/bin/@UNISON_GTK_ALTERNATIVE@
-fi
-
-#DEBHELPER#
diff --git a/debian/unison.links.in b/debian/unison.links.in
deleted file mode 100644
index 11c96e6..0000000
--- a/debian/unison.links.in
+++ /dev/null
@@ -1,4 +0,0 @@
-usr/bin/@UNISON@                 usr/bin/@UNISON_ALTERNATIVE@
-usr/bin/@UNISON@                 usr/bin/@UNISON_VERSIONNO@
-usr/share/man/man1/@UNISON at .1.gz usr/share/man/man1/@UNISON_ALTERNATIVE at .1.gz 
-usr/share/man/man1/@UNISON at .1.gz usr/share/man/man1/@UNISON_VERSIONNO at .1.gz 
diff --git a/debian/unison.manpages.in b/debian/unison.manpages.in
deleted file mode 100644
index fd4f2e9..0000000
--- a/debian/unison.manpages.in
+++ /dev/null
@@ -1 +0,0 @@
-debian/@UNISON at .1 
diff --git a/debian/unison.postinst.in b/debian/unison.postinst.in
deleted file mode 100644
index 745491b..0000000
--- a/debian/unison.postinst.in
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh -e
-
-update-alternatives --install /usr/bin/unison unison /usr/bin/@UNISON_ALTERNATIVE@ @PRIORITY@ \
-  --slave /usr/share/man/man1/unison.1.gz unison.1.gz /usr/share/man/man1/@UNISON_ALTERNATIVE at .1.gz 
-
-#DEBHELPER#
diff --git a/debian/unison.preinst.in b/debian/unison.preinst.in
deleted file mode 100644
index 675a265..0000000
--- a/debian/unison.preinst.in
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh -e 
-
-case "$1" in
-  upgrade)
-    if dpkg --compare-versions "$2" lt "2.13.16-1" && dpkg --compare-versions "$2" ge "2.10.2-1"; then
-      echo "Deleting alternatives to unison2.10.2"
-      update-alternatives --remove unison /usr/bin/unison2.10.2
-    fi
-  ;;
-esac
-
-#DEBHELPER#
diff --git a/debian/unison.prerm.in b/debian/unison.prerm.in
deleted file mode 100644
index f4e6a21..0000000
--- a/debian/unison.prerm.in
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh -e
-
-if [ "$1" = "remove" ]; then
-	update-alternatives --remove unison /usr/bin/@UNISON_ALTERNATIVE@
-fi
-
-#DEBHELPER#

-- 
unison packaging



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