You are not logged in.

#1 2014-06-27 13:44:47

starfry
Member
From: Surrey, UK
Registered: 2010-08-18
Posts: 238

Use an alternative PKGBUILD with mkaurball

Hello, I wanted to use a different PKGBUILD file with mkaurball, like you can with makepkg by giving it a "-p" argument. I tried a similar

$ mkaurball -p PKGBUILD.other

However it doesn't appear to be supported, so I patched it so that it works. Is this the right place to suggest a patch ?

Here it is:

--- /usr/bin/mkaurball	2014-05-28 06:04:25.000000000 +0100
+++ mkaurball	2014-06-27 14:30:42.000000000 +0100
@@ -191,14 +191,16 @@
       '    -a <file>  package <file> as .AURINFO' \
       '    -e         edit .AURINFO before repackaging' \
       '    -f         pass the --force flag to makepkg' \
+      '    -p <file>  use <file> as PKGBUILD' \
       '    -h         display this help message and exit'
 }
 
 mkaurball() {
   local tarball_basename= tarball_fullname= tmpdir=
 
-  if ! . ./PKGBUILD; then
-    die 'Unable to source %s/PKGBUILD' "$PWD"
+  pkgbuild=${pkgbuild:-PKGBUILD}
+  if ! . ./${pkgbuild}; then
+    die 'Unable to source %s/%s' "$PWD" "${pkgbuild}"
   fi
 
   if ! makepkg "${makepkg_args[@]}"; then
@@ -239,7 +241,7 @@
   fi
 }
 
-while getopts ':a:efh' flag; do
+while getopts ':a:efp:h' flag; do
   case $flag in
     a)
       srcinfo_path=$OPTARG
@@ -250,6 +252,10 @@
     f)
       makepkg_args+=('--force')
       ;;
+    p)
+      makepkg_args+=("-p$OPTARG")
+      pkgbuild=$OPTARG
+      ;;
     h)
       usage
       exit 0

If I should post this elsewhere, please let me know. Hopefully this patch can be considered to enhance the "mkaurball" tool ?

Offline

#2 2014-06-27 14:48:38

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: Use an alternative PKGBUILD with mkaurball

Why do you want this? The AUR is going to reject your tarball if it doesn't contain a file named PKGBUILD.

Last edited by falconindy (2014-06-27 14:48:53)

Offline

#3 2014-06-27 15:00:54

starfry
Member
From: Surrey, UK
Registered: 2010-08-18
Posts: 238

Re: Use an alternative PKGBUILD with mkaurball

The generated file is still called PKGBUILD, I've tested it and it works. I have just set you a pull request https://github.com/falconindy/pkgbuild- … on/pull/11.

I can explain what I am doing... I have a git repo for a package that I maintain that contains the stuff for the package plus extra supporting stuff for my use only (e.g. notes and so-on). In that repo are two PKGBUILD files : PKGBUILD (the normal one), which builds blah package and PKGBUILD.git, which builds a blah-git package.

With the patch, I can use "mkaurball" to build both "blah" and "blah-git" packages with both PKGBUILDS being in the same directory in my repo.

Does that make sense ?

(to avoid confusion and double posts, let's talk on GitHub...)

Last edited by starfry (2014-06-27 15:22:40)

Offline

Board footer

Powered by FluxBB