[Mplayer-dev-eng] [patch] Debian changes, part 3

André Dahlqvist andre.dahlqvist at telia.com
Sat Jul 28 18:18:03 CEST 2001


Ok, here's another patch to apply on top of my other. It replaces the old
very-much-overcomplicate postinst with a fresh and clean one that we can
work on. The old one just asked questions which Debian automatically
handles. If we need debconf questions we can easily add them later now
that we have a clean postinst.

This patch also makes mplayer follow the debian policy of where to install
things. Please apply my patches. The debian/README.debian file should also
be renamed to debian/README.Debian is we want to be perfect:-)

This patch also removes a bogus debian/changelog entry that slipped into my
last patch.

diff -urN debian.old/changelog debian/changelog
--- debian.old/changelog	Sat Jul 28 18:11:32 2001
+++ debian/changelog	Sat Jul 28 18:04:11 2001
@@ -1,9 +1,3 @@
-mplayer (0.18-3) unstable; urgency=low
-
-  * blaa
-
- -- André Dahlqvist <andre at debian.org>  Sat, 28 Jul 2001 16:08:41 +0200
-
 mplayer (0.18-2) unstable; urgency=low
 
   * modified debian scripts 
diff -urN debian.old/config debian/config
--- debian.old/config	Sat Jul 28 09:54:52 2001
+++ debian/config	Thu Jan  1 01:00:00 1970
@@ -1,98 +0,0 @@
-#!/usr/bin/perl -w
-
-# Script to configure mplayer 
-# based on etherconf by John Goerzen <jgoerzen at progenylinux.com>
-
-use Debian::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.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");
-  # 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');
-  }
-}
diff -urN debian.old/control debian/control
--- debian.old/control	Sat Jul 28 18:11:32 2001
+++ debian/control	Sat Jul 28 17:55:43 2001
@@ -7,7 +7,7 @@
 
 Package: mplayer
 Architecture: any
-Depends: ${shlibs:Depends},debconf,libconfhelper-perl
+Depends: ${shlibs:Depends}, debconf
 Description: The Ultimate Movie Player For Linux
  MPlayer is a movie player for LINUX. It plays most MPEG, AVI and ASF files,
  supported by many native and Win32 DLL codecs. You can watch VCD, DVD and even
diff -urN debian.old/dirs debian/dirs
--- debian.old/dirs	Tue Feb 27 03:04:09 2001
+++ debian/dirs	Sat Jul 28 17:58:59 2001
@@ -1,3 +1,5 @@
+etc
 usr/bin
-usr/sbin
-usr/man/man1/
+usr/share/man/man1
+usr/share/doc
+usr/share/doc/examples
diff -urN debian.old/postinst debian/postinst
--- debian.old/postinst	Sat Jul 28 09:54:52 2001
+++ debian/postinst	Sat Jul 28 16:54:45 2001
@@ -1,88 +1,16 @@
-#!/usr/bin/perl -w
+#!/bin/sh -
+#
+# Post-Installation script
+
+set -e
+
+# Source debconf library so we can ask questions using debconf later.
+. /usr/share/debconf/confmodule
+db_version 2.0
+
+# Make sure mplayer's menu file gets processed.
+if [ -x /usr/bin/update-menus ] ; then
+  update-menus ;
+fi
 
