[aur-general] Request for assistance with a PKGBUILD
Hello fellow AUR maintainers, I've come to ask for some of your wisdom on a particular subject because, quite frankly, I'm completely unsure of how to move forward. I'm attempting to put together a PKGBUILD for a library (tsdl) but running in to trouble with the installation part. I can run make no problem, everything proceeds as expected, however I receive a permission error when running make install. The output is shown below at the point which it fails. http://pastebin.com/0xVvf1kN Obviously this is going to fail unless makepkg -s is run as root, which is highlighted as not being a good idea, so I'm basically looking at how I could get around this, if at all. I'll admit that I'm still getting to grips with this, having only put together two PKGBUILDs from scratch before now, so I would appreciate any pointers that could guide me in the right direction. Below are links to the PKGBUILD I'm working on, as well as the Makefile for the library I want to build respectively. I can see that there are a bunch of operations going on in there which will result in more permission denied errors, but if I'm thinking along the right lines, then these could be installed using install -D -mXXX but again, I'm quite inexperienced so I don't know if that is entirely true. http://pastebin.com/xzVRt79d http://pastebin.com/sTN1j80f Please also feel free to criticise the PKGBUILD in general; I've been following what I've seen by other maintainers so far and trying to stick to the guidelines laid out in the Wiki pages, so hopefully it's all fine but if I have missed anything or done something stupid, I'd like to know. Thanks in advance for any help. Kind regards, Joel.
Make install will try to imstall to system sbd not into a packagefile. Make DESTDIR=$pkgdir install will instead tell make to install imto pkg dir instesd so we can make a tarball wit the lib in it, woch we can install
On 11 May 2011 22:38, jesse jaara <jesse.jaara@gmail.com> wrote:
Make install will try to imstall to system sbd not into a packagefile. Make DESTDIR=$pkgdir install will instead tell make to install imto pkg dir instesd so we can make a tarball wit the lib in it, woch we can install
Hi Jesse, thank you for the prompt response. I should have mentioned, I have tried what you have suggested and get the same issue; I believe this is because certain directories are specified in Makefile.inc as follows: PREFIX=/usr LIB_DIR=${PREFIX}/lib INC_DIR=${PREFIX}/include SHARE_DIR=${PREFIX}/share BIN_DIR=${PREFIX}/bin I could be wrong, but that seems to be the case, because when the following line is run, it still attempts to use those directories rather than creating them within the package directory: ${CC} -DLIB_DIR=\"${LIB_DIR}\" -DINC_DIR=\"${INC_DIR}\" -o ${BIN_DIR}/tsdl-config ${SRC_DIR}tools/getlibs.c Again, though, I could be wrong about that, having never made nor researched Makefiles in any detail. Regards, Joel.
On Thu, May 12, 2011 at 12:38:59AM +0300, jesse jaara wrote:
Make install will try to imstall to system sbd not into a packagefile. Make DESTDIR=$pkgdir install will instead tell make to install imto pkg dir instesd so we can make a tarball wit the lib in it, woch we can install
DESTDIR is only useful if the Makefile honors it, which this one does not. Upstream here has also decided to put a _compile_ rule in an _install_ target which is simply insane. Honestly, the easiest route here is to munge the Makefile and/or provide your own. You should also complain to upstream that their Makefile is _not_ package friendly. regards, dave
Oh and also as pkgver you could and should use 0.1.rc3
Le 11/05/2011 23:30, Joel Heaton a écrit :
Hello fellow AUR maintainers, I've come to ask for some of your wisdom on a particular subject because, quite frankly, I'm completely unsure of how to move forward. I'm attempting to put together a PKGBUILD for a library (tsdl) but running in to trouble with the installation part. I can run make no problem, everything proceeds as expected, however I receive a permission error when running make install. The output is shown below at the point which it fails.
Obviously this is going to fail unless makepkg -s is run as root, which is highlighted as not being a good idea, so I'm basically looking at how I could get around this, if at all. I'll admit that I'm still getting to grips with this, having only put together two PKGBUILDs from scratch before now, so I would appreciate any pointers that could guide me in the right direction. Below are links to the PKGBUILD I'm working on, as well as the Makefile for the library I want to build respectively. I can see that there are a bunch of operations going on in there which will result in more permission denied errors, but if I'm thinking along the right lines, then these could be installed using install -D -mXXX but again, I'm quite inexperienced so I don't know if that is entirely true.
http://pastebin.com/xzVRt79d http://pastebin.com/sTN1j80f
Please also feel free to criticise the PKGBUILD in general; I've been following what I've seen by other maintainers so far and trying to stick to the guidelines laid out in the Wiki pages, so hopefully it's all fine but if I have missed anything or done something stupid, I'd like to know.
Thanks in advance for any help.
Kind regards,
Joel.
It looks like the Makefile wasn't intended for packaging. But it's still possible to do things properly without changing it: package() { cd "$srcdir/$pkgname" mkdir -p "$pkgdir/usr/lib" make PREFIX="$pkgdir/usr" BIN_DIR="$srcdir" install } Yet this is quite tricky, so I recommend to the author some changes to his Makefile. -- Calimero
On 11 May 2011 22:51, Dave Reisner <d@falconindy.com> wrote:
On Thu, May 12, 2011 at 12:38:59AM +0300, jesse jaara wrote:
Make install will try to imstall to system sbd not into a packagefile. Make DESTDIR=$pkgdir install will instead tell make to install imto pkg dir instesd so we can make a tarball wit the lib in it, woch we can install
DESTDIR is only useful if the Makefile honors it, which this one does not. Upstream here has also decided to put a _compile_ rule in an _install_ target which is simply insane.
Honestly, the easiest route here is to munge the Makefile and/or provide your own. You should also complain to upstream that their Makefile is _not_ package friendly.
regards, dave
Thanks for that, Dave. I will ask about that at the next opportunity. Glad to know I was at least looking in the right direction, even if I don't really understand the matter entirely. Definitely feel I've learned something there, though. :-) On 11 May 2011 22:58, Calimero <calimeroteknik@free.fr> wrote:
It looks like the Makefile wasn't intended for packaging. But it's still possible to do things properly without changing it:
package() { cd "$srcdir/$pkgname" mkdir -p "$pkgdir/usr/lib" make PREFIX="$pkgdir/usr" BIN_DIR="$srcdir" install }
Yet this is quite tricky, so I recommend to the author some changes to his Makefile.
-- Calimero
Thank you Calimero. That may be the way I have to go for the moment, at least to get the PKGBUILD working and I will raise the issue regarding the Makefile to see if an adjustment might be made. Thank you all for the responses regarding this matter, I really appreciate it. Hopefully it will help me understand issues like this better in the future. Kind regards, Joel.
participants (4)
-
Calimero
-
Dave Reisner
-
jesse jaara
-
Joel Heaton