You are not logged in.
Been looking in on how to use 'install' in PKGBUILDS. I've looked at the PKGBUILD entries in the wiki and there isn't any mention on this (possibly I missed it??). I notice that these are in Makefiles and looked on the net but maybe my google-fu is lacking at the moment. I've got that:
install -d ${pkgdir}/opt
Will create an /opt directory in the pkg directory, and that:
install -m 755 ${srcdir}/${pkgname}-${pkgver}/file ${pkgdir}/opt/
Will install that file in the pkg dir. So I have a couple questions:
1) How do I install an entire directory into the pkg dir?
2) How do I create a link to /usr/bin?
2) What else is good to know if I have to manually install files/folders???
Here's the current PKGBUILD I'm working on:
# Contributor: Gen2ly <dirk.r.gently@gmail.com>
pkgname=liveusb-creator
pkgver=3.7
pkgrel=1
pkgdesc="Create LiveUSB's from a Linux install image"
arch=('any')
url="https://fedorahosted.org/liveusb-creator/"
license=('GPL2')
makedepends=()
depends=('isomd5sum' 'python' 'pyqt' 'p7zip' 'syslinux')
source=(https://fedorahosted.org/releases/l/i/liveusb-creator/$pkgname-$pkgver.tar.bz2)
build() {
# Just installing in /opt, would /usr/share/python-support be better?
install -d ${pkgdir}/opt
# Install files
install -m 755 ${srcdir}/${pkgname}-${pkgver} ${pkgdir}/opt
}
Any suggestions?
Last edited by Gen2ly (2009-08-21 09:35:35)
Setting Up a Scripting Environment | Proud donor to wikipedia - link
Offline
The build() function is bash, plain and simple. If you need to know how to use the commands, read the relevant man pages. For inspiration, look at any existing PKGBUILDs - official ones are in the Arch subversion repo, and plenty of unofficial (and possibly not quite as correct) ones in the AUR.
More specifically:
1. Use cp
2, Use ln
3. Uhmm... everything?
Offline
Didn't realize I asked such a complicated question.
I thought that install was a built in command of 'make' that's why I asked but I just found out it has a man page. It's pretty technical though so I'd wouldn't mind if a someone would help me with basic usage.
Yes, I considered using 'ln' but I've read before that PKGBUILDs should use install instead of cp or mv. Thinking now that this is not the case with 'ln'???
For installing an entire folder I looked at the install man page that says that -d "treat(s) all arguments as directory names" so would:
install -m 755 ${srcdir}/${pkgname}-${pkgver}/folder ${pkgdir}/opt/
Copy a folder and it's contents? Newbie question, I know, but first time using install, would appreciate any help.
Last edited by Gen2ly (2009-08-21 07:02:48)
Setting Up a Scripting Environment | Proud donor to wikipedia - link
Offline
it depends what folder contains. if it only contains regular files (non-executables):
install -d ${pkgdir}/opt/
install -m 644 ${srcdir}/${pkgname}-${pkgver}/folder/* ${pkgdir}/opt/
If it contains subdirectories:
install -d ${pkgdir}/opt/
cp -r ${srcdir}/${pkgname}-${pkgver}/folder/* ${pkgdir}/opt/
Offline
BTW, why don't you use the Makefile?
Offline
Seen a few warnings not to do cp before, and looked at a few odd-ish PKGBUILDS on AUR so this definitely helped. And now I'm done:
http://aur.archlinux.org/packages.php?ID=29495
I had to do a number of sub-package (parted-git, pyparted, isomd5sum) to get it all done. Phew! So I appreciate the nudge.
As for the Makefile, yeah... there is none. Doing a python program and so just a group of files installed is needed. Thank you.
Last edited by Gen2ly (2009-08-21 09:52:12)
Setting Up a Scripting Environment | Proud donor to wikipedia - link
Offline