[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[pkg-wine-party] Bug#758291: Proof of concept: Debian's alternative system in wine-development 1.7.24-5



Hi,

proof of concept - it works.

I adjusted the wine script and wineapploader to get the suffix based on
their link target's directory names. This should also work fine without
the alternative system.

Then I added a postinst and prerm script with the actual
update-alternative commands.

See attached patch from a local git repository based upon "apt-get
source wine-development". Unfortunately I'm not able to build yet, but I
think this is just because I try to patch wineapploader.in again but
with an modified patch.
[I edited my email address in the attached patch, don't know if this is
a problem for applying it. And of course it is not based on the real git
repository.]

A current git repository for the wine packaging would make these things
much easier. Michael please update it.


So for now I simply executed the commands from the postinst and adjusted
/usr/bin/wine and /usr/lib/wine-development/wineapploader.


I tested it successfully:

> /usr/bin/wine --version
wine-1.7.24
> /usr/bin/wine-development --version
wine-1.7.24
> wine --version
wine-1.7.24
> wine-development --version
wine-1.7.24

> winecfg
> winecfg-development
> /usr/bin/winecfg
> /usr/bin/winecfg-development
... all work.

To be continued ...

jre
commit 7d58285dbdb664bcc9a69a22c55144751236b0c2
Author: jre <jre.winesim@gmail.com>
Date:   Mon Aug 18 16:41:28 2014 +0200

    added update-alternatives system

diff --git a/debian/changelog b/debian/changelog
index 741d97d..1c54443 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+wine-development (1.7.24-5.1) UNRELEASED; urgency=medium
+
+  * added update-alternatives system
+
+ -- jre <jre.winesim@gmail.com>  Mon, 18 Aug 2014 14:15:37 +0200
+
 wine-development (1.7.24-5) unstable; urgency=medium
 
   * Fix wine-preloader installation path.
diff --git a/debian/patches/wineapploader.patch b/debian/patches/wineapploader.patch
index a6c75ce..4c186e6 100644
--- a/debian/patches/wineapploader.patch
+++ b/debian/patches/wineapploader.patch
@@ -10,7 +10,7 @@ author: Michael Gilbert <mgilbert@debian.org>
 -appname=`basename "$0" .exe`.exe
 +app=`basename "$0" .exe`
 +name=`echo $app | cut -d- -f1`
-+suffix=`echo $app | sed s/$name//`
++suffix=$(echo $(basename $(dirname $(readlink -f $(which $0)))) | sed s/wine//)
 +appname=$name.exe
  
  # first try explicit WINELOADER
diff --git a/debian/scripts/wine b/debian/scripts/wine
index 388f3ae..269bbe7 100755
--- a/debian/scripts/wine
+++ b/debian/scripts/wine
@@ -2,7 +2,7 @@
 
 set -e
 
-name=$(basename $0)
+name=$(basename $(readlink -f $(which $0)))
 bindir=/usr/lib/$name
 
 wine32=$bindir/wine
diff --git a/debian/wineVERSION.postinst b/debian/wineVERSION.postinst
new file mode 100644
index 0000000..1315bda
--- /dev/null
+++ b/debian/wineVERSION.postinst
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = "configure" ] ; then
+  # add update-alternatives entries for wine and the wineapploader scripts
+  # TODO: manpages
+  for app in wineboot winedbg winefile winecfg winepath ; do
+    slaves="$slaves --slave /usr/bin/$app $app /usr/bin/${app}VERSION"
+  done
+  update-alternatives \
+    --install /usr/bin/wine wine /usr/bin/wineVERSION 20 \
+    $slaves
+fi
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/wineVERSION.prerm b/debian/wineVERSION.prerm
new file mode 100644
index 0000000..6a48420
--- /dev/null
+++ b/debian/wineVERSION.prerm
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+  remove|deconfigure)
+    # remove update-alternatives entries
+    update-alternatives --remove wine /usr/bin/wineVERSION
+    ;;
+esac
+
+#DEBHELPER#
+
+exit 0

Reply to: