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

[pkg-wine-party] Bug#758291: Bug#758291: Bug#758291: Complete solution for update-alternatives



Hi

[I forgot to answer to the bug last time, see my last answer at the end
of the message.]


tldr:
=====
Everything works. No new package names.
Just take alternatives-wine1.6.2.patch and
alternatives-master_DEBSUFFIX.patch.
Consider merging the packaging to avoid some corner case issues due to
the new suffix -stable.


Long story:
===========

Attached you'll find 3 patches. The packages build, are installable and
changing the alternative between stable and development works.

I successfully  tested:

- wine --version
- wine OriginSetup.exe
- wineboot

wineboot (stable) requires a .wine to exist, but this issue is also
present in 1.6.2-8.


For current master (1.7.26-2):
------------------------------

Choose between these two patches (they install identical stuff):

- alternatives-master_DEBSUFFIX.patch
- alternatives-master_minimal.patch

The first one introduces a new variable DEBSUFFIX to make merging stable
and development packaging sometime easier.

The second (minmal) one simply uses VERSION. This will require work when
merging stable and development packaging, since VERSION is empty for
stable, thus there would be name collisions. I recommend not to use this
one.


For debian/wine-1.6.2 (1.6.2-8):
--------------------------------

- alternatives-wine1.6.2.patch

This works for the current packages. But see issues 1 & 2 below, and
consider merging the packaging now.




You'll find everything also in my git repository at
https://github.com/jre-wine/wine in the branches

- debian/wine-1.6.2UpdateAlternatives-minimal
- masterUpdateAlternatives-minimal
- masterUpdateAlternativesDEBSUFFIX



Issues
======

1.) -stable in names
--------------------

Introducing wine-stable et al. causes the same problems like for
wine-development. This does no harm as long as you use "wine" as
alternative for "wine-stable" (which is the default setup).

But if you directly use the -stable suffixed names AND wine-development
is set to provide the alternatives, then strange things might happen.
E.g. you create a Desktop launcher with "wine-stable". In it solely
"wine" is mentioned, which might point to wine-development.


2.) /usr/bin/wine32|64
----------------------

These two files are only in the stable wine package and not covered by
the alternatives system. This may be confusing when /usr/bin/wine points
to wine-development.


3.) Breaks or Conflicts?
------------------------

I added a "wine-developments breaks wine << 1.6.2.9" to avoid filename
conflicts (e.g. the new alternatives link /usr/bin/wine vs. the script
/usr/bin/wine (wine 1.6.2-8) which is called /usr/bin/wine-stable now).

--> I don't know whether to make this a Breaks or a Conflicts.

Breaks allows to install an unconfigured wine-development next to wine
1.6.2-8. While this causes no errors, you'll just miss wine-development
in the alternatives system until you install and configure it.
dpkg-reconfigure wine-development didn't help here.

lintian complained about the Conflicts being versioned. But since this
makes sense in our case it might be better to use the versioned
Conflicts and add a lintian-override.


Greets
jre



On 09/07/2014 04:13 AM, jre wrote:
> Hi
> 
>> First of all, thanks a bunch for all the work you've been doing lately
>> for the wine packages.
> 
> Thanks, much appreciated.
> 
>> I wasn't planning on merging the source for the two until after
>> jessie, and would prefer not to do that yet.  Is there any way you
>> could work these changes out so that it doesn't involve major
>> disruption to the wine stable package?
> 
> Well, it would ease maintaining the packages in jessie.
> Anyway I'll post the appropriate patches soon and then open a separate
> bug with patches for a merged packaging.
> 
> Greets
> jre
> 

commit 6f74551a08d5ef68539daf5be7f714e9801be91e
Author: jre <jre.winesim@gmail.com>
Date:   Thu Sep 11 02:38:16 2014 +0200

    alternatives for wine
    
    - Provide alternatives (priority 20) without suffix for /usr/bin/wine,
      the wineapploader links and their man pages.
      The default is wine stable with priority 70.
    - Introduce DEBSUFFIX (either -development or -stable) in d/rules.
    - Use DEBSUFFIX instead of VERSION for files that have an alternative
      link, to prevent name collisions when building wine stable.

