summaryrefslogtreecommitdiffstats
path: root/debian-build/config
diff options
context:
space:
mode:
authorattila <attila@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-02-09 12:26:11 +0000
committerattila <attila@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-02-09 12:26:11 +0000
commitb571babb131b338653162dd2d4d5da529860b011 (patch)
tree599c911e26a31f1f25c08616334df4bd3b67b717 /debian-build/config
parent381752776c08d84ef9b8d2d54add027625231b74 (diff)
downloadmpv-b571babb131b338653162dd2d4d5da529860b011.tar.bz2
mpv-b571babb131b338653162dd2d4d5da529860b011.tar.xz
Adding debian-build directory by request of Deriush Pietrzak
This is thought for creating debian binary packages for distribution. IMPORTANT: THIS DOESNT WORK CURRENTLY git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9365 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'debian-build/config')
-rw-r--r--debian-build/config99
1 files changed, 99 insertions, 0 deletions
diff --git a/debian-build/config b/debian-build/config
new file mode 100644
index 0000000000..5a342d139c
--- /dev/null
+++ b/debian-build/config
@@ -0,0 +1,99 @@
+#!/usr/bin/perl -w
+
+# Script to configure mplayer
+# based on etherconf by John Goerzen <jgoerzen@progenylinux.com>
+
+use Debconf::Client::ConfModule qw(:all);
+
+
+my $version = version(2.0);
+title('MPlayer Configuration');
+my $PRIORITY = 'high';
+#TODO: 'medium'
+my $next = 'mainmenu';
+my $isediting = 0;
+
+my @nextargs = ();
+
+checkupgrade(); # Find out if we have to upgrade.
+mainloop(letsgo());
+
+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;
+}
+
+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');
+}
+
+sub letsgo {
+#useless!
+ return "configure";
+}
+
+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';
+}
+
+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');
+ }
+}