'.($Options{"help"} || "");
}
+sub checkcommandversion
+{
+my($class,$command,$version)=@_;
+
+ local *F;
+ do { open F,$_ or confess "Open $_: $!"; } for ("$command --version|");
+ local $/;
+ undef $/;
+ my $command_out=<F>;
+ close F;
+ my $command_version=($command_out=~m#([\d.]+)#)[0];
+ confess "$command(1) version not found in its output" if !$command_version;
+ confess "'$command' version $version or higher required"
+ # Do not take 3rd+ numbers as it would not be a number
+ if ($command_version=~/^(\d+[.]\d+)/)[0]<$version;
+}
+
sub _readfile
{
my($filename)=@_;
_remove @files;
}
+sub _prepdist
+{
+my($class,$name)=@_;
+
+ my($specsrc)=map((-e $_ ? $_ : "$name.spec.in"),"$name.spec.m4.in");
+ my $spec=_readfile $specsrc;
+ $spec=~s/\\\n/ /gs;
+ my $configure_args=($spec=~/^[%]configure\b[ \t]*(.*)$/m)[0];
+ $configure_args=~s/--disable-gtk-doc\b/--enable-gtk-doc/g; # optional; gtk-doc reqd for 'make dist'
+ $class->run(%Options,
+ "ARGV"=>[qw(--copy)],
+ "configure_args"=>[split /\s+/,$configure_args],
+ );
+ _remove $Options{"ChangeLog"} || "ChangeLog"; # force its rebuild by Makefile/rcs2log
+ _system "make dist $name.spec";
+}
+
# $args{
# "sign"=>bool,
# },
_remove "nocheck",\1,
_rpmeval("_tmppath" )."/$name-*-root",
_rpmeval("_builddir")."/$name-*";
- my($specsrc)=map((-e $_ ? $_ : "$name.spec.in"),"$name.spec.m4.in");
- my $spec=_readfile $specsrc;
- $spec=~s/\\\n/ /gs;
- $class->run(%Options,
- "ARGV"=>["--copy"],
- "configure_args"=>[split /\s+/,($spec=~/^[%]configure\b[ \t]*(.*)$/m)[0]],
- );
- _remove "ChangeLog"; # force its rebuild by Makefile/rcs2log
- _system "make dist $name.spec";
+ $class->_prepdist($name);
_copy "$name-*.tar.gz",_rpmeval("_sourcedir");
_system(join(" ","rpmbuild",
"-ba",
_system "make dist-tarZ" if $Options{"dist-tarZ"};
_move _rpmeval("_srcrpmdir")."/$name-*.src.rpm",".";
_move _rpmeval("_rpmdir")."/"._rpmeval("_target_cpu")."/$name-*."._rpmeval("_target_cpu").".rpm",".";
- _system "ls -l $name-*";
+ _system "ls -l $name-*";
+ exit 0; # should never return
+}
+
+# $args{
+# "sign"=>bool,
+# },
+sub _debbuild
+{
+my($class,%args)=@_;
+
+ my $name=$Options{"name"};
+ $class->_prepdist($name);
+ _system "tar xzf $name-*.tar.gz";
+ _remove "$name-*.tar.gz"; # permit "cd $name-*" below
+ _system(join(" ","cd $name-*;dpkg-buildpackage",
+ "-rfakeroot",
+ ($args{"sign"} ? () : ("-us","-uc")),
+ ));
+ _remove \1,"$name-*";
+ _system "ls -l ${name}_*";
exit 0; # should never return
}
./missing
./mkinstalldirs
./libtool ./ltconfig ./ltmain.sh
- ./ChangeLog
./ABOUT-NLS
./<name>-[0-9]* ./<name>-devel-[0-9]*
./<name>.spec ./<name>.m4 ./<name>.spec.m4
+ ./debian/tmp ./debian/<name>
+ ./<name>_[0-9]*
./macros/macros.dep
./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/<name>.pot ./po/ChangeLog
./po/Makevars ./po/Makevars.template ./po/Rules-quot ./po/*.sed ./po/*.sin ./po/*.header
),
+ map(("./$_"),($Options{"ChangeLog"} || "ChangeLog")),
map((!$_ ? () : do { my $dir=$_; map("$dir/$_",qw(
*.stamp
sgml*
tmpl*
html*
+ xml
*.txt
*.txt.bak
+ *.new
+ *.sgml
*.args
*.hierarchy
*.signals
+ *.interfaces
+ *.prerequisites
)); }),$Options{"gtk-doc-dir"}),
map((!$_ ? () : do { my $dir=$_; map("$dir/$_",qw(
*.html
print _help() and confess if !GetOptions(
"rpm" ,sub { $class->_rpmbuild("sign"=>1); },
"rpmtest" ,sub { $class->_rpmbuild("sign"=>0); },
+ "deb" ,sub { $class->_debbuild("sign"=>1); },
+ "debtest" ,sub { $class->_debbuild("sign"=>0); },
"dist" ,\$Options{"ARGV_dist"},
"copy!" ,\$Options{"ARGV_copy"},
"fullclean",\$Options{"ARGV_fullclean"},
_system qw(autoheader) if $Options{"want-autoheader"};
# "ChangeLog" is reqd by automake(1)
# Don't remove it afterwards as it may still be needed during automatic automake Makefile rebuilds
- File::Touch->new("atime_only"=>1)->touch("ChangeLog");
+ File::Touch->new("atime_only"=>1)->touch("ChangeLog") if !$Options{"ChangeLog"};
_system qw(automake --add-missing),@copy_arg;
_system qw(autoconf);
# Why it is left there after RedHat autoconf-2.53-8 ?