-# mplayer postinst
-
-require ConfHelper;
-
-use Debian::DebConf::Client::ConfModule qw(:all);
-use IO::Handle;
-use Fcntl;
-my $version = version(1.0);
-my @savedolddata = ();
-my $didupgrade = 0;
-
-dealwithupgrades();
-
-# We add lo0 right now, useful in case we exit anyway.
-
-my $mcfg = new ConfHelper('mplayer', "/etc/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 config file, 
-
-# MPlayer video output driver, configured by mplayer.deb
-EOF
-
-  $dcarea .= "vo=" . scalar(get("mplayer/voutput"));
-$dcarea .= "\n";
-
-$mcfg->setconfarea($dcarea);
-
-if ($didupgrade) {
-  $interfaces->setotherarea_DANGEROUS(@savedolddata);
-}
-
-#%###################################
-
-exit unless (get("mplayer/configure") eq 'true');
-exit unless (fget("mplayer/configure", "isdefault") eq 'false');
-
-
-
-sub dealwithupgrades {
-  open(OLDCONF, "</etc/mplayer.conf") || return 1;
-  close OLDCONF;
-
-  my $mconf = new ConfHelper("mplayer", "/etc/mplayer.conf");
-  return 1 if ($mconf->hasconfarea());
-  undef $mconf;
-
-  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.conf"
-    #, "/etc/mplayer/fonts/sth
-    ) {
-      debug("Deleting $file");
-      unlink $file;
-    }
-  } else {
-    print STDERR "Upgrade refused, exiting.\n";
-    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";
-}
+#DEBHELPER#
diff -urN debian.old/postinst.templates debian/postinst.templates
--- debian.old/postinst.templates	Thu May 31 11:04:33 2001
+++ debian/postinst.templates	Thu Jan  1 01:00:00 1970
@@ -1,31 +0,0 @@
-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
diff -urN debian.old/rules debian/rules
--- debian.old/rules	Sat Jul 28 18:11:32 2001
+++ debian/rules	Sat Jul 28 17:56:23 2001
@@ -31,7 +31,12 @@
 	dh_clean -k
 	dh_installdirs
 
-	$(MAKE) prefix=`pwd`/debian/mplayer/usr install
+	install -m 755 mplayer debian/mplayer/usr/bin
+	install -m 4755 fibmap_mplayer debian/mplayer/usr/bin
+	install -m 644 DOCS/mplayer.1 debian/mplayer/usr/share/man/man1
+	install -m 644 DOCS/example.conf debian/mplayer/usr/share/doc/examples
+	install -m 644 DOCS/codecs.conf debian/mplayer/usr/share/doc/examples
+	install -m 644 DOCS/codecs.conf debian/mplayer/etc/codecs.conf
 
 # Build architecture-independent files here.
 binary-indep: build install
@@ -41,7 +46,7 @@
 binary-arch: build install
 	dh_testdir
 	dh_testroot
-	dh_installdebconf	
+#	dh_installdebconf	
 	dh_installdocs
 	dh_installexamples DOCS/example.conf DOCS/codecs.conf
 	dh_installmenu
@@ -55,7 +60,7 @@
 	dh_fixperms
 #	dh_makeshlibs
 	dh_installdeb
-	dh_perl
+#	dh_perl
 	dh_shlibdeps
 	dh_gencontrol
 	dh_md5sums
diff -urN debian.old/substvars debian/substvars
--- debian.old/substvars	Mon May 21 10:32:00 2001
+++ debian/substvars	Thu Jan  1 01:00:00 1970
@@ -1 +0,0 @@
-shlibs:Depends=libc6 (>= 2.2.3-1), libgl1, libncurses5 (>= 5.2.20010310-1), libpng2(>=1.0.10), libsdl1.1, libstdc++2.10-glibc2.2, svgalibg1, xlibs (>> 4.0.3), zlib1g (>= 1:1.1.3)
diff -urN debian.old/templates debian/templates
--- debian.old/templates	Sat Jul 28 09:54:52 2001
+++ debian/templates	Thu Jan  1 01:00:00 1970
@@ -1,32 +0,0 @@
-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. 
-
-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
-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.
-
-Template: mplayer/voutput
-Type: select
-Choices: ${vochoices}, x11
-Description: MPlayer Video Output
- Yada yada..
-
-- 

André Dahlqvist <andre.dahlqvist at telia.com>

_______________________________________________
Mplayer-dev-eng mailing list
Mplayer-dev-eng at lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-dev-eng



More information about the MPlayer-dev-eng mailing list