#!/usr/bin/perl -w =head1 NAME dh_installxaw - install xaw wrappers config files into package build directories =cut use strict; use Debian::Debhelper::Dh_Lib; =head1 SYNOPSIS B [S>] [B<-n>] =head1 DESCRIPTION Warning: The xaw-wrappers package has been removed from debian, and so this program is deprecated, and due to be removed soon. dh_installxaw is a debhelper program that is responsible for installing xaw wrappers config files into package build directories. It also automatically generates the postinst, prerm, and postrm commands needed to interface with the debian xaw-wrappers package. See L for an explanation of how this works. If a file named debian/package.xaw exists, then it is installed into usr/lib/xaw-wrappers/config/package in the package build directory. =head1 OPTIONS =over 4 =item B<-n>, B<--noscripts> Do not modify postinst/prerm/postrm scripts. =back =head1 NOTES Note that this command is not idempotent. "dh_clean -k" should be called between invocations of this command. Otherwise, it may cause multiple instances of the same text to be added to maintainer scripts. =cut init(); warning("The xaw-wrappers package has been removed from debian, and so this program is deprecated, and due to be removed soon."); foreach my $package (@{$dh{DOPACKAGES}}) { my $tmp=tmpdir($package); my $xaw=pkgfile($package,'xaw'); if ($xaw ne '') { if (! -d "$tmp/usr/share/xaw-wrappers/config") { doit("install","-d","$tmp/usr/share/xaw-wrappers/config"); } doit("install","-p","-m644",$xaw, "$tmp/usr/share/xaw-wrappers/config/$package"); if (! $dh{NOSCRIPTS}) { # Parse the xaw conf file to figure out what programs # and link names are present in it. Have to pass # those into the scripts. my %data; my $install_opts=''; my $remove_opts=''; my $stanza=''; open (IN,$xaw); while () { chomp; s/\s+/ /g; if (/^#/ eq '') { if (/(.*?):\s?(.*)/) { $data{lc($1)}=$2; $stanza=1; } elsif ($stanza) { $install_opts.="'$data{program} $data{'link-name'} $data{wrapped}' "; $remove_opts.="'$data{'link-name'} $data{wrapped}' "; undef %data; $stanza=''; } } } close IN; if ($stanza) { $install_opts.="'$data{program} $data{'link-name'} $data{wrapped}'"; $remove_opts.="'$data{'link-name'} $data{wrapped}'"; } autoscript($package,"postinst","postinst-xaw", "s:#OPTS#:$install_opts:"); autoscript($package,"prerm","prerm-xaw", "s:#OPTS#:$remove_opts:"); autoscript($package,"postrm","postrm-xaw"); } } } =head1 SEE ALSO L This program is a part of debhelper. =head1 AUTHOR Joey Hess =cut