You are not logged in.
Hello,
I'm writing my first PKGBUILD, for a cursor theme: http://www.gnome-look.org/content/show. … tent=88322
I'm basing the PKGBUILD off the ones for other xcursor themes in the AUR and community repo.
So far, I have:
#Maintainer: Devin Cofer <ranguvar[AT]archlinux{DOT}us>
pkgname=xcursor-dart3d
_pkgname=Dart3D_LHPPL
pkgver=1.0
pkgrel=1
pkgdesc="Dark, glassy X cursor theme"
arch=('i686' 'x86_64')
url="http://www.gnome-look.org/content/show.php?content=88322"
license=('GPL')
depends=()
source=("http://www.gnome-look.org/CONTENT/content-files/88322-${_pkgname}.tar.gz")
md5sums=('d65dbf7101ef6679f5d3fe91def5cd9f')
build() {
cd $startdir/src/$_pkgname
install -d -m755 $startdir/pkg/usr/share/icons/${_pkgname}/cursors/filesources
install -D -m644 $startdir/src/${_pkgname}/index.theme \
$startdir/pkg/usr/share/icons/${_pkgname}
cd $startdir/src/${_pkgname}/cursors
for i in * ; do
install -D -m644 $i $startdir/pkg/usr/share/icons/${_pkgname}/cursors
done
}
The build() block is unchanged from the PKGBUILD I copied it from.
I'm unsure what to put for the build() block. I can see they're using the install command, but I'm not sure why, or why they're choosing permissions...
Could someone please explain to me in detail what that block does and why? And/or if I should change it for my PKGBUILD, and why?
I did read the info about making packages on the wiki.
Thanks very much, I promise the knowledge will be put to good use helping users
Offline
'man install' will give you all the info. Basically, install command copy files and let you set the wanted permissions.
install -d -m755 $startdir/pkg/usr/share/icons/${_pkgname}/cursors/filesources
creat a directory with 755 perms.
install -D -m644 $startdir/src/${_pkgname}/index.theme \
$startdir/pkg/usr/share/icons/${_pkgname}
copy $startdir/src/${_pkgname}/index.theme to $startdir/pkg/usr/share/icons/${_pkgname}, set perm to 644 and create directory as needed.
Whether you need to change them in your build function depends on what files you want to copy and where.
Offline
Yeah, I see, but why are they setting permissions? Would not a simple copy suffice? And why such an odd method of copying, like the for loop?
Offline
Yeah, I see, but why are they setting permissions? Would not a simple copy suffice?
If the user has altered his file mode creation mask (umask), wrong permissions will be set on the copied file/folder. For example, if umask is set to 0077, nobody but the owner (usually root) will have access to those files. Therefore, specifying the target file's permissions is the safer (read "only") way to go.
And why such an odd method of copying, like the for loop?
I'd assume it's because `install' doesn't allow recursive copying.
Offline
OK... thanks...
Offline
I think you can remove the loop if you create first the target directory. so you would replace:
for i in * ; do
install -D -m644 $i $startdir/pkg/usr/share/icons/${_pkgname}/cursors
done
by:
install -d -m755 $startdir/pkg/usr/share/icons/${_pkgname}/cursors
install -m644 * $startdir/pkg/usr/share/icons/${_pkgname}/cursors/
In this specific exemple, the directory was created previously so you could replace the loop by:
install -m644 * $startdir/pkg/usr/share/icons/${_pkgname}/cursors/
I might be wrong. You should verify it.
Offline