debaux-0.1.10.orig/0000755000175000017500000000000010652063350012734 5ustar rackerackedebaux-0.1.10.orig/scripts/0000755000175000017500000000000010652063350014423 5ustar rackerackedebaux-0.1.10.orig/scripts/.debauxrc0000644000175000017500000000002107337040701016213 0ustar rackerackesharedir=../sharedebaux-0.1.10.orig/scripts/debaux-build0000755000175000017500000010723610646406741016737 0ustar rackeracke#! /usr/bin/perl -w # # debaux-build - Debian package building script # # Copyright 2000,2001,2002,2003,2004,2005,2006,2007 Stefan Hornburg (Racke) # # This program is free software; you can redistribute it # and/or modify it under the terms of the GNU General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later # version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public # License along with this program; if not, write to the Free # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA. # Parameters # debdir - Directory with Debian files # builddir - Build directory # sourcedir - Directory with source archive use vars qw($VERSION); $VERSION = '0.001_010'; # MODULES # ======= use strict; use AppConfig qw(:argcount :expand); use CPAN; use Cwd; use File::Basename; use File::Copy; use File::Find; use Getopt::Long; use LWP::UserAgent; use Net::SSH qw(sshopen2 ssh_cmd); use POSIX qw(strftime); use Time::Zone; use DebAux::Util; # VARIABLES # ========= # Upstream version number, Debian version number, # Debian release number and source package my ($vupstream, $version, $debnumber, $srcname); # Source package my ($archive, $archivefile, @archivecandidates); # Debian package name and architecture my ($debname, $debarch); # Name of .dsc file my $dscfile; # Configuration my %vars; # List of generated packages (used for installation) my @pkglist; # Chroot parameter my ($chroothost, $chrootdir, $chrootuser); # COMMANDLINE PARAMETERS # ====================== my %opts = (version => ''); my $whandler = $SIG{__WARN__}; my @OLDARGV = @ARGV; $SIG{__WARN__} = sub {print STDERR "$0: @_";}; unless (GetOptions (\%opts, 'apt', 'append-version=s', 'archive=s', 'build-options=s', 'changelog-message=s', 'chroot=s', 'chroot-user=s', 'cpan', 'directory=s', 'empty', 'epoch=i', 'extra-sources=s', 'install:s', 'lintian|l', 'make-archive=s', 'release', 'rpm|alien', 'sign|s', 'skip-patches', 'source-name=s', 'source-tree=s', 'stop-after-unpack', 'stop-before-build', 'version=s')) { exit 1; } $SIG{__WARN__} = $whandler; # sanity checks unless (@ARGV) { die "Usage: $0 DEBIANDIR\n"; } my ($debiandir, $builddir, $sourcedir) = @ARGV; my $pkgname; if ($opts{'append-version'} && ! $opts{'changelog-message'}) { die "$0: Missing changelog message\n"; } # read global configuration file my $cfgfileref; my $conf = new AppConfig ({GLOBAL => {ARGCOUNT => ARGCOUNT_ONE}, ERROR => sub { die ("$0: $$cfgfileref: @_\n"); } }); $conf -> define ('debauxdir', {ARGCOUNT => ARGCOUNT_HASH}); $conf -> define ('debiandir', {DEFAULT => '', EXPAND => EXPAND_ALL}); $conf -> define ('email', {DEFAULT => ''}); $conf -> define ('fullname', {DEFAULT => ''}); $conf -> define ('maintainer', {DEFAULT => ''}); $conf -> define ('sharedir', {DEFAULT => '/usr/share/debaux', EXPAND => EXPAND_ALL}); $conf -> define ('sourcedir', {DEFAULT => '/usr/local/src'}); $conf -> define ('source-tree', {ARGCOUNT => ARGCOUNT_HASH}); for my $cfgfile ("$ENV{'HOME'}/.debauxrc", '.debauxrc') { $cfgfileref = \$cfgfile; if (-f $cfgfile) { open (CONF, $cfgfile) || die "$0: Couldn't open configuration file $cfgfile: $!\n"; $conf -> file (\*CONF); close (CONF); } } if (substr($conf->get('sharedir'),0,1) ne '/') { $conf->set('sharedir', cwd() . '/' . $conf->get('sharedir')); } # determine architecture $debarch = DebAux::Util::architecture(); unless (-d $debiandir && -f "$debiandir/debbuild") { if (-f $debiandir) { # check if filename matches archive if (basename($debiandir) =~ m%(.*?)-(\d+(\.\d+)*)\.tar\.gz%) { # build directly from the archive $srcname = $1; $version = $2; } else { die "$0: This seems not to be an archive file\n"; } } else { $pkgname = $debiandir; $srcname = $debiandir; if (exists ($conf->get('debauxdir')->{$pkgname}) && -d $conf->get('debauxdir')->{$pkgname}) { $debiandir = $conf->get('debauxdir')->{$pkgname}; } elsif ($conf->get('debiandir') =~ /\S/ && -d join('/',$conf->get('debiandir'),$debiandir)) { $debiandir = join('/',$conf->get('debiandir'),$debiandir); } } } else { $pkgname = basename($debiandir); } $builddir = join('-', '/var/tmp/debaux', (getpwuid($<))[0]) unless defined $builddir && $builddir =~ /\S/; $sourcedir = $conf->get('sourcedir') unless defined $sourcedir && $sourcedir =~ /\S/; if ($builddir !~ /^[\w\.\/\+:-]+$/) { die "$0: Suspicious directory name \"$builddir\"\n"; } if ($opts{chroot}) { if ($opts{chroot} =~ /^(.*?):(.*?)$/) { $chroothost = $1; $chrootdir = $2; } else { $chroothost = 'localhost'; $chrootdir = $opts{chroot}; } } if (! $opts{'source-tree'} && exists $conf->get('source-tree')->{$pkgname}) { $opts{'source-tree'} = $conf->get('source-tree')->{$pkgname}; } my $aptsource = 0; my $oldbuilddir = $builddir; if ($opts{'cpan'}) { if ($conf->get('debiandir') !~ /\S/) { die "$0: Global configuration option 'debiandir' needed for --cpan\n"; } my $debianbasedir = $conf->get('debiandir'); # CPAN configuration $CPAN::Config->{keep_source} = 1; # check CPAN my @objs = CPAN::expand ('Module', $debiandir); unless (@objs) { die "$0: No hit on CPAN for $debiandir\n"; } if (@objs > 1) { die "$0: More than one hit on CPAN for $debiandir\n"; } my $cpan_file = $objs[0]->cpan_file(); my $dir = basename($cpan_file,'.tar.gz'); my $aname; if ($dir =~ /(.*?)-\d+(\.\d+)*$/) { $aname = $1; } else { die "$0: Couldn't extract version number for CPAN archive out of \"$dir\"\n"; } # download archive CPAN::get ($debiandir); my $cpansourcedir = $CPAN::Config->{keep_source_where}; # set parameters if ($opts{version} !~ /\S/) { $opts{'version'} .= $objs[0]->cpan_version(); } $opts{'archive'} = "$cpansourcedir/authors/id/$cpan_file"; $opts{'directory'} = "$aname-" . $opts{'version'}; $opts{'source-tree'} = join ('/', $CPAN::Config->{build_dir}, $dir); # determine package name and create Debian packaging files # if necessary my $buf; my $pkgname = join ('-', map {$buf = lc($_); $buf =~ s/_//g; $buf} (split(/::/, $debiandir)), 'perl'); $opts{'source-name'} = $pkgname; my $dconfdir = "$debianbasedir/$pkgname/debian"; if (! -d $dconfdir) { DebAux::Util::mkdir ($dconfdir); } sub mycopy { my ($from, $to, %filter) = @_; open (FROM, $from) || die "$0: Couldn't open $from: $!\n"; open (TO, ">$to") || die "$0: Couldn't open $to for writing: $!\n"; while () { s/\#(.*?)\#/$filter{$1} || ''/eg; print TO; } close (FROM) || die "$0: Couldn't close $from: $!\n"; close (TO) || die "$0: Couldn't close $to: $!\n"; } my %filter = (DATE => changelog_date(), DIRECTORY => $opts{directory}, EMAIL => $conf->get('email') || $ENV{'DEBEMAIL'}, PACKAGE => $pkgname, POLICY => '3.7.2.2', USERNAME => $conf->get('fullname') || $ENV{'DEBFULLNAME'}, VERSION => $opts{epoch} ? "$opts{epoch}:$opts{version}" : $opts{version}, ); &mycopy ('/usr/share/debhelper/dh_make/debian/changelog', "$dconfdir/changelog", %filter); &mycopy ($conf->get('sharedir') . '/cpan/compat', "$dconfdir/compat", %filter); &mycopy ($conf->get('sharedir') . '/cpan/control', "$dconfdir/control", %filter); &mycopy ($conf->get('sharedir') . '/cpan/debbuild', "$debianbasedir/$pkgname/debbuild", %filter); &mycopy ($conf->get('sharedir') . '/cpan/rules', "$dconfdir/rules", %filter); $debiandir = "$debianbasedir/$pkgname"; } if ($opts{'apt'} || ! (-d $debiandir || -f $debiandir || $opts{'source-tree'})) { # looks like we have no information about this package, # so we call apt-get source $builddir = mkbuilddir ($builddir, $pkgname); $opts{'source-tree'} = ''; chdir ($builddir) || die "$0: Couldn't enter build directory $builddir\n"; open (AGS, "apt-get --print-uris source $pkgname |"); while () { if (/\s(.*?)_(.*?)\.orig\.tar\.gz/ || /\s(.*?)_(.*?)(-\d+)?\.tar\.gz/) { $opts{'source-tree'} = "$builddir/$1-$2"; } } close (AGS) || die "$0: Errors while executing apt-get source $pkgname\n"; unless ($opts{'source-tree'}) { die "$0: Couldn't determine package version\n"; } # we may use patches, so we have to erase the old build # directory if (-d $opts{'source-tree'}) { DebAux::Util::remove ($opts{'source-tree'}); } open (AGS, "apt-get -qq source $pkgname |"); while () { print; } close (AGS) || die "$0: Errors while executing apt-get source $debiandir\n"; $aptsource = 1; } elsif ($debiandir !~ m%^/%) { $debiandir = cwd() . '/' . $debiandir; } # PARSE DEBIAN CHANGELOG # ====================== # first get version number from changelog file my $changelog; if ($opts{'source-tree'}) { $changelog = $opts{'source-tree'} . '/debian/changelog'; } unless ($changelog && -f $changelog) { $changelog = "$debiandir/debian/changelog"; } my $vfound = 0; my $chlref; if (-f $changelog) { $chlref = parse_changelog ($changelog); $debnumber = $chlref->{'debnumber'}; $vfound = $chlref->{'found'}; $srcname = $chlref->{'sourcename'}; $version = $chlref->{'version'}; unless ($vfound) { die "$0: Couldn't detect package version number\n"; } unless ($srcname) { die "$0: Couldn't detect source package name\n"; } } else { warn ("No changelog $changelog\n"); } if ($opts{'source-name'}) { $srcname = $opts{'source-name'}; } parse_config("$debiandir/debbuild", \%vars, \%opts, $version, $srcname); $srcname = $vars{'source-name'}; $vupstream = $vars{'version'}; unless ($vfound || length($vupstream)) { die "$0: Couldn't detect package version number\n"; } unless ($srcname) { die "$0: Couldn't detect source package name\n"; } # add source name to build directory and check if # we have to create the directory unless ($aptsource) { $builddir = mkbuilddir ($builddir, $srcname); } # MAKE ARCHIVE (optional) # ======================= my $archive_tree = $sourcedir; unless ($aptsource || $vars{'empty'}) { if ($vars{'make-archive'}) { $archive_tree = $debiandir; if ($vars{'source-tree'}) { $archive_tree = $vars{'source-tree'}; } chdir ($archive_tree) || die ("$0: Couldn't enter directory $archive_tree: $!\n"); my $retval = system ($vars{'make-archive'}); if ($retval) { die "$0: Couldn't make archive\n"; } } } # REMOVE OLD STUFF # ================ chdir ($builddir) || die "$0: Couldn't enter build directory \"$builddir\": $!\n"; unless ($aptsource) { DebAux::Util::remove ("$srcname-$vupstream.orig"); DebAux::Util::remove ("$srcname-$vupstream"); # remove old orig.tar.gz to avoid problems with dpkg-source if (-f "${srcname}_$vupstream.orig.tar.gz") { unlink ("${srcname}_$vupstream.orig.tar.gz") || die "$0: Couldn't remove ${srcname}_$vupstream.orig.tar.gz: $!\n"; } } # UNPACK ARCHIVE # ============== my ($curdir, $pkgdebdir); unless ($aptsource || $vars{'empty'}) { FIND_ARCHIVE: { my $arfile; for my $arname (@{$vars{archive}}) { if (substr($arname,0,1) eq '/') { $arfile = $arname; } else { $arfile = "$archive_tree/$arname"; } push (@archivecandidates, $arfile); if (-f $arfile) { $archivefile = $arfile; last FIND_ARCHIVE; } } my $sourcesdir = "$debiandir/sources"; if ($vars{download}) { # download archive my $ua = LWP::UserAgent->new; my ($url, $request, $response); $request = HTTP::Request->new('GET', $vars{download}); print "Downloading $vars{download}:"; $response = $ua->request($request); unless ($response->is_success) { print " failed.\n"; die "$0: Couldn't get original sources ($vars{download}): ", $response->code, " ", $response->message, "\n"; } print " done.\n"; my $archive = "$archive_tree/" . basename($vars{download}); open (ARCHIVE, ">$archive") || die "$0: Couldn't open $archive\n"; print ARCHIVE $response->content; close (ARCHIVE); $archivefile = $archive; } elsif (-d $sourcesdir) { # make an archive from the contents of this directory $archivefile = &packsources ($builddir, $srcname, $vupstream, $sourcesdir); } } unless (defined $archivefile) { die ("$0: No archive file found (Tried: ", join (', ', @archivecandidates), ")\n"); } if ($archivefile =~ /\.bz2$/) { open UNPACK, "tar -xjf $archivefile |"; } else { open UNPACK, "tar -xzf $archivefile |"; } while () { print; } close (UNPACK) || die ("$0: Couldn't unpack \"$archivefile\"\n"); # move to the location for the original sources rename ($vars{'directory'}, "$srcname-$vupstream.orig") || die "$0: Couldn't move sources to original source directory: $vars{directory} => $srcname-$vupstream.orig : $!\n"; # copy to the package build directory system ("cp -a $srcname-$vupstream.orig $srcname-$vupstream"); exit 0 if $opts{'stop-after-unpack'}; } if ($vars{empty}) { mkdir ("$srcname-$vupstream", 0755) || die "$0: Couldn't create directory $srcname-$vupstream: $!\n"; } # copy Debian files into that directory chdir ("$srcname-$vupstream") || die "$0: Couldn't enter directory $srcname-$vupstream: $!\n"; unless ($aptsource) { unless (-d 'debian') { mkdir ('debian', 0755) || die "$0: Couldn't make debian directory: $!\n"; } $curdir = cwd; $pkgdebdir = "$debiandir/debian"; if (-l "$debiandir/debian") { unless ($pkgdebdir = readlink ("$debiandir/debian")) { die "$0: Couldn't determine value of symbolic link: $!\n"; } } if (-e $pkgdebdir && -d $pkgdebdir) { find (sub{&filecopy($pkgdebdir,"$curdir/debian")}, $pkgdebdir); } if (! $vfound && -f "debian/changelog") { my $inforef = parse_changelog('debian/changelog'); $debnumber = $inforef->{debnumber}; } } # APPLY PATCHES # ============= if ($vars{'skip-patches'}) { warn "Skipping patches\n"; } else { if (-d "$debiandir/patches") { # apply arch-independent patches in this directory find (\&applypatches, "$debiandir/patches"); my $archdir = "$debiandir/patches/arch/$debarch"; if (-d $archdir) { # apply arch-dependent patches find (\&applypatches, $archdir); } } if (-f "$debiandir/sources.diff") { chdir ("$builddir/$srcname-$vupstream") || die "$0: Couldn't enter directory \"$builddir/$srcname-$vupstream\": $!\n"; open PATCH, "patch -p1 --no-backup-if-mismatch < $debiandir/sources.diff |"; while () { print; } close (PATCH) || die "$0: Patch failed\n"; } } if (-f "$debiandir/sources.tar") { chdir ("$builddir/$srcname-$vupstream") || die "$0: Couldn't enter directory \"$builddir\": $!\n"; open TAR, "tar -xvf $debiandir/sources.tar |"; while () { print; } close (TAR) || die "$0: Unarchiving extra sources failed\n"; } if ($vars{'extra-sources'}) { find (sub{&filecopy("$debiandir/$vars{'extra-sources'}", "$builddir/$srcname-$vupstream/$vars{'extra-sources'}")},"$debiandir/$vars{'extra-sources'}"); } if ($vars{'append-version'}) { # add new entry to debian/changelog if ($conf->get('maintainer')) { $chlref->{maintainer} = $conf->get('maintainer'); } update_changelog ($srcname, "$version-$debnumber" . '.' . $vars{'append-version'}, $opts{'changelog-message'}, $chlref); } # DSC file my $fv = $vupstream; if (defined $debnumber) { $fv .= "-$debnumber"; } $dscfile = "${srcname}_$fv.dsc"; # now make debian/rules executable unless ($aptsource) { chmod (0755, "$builddir/$srcname-$vupstream/debian/rules") || die "$0: Couldn't make $builddir/$srcname-$vupstream/debian/rules executable: $!\n"; } if ($opts{'release'}) { download_orig_archive ($srcname, $vupstream, $builddir); } if ($opts{'chroot'}) { chdir ("$builddir") || die "$0: Couldn't enter directory \"$builddir\": $!\n"; # build Debian source packages if (defined $debnumber) { open DSRC, "dpkg-source -b $srcname-$vupstream |"; } else { open DSRC, "dpkg-source -b $srcname-$vupstream '' |"; } while () { print; } close (DSRC) || die "$0: dpkg-source packing failed\n"; # copy them to the chroot my @buildfiles; if ($vars{empty} || ! defined $debnumber) { @buildfiles = ("${srcname}_$vupstream.tar.gz", $dscfile); } else { @buildfiles = ("${srcname}_$vupstream.orig.tar.gz", "${srcname}_$fv.diff.gz", $dscfile); } open RSYNC, "rsync -vv @buildfiles root\@$chroothost:$chrootdir/tmp |"; while () { print; } close (RSYNC) || die "$0: couldn't copy source stuff to chroot\n"; # build the package #------------------------ START BUILD SCRIPT my $script = <<'EOF'; #!/usr/bin/perl my $builddir = '/tmp'; my $lintian = '@lintian@'; my $debnumber = '@debnumber@'; my @pkglist; my @pkgfiles; my $rcmd = ''; $| = 1; # force immediate output # reset locale to get expected messages from build process $ENV{LANG} = 'C'; if ("@chroot@") { chroot("@chroot@") || die ("@prog@: couldn't go to chroot: $!\n"); } else { $rcmd = ' -rfakeroot'; } chdir("$builddir") || die ("@prog@: couldn't enter $builddir: $!\n"); open (DSRC, "dpkg-source -x @dsc@ |"); while () { print; } close (DSRC) || die ("@prog@: unpack of source according to @dsc@ failed\n"); exit unless @build@; chdir("$builddir/@dir@") || die ("@prog@: couldn't enter $builddir/@dir@: $!\n"); open (BUILD, "dpkg-buildpackage$rcmd @buildopts@ |"); while () { if ($lintian) { if (/^dpkg-deb:\s*building package \`(.*?)\' in \`(.*?)\'/) { push (@pkglist, $2); } } print; } close (BUILD) || die ("@prog@: Couldn't build package\n"); exit 0 unless $lintian; if ($lintian) { print "Running lintian on ../@dsc@ @pkglist\n"; open (LINTIAN, "lintian -i ../@dsc@ @pkglist |"); while () { print; } close (LINTIAN) || die ("@prog@: Lintian failed\n"); } EOF #----------------------- END BUILD SCRIPT remote_perl ($script, {chroot => ($opts{'chroot-user'} ? '' : $chrootdir), dir => "${srcname}-$vupstream", dsc => $dscfile, build => ($opts{'stop-before-build'} ? 0 : 1), buildopts => join(' ', '-uc', '-us', $vars{'build-options'}), lintian => $vars{'lintian'}, prog => $0, upstream => $vupstream, debnumber => $debnumber}, $chroothost, $opts{'chroot-user'}, $chrootdir, @buildfiles); exit 0; } exit 0 if $opts{'stop-before-build'}; # BUILD PACKAGE # ============= my @buildopts = ('-rfakeroot', $vars{'build-options'}); my %pkghash; unless (defined $debnumber) { # force inclusion of source code push (@buildopts, '-sa'); } unless ($opts{sign}) { # bypass signing push (@buildopts, '-uc', '-us'); } # reset locale to get expected messages from build process $ENV{LANG} = 'C'; open BUILD, join(' ', 'dpkg-buildpackage', @buildopts, '|'); while () { if (exists $opts{'install'} || $opts{'lintian'} || $opts{'rpm'}) { # filter out package names if (/^dpkg-deb:\s*building package \`(.*?)\' in \`(.*?)\'/) { $pkghash{$1} = $2; push (@pkglist, $2); } } print; } # we need absolute paths my @pkgfiles; if ($aptsource) { for (keys %pkghash) { $pkghash{$_} =~ s%^..%$oldbuilddir/$srcname%; } @pkgfiles = map {$_ =~ s%^..%$oldbuilddir/$srcname%; $_} @pkglist; } else { for (keys %pkghash) { $pkghash{$_} =~ s/^../$builddir/; } @pkgfiles = map {$_ =~ s/^../$builddir/; $_} @pkglist; } close (BUILD) || die ("$0: Couldn't build package\n"); # clean and reverse patches #open CLEAN, "fakeroot make -f debian/rules clean |"; #while () { # print; #} #close (CLEAN) || die ("$0: Error while cleansing build tree\n"); # BUILD CORRESPONDING RPM's WITH ALIEN # ==================================== if ($opts{'rpm'}) { my $rpmdir = "$builddir/rpm"; if (! -d $rpmdir) { mkdir ($rpmdir, 0755) || die ("$0: Couldn't create directory $rpmdir: $!\n"); } chdir ($rpmdir) || die ("$0: Couldn't enter build directory $builddir: $!\n"); for (@pkgfiles) { print "Building RPM package from $_\n"; open (ALIEN, "alien --to-rpm $_ |"); while () { print; } close (ALIEN); } } # INSTALL PACKAGE # =============== if (exists $opts{'install'}) { if ($opts{'install'} =~ /\S/) { @pkgfiles = (); for (split(/[,\s]+/, $opts{install})) { if (exists $pkghash{$_}) { push (@pkgfiles, $pkghash{$_}); } else { die "$0: package '$_' not available for installation\n"; } } } open (INSTALL, "ssh root\@localhost dpkg -i @pkgfiles |"); while () { print; } close (INSTALL); } # CHECK PACKAGES WITH LINTIAN # =========================== if ($opts{'lintian'}) { print "Running lintian on $builddir/$dscfile and @pkgfiles\n"; open (LINTIAN, "lintian -i $builddir/$dscfile @pkgfiles |"); while () { print; } close (LINTIAN) || die ("$0: Lintian failed\n"); } # # FUNCTIONS # ========= # -------------------------------------------------- # FUNCTION: cut_epoch VERSION # # Removes epoch from VERSION and returns the result. # -------------------------------------------------- sub cut_epoch { my ($version) = @_; $version =~ s/^\d+://; $version; } # ------------------------------------------------------------- # FUNCTION: download_orig_archive SRCNAME VUPSTREAM DIR # # Fetch the sources in the official archive to keep the md5sum. # ------------------------------------------------------------- sub download_orig_archive { my ($srcname, $vupstream, $dir) = @_; my $ua = new LWP::UserAgent (env_proxy => 1); my ($url, $request, $response); for (['ftp.debian.org','debian','main'], ['nonus.debian.org','debian-non-US','non-US/main']) { $url = "http://$_->[0]/$_->[1]/pool/$_->[2]/" . ($srcname =~ /^lib/ ? substr($srcname,0,4) : substr($srcname,0,1)) . "/$srcname/${srcname}_$vupstream.orig.tar.gz"; $request = HTTP::Request->new('GET', $url); $response = $ua->request($request); last if $response->is_success(); warn "$0: Failed to download sources from $url: ", $response->code, " ", $response->message, "\n"; } unless ($response->is_success) { die "$0: Couldn't get original sources ($url): ", $response->code, " ", $response->message, "\n"; } my $origarchive = "$dir/${srcname}_$vupstream.orig.tar.gz"; open (ORIGARCHIVE, ">$origarchive") || die "$0: Couldn't open $origarchive\n"; print ORIGARCHIVE $response->content; close (ORIGARCHIVE); } # ------------------------------------------------ # FUNCTION: parse_changelog FILE # # Parses changelog FILE and returns hash reference # with the following key/value pairs: # # debnumber # found # sourcename # version # ------------------------------------------------ sub parse_changelog { my ($file) = @_; my (%info); open (PARSECHL, "dpkg-parsechangelog -l$file |"); while () { if (/^Version: (.*)(-(\d.*))$/) { $info{version} = $1; $info{debnumber} = $3; $info{found} = 1; } elsif (/^Version: (.*)$/) { $info{version} = $1; $info{found} = 1; } elsif (/^Source: (\S+)/) { $info{sourcename} = $1; } elsif (/^(Distribution|Urgency|Maintainer): (.*)$/) { $info{lc($1)} = $2; } } close (PARSECHL) || die "$0: Errors while executing dpkg-parsechangelog on $file\n"; \%info; } # --------------------------------------------------------- # FUNCTION: update_changelog SRCNAME VERSION MESSAGE CHLREF # # Adds a changelog entry. # --------------------------------------------------------- sub update_changelog { my ($srcname, $version, $message, $chlref) = @_; my ($chl, $date); # read changelog into memory open (CHL, "debian/changelog") || die "$0: failed to open debian/changelog: $!\n"; while () { $chl .= $_; } close (CHL); # determine current date $date = changelog_date(); # prepend new entry $chl = qq{$srcname ($version) $chlref->{distribution}; urgency=$chlref->{urgency} * $message -- $chlref->{maintainer} $date } . $chl; # update changelog open (CHL, ">debian/changelog") || die "$0: failed to open debian/changelog for writing: $!\n"; print CHL $chl; close (CHL); } # --------------------------------------------------------------- # FUNCTION: changelog_date # # Returns current date in a format suitable for debian/changelog. # --------------------------------------------------------------- sub changelog_date { my ($offset, $offset_sign, $offsetstr); $offset = tz_local_offset(); if ($offset > 0) { $offset_sign = '+'; } else { $offset_sign = '-'; $offset = - $offset; } $offsetstr = sprintf("$offset_sign%02d%02d", $offset / 3600, ($offset % 3600) / 60); return strftime ('%a, %m %b %Y %H:%M:%S ', localtime()) . $offsetstr; } # ------------------------------------------------------------ # FUNCTION: parse_config FILE VREF OPTREF VERSION SOURCENAME # # Parses configuration file FILE and records the configuration # information into the hash referenced by VREF. # OPTREF is a reference to the hash with the already parsed # command line options. # SOURCENAME is the upstream package name. # VERSION is the version of the upstream package (may be # omitted). # ------------------------------------------------------------ sub parse_config { my ($file, $vref, $optref, $version, $sourcename) = @_; my ($vv, $config, @pseudoargs, %defhash); $vv = cut_epoch($version) if defined $version; $config = new AppConfig ({ERROR => sub {die "$0: $file: @_\n";}, GLOBAL => {ARGCOUNT => ARGCOUNT_ONE, EXPAND => EXPAND_ALL}}); %defhash = ('apt' => {ARGCOUNT => ARGCOUNT_NONE}, 'append-version' => {DEFAULT => ''}, 'archive' => {ARGCOUNT => ARGCOUNT_LIST}, 'build-options' => {DEFAULT => ''}, 'changelog-message' => {DEFAULT => ''}, 'chroot' => {DEFAULT => ''}, 'chroot-user' => {DEFAULT => ''}, 'cpan' => {ARGCOUNT => ARGCOUNT_NONE}, 'directory' => {DEFAULT => ''}, 'download' => {DEFAULT => ''}, 'empty' => {DEFAULT => 0}, 'epoch' => {DEFAULT => 0}, 'extra-sources' => {DEFAULT => ''}, 'install' => {ARGCOUNT => ARGCOUNT_NONE}, 'lintian' => {ARGCOUNT => ARGCOUNT_NONE}, 'make-archive' => {DEFAULT => ''}, 'release' => {ARGCOUNT => ARGCOUNT_NONE}, 'rpm' => {DEFAULT => 0}, 'sign' => {DEFAULT => 0}, 'skip-patches' => {DEFAULT => 0}, 'source-name' => {DEFAULT => $sourcename || ''}, 'source-tree' => {DEFAULT => ''}, 'stop-after-unpack' => {DEFAULT => 0}, 'stop-before-build' => {DEFAULT => 0}, 'version' => {DEFAULT => $vv}); $config -> define (%defhash); if (-f $file) { open (PKGVAR, $file) || die "$0: Couldn't open $file: $!\n"; $config -> file (\*PKGVAR); close (PKGVAR); } for (keys %$optref) { if ($optref->{$_}) { if (exists ($defhash{$_}->{ARGCOUNT}) && $defhash{$_}->{ARGCOUNT} == ARGCOUNT_NONE) { push (@pseudoargs, "--$_"); } else { push (@pseudoargs, "--$_=$optref->{$_}"); } } } $config -> getopt (\@pseudoargs); %$vref = $config -> varlist (".*"); unless (defined ($$vref{'version'})) { die "$0: Couldn't detect version of upstream package\n"; } # set missing variables based on upstream version unless (length ($$vref{'directory'})) { $$vref{'directory'} = "$$vref{'source-name'}-$$vref{version}"; } # sanity checks for (keys (%$vref)) { unless (defined ($config -> get ($_))) { die "$0: $file: variable $_ not found\n"; } } if ($$vref{'directory'} !~ /^\w[\w\.\+:-]*$/) { die "$0: Suspicious directory name \"$$vref{'directory'}\"\n"; } $vv = $$vref{'version'}; # defaults doesn't seem to work with lists unless ($$vref{'empty'} || @{$$vref{'archive'}}) { $$vref{'archive'} = ["$$vref{'source-name'}-$vv.tar.gz", "$$vref{'source-name'}-$vv.tar.gz", "$$vref{'source-name'}-$vv.tgz", "$$vref{'source-name'}-$vv.tar.bz2"]; } } # ---------------------------------------------- # FUNCTION: applypatches # # Applies any files found in a directory tree # as patches to the original sources. # ---------------------------------------------- sub applypatches { return if $_ =~ /^\.\.?$/; # don't descend into arch directory and version control directories if (-d $File::Find::name && ($_ eq 'arch' || $_ eq 'CVS')) { $File::Find::prune = 1; return; } chdir ("$builddir/$srcname-$vupstream") || die "$0: Couldn't enter directory \"$builddir/$srcname-$vupstream\": $!\n"; print "applying patches from $File::Find::name\n"; open PATCH, "patch -p1 --no-backup-if-mismatch < $File::Find::name |"; while () { print; } close (PATCH) || die "$0: Patch $File::Find::name failed\n"; } # --------------------------------------- # FUNCTION: filecopy SOURCESDIR TARGETDIR # --------------------------------------- sub filecopy { my ($sourcesdir, $targetdir) = @_; my ($perms, $loc); return if $_ =~ /^\.\.?$/; if (-d && $_ eq 'CVS') { $File::Find::prune = 1; return; } if (-f && (/^\.\#/ || /\.~(\d+\.)+\d+~$/)) { # remove old CVS versions return; } # determine relative target location $loc = substr ($File::Find::name, length($sourcesdir) + 1); if (-d) { mkdir ("$targetdir/$loc", 0755) || die "$0: Couldn't make directory $targetdir/$loc: $!\n"; } else { my $perms = (stat ($_)) [2]; copy ("$File::Find::name", "$targetdir/$loc") || die ("$0: Copy of $File::Find::name to $targetdir failed: $!\n"); chmod (oct (substr sprintf("%o", $perms), -3), "$targetdir/$loc") || die ("$0: Couldn't change permissions on $targetdir/$loc: $!\n"); } } # ----------------------------------------------------------- # FUNCTION: packsources BUILDDIR SRCNAME VUPSTREAM SOURCESDIR # # This function creates an tarball of all files within # the directory SOURCESDIR except CVS files. An toplevel # SRCNAME-VUPSTREAM is created which contains all files. # The packing is performed in the directory BUILDDIR. # ----------------------------------------------------------- sub packsources { my ($builddir, $srcname, $vupstream, $sourcesdir) = @_; my $packdir = "$builddir/$srcname-$vupstream"; my $archivefile; # create directory mkdir ($packdir, 0755) || die "$0: Couldn't make directory for packing sources: $packdir: $!\n"; # copy stuff from sources find (sub{&filecopy($sourcesdir,$packdir)}, $sourcesdir); # make an archive chdir ($builddir) || die "$0: Couldn't enter build directory $builddir: $!\n"; open (PACK, "tar -czf $srcname-$vupstream.tar.gz $srcname-$vupstream |"); while () {print;} close PACK || die "$0: Errors while packing sources\n"; "$srcname-$vupstream.tar.gz"; } # -------------------------------------------------------------------- # FUNCTION: mkbuilddir BASEDIR SRCNAME # # Add source name SRCNAME to build base directory BASEDIR and check if # we have to create the directory. Returns the build directory. # -------------------------------------------------------------------- sub mkbuilddir { my ($basedir, $srcname) = @_; my $builddir; if (-d $basedir) { $builddir = $basedir . "/" . $srcname; unless (-d $builddir) { mkdir ($builddir, 0755) || die "$0: Couldn't create package build directory $builddir: $!\n"; } } else { die "$0: Build base directory \"$basedir\" doesn't exist\n"; } $builddir; } # FUNCTION: remote_perl SCRIPT REPLACEMENTS HOST USER DIR FILES sub remote_perl { my ($script, $repref, $host, $user, $dir, @files) = @_; my $reg; for (keys %$repref) { $reg = qr/\@$_\@/; $script =~ s/$reg/$$repref{$_} || ''/eg; } if ($user) { sshopen2("root\@$host", *READER, *WRITER, "/bin/cat >$dir/tmp/debaux.$$"); print WRITER $script; close WRITER; while () { } close READER; # change ownership on needed files @files = map {"/tmp/$_"} @files; push (@files, "/tmp/debaux.$$"); ssh_cmd("root\@$host", 'chroot', $dir, 'chown', $user, @files); sshopen2("root\@$host", *READER1, *WRITER1, "/bin/cat >$dir/tmp/debaux-launch.$$"); print WRITER1 <) { } close READER1; ssh_cmd("root\@$host", 'chmod', '+x', "$dir/tmp/debaux*.$$"); # ssh_cmd("root\@$host", 'chroot', $dir, 'su', $user, "/tmp/debaux-launch.$$"); sshopen2("root\@$host", *READER, *WRITER, "chroot $dir su $user /tmp/debaux-launch.$$"); ssh_cmd("root\@$host", 'rm', "$dir/tmp/debaux-launch.$$"); close WRITER; while () { print; } close READER; } else { sshopen2("root\@$host", *READER, *WRITER, "/usr/bin/perl -"); print WRITER $script; close WRITER; while () { print; } close READER; } } # DOCUMENTATION # ============= =head1 NAME debaux-build - Debian package building script =head1 SYNOPSIS debaux-build [OPTIONS] DEBDIR [BUILDDIR SOURCEDIR] debaux-build --cpan Net::Google =head1 VERSION 0.1.10 =head1 DESCRIPTION debaux-build is a helper script for building Debian packages. Besides options it takes up to three parameters: DEBDIR, BUILDDIR, SOURCEDIR. DEBDIR is a required parameter. If DEBDIR doesn't exist, debaux-build tries to download the package with apt-get source. debaux-build applies all patches found in the DEBDIR subdirectory patches. If no source tarball exist and the DEBDIR subdirectory sources exist, all files in this directory get packed and used as source tarball. =head1 OPTIONS =over 4 =item C<--apt> Forces apt-get source mode. =back =over 4 =item C<--archive> Specifies file name of source archive. =back =over 4 =item C<--build-options> Options passed to C. =back =over 4 =item C<--cpan> Download Perl module from CPAN and create necessary Debian packaging files. You need to have the dh-make Debian package installed in order to utilize this option. =back =over 4 =item C<--empty> Empty package (no source code archive). Intended to use for task packages. =back =over 4 =item C<--epoch> Specifies epoch for CPAN builds. =over 4 =item C<--extra-sources> Specifies a directory below DEBDIR which is copied to the build directory. =back =over 4 =item C<-i, --install, --install=PACKAGE> Install build package. =back =over 4 =item C<-l, --lintian> Run lintian on the source file and the generated packages. =back =over 4 =item C<--make-archive> Intended to use for native Debian packages. Specify the commands to build the archive here. =back =over 4 =item C<--release> The generated packages are targeted for official Debian packages. =back =over 4 =item C<--rpm, --alien> Convert generated packages into RPM packages by using C. =back =over 4 =item C<-s, --sign> Sign source package and changelog. =back =over 4 =item C<--skip-patches> Don't apply patches from the patches directory and sources.diff file. =over 4 =item C<--source-tree> Instructs C to use the specified directory instead of an archive file. =back =over 4 =item C<--stop-before-build> Stop script before calling C. =back =head1 CONFIGURATION FILE C looks for the configuration file C<.debauxrc> in the home directory and in the current directory and recognizes the following directives: =over 4 =item C PACKAGE Used as C for package if it is an existing directory. Considered before the directive. =item C If the directory C on the commandline doesn't exist, C appends C to the specified directory and tries again. =item C Directory with the source archives. Can be overridden by the commandline parameter C. =item C PACKAGE Directory with the source code for PACKAGE. =back =head1 SEE ALSO dpkg(8), dpkg-source(1), apt-get(8) =head1 AUTHOR Stefan Hornburg (Racke) . =head1 LICENSE debaux-build comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute and modify it under the terms of the GNU General Public License. =head1 COPYRIGHT Copyright 2000,2001,2002,2003,2004,2005,2006,2007 Stefan Hornburg (Racke) . =cut debaux-0.1.10.orig/scripts/debaux-publish0000755000175000017500000004262010646401676017303 0ustar rackeracke#! /usr/bin/perl -w # # debaux-publish - Debian package publishing script # # Copyright 2000,2001,2002,2006 Stefan Hornburg (Racke) # # This program is free software; you can redistribute it # and/or modify it under the terms of the GNU General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later # version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public # License along with this program; if not, write to the Free # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA. # MODULE SETUP # ============ use strict; use AppConfig qw(:argcount); use Data::Dumper; $Data::Dumper::Terse = 1; use File::Basename; use Getopt::Long; use Net::SSH qw(sshopen2); use DebAux::Util; # VARIABLES # ========= my $infref; # package info by file name, binary package name, source package name my (%upmap, %pkgmap, %srcmap); my @secdirs; # remote location information my %rmtloc; # used distributions and architectures my $debarch; my %distmap; my %distarches; # settings specific for a site my %sitedefs; # COMMANDLINE PARAMETERS # ====================== my %opts = ('dry-run' => 0); my $whandler = $SIG{__WARN__}; $SIG{__WARN__} = sub {print STDERR "$0: @_";}; unless (GetOptions (\%opts, 'distribution|d=s', 'dry-run|n', 'site=s')) { exit 1; } $SIG{__WARN__} = $whandler; # PARSE CONFIGURATION FILE # ======================== my $cfgfile = $ENV{'HOME'} . '/.debpublishrc'; my $config = new AppConfig ({GLOBAL => {ARGCOUNT => ARGCOUNT_ONE}, ERROR => sub {conferror($cfgfile,@_)}}); $config -> define ('host', {ARGCOUNT => ARGCOUNT_HASH}); $config -> define ('remote_host'); $config -> define ('remote_dir', {ARGCOUNT => ARGCOUNT_HASH}); $config -> define ('remote_user'); $config -> define ('user', {ARGCOUNT => ARGCOUNT_HASH}); $config -> define ('override'); $config -> define ('distconf'); $config -> define ('dist_remote_dir'); open (CONF, $cfgfile) || die "$0: Couldn't open configuration file $cfgfile: $!\n"; $config -> file (\*CONF); close (CONF); # sanity checks if ($opts{'site'}) { # if a site is given, we need its name and the remote directory my $href = $config->get('remote_dir'); unless (exists $href->{$opts{'site'}}) { die "$0: remote directory for site \"$opts{'site'}\" not defined\n"; } $sitedefs{'remote_dir'} = $href->{$opts{'site'}}; $href = $config->get('host'); unless (exists $href->{$opts{'site'}}) { die "$0: remote host for site \"$opts{'site'}\" not defined\n"; } $sitedefs{'host'} = $href->{$opts{'site'}}; $href = $config->get('user'); $sitedefs{'user'} = $href->{$opts{'site'}}; } # determine architecture $debarch = DebAux::Util::architecture(); my $debfile; for (@ARGV) { if (/\.deb$/) { # Debian package file $debfile = $_; $infref = get_debinfo ($_); if (exists $pkgmap{$infref->{'package'}}) { if (compare_versions('>', $infref->{'version'}, $pkgmap{$infref->{'package'}}->{'version'})) { # remove entrie for older package delete $upmap{$pkgmap{$infref->{'package'}}->{'deb'}}; } else { next; } } # push (@secdirs, $infref->{'section'}); $upmap{$debfile} = {arch => $infref->{'arch'}, dir => $infref->{'section'}, deb => $debfile, dsc => dsc_filename ($infref), name => $infref->{'package'}, priority => $infref->{'priority'}, source => $infref->{'source'}, version => $infref->{'version'}, }; $pkgmap{$infref->{'package'}} = $upmap{$debfile}; } else { die "$0: What is $_ ?\n"; } } unless (keys %upmap) { die "$0: Nothing found to publish\n"; } for (keys %upmap) { # complete entries for valid packages push(@{$srcmap{$upmap{$_}->{'source'}}->{'bin'}}, $upmap{$_}->{'name'}); $srcmap{$upmap{$_}->{'source'}}->{'localdir'} = dirname($_); $srcmap{$upmap{$_}->{'source'}}->{'version'} = $upmap{$_}->{'version'}; $srcmap{$upmap{$_}->{'source'}}->{'dir'} = $upmap{$_}->{'dir'}; } my $distconfig; my %distrmtdirs; my $rmtdir; # read distribution configuration file my $distrcfile; my %vars; if ($opts{'distribution'}) { for (keys %upmap) { $vars{$upmap{$_}->{source}} = [$opts{'distribution'}]; $vars{$upmap{$_}->{name}} = [$opts{'distribution'}]; } } else { $distrcfile = $config->get('distconf'); unless ($distrcfile) { die "$0: please specify distribution configuration file or use the distribution commandline option\n"; } $distconfig = new AppConfig ({GLOBAL => {ARGCOUNT => ARGCOUNT_LIST}, CREATE => 1, ERROR => sub {conferror($distrcfile,@_)}}); open (CONF, $distrcfile) || die "$0: Couldn't open configuration file $distrcfile: $!\n"; $distconfig -> file (\*CONF); close (CONF); %vars = $distconfig -> varlist ('.'); } my $dscfile; if ($opts{site}) { $rmtdir = $sitedefs{'remote_dir'}; } else { $rmtdir = $config -> get ('dist_remote_dir'); } foreach my $src (keys %vars) { if (exists $srcmap{$src}) { # read corresponding .dsc file $dscfile = $srcmap{$src}->{localdir} . '/' . $src . '_' . cut_epoch($srcmap{$src}->{version}) . '.dsc'; open (DSC, $dscfile) || die ("$0: Couldn't open $dscfile\n"); my ($afterfiles, @frags, @srcfiles); while () { if ($afterfiles) { last unless /\S/; s/^\s+//; @frags = split (/\s+/); push (@srcfiles, $frags[2]); } elsif (index ($_, 'Files:') == 0) { $afterfiles = 1; } } close (DSC); push (@srcfiles, $src . '_' . cut_epoch ($srcmap{$src}->{version}) . '.dsc'); for my $dist (@{$vars{$src}}) { next if $dist eq '1'; my (@distfrags, $cmpop, $cmpversion, $sysret); @distfrags = split (/\s+/, $dist); if (@distfrags == 3) { ($dist, $cmpop, $cmpversion) = @distfrags; my $cmpret = compare_versions($cmpop, $srcmap{$src}->{version},$cmpversion); next if $cmpret == 0; # skip this entry } $distmap{$dist} = 1; # add source files for my $srcfile (@srcfiles) { push (@{$rmtloc{$srcmap{$src}->{localdir} . '/' . $srcfile}}, join ('/', "dists/$dist/main/source", $srcmap{$src}->{dir}, $srcfile)); } # loop over all corresponding binary packages for my $pkg (@{$srcmap{$src}->{'bin'}}) { push (@{$pkgmap{$pkg}->{dists}}, $dist); my $arch = $pkgmap{$pkg}->{arch}; if ($arch eq 'all') { $arch = $debarch; } unless (grep {$_ eq $pkgmap{$pkg}->{arch}} @{$distarches{$dist}}) { push (@{$distarches{$dist}}, $arch); } push (@{$rmtloc{$pkgmap{$pkg}->{deb}}}, join ('/', "dists/$dist/main/binary-" . $pkgmap{$pkg}->{arch}, $pkgmap{$pkg}->{dir}, basename($pkgmap{$pkg}->{deb}))); if ($pkgmap{$pkg}->{arch} eq 'all') { push (@{$rmtloc{$pkgmap{$pkg}->{deb}}}, join ('/', "dists/$dist/main/binary-$debarch", $pkgmap{$pkg}->{dir}, basename($pkgmap{$pkg}->{deb}))); } } } } } for (keys %rmtloc) { for my $loc (@{$rmtloc{$_}}) { $distrmtdirs{$rmtdir . '/' . dirname($loc)} = 1; } } sub conferror { my $file = shift; die "$0: $file: @_\n"; } # CREATE REMOTE DIRECTORIES # ========================= $rmtdir ||= ''; if ($rmtdir !~ m%^/\S+%) { die "$0: suspicious remote directory \"$rmtdir\"\n"; } my $seclist = join (',', map{"'$_'"} (@secdirs, "$rmtdir/indices", sort(keys(%distrmtdirs)))); my $script = <<'EOF'; use strict; use File::Path; my $dryrun = '@dryrun@'; if ($dryrun) { print "Creating directories @secdirs@\n"; } else { mkpath([@secdirs@], 1, 0755); } EOF my $host = $config->get('remote_host'); my $user = $config->get('remote_user'); if ($opts{'site'}) { $host = $sitedefs{'host'}; $user = $sitedefs{'user'}; } remote_perl ($script, {secdirs => $seclist, dryrun => $opts{'dry-run'}}, $host, $user); # UPLOAD FILES # ============ $script = << 'EOF'; use strict; my $locs = @locs@; my $dryrun = '@dryrun@'; chdir('@remotedir@') || die "Couldn't enter remote directory @remotedir@: $!\n"; for (@$locs) { if (-f $_ || -l $_) { if ($dryrun) { print "Unlinking $_\n"; } else { unlink($_) || die "Couldn't delete $_: $!\n"; } } if ($dryrun) { print "Creating symbolic link from $_ to ../../../../../@original@\n"; } else { symlink('../../../../../@original@', $_) || die "Couldn't create symbolic link @original@ => $_: $!\n"; } } EOF my $sysret; for (sort (keys %rmtloc)) { my @locs = @{$rmtloc{$_}}; my $firstloc = shift(@locs); # copy first location if ($opts{'dry-run'}) { print "Running rsync $_ $user\@$host:$rmtdir/$firstloc\n"; } else { $sysret = system ("rsync $_ $user\@$host:$rmtdir/$firstloc"); if ($sysret) { die "Rsync failed with exit state ", $sysret >> 8, "\n"; } } # symlink other locations remote_perl ($script, {original => $firstloc, locs => Dumper(\@locs), remotedir => $rmtdir, dryrun => $opts{'dry-run'}}, $host, $user ); } # DELETE OLD PACKAGES, MANGLE OVERRIDE FILE, UPDATE PACKAGES FILE # =============================================================== my $ovfile = $config->get('override'); $script = << 'EOF'; use strict; use File::Basename; use File::Find; # FUNCTION: cut_epoch sub cut_epoch { my ($version) = @_; $version =~ s/^\d+://; $version; } my (@ovlines, $package, $state, $section); my $pkgmap = @pkgdata@; my $srcmap = @srcdata@; my $dist = '@dist@'; my $archs = @archs@; my $dryrun = '@dryrun@'; sub debcleaner { my ($package, $file, $var, $value); # remove broken symlinks if (-l $_ && ! -f readlink($_)) { if ($dryrun) { print "Deleting broken symlink $_\n"; } else { print "Deleting broken symlink $_\n"; unlink ($_) || die "$0: Couldn't delete symlink $_: $!\n"; } return; } # consider only valid files return unless (-f $_ || -l $_); # return unless /\.deb$/; $file = $_; if (/\.deb$/) { open (DPKGINF, "dpkg-deb --info $_ |"); while () { s/\s+$//; ($var, $value) = split (/:\s*/); if ($var =~ /^ Package/) { $package = $value; last; } } close (DPKGINF) || die "$0: Bad exit state from dpkg-deb\n"; # see if package corresponds to one of the published if (exists $$pkgmap{$package}) { if ($file ne basename($$pkgmap{$package}->{deb})) { # inappropriate package => need to delete it print "Delete $file\n"; unless ($dryrun) { unlink ($file) || die "$0: Couldn't delete file $file: $!\n"; } } } } elsif (/^(.*?)_(.*?)\.diff\.gz$/) { if (exists $$srcmap{$1}) { if ($file ne $1 . '_' . cut_epoch($$srcmap{$1}->{version}) . '.diff.gz') { print "Delete $file\n"; unless ($dryrun) { unlink ($file) || die "$0: Couldn't delete file $file: $!\n"; } } } } elsif (/^(.*?)_(.*?)\.dsc$/) { if (exists $$srcmap{$1}) { if ($file ne $1 . '_' . cut_epoch($$srcmap{$1}->{version}) . '.dsc') { print "Delete $file\n"; unless ($dryrun) { unlink ($file) || die "$0: Couldn't delete file $file: $!\n"; } } } } elsif (/^(.*?)_(.*?)\.orig\.tar\.gz$/) { if (exists $$srcmap{$1}) { my ($origversion) = split (/-/, cut_epoch($$srcmap{$1}->{version})); if ($file ne $1 . '_' . $origversion . '.orig.tar.gz') { print "Delete $file\n"; unless ($dryrun) { unlink ($file) || die "$0: Couldn't delete file $file: $!\n"; } } } } } find (\&debcleaner, '@rootdir@/main'); unless ($dryrun) { unless (-f '@override@') { open (OVERRIDE, '>@override@'); close (OVERRIDE); } open (OVERRIDE, '+<@override@') || die ("$0: Couldn't open override file @override@: $!\n"); while () { chomp; next unless /\S/; my $distflag = 1; ($package, $state, $section) = split; # is this a package just uploaded ? if (exists $$pkgmap{$package}) { if ($dist) { $distflag = grep {$_ eq $dist} @{$$pkgmap{$package}->{dists}}; next unless $distflag; } push (@ovlines, join (' ', $package, $$pkgmap{$package}->{priority}, $$pkgmap{$package}->{dir})); delete $$pkgmap{$package}; } else { push (@ovlines, $_); } } for (sort (keys %$pkgmap)) { push (@ovlines, join (' ', $_, $$pkgmap{$_}->{priority}, $$pkgmap{$_}->{dir})); } unless (truncate (OVERRIDE, 0)) { die ("$0: Couldn't truncate @override@: $!\n"); } seek (OVERRIDE, 0, 0); print OVERRIDE join ("\n", @ovlines, ''); close(OVERRIDE); for (@$archs) { chdir ("@rootdir@") || die "$0: Couldn't enter directory @rootdir@: $!\n"; system ("dpkg-scanpackages main/binary-$_ '@override@' dists/$dist/ | gzip -c > main/binary-$_/Packages.gz"); } chdir ("@rootdir@") || die "$0: Couldn't enter directory @rootdir@: $!\n"; system ("dpkg-scansources main/source '@override@' dists/$dist/ | gzip -c > main/source/Sources.gz"); } EOF #remote_perl ($script, # {override => $config->get('override'), # pkgdata => Dumper(\%pkgmap), # rootdir => $config->get('remote_dir')}, # $config->get('remote_host'), # $config->get('remote_user') # ); for (sort (keys %distmap)) { print "Preparing distribution $_\n"; remote_perl ($script, {archs => Dumper($distarches{$_}), dist => $_, override => "$rmtdir/indices/override.$_", pkgdata => Dumper(\%pkgmap), rootdir => "$rmtdir/dists/$_", srcdata => Dumper(\%srcmap), dryrun => $opts{'dry-run'}}, $host, $user ); } # ----------------------------------------------- # FUNCTION: compare_versions OP VERSION1 VERSION2 # # Compares versions VERSION1 and VERSION2 with # operator OP. Returns the result. # ----------------------------------------------- sub compare_versions { my ($op, $version1, $version2) = @_; my $sysret; $sysret = system ("dpkg --compare-versions '$version1' '$op' '$version2'"); $sysret /= 256; if ($sysret != 0 && $sysret != 1) { die "$0: dpkg --compare-versions '$version1' '$op' '$version2' failed\n"; } return ! $sysret; } # ---------------------------------------------------------- # FUNCTION: get_debinfo FILE # # Retrieves information about the Debian package and returns # a hash reference with the following pieces of information: # # arch architecture where the package belongs to # package package name # priority package priority # section category where the package belongs to # source source package name # ---------------------------------------------------------- sub get_debinfo { my ($file) = @_; my (%infmap, $var, $value, $param); open (DPKGINF, "dpkg-deb --info $file |"); while () { s/\s+$//; ($var, $value) = split (/:\s*/, $_, 2); if ($var =~ /^ Section/) { if ($value eq 'non-US/main') { $infmap{'section'} = 'non-us'; } else { $infmap{'section'} = $value; } } elsif ($var =~ /^ Architecture/) { $infmap{'arch'} = $value; } elsif ($var =~ /^ Package/) { $infmap{'package'} = $value; } elsif ($var =~ /^ Priority/) { $infmap{'priority'} = $value; } elsif ($var =~ /^ Source/) { ($value, $param) = split (/\s/, $value); $infmap{'source'} = $value; if (defined $param && $param =~ /\((.*?)\)/) { $infmap{'version'} = $1; } } elsif ($var =~ /^ Version/) { $infmap{'version'} = $value; } } close (DPKGINF) || die "$0: Bad exit state from dpkg-deb\n"; # source package has the same name as the base package # if source not explicitly mentioned by dpkg-deb unless (exists $infmap{'source'}) { $infmap{'source'} = $infmap{'package'}; } \%infmap; } # ------------------------------------------------- # FUNCTION: dsc_filename DEBINFREF # # Returns the name of the description file # derived from the information stored in DEBINFREF. # ------------------------------------------------- sub dsc_filename { my ($debinfref) = @_; $debinfref->{'package'} . '_' . $debinfref->{'version'} . '.dsc'; } # -------------------------------------------------------- # FUNCTION: pooldir NAME # # Returns the name of the pool directory for package NAME. # -------------------------------------------------------- sub pooldir { my ($name) = @_; join('/', substr($name,0,1), $name); } # FUNCTION: cut_epoch sub cut_epoch { my ($version) = @_; $version =~ s/^\d+://; $version; } # FUNCTION: remote_perl SCRIPT REPLACEMENTS HOST USER sub remote_perl { my ($script, $repref, $host, $user) = @_; my $reg; for (keys %$repref) { $reg = qr/\@$_\@/; $script =~ s/$reg/$$repref{$_}/eg; } sshopen2("$user\@$host", *READER, *WRITER, "/usr/bin/perl -"); print WRITER $script; close WRITER; while () { print; } close READER; } # DOCUMENTATION # ============= =head1 NAME debaux-publish - Debian package publishing script =head1 SYNOPSIS debaux-publish [OPTIONS] DEBFILES =head1 VERSION 0.1.4 =head1 DESCRIPTION debaux-publish is a helper script for publishing Debian packages. =head1 OPTIONS =over 4 =item C<-d NAME, --distribution NAME> Forces debaux-publish to publish the package(s) to this distribution. =item C<-n, --dry-run> Don't actually publish anything. =item C<--site=NAME> Publish Debian packages on site NAME. =back =head1 SEE ALSO dpkg(8), dpkg-scanpackages(8) =head1 AUTHOR Stefan Hornburg (Racke) . =head1 LICENSE debaux-publish comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute and modify it under the terms of the GNU General Public License. =head1 COPYRIGHT Copyright 2000,2001,2002 Stefan Hornburg (Racke) . =cut debaux-0.1.10.orig/debian/0000755000175000017500000000000010652063350014156 5ustar rackerackedebaux-0.1.10.orig/debian/copyright0000644000175000017500000000050210006000263016071 0ustar rackerackeThis package was debianized by Stefan Hornburg (Racke) on Mon, 16 Jul 12:58:59 2001. Upstream Author: Stefan Hornburg (Racke) Copyright: It may be redistributed under the terms of the GNU GPL, Version 2 or later, found on Debian systems in the file /usr/share/common-licenses/GPL. debaux-0.1.10.orig/debian/debaux-debconf.files0000644000175000017500000000011307447631222020052 0ustar rackeracke/usr/share/man/man3/DebAux::Debconf.3pm /usr/share/perl5/DebAux/Debconf.pm debaux-0.1.10.orig/debian/rules0000644000175000017500000000547010646420725015247 0ustar rackeracke#!/usr/bin/make -f # # Copyright 2001,2002,2003,2007 by Stefan Hornburg (Racke) # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public # License along with this program; if not, write to the Free # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 # This is the debhelper compatability version to use. export DH_COMPAT=2 # This has to be exported to make some magic below work. export DH_OPTIONS ifndef PERL PERL = /usr/bin/perl endif TMP =`pwd`/debian/tmp archlib =`$(PERL) -MConfig -e 'print $$Config{installarchlib}'` config =INSTALLDIRS=perl INSTALLMAN1DIR=$(TMP)/usr/share/man/man1 INSTALLMAN3DIR=$(TMP)/usr/share/man/man3 INSTALLPRIVLIB=$(TMP)/usr/lib/perl5 INSTALLARCHLIB=$(TMP)$(archlib) INSTALLBIN=$(TMP)/usr/bin INSTALLSCRIPT=$(TMP)/usr/bin build: build-stamp build-stamp: dh_testdir # Add here commands to compile the package. $(PERL) Makefile.PL INSTALLDIRS=vendor # For potato builds if ! grep ^install_vendor Makefile >/dev/null; then \ $(MAKE) clean; \ $(PERL) Makefile.PL $(config); \ fi $(MAKE) OPTIMIZE="-O2 -g -Wall" touch build-stamp clean: dh_testdir dh_testroot rm -f build-stamp # Add here commands to clean up after the build process. $(PERL) Makefile.PL $(MAKE) distclean dh_clean install: build dh_testdir dh_testroot dh_clean -k dh_installdirs # Add here commands to install the package into debian/tmp. $(MAKE) install PREFIX=$(PWD)/debian/tmp/usr; \ mkdir -p $(TMP)/usr/share/debaux/cpan cp -p share/cpan/compat share/cpan/control share/cpan/debbuild share/cpan/rules $(TMP)/usr/share/debaux/cpan dh_movefiles touch install-stamp # Build architecture-independent files here. binary-indep: build install # We have nothing to do by default. # Build architecture-dependent files here. binary-arch: build install # dh_testversion dh_testdir dh_testroot # dh_installdebconf dh_installdocs dh_installexamples dh_installmenu # dh_installemacsen # dh_installpam # dh_installinit dh_installcron # dh_installmanpages dh_installinfo dh_installchangelogs dh_link dh_strip dh_compress dh_fixperms dh_makeshlibs dh_installdeb dh_perl dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install debaux-0.1.10.orig/debian/debaux.files0000644000175000017500000000031407605574660016467 0ustar rackeracke/usr/bin /usr/share/debaux /usr/share/man/man1/debaux-build.1p /usr/share/man/man1/debaux-publish.1p /usr/share/man/man3/DebAux::Util.3pm /usr/share/perl5/DebAux/Util.pm /usr/share/perl5/DebAux/Version.pmdebaux-0.1.10.orig/debian/control0000644000175000017500000000301210566554167015574 0ustar rackerackeSource: debaux Section: devel Priority: optional Maintainer: Stefan Hornburg (Racke) Standards-Version: 3.5.6.0 Build-Depends: debhelper Package: debaux Architecture: all Depends: ${perl:Depends}, libappconfig-perl, libnet-ssh-perl, libtimedate-perl, libwww-perl, dpkg-dev, rsync Suggests: dh-make Description: Debian Auxiliary Programs This package contains Perl programs and modules to build and publish Debian packages. . debaux-build automatically downloads APT sources before building, applies patches and additional sources. It has options to build the packages in an existing chroot environment, check the generated packages with lintian, install the created packages on your local system or turn them into RPM packages. . debaux-build has experimental support for downloading Perl modules from CPAN and creating the necessary Debian packaging files. . debaux-publish uploads packages and runs the scripts to create the APT sources and packages files on the remote system. debaux-publish doesn't support the pool structure yet. Package: debaux-debconf Architecture: all Depends: ${perl:Depends}, debconf | debconf-2.0 Description: Perl Interface to Debconf This package contains the DebAux::Debconf module, which provides an easy-to-use interface for some of the Debconf::Client::ConfModule functions. . It has been separated from the debaux package to allow packages utilizing this package during configuration and/or installation without drawing the whole list of debaux's dependencies. debaux-0.1.10.orig/debian/changelog0000644000175000017500000001166510652062710016040 0ustar rackerackedebaux (0.1.10-1) unstable; urgency=low * missing dependency to dpkg-dev added * reset locale in chroot environment to get expected messages from build process * bypass signing in chroot environment * fix problem with publishing architecture-independent packages on architectures other than i386 * --install now takes optional arguments * --lintian now checks source as well * new option --skip-patches * new configuration variables email and fullname * --release option adheres to proxy environment variable * build from CPAN: - move DH_COMPAT into debian/compat - create debbuild - remove underscores from Perl module names (e.g. Tree::DAG_Node becomes libtree-dagnode-perl) - support modules installed by Module::Build - set standards version to 3.7.2.2 - remove empty /usr/lib directory chain * DebAux::Debconf: - set method acknowledges "value set" as successful status - fixed wrong module name in manpage * update FSF address -- Stefan Hornburg (Racke) Thu, 26 Jul 2007 11:13:44 +0200 debaux (0.1.9-1) unstable; urgency=low * --append-version fails to work in time zones to the west of GMT -- Stefan Hornburg (Racke) Mon, 19 Dec 2005 23:09:09 +0100 debaux (0.1.8-1) unstable; urgency=low * fixed various problems with native packages (--chroot, inclusion of source) * arch-dependent patches * new options --append-version and --changelog-message to prepend changelog entries * reset locale before calling dpkg-buildpackage * use section perl in CPAN debian/control template * debconf-2.0 alternative dependency added (Closes: #331795, thanks to Joey Hess ) -- Stefan Hornburg (Racke) Thu, 20 Oct 2005 15:32:50 +0200 debaux (0.1.7-1) unstable; urgency=low * fixed some issues with --chroot-user * adding missing back to debaux-build's POD documentation * --release downloads original archive even if debian release number is 1, there are releases with smaller numbers like jfsutils 1.1.4-0.1 * --release works now without --chroot as well * lintian fix for copyright file -- Stefan Hornburg (Racke) Wed, 28 Jan 2004 19:23:18 +0100 debaux (0.1.6-1) unstable; urgency=low * found a case where debaux-build didn't split upstream version and debian release number correctly: 1.64-cvs20010402-2 * removed dh_suidregister from share/cpan/rules * misleading error message on apt-get source failure fixed * new commandline option --extra-sources * added plus to allowed characters in package directory names, e.g. libsigc++-1.0.4 (thanks to Eric Woodruff for the bug report) -- Stefan Hornburg (Racke) Fri, 1 Aug 2003 01:16:46 +0200 debaux (0.1.5-1) unstable; urgency=low * broken description line removed from debian/control * reasoning for separate distribution added to debaux-debconf's description * removed potato compatibility code from debian/rules * install share/cpan/{control,rules} (Closes: #148151) * debaux-build no longer copies files like foo.c.~1.1~ from the source directory * new debauxdir option added to global configuration file * full implementation of download parameter -- Stefan Hornburg (Racke) Tue, 28 Jan 2003 22:06:06 +0100 debaux (0.1.4-3) unstable; urgency=low * set() method added to Debaux::Debconf -- Stefan Hornburg (Racke) Sat, 28 Dec 2002 19:28:15 +0100 debaux (0.1.4-2) unstable; urgency=low * --stop-before-build works with --chroot now * added nasty hack to build with other user in chroot -- Stefan Hornburg (Racke) Fri, 27 Dec 2002 00:24:31 +0100 debaux (0.1.4-1) unstable; urgency=low * moved DebAux::Debconf into separate package debaux-debconf * new sourcedir parameter for global configuration file * new download parameter for package configuration files * debaux suggests now dh-make, which is needed for the --cpan option * debaux-build checks for the changelog in the source tree and in the Debian directory now * debaux-build displays changelog filename if dpkg-parsechangelog fails * debaux-publish allows to specify the remote user now * fixed indentation in debaux-publish manual page * add patch filename to error message for patches in patches directory -- Stefan Hornburg (Racke) Sun, 17 Nov 2002 13:21:49 +0100 debaux (0.1.3-1) unstable; urgency=medium * DebAux::Debconf module added * use -j flag for unpacking .tar.bz2 archives -- Stefan Hornburg (Racke) Fri, 15 Mar 2002 18:46:58 +0100 debaux (0.1.2-1) unstable; urgency=low * More comprehensive description (Closes: #135310) -- Stefan Hornburg (Racke) Sat, 23 Feb 2002 17:07:04 +0100 debaux (0.1.1-1) unstable; urgency=low * Initial release -- Stefan Hornburg (Racke) Mon, 18 Feb 2002 10:18:10 +0100 debaux-0.1.10.orig/lib/0000755000175000017500000000000010652063350013502 5ustar rackerackedebaux-0.1.10.orig/lib/DebAux/0000755000175000017500000000000010652063350014652 5ustar rackerackedebaux-0.1.10.orig/lib/DebAux/Version.pm0000644000175000017500000000005510652062640016636 0ustar rackerackeuse vars qw($VERSION); $VERSION = 0.001_010; debaux-0.1.10.orig/lib/DebAux/Util.pm0000644000175000017500000000562510652062621016135 0ustar rackeracke# Util.pm - utility functions for DebAux scripts # Copyright (C) 2001,2005 Stefan Hornburg (Racke) # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 2, or (at your option) any # later version. # This file is distributed in the hope that it will be # useful, but WITHOUT ANY WARRANTY; without even the implied warranty # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # You should have received a copy of the GNU General Public License # along with this file; see the file COPYING. If not, write to the Free # Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301 USA. =head1 NAME DebAux::Util - utility functions for scripts of the debaux suite =head1 SYNOPSIS use DebAux::Util; DebAux::Util::mkdir ('/path/to/a/directory'); DebAux::Util::remove ('/path/to/a/directory'); DebAux::Util::architecture (); =head1 DESCRIPTION This modules provides utility functions for scripts of the debaux suite. =head1 FUNCTIONS =over 4 =item mkdir I Creates I and any missing parent directories. =back =cut package DebAux::Util; use strict; use Cwd; use File::Find; sub mkdir { my ($directory) = @_; my @frags = split (/\/+/, $directory); my $path; unless (length $frags[0]) { shift (@frags); $path = '/'; } for (@frags) { $path .= $_; unless (-d $path) { mkdir ($path, 0777) || die "$0: Couldn't create directory \"$path\"\n"; } $path .= '/'; } } =over 4 =item remove I Removes recursively I in the way I would do. =cut sub remove { my ($directory) = @_; # proceed only if directory exists return unless -d $directory; my $sub = sub { my $cwd = cwd(); # ignore special files return if $_ =~ /^\.\.?$/; if (-d $_ && ! -l $_) { # remove directory rmdir ($_) || die "$0: Couldn't remove directory: $cwd/$_: $!\n"; } else { # remove file unlink ($_) || die "$0: Couldn't remove file: $cwd/$_: $!\n"; } }; my $cwd = cwd(); finddepth ($sub, $directory); rmdir ($directory) || die "$0: Couldn't remove directory: $cwd/$directory\n"; } =over 4 =item architecture Returns current architecture. =cut sub architecture { my ($arch); $arch = `dpkg --print-architecture`; if ($@ || !$arch) { die "$0: failed to determine current architecture\n"; } # remove trailing blanks $arch =~ s/\s+$//; return $arch; } 1; __END__ =head1 AUTHOR Stefan Hornburg (Racke) =head1 LICENSE DebAux::Util comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute and modify it under the terms of the GNU General Public License. =head1 COPYRIGHT Copyright 2001,2005 Stefan Hornburg (Racke) . =cut debaux-0.1.10.orig/lib/DebAux/Debconf.pm0000644000175000017500000000451610652062611016555 0ustar rackeracke# Debconf.pm - utility functions for DebAux scripts # Copyright (C) 2002,2007 Stefan Hornburg (Racke) # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 2, or (at your option) any # later version. # This file is distributed in the hope that it will be # useful, but WITHOUT ANY WARRANTY; without even the implied warranty # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # You should have received a copy of the GNU General Public License # along with this file; see the file COPYING. If not, write to the Free # Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301 USA. package DebAux::Debconf; use strict; use Debconf::Client::ConfModule; =head1 NAME DebAux::Debconf - easy interface to Debconf::Client::ConfModule =head1 SYNOPSIS use DebAux::Debconf; DebAux::Debconf::get('package/name'); DebAux::Debconf::set('package/name','value'); DebAux::Debconf::ask('medium','package/name'); =head1 DESCRIPTION This module provides an easy interface to Debconf::Client::Module which does the error handling for you. =head1 FUNCTIONS =over 4 =item get I Get the value for I. Dies on any error. =back =cut sub get { my ($name) = @_; my ($status, $value) = Debconf::Client::ConfModule::get($name); if ($status) { die ("Couldn't get debconf value for $name (Status: $status)\n"); } $value; } =over 4 =item set I I Set the value for I. Dies on any error. =back =cut sub set { my ($name, $value) = @_; my $status = Debconf::Client::ConfModule::set($name, $value); if ($status ne 'value set') { die ("Couldn't set debconf value $value for $name (Status: $status)\n"); } $value; } =over 4 =item ask I I Asks for the value for I with the priority I. Combines the debconf commands INPUT and GO. Dies on any error. =back =cut sub ask { my ($priority, $name) = @_; my ($status, $value); ($status, $value) = Debconf::Client::ConfModule::input($priority, $name); if ($status && $status != 30) { die "Configuration of $name failed with status $status ($value)\n"; } Debconf::Client::ConfModule::go(); } 1; debaux-0.1.10.orig/MANIFEST0000644000175000017500000000064710646406220014074 0ustar rackerackedebian/changelog debian/control debian/copyright debian/debaux.files debian/debaux-debconf.files debian/rules lib/DebAux/Debconf.pm lib/DebAux/Util.pm lib/DebAux/Version.pm MANIFEST MANIFEST.SKIP Makefile.PL scripts/.debauxrc scripts/debaux-build scripts/debaux-publish share/cpan/compat share/cpan/control share/cpan/debbuild share/cpan/rules META.yml Module meta-data (added by MakeMaker) debaux-0.1.10.orig/MANIFEST.SKIP0000644000175000017500000000004207321006405014623 0ustar rackeracke\bCVS\b (^|/)\.cvs \.gz$ ^MANIFESTdebaux-0.1.10.orig/share/0000755000175000017500000000000010652063350014036 5ustar rackerackedebaux-0.1.10.orig/share/cpan/0000755000175000017500000000000010652063350014757 5ustar rackerackedebaux-0.1.10.orig/share/cpan/control0000644000175000017500000000046410646401341016365 0ustar rackerackeSource: #PACKAGE# Section: perl Priority: optional Maintainer: #USERNAME# <#EMAIL#> Build-Depends: debhelper (>= 5) Standards-Version: #POLICY# Package: lib#PACKAGE# Architecture: any Depends: ${perl:Depends} Description: debaux-0.1.10.orig/share/cpan/compat0000644000175000017500000000000210646376345016173 0ustar rackeracke5 debaux-0.1.10.orig/share/cpan/rules0000644000175000017500000000355610646413776016063 0ustar rackeracke#!/usr/bin/make -f # Sample debian/rules that uses debhelper. # GNU copyright 1997 to 1999 by Joey Hess. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 ifndef PERL PERL = /usr/bin/perl endif TMP := $(shell pwd)/debian/lib#PACKAGE# archlib := $(shell $(PERL) -MConfig -e 'print $$Config{installarchlib}') config =INSTALLDIRS=perl INSTALLMAN1DIR=$(TMP)/usr/share/man/man1 INSTALLMAN3DIR=$(TMP)/usr/share/man/man3 INSTALLPRIVLIB=$(TMP)/usr/lib/perl5 INSTALLARCHLIB=$(TMP)$(archlib) INSTALLBIN=$(TMP)/usr/bin INSTALLSCRIPT=$(TMP)/usr/bin build: build-stamp build-stamp: dh_testdir # Add here commands to compile the package. $(PERL) Makefile.PL INSTALLDIRS=vendor $(MAKE) OPTIMIZE="-O2 -g -Wall" touch build-stamp clean: dh_testdir dh_testroot rm -f build-stamp # Add here commands to clean up after the build process. -#CLEAN# dh_clean install: build dh_testdir dh_testroot dh_clean -k dh_installdirs # Module::Build clause if [ -f Build.PL ] ; then \ $(PERL) Build.PL destdir=$(TMP); \ $(PERL) Build install destdir=$(TMP); \ else \ $(MAKE) install PREFIX=$(TMP)/usr; \ fi # Remove empty directory chain rmdir --ignore-fail-on-non-empty --parents $(TMP)/usr/lib/perl5 # Build architecture-independent files here. binary-indep: build install # We have nothing to do by default. # Build architecture-dependent files here. binary-arch: build install # dh_testversion dh_testdir dh_testroot # dh_installdebconf dh_installdocs dh_installexamples dh_installmenu # dh_installemacsen # dh_installpam # dh_installinit dh_installcron dh_installman dh_installinfo # dh_undocumented dh_installchangelogs #CHANGELOGS# dh_link dh_strip dh_compress dh_fixperms # dh_makeshlibs dh_installdeb dh_perl dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install debaux-0.1.10.orig/share/cpan/debbuild0000644000175000017500000000006510646406403016460 0ustar rackerackearchive = #DIRECTORY#.tar.gz directory = #DIRECTORY# debaux-0.1.10.orig/META.yml0000644000175000017500000000046610652063350014213 0ustar rackeracke# http://module-build.sourceforge.net/META-spec.html #XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX# name: debaux version: 0.00101 version_from: lib/DebAux/Version.pm installdirs: site requires: distribution_type: module generated_by: ExtUtils::MakeMaker version 6.30_01 debaux-0.1.10.orig/Makefile.PL0000644000175000017500000000113007605571422014711 0ustar rackerackeuse ExtUtils::MakeMaker; # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. WriteMakefile ( ($] ge '5.005') ? ( 'AUTHOR' => 'Stefan Hornburg (Racke) ', 'ABSTRACT' => "Debian Auxiliary Programs", ) : (), 'clean' => { 'FILES' => 'blib/* Makefile' }, 'dist' => { 'COMPRESS' => 'gzip', 'SUFFIX' => 'gz' }, 'DISTNAME' => 'debaux', 'NAME' => 'debaux', 'EXE_FILES' => ['scripts/debaux-build', 'scripts/debaux-publish'], 'PREREQ_PM' => {}, 'VERSION_FROM' => 'lib/DebAux/Version.pm' );