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

[pkg-wine-party] Bug#758291: Wine alternatives - last design decisions



Hi all!

Here's a proposal to implement the wine alternatives. (The manpage
update-alternatives(1) imo is the best reference for this.)

The Debian alternatives system uses one master and additional slaves. As
master I'd suggest "wine" (/usr/bin/wine). As slaves all other commands
in /usr/bin/ and their manpages.


The alternatives system would then be handled by the wine(-development)
binary package. Unfortunately some slaves are not in there, but in
wine64(-development) or wine{32,64}(-development)-tools.


If these packages are not installed, the corresponding slave alternative
links will simply not be installed. Per default update-alternatives will
display a warning then, but I'd suggest to use "--quiet" (Don't generate
any comments unless errors occur).

I added file triggers[1] on a file in each of these packages. These are
activated automatically by dpkg when a matching file is installed,
upgraded or removed as part of a package. The wine(-development) package
is then triggered to update the alternatives, so there won't be any
broken or wrong links.

[1] /usr/share/doc/dpkg-dev/triggers.txt.gz


If wine(-development) is not installed, the other packages still work,
but their commands are only available with suffix (-stable or -development).

wine64 already recommends wine. I propose to also let the -tools
recommend wine. I assume that nearly everybody who installs the -tools
also installs wine anyway. The packages wine, wine32 and wine64 together
have a installed size of only about 1 MB. However (once it's available
and recommended by wine) libwine-gecko has about 45MB. This is a
regression for users of the -tools packages, who don't want to install
wine(-development). But I think that's ok.

Alternatively we might add a new package wine-dummy that only ships the
alternatives system with a dummy script as master, and add "Depends:
wine|wine-dummy" to all slaves packages. I didn't try this yet, because
I'd like to avoid the extra package and the dummy script.

Or alternatively we could add a separate alternative system for the
-tools packages, with e.g. "winegcc" as master. But I assume that would
only help a very small minority of users.


