[Pkg-ocaml-maint-commits] r1297 - trunk/packages/unison/unison2.9/trunk/debian

Sylvain LE GALL gildor-guest@costa.debian.org
Thu, 21 Apr 2005 22:36:08 +0000


Author: gildor-guest
Date: 2005-04-21 22:36:08 +0000 (Thu, 21 Apr 2005)
New Revision: 1297

Added:
   trunk/packages/unison/unison2.9/trunk/debian/unison-gtk.postinst
   trunk/packages/unison/unison2.9/trunk/debian/unison-gtk.prerm
   trunk/packages/unison/unison2.9/trunk/debian/unison.postinst
   trunk/packages/unison/unison2.9/trunk/debian/unison.prerm
Modified:
   trunk/packages/unison/unison2.9/trunk/debian/changelog
   trunk/packages/unison/unison2.9/trunk/debian/control
   trunk/packages/unison/unison2.9/trunk/debian/rules
Log:
Use update-alternative and add a field provides and conflict -- SLG


Modified: trunk/packages/unison/unison2.9/trunk/debian/changelog
===================================================================
--- trunk/packages/unison/unison2.9/trunk/debian/changelog	2005-04-21 01:11:00 UTC (rev 1296)
+++ trunk/packages/unison/unison2.9/trunk/debian/changelog	2005-04-21 22:36:08 UTC (rev 1297)
@@ -3,6 +3,15 @@
   * Transition to ocaml 3.08.3
   * Split the package unison in unison2.9.1 and unison for being able to
     have 2 versions of the protocol.
+  * Use update-alternative to be able to install both unison2.9.1 and
+    unison2.10.2
+  * Revisit the build system : use sed and mv to create package unison2.9.1
+    and unisonXXX ( rename debhelper files in rule, subsitute @VERSION@ by the
+    right version in the content of some files ).
+  * Conflicts with package unison (<< 2.9.1-2 ), because this package install
+    a binary "unison" which will conflict with update-alternative
+  * Use a "Provide: unison" to manage the two new package ( which provides
+    both unison, but with a slightly different protocol ).
 
  -- Sylvain Le Gall <sylvain.le-gall@polytechnique.org>  Tue, 19 Apr 2005 00:08:05 +0200
 

Modified: trunk/packages/unison/unison2.9/trunk/debian/control
===================================================================
--- trunk/packages/unison/unison2.9/trunk/debian/control	2005-04-21 01:11:00 UTC (rev 1296)
+++ trunk/packages/unison/unison2.9/trunk/debian/control	2005-04-21 22:36:08 UTC (rev 1297)
@@ -9,6 +9,8 @@
 Architecture: any
 Depends: ${shlibs:Depends}, ${interpreter:Depends}
 Recommends: ssh
+Provides: unison
+Conflicts: unison (<< 2.9.1-3)
 Description: A file-synchronization tool for Unix and Windows
  Unison is a file-synchronization tool for Unix and Windows, written
  in OCaml. It allows two replicas of a collection of files and
@@ -32,6 +34,8 @@
 Package: unison2.9.1-gtk
 Architecture: any
 Depends: unison2.9.1 (= ${Source-Version}), ${shlibs:Depends}, ${interpreter:Depends}
+Provides: unison-gtk
+Conflicts: unison-gtk (<< 2.9.1-3)
 Description: A file-synchronization tool for Unix and Windows - GTK interface
  This package adds the optional GTK interface to the file synchronization
  tool 'unison'.

Modified: trunk/packages/unison/unison2.9/trunk/debian/rules
===================================================================
--- trunk/packages/unison/unison2.9/trunk/debian/rules	2005-04-21 01:11:00 UTC (rev 1296)
+++ trunk/packages/unison/unison2.9/trunk/debian/rules	2005-04-21 22:36:08 UTC (rev 1297)
@@ -5,6 +5,9 @@
 
 PACKAGE=unison
 VERSION=2.9.1
+# PRIORITY should be set to 10 for stable compatibility package 
+# and to 20 for unstable/testing package
+PRIORITY=10
 
 # set $(NATIVE) to true if this arch has an optimising compiler
 NATIVE := $(shell test -x /usr/bin/ocamlopt -o -x /usr/bin/ocamlopt.opt && echo true || echo false)
@@ -14,12 +17,23 @@
 RENAME += debian/unison.dirs 
 RENAME += debian/unison.doc-base 
 RENAME += debian/unison.docs 
