X-Git-Url: http://git.jankratochvil.net/?p=macros.git;a=blobdiff_plain;f=AutoGen.pm;h=af3ffe100dfda3c5149e40bbfa82ddbab05ae1f5;hp=5075ee65afdb0f1ba4edc07bc478e96f37ae6acf;hb=a6f7d73f341c545438acaeab8b5cb0c5156105b7;hpb=a64d3257b666b1494c96019f2570ed4a41a99450;ds=sidebyside diff --git a/AutoGen.pm b/AutoGen.pm index 5075ee6..af3ffe1 100644 --- a/AutoGen.pm +++ b/AutoGen.pm @@ -19,6 +19,7 @@ package AutoGen; +require 5.6.0; # at least 'use warnings;' but we need some 5.6.0+ modules anyway use vars qw($VERSION); $VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; }; use strict; @@ -160,19 +161,21 @@ my($class,%args)=@_; "ARGV"=>["--copy"], "configure_args"=>[split /\s+/,($spec=~/^%configure\s+(.*)$/m)[0]], ); + _remove "ChangeLog"; # force its rebuild by Makefile/rcs2log _system "make dist $name.spec"; _copy "$name-*.tar.gz",_rpmeval("_sourcedir"); - _system(join(" ","rpm", + _system(join(" ","rpmbuild", "-ba", + "--rmsource", # _remove _rpmeval("_sourcedir")."/$name-*.tar.gz"; + "--clean", # _remove _rpmeval("_builddir")."/$name-VERSION"; (!$args{"sign"} ? () : "--sign"), "$name.spec", )); _system "make dist-tarZ" if $Options{"dist-tarZ"}; - _remove _rpmeval{"_sourcedir"}."/$name-*.tar.gz"; - _move _rpmeval{"_srcrpmdir"}."/$name-*.src.rpm","."; - _move "nocheck",_rpmeval{"_rpmdir"}."/"._rpmeval{"_arch"}."/$name-*."._rpmeval{"_arch"}.".rpm","."; + _move _rpmeval("_srcrpmdir")."/$name-*.src.rpm","."; + _move _rpmeval("_rpmdir")."/"._rpmeval("_arch")."/$name-*."._rpmeval("_arch").".rpm","."; _system "ls -l $name-*"; - # NOTREACHED + exit 0; # should never return } # WARNING: doesn't respect %Options change! @@ -212,6 +215,7 @@ sub _cleanfiles ./confdefs.h ./conftest* ./autoh[0-9]* ./confcache ./config.rpath ./depcomp + ./compile ./stamp-h ./stamp-h.in ./stamp-h1 ./install-sh ./aclocal.m4 @@ -344,8 +348,8 @@ my($class,%options)=@_; Getopt::Long::Configure('noignorecase','prefix_pattern=(--|-|\+|)'); local @ARGV=@{$Options{"ARGV"}}; print _help() and confess if !GetOptions( - "rpm" ,sub { $class->_rpmbuild("sign"=>1); return; }, - "rpmtest" ,sub { $class->_rpmbuild("sign"=>0); return; }, + "rpm" ,sub { $class->_rpmbuild("sign"=>1); }, + "rpmtest" ,sub { $class->_rpmbuild("sign"=>0); }, "dist" ,\$Options{"ARGV_dist"}, "copy!" ,\$Options{"ARGV_copy"}, "fullclean",\$Options{"ARGV_fullclean"}, @@ -436,6 +440,9 @@ my($class,%options)=@_; return if $Options{"ARGV_dist"}; + # 'configure' defaults to CFLAGS '-g -O2' but our --enable-maintainer-mode + # should force '-ggdb3' + $ENV{"CFLAGS"}||=""; # shared/static switching cannot be based on maintainer-mode in configure _system(qw(./configure --enable-maintainer-mode), ($Options{"want-libtoolize"} && qw(--enable-shared --disable-static)),