Package: mplayer
Followup-For: Bug #523842
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu karmic ubuntu-patch

This debdiff creates a -nogui package, but also, to avoid duplicating the 
manpages
(1 Mb compressed), it creates a -manpages package.
mplayer-nogui conflicts and replace mplayer (same executable name), and
mplayer-manpages is recommended in mplayer and mplayer-nogui.

*** /tmp/tmpAYa1Zz


-- System Information:
Debian Release: squeeze/sid
  APT prefers karmic-updates
  APT policy: (500, 'karmic-updates'), (500, 'karmic-security'), (500, 'karmic')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.28-11-generic (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash
diff -u mplayer-1.0~rc3+svn20090405/debian/rules mplayer-1.0~rc3+svn20090405/debian/rules
--- mplayer-1.0~rc3+svn20090405/debian/rules
+++ mplayer-1.0~rc3+svn20090405/debian/rules
@@ -135,7 +135,6 @@
 	--enable-sdl \
 	--enable-ossaudio \
 	--enable-lirc \
-	--enable-gui \
 	--enable-freetype \
 	--enable-menu \
 	--enable-largefiles 
@@ -150,16 +149,34 @@
 	test -r .svnrevision && cp .svnrevision snapshot_version
 	# Add commands to configure the package here.
 	$(CLEAN_ENV) \
-	./configure $(COMMON_CONFIGURE_FLAGS) $(DEB_BUILD_CONFIGURE)
+	./configure $(COMMON_CONFIGURE_FLAGS) $(DEB_BUILD_CONFIGURE) --disable-gui
 	touch configure-arch-stamp
 
 # commands to compile the package
-build-arch: build-arch-stamp
-build-arch-stamp: configure-arch-stamp
+build-gui: build-gui-stamp
+build-gui-stamp:
 	dh_testdir
+	if test -f build-nogui-stamp; then \
+	  $(MAKE) distclean; \
+	  rm -f build-nogui-stamp; \
+	fi
+	rm -f configure-arch-stamp
+	$(CLEAN_ENV) \
+	./configure $(COMMON_CONFIGURE_FLAGS) $(DEB_BUILD_CONFIGURE) --enable-gui
+	$(CLEAN_ENV) \
+	$(MAKE)
+	touch build-gui-stamp
+
+build-nogui: build-nogui-stamp
+build-nogui-stamp: configure-arch-stamp
+	dh_testdir
+	if test -f build-gui-stamp; then \
+	  $(MAKE) distclean; \
+	  rm -f build-gui-stamp; \
+	fi
 	$(CLEAN_ENV) \
 	$(MAKE)
-	touch build-arch-stamp
+	touch build-nogui-stamp
 
 ###### build-indep
 
@@ -172,7 +189,7 @@
 	$(MAKE) -C DOCS/xml html-chunked
 	touch build-indep-stamp
 
-build: build-indep build-arch
+build: build-indep
 
 
 ################ clean
@@ -187,23 +204,29 @@
 
 ##################### install
 
-install-arch:  build-arch
+install-arch:  
+install-nogui: build-nogui
 	dh_testdir
 	dh_prep -a
-	$(MAKE) install-gui DESTDIR=$(destdir)
-	$(MAKE) install-mplayer-gui-man DESTDIR=$(destdir)
+	$(MAKE) install-mplayer DESTDIR=$(CURDIR)/debian/mplayer-nogui
 
 # scripts
 	chmod a+x debian/scripts/*
 	dh_install
-	install -D -m 644 etc/example.conf $(destdir)/etc/mplayer/mplayer.conf
+	install -D -m 644 etc/example.conf $(CURDIR)/debian/mplayer-nogui/etc/mplayer/mplayer.conf
 
-	dh_installdocs -p $(DEB_SOURCE)
-	dh_installexamples
+install-gui: build-gui
+	$(MAKE) install-gui DESTDIR=$(CURDIR)/debian/mplayer
+
+# scripts
+	chmod a+x debian/scripts/*
+	dh_install
+	install -D -m 644 etc/example.conf $(CURDIR)/debian/mplayer/etc/mplayer/mplayer.conf
 
 install-indep: build-indep 
 	dh_testdir
 	dh_prep -i
+	$(MAKE) install-mplayer-gui-man DESTDIR=$(CURDIR)/debian/mplayer-manpages
 	dh_installdocs -i
 
 #####################################################
@@ -259,9 +282,13 @@
 	$(MAKE) -f debian/rules DH_OPTIONS=-i THISPACKAGE=mplayer-doc binary-common
 
 # Build architecture-dependent packages using the common target.
-binary-arch: install-arch
+binary-arch: binary-nogui binary-gui
+binary-gui: install-gui
 	$(MAKE) -f debian/rules DH_OPTIONS=-a THISPACKAGE=mplayer binary-common
 
+binary-nogui: install-nogui
+	$(MAKE) -f debian/rules DH_OPTIONS=-a THISPACKAGE=mplayer-nogui binary-common
+
 binary: binary-indep binary-arch
 
 ###############################################
@@ -277 +304 @@
-.PHONY: build clean binary-indep binary-arch binary-common binary install binary binary-arch binary-indep clean checkroot get-orig-source autocontrol fix-orig-source copy-orig-from-svn download-and-unpack-orig
+.PHONY: build clean binary-indep binary-arch binary-common binary install binary binary-arch binary-indep clean checkroot get-orig-source autocontrol fix-orig-source copy-orig-from-svn download-and-unpack-orig build-gui build-nogui install-gui install-nogui
diff -u mplayer-1.0~rc3+svn20090405/debian/control mplayer-1.0~rc3+svn20090405/debian/control
--- mplayer-1.0~rc3+svn20090405/debian/control
+++ mplayer-1.0~rc3+svn20090405/debian/control
@@ -75,6 +75,9 @@
 	 mplayer-skin,
 	 ${shlibs:Depends},
 	 ${misc:Depends}
+Recommends: mplayer-manpages
+Conflicts: mplayer-nogui
+Replaces: mplayer-nogui
 Description: movie player for Unix-like systems
  MPlayer plays most MPEG, VOB, AVI, Ogg/OGM, VIVO,
  ASF/WMA/WMV, QT/MOV/MP4, FLI, RM, NuppelVideo, yuv4mpeg, FILM, RoQ, PVA files,
@@ -93,6 +96,40 @@
  Not all of the upstream code is distributed in the source tarball.
  See the README.Debian and copyright files for details.
 
+Package: mplayer-nogui
+Architecture: any
+Section: video
+Suggests: mplayer-doc,
+	  ttf-freefont,
+	  netselect | fping,
+	  bzip2,
+	  fontconfig
+Depends: debconf | debconf-2.0,
+	 ${shlibs:Depends},
+	 ${misc:Depends}
+Recommends: mplayer-manpages
+Conflicts: mplayer
+Replaces: mplayer
+Description: movie player for Unix-like systems
+ MPlayer plays most MPEG, VOB, AVI, Ogg/OGM, VIVO,
+ ASF/WMA/WMV, QT/MOV/MP4, FLI, RM, NuppelVideo, yuv4mpeg, FILM, RoQ, PVA files,
+ supported by many native, XAnim, RealPlayer, and Win32 DLL codecs. It can
+ also play VideoCD, SVCD, DVD, 3ivx, RealMedia, and DivX movies.
+ .
+ Another big feature of MPlayer is the wide range of supported output
+ drivers. It works with X11, Xv, DGA, OpenGL, SVGAlib, fbdev,
+ DirectFB, but also SDL (plus all its drivers) and some
+ low level card-specific drivers (for Matrox, 3Dfx and Radeon, Mach64
+ and Permedia3). Most of them support software or hardware scaling,
+ therefore allowing fullscreen display.  MPlayer is also able
+ to use some hardware MPEG decoder boards, such as the DVB
+ and DXR3/Hollywood+. 
+ .
+ Not all of the upstream code is distributed in the source tarball.
+ See the README.Debian and copyright files for details.
+ .
+ Version without the GUI in GTK
+
 Package: mplayer-dbg
 Architecture: any
 Section: debug
@@ -114,0 +152,9 @@
+
+Package: mplayer-manpages
+Architecture: all
+Section: doc
+Recommends: mplayer
+Depends: ${misc:Depends}
+Description: documentation for MPlayer
+ This package contains the documentation for MPlayer, a movie player for
+ Unix-like systems.
only in patch2:
unchanged:
--- mplayer-1.0~rc3+svn20090405.orig/debian/mplayer-nogui.install
+++ mplayer-1.0~rc3+svn20090405/debian/mplayer-nogui.install
@@ -0,0 +1,3 @@
+debian/scripts usr/share/mplayer/
+debian/prefs var/lib/mplayer/
+etc/input.conf etc/menu.conf etc/mplayer
only in patch2:
unchanged:
--- mplayer-1.0~rc3+svn20090405.orig/debian/mplayer-nogui.examples
+++ mplayer-1.0~rc3+svn20090405/debian/mplayer-nogui.examples
@@ -0,0 +1,3 @@
+etc/example.conf
+etc/menu.conf
+etc/input.conf
only in patch2:
unchanged:
--- mplayer-1.0~rc3+svn20090405.orig/debian/mplayer-nogui.mime
+++ mplayer-1.0~rc3+svn20090405/debian/mplayer-nogui.mime
@@ -0,0 +1,21 @@
+application/x-ogg; /usr/bin/mplayer %s; description="OggVorbis Audio"
+application/ogg; /usr/bin/mplayer %s; description="OggVorbis Audio"
+audio/mpeg; /usr/bin/mplayer %s; description="MPEG Audio Format"
+audio/x-mpegurl; /usr/bin/mplayer %s; description="Icecast Playlists"
+audio/x-ms-wax; /usr/bin/mplayer %s; description="Audio Format"
+audio/x-ms-wma; /usr/bin/mplayer %s; description="Audio Format"
+audio/x-pls; /usr/bin/mplayer %s; description="MP3 ShoutCast/IceCast Playlist"
+audio/x-scpls; /usr/bin/mplayer %s; description="Shoutcast Playlists"
+audio/x-wav; /usr/bin/mplayer %s; description="Waveform Microsoft Wave/RIFF"
+video/mpeg; /usr/bin/mplayer %s; description="MPEG Video Format"; test=test -n "$DISPLAY"
+video/quicktime; /usr/bin/mplayer %s; description="Apple Quicktime Video"; test=test -n "$DISPLAY"
+video/x-mpeg2; /usr/bin/mplayer %s; description="MPEG Video"; test=test -n "$DISPLAY"
+video/x-mpeg; /usr/bin/mplayer %s; description="MPEG 2 Video"; test=test -n "$DISPLAY"
+video/mpeg; /usr/bin/mplayer %s; description="MPEG 2 Video"; test=test -n "$DISPLAY"
+video/x-ms-afs; /usr/bin/mplayer %s; description="Audio Video Interleave - Microsoft"; test=test -n "$DISPLAY"
+video/x-ms-asf; /usr/bin/mplayer %s; description="MS ASF video"; test=test -n "$DISPLAY"
+video/x-msvideo; /usr/bin/mplayer %s; description="Audio Video Interleave - Microsoft"; test=test -n "$DISPLAY"
+video/x-ms-wma; /usr/bin/mplayer %s; description="Audio Video Interleave - Microsoft"; test=test -n "$DISPLAY"
+video/x-ms-wmv; /usr/bin/mplayer %s; description="Audio Video Interleave - Microsoft"; test=test -n "$DISPLAY"
+video/x-ms-wmx; /usr/bin/mplayer %s; description="Audio Video Interleave - Microsoft"; test=test -n "$DISPLAY"
+video/x-ms-wvx; /usr/bin/mplayer %s; description="Audio Video Interleave - Microsoft"; test=test -n "$DISPLAY"
only in patch2:
unchanged:
--- mplayer-1.0~rc3+svn20090405.orig/debian/mplayer-nogui.preinst
+++ mplayer-1.0~rc3+svn20090405/debian/mplayer-nogui.preinst
@@ -0,0 +1,43 @@
+#!/bin/sh
+# preinst script
+#
+
+set -e
+
+# summary of how this script can be called:
+#        * <new-preinst> `install'
+#        * <new-preinst> `install' <old-version>
+#        * <new-preinst> `upgrade' <old-version>
+#        * <old-preinst> `abort-upgrade' <new-version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+case "$1" in
+    install)
+    ;;
+    upgrade)
+    if dpkg --compare-versions "$2" le "1.0~rc3+svn20090405-1"; then
+        md5=`md5sum /etc/mplayer/mplayer.conf | cut -d' ' -f1`
+	case "$md5" in
+	    46f52a60c07ed788500056dd7ffd27b9)
+		echo "removing obsolete /etc/mplayer/mplayer.conf"
+		rm -f /etc/mplayer/mplayer.conf
+	esac
+    fi
+
+    ;;
+    abort-upgrade)
+    ;;
+
+    *)
+        echo "preinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0

Reply via email to