X-Git-Url: http://git.jankratochvil.net/?p=macros.git;a=blobdiff_plain;f=AutoGen.pm;h=36fd16554f7dc5f703a6f246fb234670342cfd01;hp=52074ebe4765fa5eff5b6e253155338821b1ffc7;hb=d7f58ecae453bcea03b2917cf098e227c86c26d9;hpb=3c47af06fba573a1d76a6707f5efc9102477645e diff --git a/AutoGen.pm b/AutoGen.pm index 52074eb..36fd165 100644 --- a/AutoGen.pm +++ b/AutoGen.pm @@ -59,6 +59,9 @@ Beware: '.basename($0).' is a tool only for maintainers! Supported parameters: --rpm Build RPM packages locally (needs /usr/src/(redhat|packages)/ access) --rpmtest Build RPM like "rpm" but w/o gpg/pgp signing + --deb Build DEB packages locally + --debtest Build DEB like "deb" but w/o gpg/pgp signing + --dist Prepare all build files but do not run the final "./configure" --clean Standard cleanup method --fullclean Like clean but even the .cvsignore files are removed --copy Behave exactly like in default mode but copy all instead of symlinks @@ -228,21 +231,28 @@ my($class,%args)=@_; @origs=glob $glob; confess "Invalid glob $glob: ".join(",",@origs) if 1!=@origs; } - my($base,$ext)=($origs[0]=~/^orig-(.*)[.]tar[.](gz|Z|bz2)$/); + my($origbase,$ext)=($origs[0]=~/^orig-(.*)[.]tar[.](gz|Z|bz2)$/); _copy $origs[0],_rpmeval("_sourcedir")."/".($origs[0]=~/^orig-(.*)$/)[0]; _system "tar x".($ext eq "bz2" ? "j" : "z")."f ".$origs[0]; - _mkdir $base."-orig"; + _mkdir $origbase."-orig"; # FIXME: Copy also dot-prefixed files! - _move \1,$base."/*",$base."-orig/"; - _system "tar xzf $name-*.tar.gz"; + _move \1,$origbase."/*",$origbase."-orig/"; + rmdir $origbase or confess "rmdir $origbase: $!"; + my @ours; + for my $glob ("$name-*.tar.gz") { + @ours=glob $glob; + confess "Invalid glob $glob: ".join(",",@ours) if 1!=@ours; + } + my($ourbase)=($ours[0]=~/^(.*)[.]tar[.]gz$/); + _system "tar xzf ".$ours[0]; # Use single-argument system() as we need shell redirection. # FIXME: Use directory-independent _cleanfiles(), not root-directory '.cvsignore'. # "-X -" does not work, it needs to be stat(2)able file. _system "diff -ruP -X .cvsignore -I '".'[$]\(Id\|RCSfile\)\>.*[$]'."'" - ." $base-orig/ $base/" + ." $origbase-orig/ $ourbase/" ." >"._rpmeval("_sourcedir")."/".$patch, sub { $_[0]==0 || $_[0]==1; }; # diff(1) returns non-zero return code on any diffs. - _remove \1,$base,$base."-orig"; + _remove \1,$ourbase,$origbase."-orig"; } _system(join(" ","rpmbuild", "-ba", @@ -270,11 +280,14 @@ my($class,%args)=@_; _system "make distdir"; # Copy 'orig' archive after &_prepdist which would delete it. my @origs; + my $base; for my $glob ("orig-$name-*.tar.{gz,Z,bz2}") { @origs=glob $glob; if (@origs) { confess "Invalid glob $glob: ".join(",",@origs) if 1!=@origs; - (my $deborig=$origs[0])=~s/^orig-([^-]+)-(.*)([.]tar[.][^.]+)$/$1_$2.orig$3/; + $origs[0]=~/^orig-([^-]+)-(.*)([.]tar[.][^.]+)$/; + my $deborig="$1_$2.orig$3"; + $base="$1-$2"; _copy $origs[0],$deborig; } } @@ -283,11 +296,12 @@ my($class,%args)=@_; @subdirs=glob $glob; confess "Invalid glob $glob: ".join(",",@subdirs) if 1!=@subdirs; } - _system(join(" ","cd ".$subdirs[0].";dpkg-buildpackage", + rename $subdirs[0],$base or confess "$!"; + _system(join(" ","cd ".$base.";dpkg-buildpackage", "-rfakeroot", ($args{"sign"} ? () : ("-us","-uc")), )); - _remove \1,$subdirs[0]; + _remove \1,$base; _system "ls -l ${name}*_[0-9]*"; exit 0; # should never return } @@ -344,6 +358,7 @@ sub _cleanfiles ./debian/tmp ./debian/ ./*_[0-9]* ./macros/macros.dep + ./macros/glade-w.sh ./po/Makefile.in.in ./po/POTFILES* ./po/cat-id-tbl.c ./po/cat-id-tbl.tmp ./po/*.gmo ./po/*.mo ./po/stamp-cat-id ./po/.pot ./po/ChangeLog ./po/Makevars ./po/Makevars.template ./po/Rules-quot ./po/*.sed ./po/*.sin ./po/*.header @@ -588,6 +603,7 @@ my($class,%options)=@_; cat $tmp/out rm -f $tmp/out CONFIGURE_SUBST_X_EOF + _remove "nocheck","./configure.orig"; # It is usually produced by 'CONFIGURE_SUBST_X'. # Why it is left there after RedHat autoconf-2.53-8 ? _remove "nocheck",\1,"autom4te-*.cache";