summaryrefslogtreecommitdiffstats
path: root/bin/templ
diff options
context:
space:
mode:
authorJustin Davis <jrcd83@gmail.com>2011-09-21 23:18:58 +0200
committerJustin Davis <jrcd83@gmail.com>2011-09-21 23:18:58 +0200
commitd4ad6bae77cfd68d4ac79471ee6f977621fb9b31 (patch)
treefaa5ccc3d3c01efc94a93691df7fc2a3517c29c9 /bin/templ
parentc3f405c8f1af4a06661584e12f8449e86389a772 (diff)
downloadgenpkg-d4ad6bae77cfd68d4ac79471ee6f977621fb9b31.tar.gz
genpkg-d4ad6bae77cfd68d4ac79471ee6f977621fb9b31.tar.xz
Refinish PKGBUILD generation.
Adds makepkgbuild script. The call to pbfields is moved from perl-pkg to makepkgbuild. pbfields prints the PKGBUILD header now, too. makepkgbuild is called from the Makefile with the proper env var set. Pretty close to 100% working again.
Diffstat (limited to 'bin/templ')
-rwxr-xr-xbin/templ/pbfields6
-rwxr-xr-xbin/templ/perl-pkg19
2 files changed, 6 insertions, 19 deletions
diff --git a/bin/templ/pbfields b/bin/templ/pbfields
index 4bbfdfc..980dc7a 100755
--- a/bin/templ/pbfields
+++ b/bin/templ/pbfields
@@ -19,6 +19,8 @@ BEGIN {
NF < 2 { next }
+$1 ~ "packager" { packager = $2 }
+
$1 ~ /depends$|conflicts|provides|source/ { quotevals() }
$1 == "pkgdesc" {
@@ -33,6 +35,10 @@ arrfield[$1] {
}
END {
+ if (!packager) { packager = "Anonymous" }
+ print "# Maintainer: " packager
+ print ""
+
OFS = "="; ORS = "\n";
for (i=1; i<=max; i++) {
name = fields[i]
diff --git a/bin/templ/perl-pkg b/bin/templ/perl-pkg
index b008cbd..790a798 100755
--- a/bin/templ/perl-pkg
+++ b/bin/templ/perl-pkg
@@ -16,11 +16,6 @@ my %ACTIONS_OF = ('MM',
'package' => [ q{./Build install} ]
} );
-my $PBBEG = <<'END_BEG';
-# Maintainer : %s
-# Generator : pbjam %s
-END_BEG
-
my %FUNCFMTS;
$FUNCFMTS{'build'} = <<'END_FMT';
build() {
@@ -91,20 +86,6 @@ sub printpb
my $acts = $ACTIONS_OF{$btype}
or die "$0: unknown build type ($btype)\n";
- my $pkger = $pbvars->{'packager'}[0] || 'Anonymous';
- printf $PBBEG, $pkger, $pbvars->{'pbjver'}[0];
- print "\n";
-
- # 'pbfields' will recognize and PKGBUILD fields in the data
- # and print them out in order, wordwrapping arrays.
- open my $pbfields, '|pbfields' or die "failed to pipe to pbfields: $!";
- while (my ($name, $vals) = each %$pbvars) {
- print $pbfields $name, "\n";
- print $pbfields $_, "\n" for @$vals;
- print $pbfields "\n";
- }
- close $pbfields;
-
my $distdir = $pbvars->{'distdir'}[0];
print qq{_distdir="\${srcdir}/$distdir"\n};
print "\n";