summaryrefslogtreecommitdiffstats
path: root/debian
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
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')
-rwxr-xr-xdebian/config125
-rwxr-xr-xdebian/postinst60
-rw-r--r--debian/templates65
3 files changed, 70 insertions, 180 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
diff --git a/debian/postinst b/debian/postinst
index 5a0d46da22..e8fb6367ab 100755
--- a/debian/postinst
+++ b/debian/postinst
@@ -7,44 +7,20 @@ require ConfHelper;
use Debconf::Client::ConfModule qw(:all);
use IO::Handle;
use Fcntl;
-my $version = version(1.0);
-my @savedolddata = ();
+my $version = version(2.0);
my $didupgrade = 0;
dealwithupgrades();
my $mcfg = new ConfHelper('mplayer', "/etc/mplayer/mplayer.conf");
-$mcfg->setconfarea("
-#MPlayer config file generated by .deb package.
-#ffactor = 0.9
-#fs = yes
-");
-###########################################################################
-debug("Configuring video output driver...");
-
-my $dcarea = <<"EOF";
-# MPlayer video output driver, configured by mplayer.deb
-EOF
-
- $dcarea .= "vo=" . scalar(get("mplayer/voutput"));
- $dcarea .= ",\n";
+my $dcarea = "" ;
+my $font = scalar(get("mplayer/ttfont")) ;
+ $dcarea .= "#truetype font\nfont=" . $font . "\n" if $font;
$mcfg->setconfarea($dcarea);
-if ($didupgrade) {
- $mcfg->setotherarea_DANGEROUS(@savedolddata);
-}
-
-#%###################################
-
-exit unless (get("mplayer/configure") eq 'true');
-exit unless (fget("mplayer/configure", "isdefault") eq 'false');
-
-#%##################################
-get("mplayer/cfgnote");
-
sub dealwithupgrades {
@@ -57,31 +33,17 @@ sub dealwithupgrades {
if ((get('mplayer/replace-existing-files') eq 'true') &&
(fget('mplayer/replace-existing-files', 'isdefault') eq 'false')) {
- print STDERR "Upgrading...\n";
-#? saveolddata("/etc/network/interfaces", "pppconf");
$didupgrade = 1;
- for my $file ("/etc/mplayer/mplayer.conf"
- #, "/etc/mplayer/fonts/sth
- ) {
- debug("Deleting $file");
- unlink $file;
+ for my $file ("/etc/mplayer/mplayer.conf" ) {
+ debug("Moving away $file");
+ rename($file,$file . ".old");
}
} else {
- print STDERR "Upgrade refused, exiting.\n";
+ debug("Upgrade refused, exiting");
exit 0;
}
}
-# Gets any debconf area for other packages and saves it off.
-
-sub saveolddata {
- my ($file, $package) = @_;
- my $conf = new ConfHelper($package, $file);
- push(@savedolddata, $conf->{startline} . "\n");
- push(@savedolddata, $conf->getconfarea());
- push(@savedolddata, $conf->{endline} . "\n");
-}
-
sub debug {
print STDERR @_, "\n";
}
@@ -89,6 +51,8 @@ sub debug {
# pass control to debhelper scripts..
#
-system <<EODEBHELPER;
+my $temp="set -e\nset -- @ARGV\n" . << 'DEBHELPER_EOF_';
#DEBHELPER#
-EODEBHELPER
+DEBHELPER_EOF_
+system ($temp) / 256 == 0
+ or die "Problem with debhelper scripts: $!";
diff --git a/debian/templates b/debian/templates
index 627da29204..4cfc0e63db 100644
--- a/debian/templates
+++ b/debian/templates
@@ -2,53 +2,26 @@ Template: mplayer/replace-existing-files
Type: boolean
Default: true
Description: Upgrade existing system?
- It looks like you've configured your mplayer already.
- If you'd like to configure it with this program, I'll have
- to delete the old configuration. Do you want to continue
- configuration with this program? If you say "yes", I'll go ahead
- and delete your old configuration and you can create it anew with
- this program.
+ It looks like you've configured MPlayer already. If you'd like to
+ configure it with this program, I'll have to delete the old
+ configuration /etc/mplayer/mplayer.conf. Do you want to continue
+ configuration with this program? If you say "Yes", I'll go ahead and
+ delete your old configuration and you can create it anew with this
+ program. If you say "No" I'm going to exit now since you don't want
+ me to replace your existing files. If you change your mind later,
+ you can run 'dpkg-reconfigure mplayer'.
-Template: mplayer/replace-existing-files-bail
-Type: note
-Description: Files not replaced
- I'm going to exit now since you don't want me to replace your
- existing files. If you change your mind later, you can run
- dpkg-reconfigure mplayer.
-
-Template: mplayer/mainmenu
+Template: mplayer/ttfont
Type: select
-Choices: ${choices}, Exit
-Description: MPlayer Main Menu
- From this menu, you can modify any of the settings for your device.
- Simply select the item you'd like to change to modify it.
- When you are done, select Exit.
+Choices: ${ttfontchoices}
+Default: ${ttfontdefault}
+Description: MPlayer fonts
+ MPlayer can use TrueType fonts to render the OSD and subtitles.
+ Choose your favorite.
-Template: mplayer/voutput
-Type: select
-Default: xv
-Choices: ${vochoices}
-Description: MPlayer Video Output
- 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
- * ggi - GGI 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 this will have a tremendous effect on speed.
-
-Template: mplayer/cfgnote
+Template: mplayer/no-ttfont
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
-
+Description: MPlayer cannot find TrueType fonts
+ You should install a package providing TrueType fonts (such as
+ 'ttf-freefont' or 'ttf-bitstream-vera' or 'msttcorefonts' )
+ and reconfigure mplayer.