diff --git a/debian/changelog b/debian/changelog
index e1d8eff..20ca599 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+wine-development (1.7.26-3) UNRELEASED; urgency=medium
+
+  * Add alternatives system for wine, the wineapploader links and the manpages.
+  * Introduce DEBSUFFIX (either -development or -stable) in d/rules.
+
+ -- jre <jre.winesim@gmail.com>  Thu, 11 Sep 2014 02:15:20 +0200
+
 wine-development (1.7.26-2) unstable; urgency=medium
 
   * Install manpages, thanks jre (closes: #760694).
diff --git a/debian/control.in b/debian/control.in
index f73ad85..34f1746 100644
--- a/debian/control.in
+++ b/debian/control.in
@@ -70,6 +70,8 @@ Suggests:
  wine-doc,
  binfmt-support,
  ttf-mscorefonts-installer,
+Breaks:
+ wine (<< 1.6.2-9),
 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.
diff --git a/debian/rules b/debian/rules
index b1db543..d00eafa 100755
--- a/debian/rules
+++ b/debian/rules
@@ -7,6 +7,11 @@ export DH_VERBOSE=1
 export DEB_BUILD_MAINT_OPTIONS=hardening=+all,-pie
 
 VERSION=$(shell dpkg-parsechangelog | grep ^Source | cut -d\  -f2 | sed s/wine//g)
+ifeq ($(VERSION), -development)
+DEBSUFFIX=$(VERSION)
+else
+DEBSUFFIX=-stable
+endif
 
 DATADIR=/usr/share/wine$(VERSION)
 INCLUDEDIR=/usr/include/wine$(VERSION)
@@ -49,7 +54,7 @@ debian/control: debian/control.in
 	sed s/VERSION/$(VERSION)/g < $< > $@
 
 debian/wine$(VERSION)%: debian/wineVERSION%
-	sed s/VERSION/$(VERSION)/g < $< > $@
+	sed "s/VERSION/$(VERSION)/g;s/DEBSUFFIX/$(DEBSUFFIX)/g" < $< > $@
 
 debian/wine32$(VERSION)%: debian/wine32VERSION%
 	sed s/VERSION/$(VERSION)/g < $< > $@
@@ -70,14 +75,14 @@ override_dh_auto_configure:
 
 override_dh_install: $(INSTALLS)
 	mkdir -p debian/tmp
-	cp debian/scripts/wine debian/tmp/wine$(VERSION)
+	cp debian/scripts/wine debian/tmp/wine$(DEBSUFFIX)
 	cp tools/winedump/README debian/tmp/README.winedump
 	cp programs/winedbg/README debian/tmp/README.winedbg
 	cp debian/tmp/$(LIBDIR)/winecfg debian/tmp/wineapploader
 	test -f debian/tmp/$(LIBDIR)/wine-preloader || \
 	    cp debian/scripts/wine-preloader debian/tmp/$(LIBDIR)
 	for file in $$(find debian/tmp/$(MANDIR) -type f); do \
-	    rename=$$(echo $$file | sed s/\\.1/$(VERSION)\\.1/); \
+	    rename=$$(echo $$file | sed s/\\.1/$(DEBSUFFIX)\\.1/); \
 	    cp $$file $$rename || true; \
 	    done
 	dh_install
diff --git a/debian/scripts/wine b/debian/scripts/wine
index 388f3ae..ebcb17b 100755
--- a/debian/scripts/wine
+++ b/debian/scripts/wine
@@ -2,7 +2,8 @@
 
 set -e
 
-name=$(basename $0)
+# name results in "wine-development" or "wine"
+name="$(echo $(basename $(readlink -f $0)) | sed s/-stable//)"
 bindir=/usr/lib/$name
 
 wine32=$bindir/wine
diff --git a/debian/wineVERSION.install b/debian/wineVERSION.install
index c27eb19..f565373 100644
--- a/debian/wineVERSION.install
+++ b/debian/wineVERSION.install
@@ -1,2 +1,2 @@
-debian/tmp/wineVERSION usr/bin
+debian/tmp/wineDEBSUFFIX usr/bin
 debian/tmp/wineapploader usr/lib/wineVERSION
diff --git a/debian/wineVERSION.links b/debian/wineVERSION.links
index 757f5a4..1226deb 100644
--- a/debian/wineVERSION.links
+++ b/debian/wineVERSION.links
@@ -1,7 +1,7 @@
-usr/lib/wineVERSION/wineapploader usr/bin/regeditVERSION
-usr/lib/wineVERSION/wineapploader usr/bin/winecfgVERSION
-usr/lib/wineVERSION/wineapploader usr/bin/winedbgVERSION
-usr/lib/wineVERSION/wineapploader usr/bin/winebootVERSION
-usr/lib/wineVERSION/wineapploader usr/bin/winepathVERSION
-usr/lib/wineVERSION/wineapploader usr/bin/winefileVERSION
-usr/lib/wineVERSION/wineapploader usr/bin/regsvr32VERSION
+usr/lib/wineVERSION/wineapploader usr/bin/regeditDEBSUFFIX
+usr/lib/wineVERSION/wineapploader usr/bin/winecfgDEBSUFFIX
+usr/lib/wineVERSION/wineapploader usr/bin/winedbgDEBSUFFIX
+usr/lib/wineVERSION/wineapploader usr/bin/winebootDEBSUFFIX
+usr/lib/wineVERSION/wineapploader usr/bin/winepathDEBSUFFIX
+usr/lib/wineVERSION/wineapploader usr/bin/winefileDEBSUFFIX
+usr/lib/wineVERSION/wineapploader usr/bin/regsvr32DEBSUFFIX
diff --git a/debian/wineVERSION.postinst b/debian/wineVERSION.postinst
new file mode 100644
index 0000000..82dd5d8
--- /dev/null
+++ b/debian/wineVERSION.postinst
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = "configure" ] ; then
+  # add update-alternatives entries
+  PRIORITY=70
+  [ DEBSUFFIX != -development ] || PRIORITY=20
+
+  for app in regedit regsvr32 wineboot winecfg winedbg winefile winepath ; 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 \
+    --slave /usr/share/man/man1/wine.1.gz wine.1.gz /usr/share/man/man1/wineDEBSUFFIX.1.gz \
+    $slaves
+fi
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/wineVERSION.prerm b/debian/wineVERSION.prerm
new file mode 100644
index 0000000..01dfc5f
--- /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/wineDEBSUFFIX
+    ;;
+esac
+
+#DEBHELPER#
+
+exit 0
commit c89a5aa7a08396667a5feef27e4269ea9b2d724f
Author: jre <jre.winesim@gmail.com>
Date:   Thu Sep 11 02:28:22 2014 +0200

    alternatives for wine-development (minimal, not futureproof)
    
    - Provide alternatives (priority 20) without suffix for /usr/bin/wine,
      the wineapploader links and their man pages.
      The default is wine stable with priority 70.
    
    NOTE:
    This requires work when merging stable and development packaging, since
    VERSION is empty for stable, thus there are name collisions.

diff --git a/debian/changelog b/debian/changelog
index e1d8eff..0f89c3e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+wine-development (1.7.26-3minimal) UNRELEASED; urgency=medium
+
+  * Add alternatives system for wine, the wineapploader links and the manpages.
+
+ -- jre <jre.winesim@gmail.com>  Thu, 11 Sep 2014 02:15:20 +0200
+
 wine-development (1.7.26-2) unstable; urgency=medium
 
   * Install manpages, thanks jre (closes: #760694).
diff --git a/debian/control.in b/debian/control.in
index f73ad85..34f1746 100644
--- a/debian/control.in
+++ b/debian/control.in
@@ -70,6 +70,8 @@ Suggests:
  wine-doc,
  binfmt-support,
  ttf-mscorefonts-installer,
+Breaks:
+ wine (<< 1.6.2-9),
 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.
diff --git a/debian/scripts/wine b/debian/scripts/wine
index 388f3ae..ebcb17b 100755
--- a/debian/scripts/wine
+++ b/debian/scripts/wine
@@ -2,7 +2,8 @@
 
 set -e
 
-name=$(basename $0)
+# name results in "wine-development" or "wine"
+name="$(echo $(basename $(readlink -f $0)) | sed s/-stable//)"
 bindir=/usr/lib/$name
 
 wine32=$bindir/wine
diff --git a/debian/wineVERSION.postinst b/debian/wineVERSION.postinst
new file mode 100644
index 0000000..f14242b
--- /dev/null
+++ b/debian/wineVERSION.postinst
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = "configure" ] ; then
+  # add update-alternatives entries
+  for app in regedit regsvr32 wineboot winecfg winedbg winefile winepath ; do
+    slaves="$slaves --slave /usr/bin/$app $app /usr/bin/${app}VERSION \
+      --slave /usr/share/man/man1/${app}.1.gz ${app}.1.gz /usr/share/man/man1/${app}VERSION.1.gz"
+  done
+
+  update-alternatives \
+    --install /usr/bin/wine wine /usr/bin/wineVERSION 20 \
+    --slave /usr/share/man/man1/wine.1.gz wine.1.gz /usr/share/man/man1/wineVERSION.1.gz \
+    $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
commit 77bd8f2194ea5b7309f8d4c9ad670b84e0529843
Author: jre <jre.winesim@gmail.com>
Date:   Thu Sep 11 02:40:42 2014 +0200

    alternatives for wine stable (hardcoded)
    
    - Add suffix -stable to /usr/bin/wine, the wine-wrapper links and their
      manpages.
    - Provide alternatives (priority 70) for above mentioned without suffix
      -stable. This is the default, since wine-development has priority 20.
    - Move removal of wine alternative from packages wine32|64 to package
      wine.
      NOTE: The alternative for wineserver is still removed in wine32|64.
    - Fix wine-wrapper to ignore -stable suffix.
    
    NOTE:
    /usr/bin/wine32|64 stay untouched. I think this may be confusing when
    /usr/bin/wine points to wine-development.

diff --git a/debian/changelog b/debian/changelog
index 05727be..659ecd9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+wine (1.6.2-9) UNRELEASED; urgency=medium
+
+  * Add alternatives system for wine, the wine-wrapper links and the manpages.
+
+ -- jre <jre.winesim@gmail.com>  Thu, 11 Sep 2014 01:08:30 +0200
+
 wine (1.6.2-8) unstable; urgency=medium
 
   * Use a .maintscript file to handle symlink-to-folder transitions in
diff --git a/debian/rules b/debian/rules
index 8f51a87..18ea179 100755
--- a/debian/rules
+++ b/debian/rules
@@ -51,6 +51,12 @@ debian/%$(VERSUFFIX).manpages: debian/%.manpages-common
 debian/%$(VERSUFFIX).lintian-overrides: debian/%.lintian-overrides-common
 	cp $< $@
 
+debian/%$(VERSUFFIX).postinst: debian/%.postinst-common
+	cp $< $@
+
+debian/%$(VERSUFFIX).prerm: debian/%.prerm-common
+	cp $< $@
+
 %:
 	dh $@ --parallel --with autoreconf
 
@@ -74,6 +80,14 @@ ifneq ($(DEB_BUILD_ARCH), kfreebsd-amd64)
 	cd debian/tmp/$(LIBDIR)/bin && ln -s wine-preloader wine64-preloader || true
 	cp debian/tmp/usr/share/man/man1/wine.1 debian/tmp/usr/share/man/man1/wine32.1
 	cp debian/tmp/usr/share/man/man1/wine.1 debian/tmp/usr/share/man/man1/wine64.1
+	mv debian/tmp/usr/share/man/man1/wine.1 debian/tmp/usr/share/man/man1/wine-stable.1
+	mv debian/tmp/usr/share/man/man1/regedit.1 debian/tmp/usr/share/man/man1/regedit-stable.1
+	mv debian/tmp/usr/share/man/man1/winecfg.1 debian/tmp/usr/share/man/man1/winecfg-stable.1
+	mv debian/tmp/usr/share/man/man1/winedbg.1 debian/tmp/usr/share/man/man1/winedbg-stable.1
+	mv debian/tmp/usr/share/man/man1/wineboot.1 debian/tmp/usr/share/man/man1/wineboot-stable.1
+	mv debian/tmp/usr/share/man/man1/winepath.1 debian/tmp/usr/share/man/man1/winepath-stable.1
+	mv debian/tmp/usr/share/man/man1/winefile.1 debian/tmp/usr/share/man/man1/winefile-stable.1
+	mv debian/tmp/usr/share/man/man1/regsvr32.1 debian/tmp/usr/share/man/man1/regsvr32-stable.1
 	test -f debian/tmp/$(LIBDIR)/bin/wine-preloader || \
 	    cp debian/scripts/wine-preloader debian/tmp/$(LIBDIR)/bin
 	dh_install
diff --git a/debian/scripts/wine b/debian/scripts/wine
deleted file mode 100755
index 2cf676c..0000000
--- a/debian/scripts/wine
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh
-
-set -e
-
-wine=/usr/bin/wine32
-if test "$(file -b -L "$1" | cut -d\  -f1)" = "PE32+" -o "$WINEARCH" = "win64"; then
-    wine=/usr/bin/wine64
-fi
-
-if test -f $wine; then
-    $wine "$@"
-else
-    echo "unable to find wine executable: the $(basename $wine) package probably needs to be installed."
-    if [ "$(dpkg --print-architecture)" = "amd64" -a "$(dpkg --print-foreign-architectures)" != "i386" ]; then
-        echo "and it looks like multiarch needs to be enabled as well.  as root, please"
-        echo "execute \"dpkg --add-architecture i386 && apt-get install wine32\""
-    fi
-    exit 1
-fi
diff --git a/debian/scripts/wine-stable b/debian/scripts/wine-stable
new file mode 100755
index 0000000..2cf676c
--- /dev/null
+++ b/debian/scripts/wine-stable
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+set -e
+
+wine=/usr/bin/wine32
+if test "$(file -b -L "$1" | cut -d\  -f1)" = "PE32+" -o "$WINEARCH" = "win64"; then
+    wine=/usr/bin/wine64
+fi
+
+if test -f $wine; then
+    $wine "$@"
+else
+    echo "unable to find wine executable: the $(basename $wine) package probably needs to be installed."
+    if [ "$(dpkg --print-architecture)" = "amd64" -a "$(dpkg --print-foreign-architectures)" != "i386" ]; then
+        echo "and it looks like multiarch needs to be enabled as well.  as root, please"
+        echo "execute \"dpkg --add-architecture i386 && apt-get install wine32\""
+    fi
+    exit 1
+fi
diff --git a/debian/scripts/wine-wrapper b/debian/scripts/wine-wrapper
index 95d2c8f..10fcc80 100644
--- a/debian/scripts/wine-wrapper
+++ b/debian/scripts/wine-wrapper
@@ -20,7 +20,7 @@
 # License along with this library; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 
-appname=`basename "$0" .exe`.exe
+appname=`basename "$0" .exe|sed "s/-stable//"`.exe
 
 if test -z $WINEARCH; then
     test ! -z "$WINEPREFIX" || WINEPREFIX="$HOME/.wine"
diff --git a/debian/wine.install-common b/debian/wine.install-common
index 27e6c13..77d3bc8 100644
--- a/debian/wine.install-common
+++ b/debian/wine.install-common
@@ -1,18 +1,18 @@
-debian/scripts/wine usr/bin
+debian/scripts/wine-stable usr/bin
 
 debian/scripts/wine-wrapper usr/bin
 debian/scripts/wine-wrapper.1 usr/share/man/man1
 
 programs/winedbg/README usr/share/doc/wine/README.winedbg
 
-usr/share/man/man1/wine.1
-usr/share/man/man1/regedit.1
-usr/share/man/man1/winecfg.1
-usr/share/man/man1/winedbg.1
-usr/share/man/man1/wineboot.1
-usr/share/man/man1/winepath.1
-usr/share/man/man1/winefile.1
-usr/share/man/man1/regsvr32.1
+usr/share/man/man1/wine-stable.1
+usr/share/man/man1/regedit-stable.1
+usr/share/man/man1/winecfg-stable.1
+usr/share/man/man1/winedbg-stable.1
+usr/share/man/man1/wineboot-stable.1
+usr/share/man/man1/winepath-stable.1
+usr/share/man/man1/winefile-stable.1
+usr/share/man/man1/regsvr32-stable.1
 
 usr/share/man/de.UTF-8
 usr/share/man/fr.UTF-8
diff --git a/debian/wine.links-common b/debian/wine.links-common
index c571b64..96206df 100644
--- a/debian/wine.links-common
+++ b/debian/wine.links-common
@@ -1,7 +1,7 @@
-usr/bin/wine-wrapper usr/bin/regedit
-usr/bin/wine-wrapper usr/bin/winecfg
-usr/bin/wine-wrapper usr/bin/winedbg
-usr/bin/wine-wrapper usr/bin/wineboot
-usr/bin/wine-wrapper usr/bin/winepath
-usr/bin/wine-wrapper usr/bin/winefile
-usr/bin/wine-wrapper usr/bin/regsvr32
+usr/bin/wine-wrapper usr/bin/regedit-stable
+usr/bin/wine-wrapper usr/bin/winecfg-stable
+usr/bin/wine-wrapper usr/bin/winedbg-stable
+usr/bin/wine-wrapper usr/bin/wineboot-stable
+usr/bin/wine-wrapper usr/bin/winepath-stable
+usr/bin/wine-wrapper usr/bin/winefile-stable
+usr/bin/wine-wrapper usr/bin/regsvr32-stable
diff --git a/debian/wine.postinst-common b/debian/wine.postinst-common
new file mode 100644
index 0000000..f178ff1
--- /dev/null
+++ b/debian/wine.postinst-common
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = "configure" ] ; then
+  # add update-alternatives entries for wine and the wine-wrapper scripts
+  for app in regedit regsvr32 wineboot winedbg winefile winecfg winepath ; do
+    slaves="$slaves --slave /usr/bin/$app $app /usr/bin/${app}-stable \
+      --slave /usr/share/man/man1/${app}.1.gz ${app}.1.gz /usr/share/man/man1/${app}-stable.1.gz"
+  done
+
+  update-alternatives \
+    --install /usr/bin/wine wine /usr/bin/wine-stable 70 \
+    --slave /usr/share/man/man1/wine.1.gz wine.1.gz /usr/share/man/man1/wine-stable.1.gz \
+    $slaves
+fi
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/wine.prerm-common b/debian/wine.prerm-common
new file mode 100644
index 0000000..b65b621
--- /dev/null
+++ b/debian/wine.prerm-common
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+  remove|deconfigure)
+    # remove update-alternatives entries
+    update-alternatives --remove wine /usr/bin/wine-stable
+    ;;
+esac
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/wine32.prerm b/debian/wine32.prerm
index 01a4b69..0697ebf 100644
--- a/debian/wine32.prerm
+++ b/debian/wine32.prerm
@@ -1,6 +1,5 @@
 #!/bin/sh -e
 
-update-alternatives --remove-all wine 2>/dev/null || true
 update-alternatives --remove-all wineserver 2>/dev/null || true
 
 #DEBHELPER#
diff --git a/debian/wine64.prerm b/debian/wine64.prerm
index 01a4b69..0697ebf 100644
--- a/debian/wine64.prerm
+++ b/debian/wine64.prerm
@@ -1,6 +1,5 @@
 #!/bin/sh -e
 
-update-alternatives --remove-all wine 2>/dev/null || true
 update-alternatives --remove-all wineserver 2>/dev/null || true
 
 #DEBHELPER#

Reply to: