diff options
-rwxr-xr-x | bin/makepkgbuild | 36 | ||||
-rwxr-xr-x | bin/makepkgmeta | 4 | ||||
-rwxr-xr-x | bin/tweakmeta | 7 | ||||
-rw-r--r-- | tweaks/perl-anyevent | 6 | ||||
-rw-r--r-- | tweaks/perl-extutils-makemaker | 6 |
5 files changed, 45 insertions, 14 deletions
diff --git a/bin/makepkgbuild b/bin/makepkgbuild index 4655e89..f2469bf 100755 --- a/bin/makepkgbuild +++ b/bin/makepkgbuild @@ -5,18 +5,37 @@ prog=makepkgbuild appendpb() { txt=$(awk -v f=$1 'BEGIN { FS = "\n"; RS = "" } - $1 == f "()" { for (i = 2; i <= NF; i++) print $i }' PKGMETA \ - | sed 's/^/ /') + $1 ~ "^" f "[(][)]<?$" { for (i = 2; i <= NF; i++) print $i }' \ + PKGMETA | sed 's/^/ /') case "$txt" in '') return 0 ;; - *) echo '/^ *'"${func}"'()[ \\n]*{ + *) echo "/^ *${func}()[ \\n]*{ /^} i -'"$txt"' +$txt . wq -' | ed PKGBUILD >/dev/null 2>&1 +" | ed PKGBUILD >/dev/null 2>&1 + return $? ;; + esac +} + +prependpb() +{ + txt=$(awk -v f=$1 'BEGIN { FS = "\n"; RS = "" } + $1 == ">" f "()" { for (i = 2; i <= NF; i++) print $i }' \ + PKGMETA | sed 's/^/ /') + + case "$txt" in + '') return 0 ;; + *) echo "/^ *${func}()[ \\n]*{ +/^[ \t]*cd/ +a +$txt +. +wq +" | ed PKGBUILD >/dev/null 2>&1 return $? ;; esac } @@ -55,7 +74,12 @@ for func in package check build do if ! appendpb $func then - echo "$prog: failed to append to the ${func}() function in PKGBUILD" 1>&2 + echo "$prog: error when trying to append to ${func}()" 1>&2 + exit 2 + fi + if ! prependpb $func + then + echo "$prog: error when trying to prepend to ${func}()" 1>&2 exit 2 fi done diff --git a/bin/makepkgmeta b/bin/makepkgmeta index 8ae661c..cce6dbe 100755 --- a/bin/makepkgmeta +++ b/bin/makepkgmeta @@ -10,7 +10,9 @@ case "$METABIN" in exit 2 esac -printf "pkgname\n%s\n\npkgrel\n%d\n\n" $1 1 +printf "pkgname\n%s\n\n" "$1" +printf "pkgrel\n%d\n\n" "${PKGREL:-1}" +printf "packager\n%s\n\n" "${PACKAGER:-Anonymous}" for flav in "$METABIN"/* do diff --git a/bin/tweakmeta b/bin/tweakmeta index 32fda08..d38f316 100755 --- a/bin/tweakmeta +++ b/bin/tweakmeta @@ -66,12 +66,6 @@ END { for (i=1; i<=len; i++) print pbvars[name, i] print "" } - - if (!seenpkgr) { - pkger = ENVIRON["PACKAGER"] - if (pkger == "") pkger = "Anonymous" - print "packager", pkger, "" - } } function die (msg) @@ -94,7 +88,6 @@ function remall (field) function pushval (field, val) { - if (field == "packager") seenpkgr = 1 pbvars[field, ++pbcount[field]] = val } diff --git a/tweaks/perl-anyevent b/tweaks/perl-anyevent new file mode 100644 index 0000000..8eea46d --- /dev/null +++ b/tweaks/perl-anyevent @@ -0,0 +1,6 @@ +! perl-cpan AnyEvent ++ optdepends perl-async-interrupt: Faster signal handling for some event loops. ++ depends perl-ev>=4.00 ++ depends perl-guard>=1.02 ++ depends perl-json-xs>=2.2 ++ depends perl-net-ssleay>=1.33 diff --git a/tweaks/perl-extutils-makemaker b/tweaks/perl-extutils-makemaker new file mode 100644 index 0000000..66c1af8 --- /dev/null +++ b/tweaks/perl-extutils-makemaker @@ -0,0 +1,6 @@ ++ depends perl-cpan-meta>=2.112150 ++ depends perl-extutils-install>=1.52 ++ depends perl-extutils-command>=1.16 ++ depends perl-extutils-manifest>=1.58 ++ >build() sed -e '/my::bundles/d' Makefile.PL >Makefile.PL.new ++ >build() mv Makefile.PL.new Makefile.PL |