In the attached patch there are 2 DEBUG lines and "--quiet" is not
specified, I'd change that before committing. I'd also rename
development/*.patch to debsuffix/*.patch, and drop winegcc.patch (see my
previous mail in this bugreport).

I will commit this to master and (slightly adjusted + the other relevant
changes) to stretch, in a few days for easier review.

Alternatively I might just commit to stretch for now, so that we could
first release wine, to have another round of testing.

Greets
jre
diff --git a/debian/NEWS b/debian/NEWS
index 31dcfde..8761c2d 100644
--- a/debian/NEWS
+++ b/debian/NEWS
@@ -1,3 +1,17 @@
+wine-development (1.9.15-2) unstable; urgency=medium
+
+  Debian has two sets of Wine packages: wine and wine-development. They now use
+  the Debian alternatives system to provide /usr/bin/wine and other commands.
+  If both are installed this system defaults to use the commands provided by
+  wine, which also previously provided the command names without suffix.
+
+  But if configured, or if only "wine-development" is installed, you may now
+  use wine-development's commands without the "-development" suffix.
+
+  For more information on this please have a look at README.debian.
+
+ -- Jens Reyer <jre.winesim@gmail.com>  Sun, 24 Jul 2016 23:43:42 +0200
+
 wine-development (1.9.0-2) unstable; urgency=medium
 
   Wine now uses a shared 64-bit wineprefix per default if wine32 and wine64 (or
diff --git a/debian/README.debian b/debian/README.debian
index 044a2fd..b695045 100644
--- a/debian/README.debian
+++ b/debian/README.debian
@@ -26,9 +26,8 @@ Debugging information is limited to only error messages by default.  If you
 want other types of debugging output as well, you can set the WINEDEBUG
 environment variable.
 
-Examples:
+Example:
 $ WINEDEBUG=fixme+all wine
-$ WINEDEBUG=fixme+all wine-development
 
 If you want this to be more permanent, you can include an
 "export WINEDEBUG=fixme+all" line in your ~/.bashrc file.
@@ -50,15 +49,34 @@ debsnap fetches source packages by default, which you will then need to build
 (see debuild).  debsnap also lets you fetch the binary packages with the
 "-a <architecture>" option and then specifying each of the binary packages.
 
+Alternative current versions
+============================
+You can choose between two sets of Wine packages: wine and wine-development.
+wine tracks the stable releases from winehq.org (e.g. version 1.8.3), and
+wine-development the development releases (e.g. version 1.7.15).
+
+wine and wine-development use the Debian alternatives system to provide
+/usr/bin/wine and other commands. If both packages are installed it defaults to
+use the commands provided by wine. You may change this by running:
+$ sudo update-alternatives --config wine
+
+You may force a version at any time (as long as the wineserver isn't running
+yet), by using the suffixed command names, e.g.:
+$ wine-stable foo.exe
+$ wine-development foo.exe
+$ winecfg-stable
+$ winecfg-development
+$ winegcc-stable ...
+$ winegcc-development ...
+
 Configuration
 =============
 Usually everything is automatically configured, but for fine-tuning a good tool
-is winecfg (or winecfg-development).
+is winecfg.
 
 If you need to set up Wine manually, without winecfg, you can force the
 creation of a ~/.wine directory by running:
 $ wineboot
-$ wineboot-development
 
 If something goes horribly wrong, you can always completely wipe your Wine
 setup with "rm -rf ~/.wine". This will destroy everything you've installed,
@@ -83,11 +101,9 @@ Windows applications (WoW64).
 If this causes problems for an application, you may create a 32-bit prefix by
 running e.g.:
 $ WINEARCH=win32 WINEPREFIX="$HOME/.wine32" wineboot
-$ WINEARCH=win32 WINEPREFIX="$HOME/.wine32" wineboot-development
 
 You have to specify this 32-bit prefix, whenever you want to use it, e.g.:
 $ WINEPREFIX="$HOME/.wine32" wine application.exe
-$ WINEPREFIX="$HOME/.wine32" wine-development application.exe
 
 If you don't want 64-bit at all, just uninstall wine64 (or
 wine-64-development).
@@ -107,7 +123,7 @@ Use the programs with the option "-m32" (for winemaker --wine32). If you are
 using wine64(-development)-tools specify the arch-specific path to some files
 additionally, e.g.:
 $ winegcc -m32 -L/usr/lib/i386-linux-gnu/wine ...
-$ winegcc-development -m32 -L/usr/lib/i386-linux-gnu/wine-development ...
+$ winegcc -m32 -L/usr/lib/i386-linux-gnu/wine-development ...
 
 Wine Gecko
 ==========
diff --git a/debian/control.in b/debian/control.in
index 64522a5..927bfdc 100644
--- a/debian/control.in
+++ b/debian/control.in
@@ -85,6 +85,8 @@ Suggests:
  playonlinux,
  wine-binfmt,
  dosbox (>= 0.74-4.2~),
+Breaks:
+ wine (<< 1.8.3-3~),
 Description: Windows API implementation - standard suite
  Wine is a free MS-Windows API implementation.
  This is still a work in progress and many applications may still not work.
@@ -129,6 +131,7 @@ Suggests:
  libwine-gecko-2.47 [!armel !armhf !arm64],
  wine64VERSION-preloader (= ${binary:Version}),
 Breaks:
+ wine64 (<< 1.8.3-3~),
  wineVERSION (<< 1.7.50-3~),
  wine64VERSION-preloader (<< 1.7.51-2~),
 Description: Windows API implementation - 64-bit binary loader
@@ -174,8 +177,13 @@ Depends:
  ${misc:Depends},
  ${shlibs:Depends},
  libwineVERSION-dev (= ${binary:Version}),
+Recommends:
+ wineVERSION (= ${source:Version}),
 Conflicts:
  wine64VERSION-tools,
+Breaks:
+ wine32-tools (<< 1.8.3-3~),
+ wine64-tools (<< 1.8.3-3~),
 Description: Windows API implementation - 32-bit developer tools
  Wine is a free MS-Windows API implementation.
  This is still a work in progress and many applications may still not work.
@@ -197,8 +205,13 @@ Depends:
  libwineVERSION-dev:i386 (= ${binary:Version}) [amd64] |
  libwineVERSION-dev:armel (= ${binary:Version}) [arm64] |
  libwineVERSION-dev:armhf (= ${binary:Version}) [arm64],
+Recommends:
+ wineVERSION (= ${source:Version}),
 Conflicts:
  wine32VERSION-tools,
+Breaks:
+ wine32-tools (<< 1.8.3-3~),
+ wine64-tools (<< 1.8.3-3~),
 Description: Windows API implementation - 64-bit developer tools
  Wine is a free MS-Windows API implementation.
  This is still a work in progress and many applications may still not work.
diff --git a/debian/wineVERSION.postinst b/debian/wineVERSION.postinst
new file mode 100644
index 0000000..474e7b8
--- /dev/null
+++ b/debian/wineVERSION.postinst
@@ -0,0 +1,78 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+    configure)
+        echo "DEBUG: $0 $1" 2>&1 
+        dpkg-trigger wineVERSION
+        ;;
+    triggered)
+        # debian alternatives system
+        echo "DEBUG: $0 $1" 2>&1
+        case DEBSUFFIX in
+            -stable)
+                PRIORITY=70;;
+            -development)
+                PRIORITY=50;;
+            *)
+                echo "DEBSUFFIX unknown"; exit 1;;
+        esac
+
+        apps="wineserver
+              msiexec
+              regedit
+              winecfg
+              winedbg
+              wineboot
+              winefile
+              winepath
+              regsvr32
+              wineconsole
+
+              wine64
+
+              wmc
+              wrc
+              widl
+              winecpp
+              winegcc
+              wineg++
+              winedump
+              winebuild
+              winemaker"
+
+        slaves=
+        for app in $apps; do
+            slaves="$slaves
+                    --slave /usr/bin/$app $app
+                            /usr/bin/${app}DEBSUFFIX
+                    --slave /usr/share/man/man1/${app}.1.gz ${app}.1.gz
+                            /usr/share/man/man1/${app}DEBSUFFIX.1.gz"
+        done
+
+        update-alternatives \
+            --install /usr/bin/wine wine /usr/bin/wineDEBSUFFIX $PRIORITY \
+            $slaves \
+            --slave /usr/share/man/man1/wine.1.gz wine.1.gz \
+                    /usr/share/man/man1/wineDEBSUFFIX.1.gz \
+            --slave /usr/share/man/de/man1/wine.1.gz wine.de.1.gz \
+                    /usr/share/man/de/man1/wineDEBSUFFIX.1.gz \
+            --slave /usr/share/man/fr/man1/wine.1.gz wine.fr.1.gz \
+                    /usr/share/man/fr/man1/wineDEBSUFFIX.1.gz \
+            --slave /usr/share/man/pl/man1/wine.1.gz wine.pl.1.gz \
+                    /usr/share/man/pl/man1/wineDEBSUFFIX.1.gz \
+            --slave /usr/share/man/de/man1/wineserver.1.gz wineserver.de.1.gz \
+                    /usr/share/man/de/man1/wineserverDEBSUFFIX.1.gz \
+            --slave /usr/share/man/fr/man1/wineserver.1.gz wineserver.fr.1.gz \
+                    /usr/share/man/fr/man1/wineserverDEBSUFFIX.1.gz \
+            --slave /usr/share/man/de/man1/winemaker.1.gz winemaker.de.1.gz \
+                    /usr/share/man/de/man1/winemakerDEBSUFFIX.1.gz \
+            --slave /usr/share/man/fr/man1/winemaker.1.gz winemaker.fr.1.gz \
+                    /usr/share/man/fr/man1/winemakerDEBSUFFIX.1.gz
+        ;;
+esac
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/wineVERSION.prerm b/debian/wineVERSION.prerm
new file mode 100644
index 0000000..5c68c07
--- /dev/null
+++ b/debian/wineVERSION.prerm
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+    remove|deconfigure)
+        update-alternatives --remove wine /usr/bin/wineDEBSUFFIX
+        ;;
+esac
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/wineVERSION.triggers b/debian/wineVERSION.triggers
new file mode 100644
index 0000000..43dad79
--- /dev/null
+++ b/debian/wineVERSION.triggers
@@ -0,0 +1,10 @@
+# update the wine alternatives in "wineVERSION.postinst triggered"
+
+# explicit trigger
+interest wineVERSION
+
+# indicates package wine64 installation status changed
+interest /usr/bin/wine64DEBSUFFIX
+
+# indicates package wine{32|64}-tools installation status changed
+interest /usr/bin/winegccDEBSUFFIX

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: