--- unison-2.27.57.orig/debian/watch
+++ unison-2.27.57/debian/watch
@@ -0,0 +1,2 @@
+version=3
+http://www.cis.upenn.edu/~bcpierce/unison/download/releases/stable/unison-([0-9\.]*)\.tar\.gz
--- unison-2.27.57.orig/debian/unison-gtk.postinst.in
+++ unison-2.27.57/debian/unison-gtk.postinst.in
@@ -0,0 +1,9 @@
+#!/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@.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@.1.gz 
+
+#DEBHELPER#
--- unison-2.27.57.orig/debian/unison-gtk.dirs.in
+++ unison-2.27.57/debian/unison-gtk.dirs.in
@@ -0,0 +1,3 @@
+usr/bin
+usr/share/doc
+usr/share/man/man1
--- unison-2.27.57.orig/debian/unison-gtk.install.in
+++ unison-2.27.57/debian/unison-gtk.install.in
@@ -0,0 +1,4 @@
+debian/@UNISON_GTK_PACKAGE@.xpm     /usr/share/pixmaps/
+debian/@UNISON_GTK_PACKAGE@.svg     /usr/share/pixmaps/
+@UNISON_GTK@                        /usr/bin/
+debian/@UNISON_GTK_PACKAGE@.desktop /usr/share/applications/
--- unison-2.27.57.orig/debian/README.Debian
+++ unison-2.27.57/debian/README.Debian
@@ -0,0 +1,114 @@
+#----------------------------#
+# Documentation              #
+#----------------------------#
+
+Documentation for Unison is in the manual, which is available in 
+text formats in /usr/share/doc/unison. The same documentation 
+can also be accessed over the command line, and you can list the 
+available topics by executing 'unison -doc topics'. Of 
+particular interest for new users is the tutorial at 
+'unison -doc tutorial'.
+
+The most common usage of this package is to use ssh to connect
+to the remote host via to synchronise files. The 'Install'
+section of the manual details how to set up ssh with a key
+file and authentication agent to avoid repeatedly entering
+passwords or pass-phrases. Assuming your key file remains
+private, this is a more secure authentication method than
+passwords.
+
+The GTK+ interface for Unison is now available separately in
+the unison-gtk package.
+
+ -- Robert McQueen <robot101@debian.org>  Wed, 29 Aug 2001 21:18:29 +0100
+
+#----------------------------#
+# Unison and UnisonXXX       #
+#----------------------------#
+
+This package has been split when Unison 2.10.2 was released. 
+There now exist versions of the package : 
+- unison, unison-gtk (version 2.27)
+- unison2.13.16, unison2.13.16 (version 2.13.16)
+- unison2.9.1, unison2.9.1-gtk (version 2.9.1)
+
+The reason for this split is to preserve protocol compatibility with actual
+stable release of debian (e.g. Woody or Sarge or Etch).  By this way, you can
+install unison and synchronise testing/unstable systems or install unison2.9.1
+and synchronise testing/unstable with stable systems.
+
+You can install both unison and unison2.9.1, an alternative system is used (see
+"man update-alternatives"). 
+
+When the stable release will contain unison 2.10.2, unison2.9.1 will be
+removed. When a new stable release of unison will come (for example unison
+2.11.0) a package unison2.10.2 will be created to be able to synchronise with
+the future stable release of debian. The package unison will then hold the
+latest release of Unison (e.g. 2.11.0).
+
+By this way, you should always be able to synchronise stable/testing/unstable
+system using unison (the good version of unison).
+
+This scheme continue to apply further (unison 2.13.16 was released in unison
+package and unison2.9.1 was keep in Etch/Sid while Sarge was stable). 
+
+Etch is now released with unison 2.13.16, so unison2.9.1 will be removed.
+
+ -- Sylvain Le Gall <gildor@debian.org>  Mon, 25 Apr 2005 23:06:44 +0200  
+
+#----------------------------#
+# ssh-askpass                #
+#----------------------------#
+
+Ssh-askpass is a recommended package when using unison-gtk. The reason 
+for this is that if you use SSH access and that the key for this specific
+SSH login is password protected and that you don't have added it to your
+ssh-agent, you should be asked for a password in console mode. If unison
+was launched from menu, you won't be aware of this and the command will
+fail without explanation. The problem will be the same for simple password
+access. So it is strongly recommended to install ssh-askpass if you want 
+to use SSH access.
+
+However, it is not a dependency, because there is no obvious call to 
+ssh-askpass in the unison source. Moreover, using SSH is not mandatory for
+unison, ssh is only a "recommends" for unison and not a "depends".
+
+ -- Sylvain Le Gall <gildor@debian.org>  Mon,  9 May 2005 00:47:47 +0200
+ 
+#-----------------#
+# removable media #
+#-----------------#
+
+Using unison with removable media is not safe. If you run unison in batch mode
+with one of the replica on a removable media and if the media get disconnected
+during the operation unison will consider that most files of one replica has
+just been deleted and will delete the file of the other replica since it is
+running in batch mode.
+
+This happens if you run in batch mode. If you are not running in batch you 
+should notice that unison propose to delete a lot of files!
+
+As usual: keep an eye of what is proposed by unison! This is one of the reason 
+why unison keep asking you what you really want to do.
+
+ -- Sylvain Le Gall <gildor@debian.org>  Thu, 15 Feb 2007 22:12:48 +0100
+
+#----------------------#
+# unison-latest-stable #
+#----------------------#
+
+The package unison provide a link to the latest stable version of unison. This
+link is here to help people not asking themselves what is the latest stable 
+version of unison.
+
+In package provided for compatibility reason (unison2.9.1 for example) such a link
+doesn't exists. 
+
+If you use unison-latest-stable, you are sure to use the most up-to-date stable 
+version of unison.
+
+Moreover, using a constant name help "update-alternatives" not to get lost when
+upgrading the package from major version to major version (when the version 
+of unison change).
+
+ -- Sylvain Le Gall <gildor@debian.org>  Thu, 20 Sep 2007 15:58:53 +0200
--- unison-2.27.57.orig/debian/unison-gtk.svg.in
+++ unison-2.27.57/debian/unison-gtk.svg.in
@@ -0,0 +1,142 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://web.resource.org/cc/"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="48"
+   height="48"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.44.1"
+   sodipodi:docbase="/home/ericl/tmp"
+   sodipodi:docname="Unison.svg"
+   version="1.0">
+  <defs
+     id="defs4">
+    <linearGradient
+       id="linearGradient4637">
+      <stop
+         id="stop4639"
+         offset="0"
+         style="stop-color:yellow;stop-opacity:1;" />
+      <stop
+         style="stop-color:yellow;stop-opacity:1;"
+         offset="0.5"
+         id="stop4649" />
+      <stop
+         style="stop-color:#f30;stop-opacity:1;"
+         offset="1"
+         id="stop4645" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4637"
+       id="linearGradient4635"
+       x1="59.919643"
+       y1="257.14285"
+       x2="59.919643"
+       y2="307.51785"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.886245,0,0,0.886245,-29.10345,-226.2135)" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     gridtolerance="10000"
+     guidetolerance="10"
+     objecttolerance="10"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="7.875"
+     inkscape:cx="24"
+     inkscape:cy="24"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     inkscape:window-width="902"
+     inkscape:window-height="583"
+     inkscape:window-x="391"
+     inkscape:window-y="139"
+     width="48px"
+     height="48px" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title>Unison Logo</dc:title>
+        <dc:date>2007-05-01</dc:date>
+        <dc:creator>
+          <cc:Agent>
+            <dc:title>Eric Lavarde</dc:title>
+          </cc:Agent>
+        </dc:creator>
+        <dc:contributor>
+          <cc:Agent>
+            <dc:title>Benjamin C. Pierce, Jérôme Vouillon, S. Balasubramaniam</dc:title>
+          </cc:Agent>
+        </dc:contributor>
+        <dc:description>The U with arrow ends and yellow/red gradient from Unison</dc:description>
+        <dc:coverage>The Unison File Synchronizer Project or any packaging effort of Unison offering free access to the package sources</dc:coverage>
+        <dc:relation>http://www.cis.upenn.edu/~bcpierce/unison/Unison.gif</dc:relation>
+        <dc:rights>
+          <cc:Agent>
+            <dc:title>The Unison File Synchronizer Project</dc:title>
+          </cc:Agent>
+        </dc:rights>
+        <dc:language>N/A</dc:language>
+        <dc:subject>
+          <rdf:Bag>
+            <rdf:li>Unison</rdf:li>
+            <rdf:li>Synchronizer</rdf:li>
+            <rdf:li>Logo</rdf:li>
+          </rdf:Bag>
+        </dc:subject>
+        <cc:license
+           rdf:resource="http://creativecommons.org/licenses/GPL/2.0/" />
+        <dc:publisher>
+          <cc:Agent>
+            <dc:title>Eric Lavarde</dc:title>
+          </cc:Agent>
+        </dc:publisher>
+        <dc:identifier>http://eric.lavar.de/comp/unison/Unison.svg</dc:identifier>
+        <dc:source>http://eric.lavar.de/comp/unison/Unison.svg</dc:source>
+      </cc:Work>
+      <cc:License
+         rdf:about="http://creativecommons.org/licenses/GPL/2.0/">
+        <cc:permits
+           rdf:resource="http://web.resource.org/cc/Reproduction" />
+        <cc:permits
+           rdf:resource="http://web.resource.org/cc/Distribution" />
+        <cc:requires
+           rdf:resource="http://web.resource.org/cc/Notice" />
+        <cc:permits
+           rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
+        <cc:requires
+           rdf:resource="http://web.resource.org/cc/ShareAlike" />
+        <cc:requires
+           rdf:resource="http://web.resource.org/cc/SourceCode" />
+      </cc:License>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1">
+    <path
+       style="font-size:70.22288513px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:url(#linearGradient4635);fill-opacity:1;stroke:black;stroke-width:0.88624346px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Eras"
+       d="M 12.921958,2.1208664 L 5.8320104,9.349289 L 6.7182538,10.235533 L 8.2414846,10.235533 L 8.2414846,33.831765 C 8.2414846,34.063535 8.2573128,33.588127 8.2573128,33.819898 C 8.2573041,41.584443 15.516984,45.879134 23.529183,45.879134 C 34.454898,45.879134 39.675429,42.107983 39.675429,33.416336 L 39.675429,10.235533 L 41.281745,10.235533 L 42.16799,9.349289 L 35.078042,2.1208664 L 27.988095,9.349289 L 28.874338,10.235533 L 30.480655,10.235533 L 30.369875,33.416336 C 30.369875,41.296751 26.138665,42.1126 23.529183,42.1126 C 20.931382,42.112591 17.325479,41.702376 17.325479,33.416336 L 17.325479,10.235533 L 19.125662,10.235533 L 20.011905,9.349289 L 12.921958,2.1208664 z "
+       id="text2847"
+       sodipodi:nodetypes="cccccsscccccccccsccccc" />
+  </g>
+</svg>
--- unison-2.27.57.orig/debian/changelog
+++ unison-2.27.57/debian/changelog
@@ -0,0 +1,294 @@
+unison (2.27.57-1~bpo40+1) etch-backports; urgency=low
+
+  * Rebuild for etch-backports.
+  * Dropped the versioned build dependency on librsvg2-bin.  The etch version
+    creates a slightly uglier XPM icon, but it's not work backporting librsvg
+    for.
+
+ -- Peter Eisentraut <petere@debian.org>  Fri, 11 Jul 2008 10:35:10 +0200
+
+unison (2.27.57-1) unstable; urgency=low
+
+  [ Sylvain Le Gall]
+  * New upstream release (Closes: #462598):
+    * New option mountpoint can help avoid problem with removable media
+      (Closes: #349674)
+  * Unset CFLAGS in debian/rules (Closes: #476051)
+  * Upgrade to standards version 3.7.3 (no change)
+  * Update README.Debian to add new package unison2.13.16
+  * Remove debian/control.in
+  * Remove now useless gtkfont patch
+  * Change doc-base section to File Management
+
+  [ Stefano Zacchiroli ]
+  * promote Homepage to a real debian/control field, now that dpkg supports it
+  * fix vcs-svn field to point just above the debian/ dir
+
+ -- Sylvain Le Gall <gildor@debian.org>  Mon, 14 Apr 2008 19:39:39 +0200
+
+unison (2.13.16-9) unstable; urgency=low
+
+  * Use a correct way to test thing in shell (Closes: #443715)
+
+ -- Sylvain Le Gall <gildor@debian.org>  Sun, 23 Sep 2007 23:54:42 +0200
+
+unison (2.13.16-8) unstable; urgency=low
+
+  * Change section from net to utils 
+  * Tighten build-dependency on lablgtk2 and librsvg2
+  * Rework description of the package
+
+ -- Sylvain Le Gall <gildor@debian.org>  Thu, 20 Sep 2007 16:53:23 +0200
+
+unison (2.13.16-7) unstable; urgency=low
+
+  * Upgrade debian/watch version to 3,
+  * Upgrade debhelper debian/compat to 5,
+  * Use CDBS for debian/rules,
+  * Add debian/unison-gtk.desktop.in (Closes: #387666, #422495),
+  * Add a note in README.Debian about removable media
+  * Change my email address to gildor@debian.org,
+  * Change email address to gildor@debian.org everywhere
+  * Rebuild for ocaml 3.10.0
+  * Add icons for unison-gtk
+  * Use ocamlopt.opt when possible
+  * Provide a link from unison to unison-2.13 to work with
+    "addversionno = true" (Closes: #368418, #392099)
+  * Apply patche 01gtkfont to stop trying to use deprecated
+    font setting, thanks to Norman Ramsey (Closes: #372545)
+  * Add a note on what unison-latest-stable is supposed to do in
+    README.Debian (Closes: #361900), in the same time explain failure 
+    when trying to upgrade with update-alternatives (Closes: #335413)
+  * unison-gtk is now an alternative to unison (Closes: #411297)
+  * change stable release codename to Etch in README.Debian 
+    (Closes: #394738)
+
+ -- Sylvain Le Gall <gildor@debian.org>  Thu, 20 Sep 2007 15:58:53 +0200
+
+unison (2.13.16-6) unstable; urgency=low
+
+  * Add a note in README.Debian concerning the use of removable media
+  * Use ubuntu patch against bashism (Closes: #376362)
+
+ -- Sylvain Le Gall <gildor@debian.org>  Thu, 15 Feb 2007 22:36:17 +0100
+
+unison (2.13.16-5) unstable; urgency=low
+
+  * Rebuild for OCaml 3.09.1
+
+ -- Sylvain Le Gall <sylvain.le-gall@polytechnique.org>  Tue,  7 Feb 2006 00:36:07 +0100
+
+unison (2.13.16-4) unstable; urgency=low
+
+  * Forget to replace 3.08.3 by $(OCAMLABI) in the substvar
+    OCaml:Interpreter
+
+ -- Sylvain Le Gall <sylvain.le-gall@polytechnique.org>  Sat,  3 Dec 2005 00:56:50 +0100
+
+unison (2.13.16-3) unstable; urgency=low
+
+  * Remove hardcoded OCaml ABI
+
+ -- Sylvain Le Gall <sylvain.le-gall@polytechnique.org>  Fri,  2 Dec 2005 23:26:39 +0100
+
+unison (2.13.16-2) unstable; urgency=low
+
+  * Recommend ssh-client | openssh-client rather than ssh
+  * Remove dependency between unison and unison-gtk:
+    * Copy manual to unison-gtk.1
+    * Install documentation in all package
+    * (Closes: #308683)
+  * Use "mv unison $(UNISON)" and "$(UNISON_GTK)" rather than supplying
+    NAME=$(UNISON) when building (Closes: #325932, #326589, #326395, #325812)
+  * Remove reference to PostScript/HTML in the manpages (Closes: #323859)
+  * Reformat NEWS.Debian to limit line length to 72 (Closes: #326154)
+  
+ -- Sylvain Le Gall <sylvain.le-gall@polytechnique.org>  Mon,  5 Sep 2005 23:50:34 +0200
+
+unison (2.13.16-1) unstable; urgency=low
+
+  * New upstream release (Closes: #322042)
+  * Use the same binary version scheme as the "-addversionno" unison
+    option (Closes: #308507)
+  * Change the menu section to Apps/Tools (Closes: #308683). 
+  * The conflict between unison and unison-gtk as proposed in bug #308683 will
+    not be used: 
+    * the dependency is mainly a documentation dependency (symlink for
+      unison-gtk.1.gz and /usr/share/doc/unison-gtk )
+    * user can choose to install both unison and unison-gtk
+  * Correct a problem in the alternative system: when a package is upgraded
+    upstream, the binary provided is also changed (ie going from 
+    /usr/bin/unison-2.12.0 to /usr/bin/unison-2.13.16). So we symlinked the
+    binary to unison-latest-stable and use this binary in the alternative
+    system. 
+  * Add a unison[-gtk].preinst in order to correct the former behavior of
+    update alternatives.
+  * Transition to svn-buildpackage
+
+ -- Sylvain Le Gall <sylvain.le-gall@polytechnique.org>  Sat, 13 Aug 2005 20:17:11 +0200
+
+unison (2.12.0-1) unstable; urgency=low
+
+  * New upstream release
+  * Change the watch file to allow QA to use it
+  * Upgrade standards version to 3.6.2.0 (no change)
+
+ -- Sylvain Le Gall <sylvain.le-gall@polytechnique.org>  Thu, 28 Jul 2005 00:15:20 +0200
+
+unison (2.10.2-3) unstable; urgency=low
+
+  * Backport of sarge changes. Unison doesn't read/write on
+    $HOME/.unison, it is only a hack used in Fspath.canonizeFspath
+    and called from Os.unisonDir. Set the HOME variable before
+    generating to be $(CURDIR) in debian/rules (Closes in sarge:#308773)
+
+ -- Sylvain Le Gall <sylvain.le-gall@polytechnique.org>  Fri, 13 May 2005 00:11:09 +0200
+
+unison (2.10.2-2) unstable; urgency=low
+
+  * Using PACKAGE_VERSION to substitute variable in doc-base. (Closes: #307411)
+  * unison-gtk now recommends ssh-askpass, put a note in README.Debian
+    concerning the fact that ssh-askpass is required for using a password
+    protected SSH connection (Closes: #238854)
+  * State the changes of archive format from 2.9.1 to 2.10.2 in NEWS.Debian
+    (Closes: #308126)
+
+ -- Sylvain Le Gall <sylvain.le-gall@polytechnique.org>  Mon,  9 May 2005 00:47:47 +0200
+
+unison (2.10.2-1) unstable; urgency=medium
+
+  * Transition to ocaml 3.08.3 ( Closes: #304124 )
+  * 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
+    unison
+  * Revisit the build system : use sed and mv to create package unison2.9.1
+    and unison ( 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 oldest package ( which provides
+    also unison, but with a slightly different protocol ).
+  * Remove the patch 01_ocaml_3_08 since it is applied upstream
+  * Use a GTK2 interface, since GTK1 interface doesn't even build 
+    (Closes: #252617)
+  * No more HTML/PS documentation, only text documentation, because it is the
+    only one i can produce without doing severe licence violation ( the former
+    HTML version comes from a strange unison-manual.tex, which cannot be
+    found, so i don't have the source and i cannot distribute files without
+    source ) ( Closes: #171063, #184465 )
+  * New upstream release ( Closes: #271415 )
+  * Add NEWS.Debian to explain the split of the package
+  * Correct and add a section to README.Debian.
+
+ -- Sylvain Le Gall <sylvain.le-gall@polytechnique.org>  Tue, 19 Apr 2005 00:08:05 +0200
+
+unison (2.9.1-2) unstable; urgency=medium
+
+  * Version to fix maintainer fields
+
+ -- Sylvain Le Gall <sylvain.le-gall@polytechnique.org>  Mon,  7 Jun 2004 22:58:50 +0200
+
+unison (2.9.1-1) unstable; urgency=medium
+
+  * New upstream version.				(closes: #142748)
+  * Medium urgency to make woody release. Rationale:
+     - upstream versions of unison are rarely, if ever, broken, and if 
+       they are, are fixed within days. this release has had a week or
+       two to sweat it out.
+     - the previous version had problems on windows. seeing as
+       cross-platform compatibility is a major feature of unison, this 
+       could cause long-term aggrivation for people hoping to sync their
+       woody box with their windows box.
+     - unison's protocol is version specific, and if I waited until sid 
+       released to upload this new version, I'd have to provide an old
+       version in sid sooner than I'd have liked.
+     - it'd really annoy me if the version in woody wasn't the latest 
+       when it released. =)
+
+ -- Robert McQueen <robot101@debian.org>  Wed, 24 Apr 2002 19:05:08 +0100
+
+unison (2.8.1-2) unstable; urgency=low
+
+  * Moved to main.
+
+ -- Robert McQueen <robot101@debian.org>  Sat, 30 Mar 2002 04:13:46 +0000
+
+unison (2.8.1-1) unstable; urgency=low
+
+  * New upstream version.				(closes: #138576)
+  * Added menu entry for unison-gtk.			(closes: #133039)
+  * Changed 'lablgtk, libgtk1.2-dev' build dep to 'liblablgtk-ocaml-dev'.
+  * Updated manpage for new/removed options.
+
+ -- Robert McQueen <robot101@debian.org>  Fri, 29 Mar 2002 19:22:33 +0000
+
+unison (2.7.7-1) unstable; urgency=medium
+
+  * New upstream version. Fixes bugs in connecting and the client
+     startup sequence.
+
+ -- Robert McQueen <robot101@debian.org>  Sun, 23 Sep 2001 19:27:27 +0100
+
+unison (2.7.1-2) unstable; urgency=low
+
+  * Added libgtk1.2-dev build dep, but this is really a bug in lablgtk.
+  * Optimised debian/rules to only call shell once to set a variable, and
+     use that instead of an elaborate (and fallible) if construct.
+
+ -- Robert McQueen <robot101@debian.org>  Thu, 30 Aug 2001 12:57:44 +0100
+
+unison (2.7.1-1) unstable; urgency=low
+
+  * New upstream version.				(closes: #106983)
+  * Moved package to non-US/main - it recommends ssh.	(closes: #109406)
+  * Added the GTK interface version in a seperate unison-gtk package.
+							(closes: #105911)
+  * Added symlinks from unison-gtk's documentation and manpage to
+     unison's.
+  * Amended the manpage to detail the unison-gtk binary and changed
+     command line options.
+  * Install 'NEWS' file as upstream changelog, which it is, and remove
+     some extraneous docs.
+
+ -- Robert McQueen <robot101@debian.org>  Thu, 30 Aug 2001 01:21:14 +0100
+
+unison (2.6.11-2) unstable; urgency=low
+
+  * Added newline before descriptions are returned.	(closes: #86621)
+  * Fixed gratuitous debhelperism - version 3 is not required.
+							(closes: #97563)
+
+ -- Robert McQueen <robot101@debian.org>  Tue, 15 May 2001 20:36:43 +0100
+
+unison (2.6.11-1) unstable; urgency=low
+
+  * New upstream version.
+
+ -- Robert McQueen <robot101@debian.org>  Mon, 30 Apr 2001 19:06:03 +0100
+
+unison (2.6.1-2) unstable; urgency=low
+
+  * Fixed to take account of no native (ocamlopt) compiler on some archs.
+  * Minor debian/rules cleanups.
+
+ -- Robert McQueen <robot101@debian.org>  Thu, 28 Dec 2000 18:23:55 +0000
+
+unison (2.6.1-1) unstable; urgency=low
+
+  * Package adopted by new Debian maintainer. (closes: #75968)
+  * New upstream version. (closes: #65601)
+
+ -- Robert McQueen <robot101@debian.org>  Fri, 10 Nov 2000 23:12:02 +0000
+
+unison (1.180-2) unstable; urgency=low
+
+  * Changed the architecture field from all to any.
+
+ -- Sven LUTHER <luther@debian.org>  Mon, 10 Jan 2000 19:50:16 +0100
+
+unison (1.180-1) unstable; urgency=low
+
+  * Initial release.
+
+ -- Sven LUTHER <luther@debian.org>  Tue, 21 Dec 1999 12:15:49 +0100
--- unison-2.27.57.orig/debian/unison-gtk.prerm.in
+++ unison-2.27.57/debian/unison-gtk.prerm.in
@@ -0,0 +1,7 @@
+#!/bin/sh -e
+
+if [ "$1" = "remove" ];  then
+	update-alternatives --remove unison-gtk /usr/bin/@UNISON_GTK_ALTERNATIVE@
+fi
+
+#DEBHELPER#
--- unison-2.27.57.orig/debian/unison.dirs.in
+++ unison-2.27.57/debian/unison.dirs.in
@@ -0,0 +1,2 @@
+usr/bin
+usr/share/man/man1
--- unison-2.27.57.orig/debian/unison.postinst.in
+++ unison-2.27.57/debian/unison.postinst.in
@@ -0,0 +1,6 @@
+#!/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@.1.gz 
+
+#DEBHELPER#
--- unison-2.27.57.orig/debian/unison-gtk.links.in
+++ unison-2.27.57/debian/unison-gtk.links.in
@@ -0,0 +1,4 @@
+usr/bin/@UNISON_GTK@                 usr/bin/@UNISON_GTK_ALTERNATIVE@ 
+usr/bin/@UNISON_GTK@                 usr/bin/@UNISON_GTK_VERSIONNO@ 
+usr/share/man/man1/@UNISON_GTK@.1.gz usr/share/man/man1/@UNISON_GTK_ALTERNATIVE@.1.gz 
+usr/share/man/man1/@UNISON_GTK@.1.gz usr/share/man/man1/@UNISON_GTK_VERSIONNO@.1.gz 
--- unison-2.27.57.orig/debian/unison.install.in
+++ unison-2.27.57/debian/unison.install.in
@@ -0,0 +1 @@
+@UNISON@   /usr/bin/
--- unison-2.27.57.orig/debian/copyright
+++ unison-2.27.57/debian/copyright
@@ -0,0 +1,43 @@
+Unison was packaged for Debian
+by Robert McQueen <robot101@debian.org>
+on Fri, 10 Nov 2000 23:12:02 +0000.
+
+It was downloaded from:
+ http://www.cis.upenn.edu/~bcpierce/unison/download/stable/
+
+Benjamin Pierce <bcpierce@cis.upenn.edu> is the Unison project
+leader.
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License as
+published by the Free Software Foundation; either version 2 of
+the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+On Debian systems, the complete text of the GNU General Public
+License can be found in /usr/share/common-licenses/GPL file.
+
+
+debian/unison-gtk.svg:
+Copyright (c) 2007 Eric Lavarde
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License as
+published by the Free Software Foundation; either version 2 of
+the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+On Debian systems, the complete text of the GNU General Public
+License can be found in /usr/share/common-licenses/GPL file.
+
+
+
+
--- unison-2.27.57.orig/debian/control
+++ unison-2.27.57/debian/control
@@ -0,0 +1,61 @@
+Source: unison
+Section: utils
+Priority: optional
+Maintainer: Sylvain Le Gall <gildor@debian.org>
+Build-Depends: cdbs (>= 0.4.23), debhelper (>= 5), dpatch, ocaml-nox (>= 3.10.0-8), liblablgtk2-ocaml-dev (>= 2.6.0-13), chrpath, librsvg2-bin, imagemagick
+Standards-Version: 3.7.3
+Vcs-Svn: svn://svn.debian.org/svn/pkg-ocaml-maint/trunk/packages/unison/trunk
+Vcs-Browser: http://svn.debian.org/wsvn/pkg-ocaml-maint/trunk/packages/unison/trunk/
+Homepage: http://www.cis.upenn.edu/~bcpierce/unison/
+
+Package: unison
+Architecture: any
+Depends: ${shlibs:Depends}, ${F:OCamlInterpreter}
+Recommends: ssh-client | openssh-client
+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
+ directories to be stored on different hosts (or different disks
+ on the same host), modified separately, and then brought up to
+ date by propagating the changes in each replica to the other.
+ .
+ Unison offers several advantages over various synchronization methods
+ such as CVS, Coda, rsync, Intellisync, etc. Unison can run on and
+ synchronize between Windows and many UNIX platforms. Unison requires
+ no root privileges, system access or kernel changes to function. Unison
+ can synchronize changes to files and directories in both directions,
+ on the same machine, or across a network using ssh or a direct
+ socket connection.
+ .
+ Transfers are optimised using a version of the rsync protocol, 
+ making it ideal for slower links. Unison has a clear and precise 
+ specification, and is resilient to failure due to its careful 
+ handling of the replicas and its private structures.
+
+Package: unison-gtk
+Architecture: any
+Depends: ${shlibs:Depends}, ${F:OCamlInterpreter}
+Conflicts: unison-gtk (<< 2.9.1-3)
+Recommends: ssh-askpass, ssh-client | openssh-client
+Description: A file-synchronization tool for Unix and Windows with GTK+ interface
+ Unison is a file-synchronization tool for Unix and Windows, written
+ in OCaml. It allows two replicas of a collection of files and
+ directories to be stored on different hosts (or different disks
+ on the same host), modified separately, and then brought up to
+ date by propagating the changes in each replica to the other.
+ .
+ Unison offers several advantages over various synchronization methods
+ such as CVS, Coda, rsync, Intellisync, etc. Unison can run on and
+ synchronize between Windows and many UNIX platforms. Unison requires
+ no root privileges, system access or kernel changes to function. Unison
+ can synchronize changes to files and directories in both directions,
+ on the same machine, or across a network using ssh or a direct
+ socket connection.
+ .
+ Transfers are optimised using a version of the rsync protocol, 
+ making it ideal for slower links. Unison has a clear and precise 
+ specification, and is resilient to failure due to its careful 
+ handling of the replicas and its private structures.
+ .
+ This package adds the optional GTK+ interface.
--- unison-2.27.57.orig/debian/unison.prerm.in
+++ unison-2.27.57/debian/unison.prerm.in
@@ -0,0 +1,7 @@
+#!/bin/sh -e
+
+if [ "$1" = "remove" ]; then
+	update-alternatives --remove unison /usr/bin/@UNISON_ALTERNATIVE@
+fi
+
+#DEBHELPER#
--- unison-2.27.57.orig/debian/unison-gtk.manpages.in
+++ unison-2.27.57/debian/unison-gtk.manpages.in
@@ -0,0 +1 @@
+debian/@UNISON_GTK@.1
--- unison-2.27.57.orig/debian/unison.1.in
+++ unison-2.27.57/debian/unison.1.in
@@ -0,0 +1,219 @@
+.\"                                      Hey, EMACS: -*- nroff -*-
+.\" First parameter, NAME, should be all caps
+.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
+.\" other parameters are allowed: see man(7), man(1)
+.TH @UNISON_MAJ@ 1 "September 23, 2001"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh        disable hyphenation
+.\" .hy        enable hyphenation
+.\" .ad l      left justify
+.\" .ad b      justify to both left and right margins
+.\" .nf        disable filling
+.\" .fi        enable filling
+.\" .br        insert line break
+.\" .sp <n>    insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+@UNISON@ \- a file-synchronization tool for Unix and Windows
+.SH SYNOPSIS
+.B @UNISON@
+.RI [ options ]
+.br
+.B @UNISON@
+root1 root2
+.RI [ options ]
+.br
+.B @UNISON@
+profilename
+.RI [ options ]
+.br
+.B @UNISON@-gtk
+.RI [ options ]
+.SH DESCRIPTION
+This manual page briefly documents Unison, and was written for the
+Debian GNU/Linux distribution because the original program does not
+have a manual page. For a full description, please refer to the
+inbuilt documentation or the manuals in /usr/share/doc/@UNISON_PACKAGE@/. The
+@UNISON_GTK@ binary has similar command-line options, but allows the user
+to select and create profiles and configure options from within the
+program.
+.PP
+Unison is a file-synchronization tool for Unix and Windows. It allows
+two replicas of a collection of files and directories to be stored on
+different hosts (or different disks on the same host), modified
+separately, and then brought up to date by propagating the changes in
+each replica to the other.
+.PP
+Unison offers several advantages over various synchronization methods
+such as CVS, Coda, rsync, Intellisync, etc. Unison can run on and
+synchronize between Windows and many UNIX platforms. Unison requires
+no root privileges, system access or kernel changes to function. Unison
+can synchronize changes to files and directories in both directions,
+on the same machine, or across a network using ssh or a direct
+socket connection.
+.PP
+Transfers are optimised using a version of the rsync protocol, making
+it ideal for slower links. Unison has a clear and precise specification,
+and is resilient to failure due to its careful handling of the replicas
+and its private structures.
+.SH OPTIONS
+All Unison options are long, starting with one dash (`-') only.
+A summary of options is included here. For a complete description,
+see the inbuilt documentation or the manuals in /usr/share/doc/@UNISON_PACKAGE@/.
+.TP
+.B \-addprefsto
+specify a file to add new preferences to in interactive mode
+.TP
+.B \-addversionno
+add version number to name of @UNISON@ executable on server
+.TP
+.B \-auto
+automatically accept default actions
+.TP
+.B \-backup xxx
+add a regexp to the backup list
+.TP
+.B \-backups
+keep backup copies of files (deprecated: use 'backup')
+.TP
+.B \-batch
+batch mode: ask no questions at all
+.TP
+.B \-contactquietly
+suppress the 'contacting server' message during startup
+.TP
+.B \-debug xxx
+debug module xxx ('all' -> everything, 'verbose' -> more)
+.TP
+.B \-doc xxx
+show documentation ('-doc topics' lists topics)
+.TP
+.B \-dumbtty
+do not try to change terminal settings in text UI
+.TP
+.B \-editor xxx
+command for displaying the output of the -merge program
+.TP
+.B \-fastcheck
+do fast (and slightly unsafe) update detection on windows
+.TP
+.B \-follow xxx
+add a regexp to the follow list
+.TP
+.B \-force xxx
+force changes from this replica to the other
+.TP
+.B \-group
+synchronize group
+.TP
+.B \-height n
+height (in lines) of main window in graphical interface
+.TP
+.B \-ignore xxx
+add a regexp to the ignore list
+.TP
+.B \-ignorecase
+ignore upper/lowercase spelling of filenames
+.TP
+.B \-ignorenot xxx
+add a regexp to the ignorenot list
+.TP
+.B \-killserver
+kill server when done (even when using sockets)
+.TP
+.B \-log
+record actions in file specified by logfile preference
+.TP
+.B \-logfile xxx
+log file name
+.TP
+.B \-maxbackups n
+number of backed up versions of a file to keep
+.TP
+.B \-merge xxx
+command for merging conflicting files
+.TP
+.B \-merge2 xxx
+command for merging files (when no common version exists)
+.TP
+.B \-numericids
+don't map uid/gid values by user/group names
+.TP
+.B \-owner
+synchronize owner
+.TP
+.B \-path xxx
+path to synchronize
+.TP
+.B \-perms n
+part of the permissions which is synchronized
+.TP
+.B \-prefer xxx
+choose this replica's version in case of conflict
+.TP
+.B \-root xxx
+root of a replica
+.TP
+.B \-rootalias xxx
+register alias for canonical root names
+.TP
+.B \-rshargs xxx
+other arguments (if any) for remote shell command
+.TP
+.B \-rshcmd xxx
+path to the rsh executable
+.TP
+.B \-servercmd xxx
+name of unison executable on remote server
+.TP
+.B \-silent
+print nothing (except error messages)
+.TP
+.B \-socket xxx
+act as a server on a socket
+.TP
+.B \-sortbysize
+list changed files by size, not name
+.TP
+.B \-sortfirst xxx
+add a regexp to the sortfirst list
+.TP
+.B \-sortlast xxx
+add a regexp to the sortlast list
+.TP
+.B \-sortnewfirst
+list new before changed files
+.TP
+.B \-sshcmd xxx
+path to the ssh executable
+.TP
+.B \-statusdepth n
+status display depth for local files
+.TP
+.B \-terse
+suppress status messages
+.TP
+.B \-testserver
+exit immediately after the connection to the server
+.TP
+.B \-times
+synchronize modification times
+.TP
+.B \-ui xxx
+select user interface ('text' or 'graphic')
+.TP
+.B \-version
+print version and exit
+.PP
+Some preferences are just boolean flags. Others take numeric or string
+arguments, indicated in the preferences list by n or xxx. Most of the
+string preferences can be given several times; the arguments are
+accumulated into a list internally.
+.SH SEE ALSO
+The program is documented fully in the in-built documentation and the
+manual, available as text in /usr/share/doc/@UNISON_PACKAGE@/.
+.SH AUTHOR
+This manual page was written by Robert McQueen <robot101@debian.org>,
+for the Debian GNU/Linux system (but may be used by others).
--- unison-2.27.57.orig/debian/utils/purify_unison
+++ unison-2.27.57/debian/utils/purify_unison
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+PACKAGE=unison
+VERSION=$2
+ORIG=$1
+
+set -e 
+
+if test -d $PACAKGE-$VERSION; then
+	echo "Directory $PACKAGE-$VERSION exists"
+	exit 1
+fi
+	
+
+tar xzf $ORIG
+
+rm -f $PACKAGE-$VERSION/mt/threads.obj
+rm -f $PACKAGE-$VERSION/non-mt/threads.cmi
+rm -f $PACKAGE-$VERSION/non-mt/threads.cmx
+rm -f $PACKAGE-$VERSION/non-mt/threads.o
+rm -f $PACKAGE-$VERSION/non-mt/threads.obj
+rm -f $PACKAGE-$VERSION/win32rc/unison.res
+rm -f $PACKAGE-$VERSION/win32rc/unison.res.lib
+
+chmod 644 $PACKAGE-$VERSION/INSTALL
+chmod 644 $PACKAGE-$VERSION/Makefile.OCaml
+
+tar czf $ORIG $PACKAGE-$VERSION/
+rm -rf $PACKAGE-$VERSION
--- unison-2.27.57.orig/debian/unison-gtk.preinst.in
+++ unison-2.27.57/debian/unison-gtk.preinst.in
@@ -0,0 +1,12 @@
+#!/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#
--- unison-2.27.57.orig/debian/unison.manpages.in
+++ unison-2.27.57/debian/unison.manpages.in
@@ -0,0 +1 @@
+debian/@UNISON@.1 
--- unison-2.27.57.orig/debian/unison.doc-base.in
+++ unison-2.27.57/debian/unison.doc-base.in
@@ -0,0 +1,13 @@
+Document: @UNISON_PACKAGE@-manual
+Title: Unison @VERSION@ Installation and Usage Manual
+Author: Benjamin Pierce <bcpierce@cis.upenn.edu>
+Abstract: Unison is a file-synchronization tool for Unix and
+ Windows. It allows two replicas of a collection of files and
+ directories to be stored on different hosts (or different
+ disks on the same host), modified separately, and then brought
+ up to date by propagating the changes in each replica to the
+ other. This manual describes how to install and use Unison.
+Section: File Management
+
+Format: text
+Files: /usr/share/doc/@UNISON_PACKAGE@/unison-manual.txt.gz
--- unison-2.27.57.orig/debian/NEWS.Debian
+++ unison-2.27.57/debian/NEWS.Debian
@@ -0,0 +1,45 @@
+unison (2.13.16-1) unstable; urgency=low
+
+ As of version 2.10.2, the package use an alternative to let the user
+ choose between unison and unison2.9.1 binaries for unison and
+ unison-gtk. The binaries used in unison and unison-gtk package were
+ versionned binaries (ie unison2.10.2 and unison2.10.2-gtk). This was a
+ mistake.  When trying to upgrade to new upstream version, former
+ alternatives were not removed and you keep symlinks to non existent
+ binaries (ie you stay with unison pointing to unison2.10.2). This
+ behavior is corrected by using a stable name for unison binaries (ie
+ unison-latest-stable).
+
+ If you have configured alternatives, you may encounter some problem,
+ because during upgrade the symlink won't be updated, since it has been
+ user configured. In this case, you should run "update-alternatives
+ --auto unison && update-alternatives --auto unison-gtk" to restore the
+ good behavior.
+
+ -- Sylvain Le Gall <gildor@debian.org>  Sat, 13 Aug 2005 20:17:11 +0200
+
+unison (2.10.2-2) unstable; urgency=low
+
+ Upgrading from version 2.9.1 to 2.10.2 involves a lot of changes. In
+ particular, most of the configuration of the former stable release
+ (2.9.1) is no longer valid. Archive format has changed: if you have any
+ unsynchronized changes when you upgrade to this new archive format, you
+ have to merge them all by hand. You can also use the new package
+ unison2.9.1 (which is the former stable release) to synchronise your
+ old archive before migrating.
+
+ Version 2.10.2 and 2.9.1 are not compatible. You will need to have the
+ same version of unison on both end of the synchronisation link (ie if
+ you need to synchronise two computers, you will need to have unison
+ 2.10.2 on both).
+
+ -- Sylvain Le Gall <gildor@debian.org>  Mon, 25 Apr 2005 23:06:44 +0200  
+ 
+unison (2.10.2-1) unstable; urgency=medium
+
+  With this new stable release, a package split has been made. Now the
+  package unison will always hold the latest stable release of unison.
+  If you need to use the former stable release, you will need to install
+  unison2.9.1, which is a new debian package. 
+
+ -- Sylvain Le Gall <gildor@debian.org>  Tue, 19 Apr 2005 00:08:05 +0200
--- unison-2.27.57.orig/debian/unison-gtk.menu.in
+++ unison-2.27.57/debian/unison-gtk.menu.in
@@ -0,0 +1,4 @@
+?package(@UNISON_GTK_PACKAGE@):needs="x11" section="Applications/File Management" \
+ title="Unison @VERSION@ (GTK)" command="/usr/bin/@UNISON_GTK@" \
+ longtitle="Unison @VERSION@ file synchronizer (GTK interface)" \
+ icon="/usr/share/pixmaps/@UNISON_GTK_PACKAGE@.xpm"
--- unison-2.27.57.orig/debian/compat
+++ unison-2.27.57/debian/compat
@@ -0,0 +1 @@
+5
--- unison-2.27.57.orig/debian/unison-gtk.desktop.in
+++ unison-2.27.57/debian/unison-gtk.desktop.in
@@ -0,0 +1,13 @@
+[Desktop Entry]
+Encoding=UTF-8
+Name=Unison
+Comment=GTK interface for the unison file synchronization tool @VERSION@
+GenericName=File synchronization tool
+Exec=@UNISON_GTK@
+Terminal=false
+X-MultipleArgs=false
+Type=Application
+Icon=@UNISON_GTK_PACKAGE@.svg
+Categories=Utility;FileTools;GTK;
+StartupWMClass=Unison-gtk
+StartupNotify=true
--- unison-2.27.57.orig/debian/unison.links.in
+++ unison-2.27.57/debian/unison.links.in
@@ -0,0 +1,4 @@
+usr/bin/@UNISON@                 usr/bin/@UNISON_ALTERNATIVE@
+usr/bin/@UNISON@                 usr/bin/@UNISON_VERSIONNO@
+usr/share/man/man1/@UNISON@.1.gz usr/share/man/man1/@UNISON_ALTERNATIVE@.1.gz 
+usr/share/man/man1/@UNISON@.1.gz usr/share/man/man1/@UNISON_VERSIONNO@.1.gz 
--- unison-2.27.57.orig/debian/rules
+++ unison-2.27.57/debian/rules
@@ -0,0 +1,179 @@
+#!/usr/bin/make -f
+# debian/rules for unison package
+# Copyright (C) 2006 Sylvain Le Gall <gildor@debian.org>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/rules/dpatch.mk
+include /usr/share/cdbs/1/class/ocaml.mk
+
+VERSION=$(DEB_UPSTREAM_VERSION)
+# version used with addversionno in unison
+VERSIONNO=$(shell echo $(VERSION) | cut -f 1-2 -d .)
+
+ifeq ($(DEB_SOURCE_PACKAGE),unison)
+# latest package
+PACKAGE_VERSION=
+PRIORITY=20
+# unison-gtk can replaced unison
+PRIORITY_GTK=15
+else
+# compatibility package
+PACKAGE_VERSION=$(VERSION)
+PRIORITY=10
+PRIORITY_GTK=5
+endif
+
+UNISON=unison-$(VERSION)
+UNISON_MAJ=UNISON-$(VERSION)
+UNISON_PACKAGE=unison$(PACKAGE_VERSION)
+UNISON_ALTERNATIVE=$(if $(PACKAGE_VERSION),$(UNISON),unison-latest-stable)
+UNISON_VERSIONNO=unison-$(VERSIONNO)
+
+UNISON_GTK=unison-$(VERSION)-gtk
+UNISON_GTK_PACKAGE=$(UNISON_PACKAGE)-gtk
+UNISON_GTK_ALTERNATIVE=$(if $(PACKAGE_VERSION),$(UNISON_GTK),unison-latest-stable-gtk)
+UNISON_GTK_VERSIONNO=unison-$(VERSIONNO)-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
+
+MY_MAKE_FLAGS += $(shell if test -x /usr/bin/ocamlopt.opt; then echo "OCAMLOPT=ocamlopt.opt"; fi )
+
+ifeq ($(OCAML_HAVE_OCAMLOPT),yes)
+  NATIVE := true
+  DEB_DH_GENCONTROL_ARGS += -VF:OCamlInterpreter=""
+else
+  NATIVE := false
+  DEB_DH_GENCONTROL_ARGS += -VF:OCamlInterpreter="ocaml-base-$(OCAML_ABI)"
+  DEB_STRIP_EXCLUDE := $(UNISON) $(UNISON_GTK)
+endif
+
+UISTYLE := $(shell dpkg --compare-versions 2.10 ge $(VERSION) && echo gtk || echo gtk2)
+
+CDBS_BUILD_DEPENDS := $(subst ocaml-nox,ocaml-nox (>= 3.10.0-8),$(CDBS_BUILD_DEPENDS))
+
+DEB_INSTALL_DOCS_ALL := BUGS.txt TODO.txt unison-manual.txt -X unison.doc-base.in
+
+DEB_INSTALL_CHANGELOGS_ALL := NEWS 
+
+#
+# Build unison
+#
+ 
+configure::
+	cp config/Makefile.unix config/Makefile
+
+build/$(UNISON_PACKAGE)::
+	$(MAKE) UISTYLE=text NATIVE=$(NATIVE) $(MY_MAKE_FLAGS) CFLAGS=
+	mv '$(CURDIR)/unison' '$(CURDIR)/$(UNISON)'
+	env HOME='$(CURDIR)' '$(CURDIR)/$(UNISON)' -doc all > '$(CURDIR)/unison-manual.txt'
+
+build/$(UNISON_GTK_PACKAGE):: debian/$(UNISON_GTK_PACKAGE).xpm
+	$(MAKE) UISTYLE=$(UISTYLE) NATIVE=$(NATIVE) $(MY_MAKE_FLAGS) CFLAGS=
+	mv '$(CURDIR)/unison' '$(CURDIR)/$(UNISON_GTK)'
+	if test 'x$(OCAML_HAVE_OCAMLOPT)' = 'xyes'; then /usr/bin/chrpath -d '$(CURDIR)/$(UNISON_GTK)'; fi
+
+clean::
+	-$(RM) '$(CURDIR)/unison-manual.txt'
+	-$(RM) '$(CURDIR)/$(UNISON_GTK)'
+	-$(RM) '$(CURDIR)/$(UNISON)'
+	$(MAKE) clean
+
+binary-install/$(UNISON_GTK_PACKAGE)::
+	dh_desktop -p$(UNISON_GTK_PACKAGE)
+
+#
+# Unison icons
+#
+
+
+debian/$(UNISON_GTK_PACKAGE).png: debian/unison-gtk.svg.in
+	 rsvg -f png -w 32 -h 32 $^ $@
+
+debian/$(UNISON_GTK_PACKAGE).xpm: debian/$(UNISON_GTK_PACKAGE).png
+	convert $^ $@
+
+clean::
+	-$(RM) '$(CURDIR)/debian/$(UNISON_GTK_PACKAGE).png'
+	-$(RM) '$(CURDIR)/debian/$(UNISON_GTK_PACKAGE).xpm'
+
+#
+# Rename and substitute files
+#
+
+unison-rename: unison-rename-stamp
+unison-rename-stamp:	
+	# Rename all the debhelper files needed and substitue the @XXX@
+	# string
+	for i in $(RENAME); 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"; \
+	done
+	
+	# We always need to rename the manual 
+	cp '$(CURDIR)/debian/$(UNISON_PACKAGE).1' '$(CURDIR)/debian/$(UNISON).1'
+	# We copy unison.1 to unison-gtk.1
+	cp '$(CURDIR)/debian/$(UNISON).1' '$(CURDIR)/debian/$(UNISON_GTK).1'
+	
+	touch $@
+
+.PHONY: unison-rename
+
+common-binary-indep:: unison-rename
+common-binary-arch:: unison-rename
+
+clean::
+	# Remove the renamed files
+	-for i in $(RENAME); do \
+	  DST=`echo $$i | sed -e "s/unison/${UNISON_PACKAGE}/" -e "s/\\.in\\$$//"`; \
+	  $(RM) "$(CURDIR)/$$DST"; \
+	done
+	-$(RM) '$(CURDIR)/debian/$(UNISON).1' 
+	-$(RM) '$(CURDIR)/debian/$(UNISON_GTK).1'
+	-$(RM) '$(CURDIR)/unison-rename-stamp'
--- unison-2.27.57.orig/debian/svn-deblayout
+++ unison-2.27.57/debian/svn-deblayout
@@ -0,0 +1,3 @@
+origDir=../upstream
+origUrl=svn+ssh://svn.debian.org/svn/pkg-ocaml-maint/trunk/packages/unison/upstream
+tagsUrl=svn+ssh://svn.debian.org/svn/pkg-ocaml-maint/tags/packages/unison
--- unison-2.27.57.orig/debian/unison.preinst.in
+++ unison-2.27.57/debian/unison.preinst.in
@@ -0,0 +1,12 @@
+#!/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#
