changeset 853:4f5a6c252703

/etc/mplayer.conf created on install-time based on user responses.
author eyck
date Wed, 23 May 2001 09:19:58 +0000
parents 8da65f529a10
children 76ca00724e12
files debian/control debian/mplayer.conf debian/postinst debian/postinst.templates
diffstat 4 files changed, 210 insertions(+), 93 deletions(-) [+]
line wrap: on
line diff
--- a/debian/control	Wed May 23 08:51:44 2001 +0000
+++ b/debian/control	Wed May 23 09:19:58 2001 +0000
@@ -6,6 +6,6 @@
 
 Package: mplayer
 Architecture: any
-Depends: ${shlibs:Depends}
+Depends: ${shlibs:Depends},debconf
 Description: The Ultimate Movie Player For Linux
  PoS Eso x"D
--- a/debian/mplayer.conf	Wed May 23 08:51:44 2001 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +0,0 @@
-##
-## MPlayer config file
-##
-## This file can be copied to /etc/mplayer.conf and/or ~/.mplayer/config .
-## If both exist, the ~/.mplayer/config's settings override the
-## /etc/mplayer.conf ones. And, of course command line overrides all.
-## The options are the same as in the command line, but they can be specified
-## more flexibly here. See below.
-##
-
-vo=xv			# To specify your default video output see -vo help for
-			# valid settings
-
-fs=yes			# Enlarges movie window to your desktop's size.
-			# Used by drivers: all
-
-vm=no			# Tries to change to a different videomode
-			# Used by drivers: dga2, x11, sdl
-
-#bpp=0			# Force changing display depth.
-			# Valid settings are: 0, 15, 16, 24, 32
-			# may need 'vm=yes' too.
-			# Used by drivers: fbdev, dga2, svga
-
-zoom=no			# Enable software scaling (powerful CPU needed)
-			# Used by drivers: svga
-
-# x=800			# scale movie to <x> pixels width
-# y=600			# scale movie to <y> pixels height
-
-##
-## Multiple languages are available :)
-##
-## Hungarian	igen	nem
-## English	yes	no
-## German	ja	nein
-## Spanish	si	no
-## Binary	1	0
-##
-## You can also use spaces and/or tabs.
-##
-
-sound	= 1
-mixer	= /dev/mixer
-master	= no		# no : set PCM volume  	yes : set MASTER volume
-
-##
-## resample the fonts' alphamap
-## 0	plain white fonts
-## 0.75	very narrow black outline (default)
-## 1	narrow black outline
-## 10	bold black outline
-##
-
-ffactor = 1
-
-##
-## FBdev driver: specify your monitor's timings, so resolutions
-## can be autodetected.
-## (see for example /etc/X11/XF86Config for timings!)
-## ** CAUTION! IF YOUR DISPLAY DOESN'T SUPPORT AUTOMATICALLY TURNING OFF WHEN
-##    OVERDRIVED (AND EVEN IF IT DOES), THIS MAY CAUSE DAMAGE TO YOUR DISPLAY!
-##    WE AREN'T RESPONSIBLE, IT'S YOUR DECISION! **
-##
-## k, K : means multiply by 1000
-## m, M : means multiply by 1.000.000
-##
-
-# fb = /dev/fb0				# framebuffer device to use
-# fbmode = 640x480-120			# use this mode (read from fb.modes!)
-# fbmodeconfig = /etc/fb.modes		# the fb.modes file
-# monitor_hfreq = 31.5k-50k,70k		# horizontal frequency range
-# monitor_vfreq = 50-90			# vertical frequency range
-# monitor_dotclock = 30M-300M		# dotclock (or pixelclock) range
-
-##
-## SDL driver
-##
-
-# sdl = aalib		# specify driver to use (for ex.: aalib, dga, fbdev...)
-# noxv = yes		# do not use XVideo hardware acceleration
-# forcexv = yes		# force XVideo even if not detected
-
-
-# nodshow = 1		# disable usage of DirectShow video codecs
-
-##
-## You can also include other configfiles
-## Specify full path!
-##
-
-#include = /home/gabucino/.mplayer/savage4.conf
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/postinst	Wed May 23 09:19:58 2001 +0000
@@ -0,0 +1,176 @@
+#!/bin/sh -e
+# postinst script for mplayer
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <postinst> `configure' <most-recently-configured-version>
+#        * <old-postinst> `abort-upgrade' <new version>
+#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+#          <new-version>
+#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+#          <failed-install-package> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see /usr/share/doc/packaging-manual/
+#
+# quoting from the policy:
+#     Any necessary prompting should almost always be confined to the
+#     post-installation script, and should be protected with a conditional
+#     so that unnecessary prompting doesn't happen if a package's
+#     installation fails and the `postinst' is called with `abort-upgrade',
+#     `abort-remove' or `abort-deconfigure'.
+
+case "$1" in
+configure)
+#TODO: creating /etc/mplayer.conf, 
+
+
+# Source debconf library.
+. /usr/share/debconf/confmodule
+
+db_subst mplayer/output vo xv, xmga, mga, x11, gl, sdl
+
+db_input high mplayer/output || true
+db_go
+
+if [ -f /etc/mplayer.conf ]; then
+
+db_input high mplayer/overwrite || true
+db_go
+db_get mplayer/overwrite
+ else
+$RET="true"
+fi
+
+	if [ "$RET" = "true" ]; then
+	db_get mplayer/output
+
+	cat <<EOCFG > /etc/mplayer.conf
+##
+## MPlayer config file
+##
+## This file can be copied to /etc/mplayer.conf and/or ~/.mplayer/config .
+## If both exist, the ~/.mplayer/config's settings override the
+## /etc/mplayer.conf ones. And, of course command line overrides all.
+## The options are the same as in the command line, but they can be specified
+## more flexibly here. See below.
+##
+
+vo=$RET			# To specify your default video output see -vo help for
+			# valid settings
+
+fs=yes			# Enlarges movie window to your desktop's size.
+			# Used by drivers: all
+
+vm=no			# Tries to change to a different videomode
+			# Used by drivers: dga2, x11, sdl
+
+#bpp=0			# Force changing display depth.
+			# Valid settings are: 0, 15, 16, 24, 32
+			# may need 'vm=yes' too.
+			# Used by drivers: fbdev, dga2, svga
+
+zoom=no			# Enable software scaling (powerful CPU needed)
+			# Used by drivers: svga
+
+# x=800			# scale movie to <x> pixels width
+# y=600			# scale movie to <y> pixels height
+
+##
+## Multiple languages are available :)
+##
+## Hungarian	igen	nem
+## English	yes	no
+## German	ja	nein
+## Spanish	si	no
+## Binary	1	0
+##
+## You can also use spaces and/or tabs.
+##
+
+sound	= 1
+mixer	= /dev/mixer
+master	= no		# no : set PCM volume  	yes : set MASTER volume
+
+##
+## resample the fonts' alphamap
+## 0	plain white fonts
+## 0.75	very narrow black outline (default)
+## 1	narrow black outline
+## 10	bold black outline
+##
+
+ffactor = 1
+
+##
+## FBdev driver: specify your monitor's timings, so resolutions
+## can be autodetected.
+## (see for example /etc/X11/XF86Config for timings!)
+## ** CAUTION! IF YOUR DISPLAY DOESN'T SUPPORT AUTOMATICALLY TURNING OFF WHEN
+##    OVERDRIVED (AND EVEN IF IT DOES), THIS MAY CAUSE DAMAGE TO YOUR DISPLAY!
+##    WE AREN'T RESPONSIBLE, IT'S YOUR DECISION! **
+##
+## k, K : means multiply by 1000
+## m, M : means multiply by 1.000.000
+##
+
+# fb = /dev/fb0				# framebuffer device to use
+# fbmode = 640x480-120			# use this mode (read from fb.modes!)
+# fbmodeconfig = /etc/fb.modes		# the fb.modes file
+# monitor_hfreq = 31.5k-50k,70k		# horizontal frequency range
+# monitor_vfreq = 50-90			# vertical frequency range
+# monitor_dotclock = 30M-300M		# dotclock (or pixelclock) range
+
+##
+## SDL driver
+##
+
+# sdl = aalib		# specify driver to use (for ex.: aalib, dga, fbdev...)
+# noxv = yes		# do not use XVideo hardware acceleration
+# forcexv = yes		# force XVideo even if not detected
+
+
+# nodshow = 1		# disable usage of DirectShow video codecs
+
+##
+## You can also include other configfiles
+## Specify full path!
+##
+
+#include = /home/gabucino/.mplayer/savage4.conf
+
+
+EOCFG
+
+	fi
+
+
+#db_purge
+db_input medium mplayer/cfgnote || true
+db_go
+
+
+
+# store info in debconf database
+;;
+
+abort-upgrade|abort-remove|abort-deconfigure)
+
+;;
+
+*)
+echo "postinst called with unknown argument \`$1'" >&2
+exit 0
+;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/postinst.templates	Wed May 23 09:19:58 2001 +0000
@@ -0,0 +1,33 @@
+Template: mplayer/output
+Type: select
+Choices: ${vo}
+Default: xv 
+Description: Which Video Output driver would you like?
+ Mplayer can use very wide range of video output drivers:
+ ( order aproximately by speed: )
+	 * mga, xmga - direct hardware access on MGA cards (G200/400/450), needs /dev/mga_vid
+	   this driver can work without X and display video on secondary head of matrox cards
+	 * xv - XVideo extensions of X 4.x ( hardware scaling, bilinear filtering )
+	 * sdl - SDL library, it can also use hardware scaling, filtering etc 
+	 * dga, fsdga - DGA extension.
+	 * fsbdev - framebuffer device ( watching movies on text console )
+	 * x11 - simple x11 output.
+ Please choose carefully because it has tramendous effect on speed.
+
+Template: mplayer/overwrite
+Type: boolean
+Default: false
+Description: Overwrite /etc/mplayer.conf ?
+ Should I overwrite your current /etc/mplayer.conf with the one created on the fly based on your answers?
+
+Template: mplayer/cfgnote
+Type: note
+Description: Create your ~/.mplayer/conf file.
+	Remember to read documentation and edit your ~/.mplayer/conf
+	(or /etc/mplayer.conf) file. This binary depends heavily on
+	your hardware - which means that it needs tweaking for every single
+	machine it's installed to. And it also it means that it will use
+	your setup very effectively. Look at /usr/share/doc/mplayer
+  end
+
+