summaryrefslogtreecommitdiffstats
path: root/debian/config
diff options
context:
space:
mode:
authordiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-01-08 18:33:54 +0000
committerdiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-01-08 18:33:54 +0000
commit11250d1f4ca55299d9c1d19c9f4247b3701ece1f (patch)
tree1db683ff903384605216379895017c3315299bed /debian/config
parent8ebd8076c87e808de38e7c921831ca0ac3ef1cdc (diff)
downloadmpv-11250d1f4ca55299d9c1d19c9f4247b3701ece1f.tar.bz2
mpv-11250d1f4ca55299d9c1d19c9f4247b3701ece1f.tar.xz
Improve the Debian package configuration: Remove the vo module configuration,
add a debconf TrueType font configuration. Based on the Debian package by Andrea Menucci. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17347 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'debian/config')
-rwxr-xr-xdebian/config125
1 files changed, 39 insertions, 86 deletions
diff --git a/debian/config b/debian/config
index 5a342d139c..ab3c8c1b5b 100755
--- a/debian/config
+++ b/debian/config
@@ -1,99 +1,52 @@
-#!/usr/bin/perl -w
+#!/bin/sh
-# Script to configure mplayer
-# based on etherconf by John Goerzen <jgoerzen@progenylinux.com>
+CONFIGFILE=/etc/mplayer/mplayer.conf
-use Debconf::Client::ConfModule qw(:all);
+set -e
+# Source debconf library.
+. /usr/share/debconf/confmodule
-my $version = version(2.0);
-title('MPlayer Configuration');
-my $PRIORITY = 'high';
-#TODO: 'medium'
-my $next = 'mainmenu';
-my $isediting = 0;
+if test -r $CONFIGFILE && ! grep -q '### mplayer DEBCONF AREA' $CONFIGFILE
+then
+ db_input medium 'mplayer/replace-existing-files' || true
+ db_go || true
+ if [ "$RET" != "true" ]; then
+ exit 0
+ fi
+ db_get 'mplayer/replace-existing-files' || true
+fi
-my @nextargs = ();
+########################################## find fonts
+#default font (if available)
+BESTFONT=/usr/share/fonts/truetype/Arial.ttf
+[ -r $BESTFONT ] || BESTFONT=/usr/share/fonts/truetype/freefont/FreeSans.ttf
-checkupgrade(); # Find out if we have to upgrade.
-mainloop(letsgo());
+t=$(tempfile -p fonts )
+find /usr/share/fonts/ /?/?in*/?ont* -type f -iname '*.ttf' -maxdepth 3 2> /dev/null > $t || true
-sub checkupgrade {
- open(MCFG, "</etc/mplayer/mplayer.conf") || return 1;
- my $line = <MCFG>;
- return 1 if ($line =~ /mplayer DEBCONF AREA/);
- exit(0) if (input($PRIORITY, 'mplayer/replace-existing-files') eq "question skipped");
- go();
- if (get('mplayer/replace-existing-files') eq 'false') {
- input($PRIORITY, 'mplayer/replace-existing-files-bail');
- go();
- exit();
- }
- close MCFG;
-}
+if test -s $t
+then
+ fonts=$( awk '{print a $0;a=", "}' $t || true )
+ db_subst "mplayer/ttfont" ttfontchoices $fonts || true
+ ## suppose the question is skipped: give a default
+ a=$BESTFONT
+ [ -r $BESTFONT ] || a=$(head -1 $t)
+ db_subst "mplayer/ttfont" ttfontdefault $a || true
-sub mainloop {
- $next = shift @_;
- do {
- my @retval = &$next(@nextargs);
- # if ($retval[0] eq 'BACK') {
- # $retval[0] = $backups{$next};
- # }
- ($next, @nextargs) = @retval;
- } while ($next ne 'Exit');
-}
+ db_input medium mplayer/ttfont || true
+ if [ "$?" = 30 ] ; then
+ db_set mplayer/ttfont $a || true
+ fi
+else
+ db_input medium "mplayer/no-ttfont" || true
+fi
-sub letsgo {
-#useless!
- return "configure";
-}
+rm $t
-sub configure {
- subst("mplayer/voutput", "vochoices", "xv, xmga, mga, x11, gl, sdl, xvidix");
- # db_subst mplayer/output vo xc,xmga,mga,x11,gl,sdl
- exit(0) if (input($PRIORITY, "mplayer/voutput") eq "question skipped");
- go();
- exit 0 unless (get("mplayer/voutput") eq 'true');
- #return 'audioout';
- return 'mainmenu';
-}
+db_go || true
-sub mainmenu {
- go(); # To catch spare things from before
- my @choices = (
- 'Video Output: ' . scalar(get("mplayer/voutput")));
- #,
- $choices = join(', ', @choices);
- $isediting = 1;
-
- subst('mplayer/mainmenu', 'choices', $choices);
- input($PRIORITY, 'mplayer/mainmenu');
- go();
-
- my $selection = get('mplayer/mainmenu');
- if ($selection =~ /^Exit/) {
- return 'Exit';
- }
+############################################################
- # Set to redisplay.
- fset('mplayer/mainmenu', 'isdefault', 'true');
- $_ = $selection;
-
- return 'configure' if /^Video/;
-# return 'aoutput' if /^Aoutput/;
- return 'Exit';
-}
-
-sub editreturn {
- my @args = @_;
- return 'mainmenu' if $isediting;
- return @args;
-}
-
-sub editfix {
- my $template = shift @_;
- if ($isediting) {
- fset($template, 'isdefault', 'true');
- }
-}
+exit 0