#!/usr/bin/perl use strict; use warnings; use Carp; use File::Path; my $tmp = '/tmp/swish3.build'; my $htdocs = '/opt/trac/swish3/htdocs'; my $doc = $htdocs . '/doc'; my $dl = $htdocs . '/download'; my $podIndex = $doc . '/index.html'; mkpath([$tmp, $doc, $dl], 1); chdir($tmp) or croak "can't chdir $tmp: $!"; # update src shell("svn up") or croak $!; # make dist shell("./bootstrap 2>/dev/null", 1) or croak $!; shell("./configure", 1) or croak $!; shell("make", 1) or croak $!; shell("make test", 1) or croak $!; shell("make dist", 1) or croak $!; shell("cp SwishParser-*.tar.gz $dl/") or croak $!; # make html docs chdir('doc') or croak "can't chdir doc/: $!"; open(P, ">$podIndex") or croak "can't write $podIndex: $!"; print P "libswish3 Documentation\n"; print P ''; print P "\n\n"; print P "\n"; close(P); sub shell { my $cmd = shift; my $quiet = shift || 0; $cmd .= " 1>/dev/null" if $quiet; print $cmd, "\n"; my $r = system($cmd); return $r ? 0 : 1; }