+RENAME += debian/unison.postinst
+RENAME += debian/unison.prerm
 RENAME += debian/unison-gtk.dirs 
 RENAME += debian/unison-gtk.menu
+RENAME += debian/unison-gtk.postinst
+RENAME += debian/unison-gtk.prerm
 
 build: build-stamp
 build-stamp: patch-stamp
 	dh_testdir
+	
+	# rename all the debhelper files needed and substitue the @VERSION@
+	# string
+	for i in $(RENAME); do \
+	  sed -e "s/@VERSION@/$(VERSION)/g" $$i | sed -e "s/@PRIORITY@/$(PRIORITY)/g" > $${i/unison/unison$(VERSION)}; \
+	done
+
 	$(MAKE) UISTYLE=gtk NATIVE=$(NATIVE) NAME=unison$(VERSION)-gtk
 	
 	$(MAKE) UISTYLE=text NATIVE=$(NATIVE) NAME=unison$(VERSION)
@@ -30,12 +44,6 @@
 		/usr/bin/chrpath -d unison$(VERSION)-gtk;  \
 	fi
 
-	# rename all the debhelper files needed and substitue the @VERSION@
-	# string
-	for i in $(RENAME); do \
-	  sed -e "s/@VERSION@/$(VERSION)/g" $$i > $${i/unison/unison$(VERSION)}; \
-	done
-
 	touch build-stamp
 
 clean: unpatch

Added: trunk/packages/unison/unison2.9/trunk/debian/unison-gtk.postinst
===================================================================
--- trunk/packages/unison/unison2.9/trunk/debian/unison-gtk.postinst	2005-04-21 01:11:00 UTC (rev 1296)
+++ trunk/packages/unison/unison2.9/trunk/debian/unison-gtk.postinst	2005-04-21 22:36:08 UTC (rev 1297)
@@ -0,0 +1,6 @@
+#!/bin/sh -e
+
+update-alternatives --install /usr/bin/unison-gtk unison-gtk /usr/bin/unison@VERSION@-gtk @PRIORITY@ \
+  --slave /usr/share/man/man1/unison-gtk.1.gz unison-gtk.1.gz /usr/share/man/man1/unison@VERSION@-gtk.1.gz 
+
+#DEBHELPER#

Added: trunk/packages/unison/unison2.9/trunk/debian/unison-gtk.prerm
===================================================================
--- trunk/packages/unison/unison2.9/trunk/debian/unison-gtk.prerm	2005-04-21 01:11:00 UTC (rev 1296)
+++ trunk/packages/unison/unison2.9/trunk/debian/unison-gtk.prerm	2005-04-21 22:36:08 UTC (rev 1297)
@@ -0,0 +1,7 @@
+#!/bin/sh -e
+
+if [ "$1" = "remove" ]; then
+	update-alternatives --remove unison-gtk /usr/bin/unison@VERSION@-gtk
+fi
+
+#DEBHELPER#

Added: trunk/packages/unison/unison2.9/trunk/debian/unison.postinst
===================================================================
--- trunk/packages/unison/unison2.9/trunk/debian/unison.postinst	2005-04-21 01:11:00 UTC (rev 1296)
+++ trunk/packages/unison/unison2.9/trunk/debian/unison.postinst	2005-04-21 22:36:08 UTC (rev 1297)
@@ -0,0 +1,6 @@
+#!/bin/sh -e
+
+update-alternatives --install /usr/bin/unison unison /usr/bin/unison@VERSION@ @PRIORITY@ \
+  --slave /usr/share/man/man1/unison.1.gz unison.1.gz /usr/share/man/man1/unison@VERSION@.1.gz 
+
+#DEBHELPER#

Added: trunk/packages/unison/unison2.9/trunk/debian/unison.prerm
===================================================================
--- trunk/packages/unison/unison2.9/trunk/debian/unison.prerm	2005-04-21 01:11:00 UTC (rev 1296)
+++ trunk/packages/unison/unison2.9/trunk/debian/unison.prerm	2005-04-21 22:36:08 UTC (rev 1297)
@@ -0,0 +1,7 @@
+#!/bin/sh -e
+
+if [ "$1" = "remove" ]; then
+	update-alternatives --remove unison /usr/bin/unison@VERSION@
+fi
+
+#DEBHELPER#