You are not logged in.
Hi Forum,
I have made my first PKGBUILD, it is a hack of the PKGBUILD of BRLCAD, which I have used to pack Ofeli, http://www.ofeli.net/, to /usr{bin lib share doc} as required by Archer Philosophy.
Here it is :
# Maintainer: Loui Chang <louipc dot ist at gmail company>
pkgname=ofeli
pkgver=2.0.2
pkgrel=1
pkgdesc="Finite elements analysis Package"
url="http://brlcad.org"
license=('LGPL' 'BSD' 'custom:BDL')
#install=brlcad.install
arch=('i686' 'x86_64')
#makedepends=('bc' 'libxslt')
#depends=('boost' 'flex' 'libpng' 'zlib' 'libgl' 'tk>=8.5')
#options=('!libtool')
source=(ofeli-2.0.2.tar.gz)
build() {
cd $srcdir/$pkgname-$pkgver
./configure --prefix=/usr
# --with-opengl=/usr/lib \
# --with-tcl=/usr/lib \
# --disable-step \
# --disable-tkhtml3 \
# --disable-tkimg \
# --disable-opennurbs
# For opennurbs, etc
# gcc -I/opt/brlcad/include -L/opt/brlcad/lib
make || return 1
}
package() {
cd $srcdir/$pkgname-$pkgver
make DESTDIR=$pkgdir install || return 1
# install -D -m755 $srcdir/brlcad.sh $pkgdir/etc/profile.d/brlcad.sh
# mkdir -p $pkgdir/usr/share/licenses/$pkgname
# cp $srcdir/$pkgname-$pkgver/doc/legal/bdl.txt \
# $pkgdir/usr/share/licenses/$pkgname
# cp $srcdir/$pkgname-$pkgver/doc/legal/bsd.txt \
# $pkgdir/usr/share/licenses/$pkgname
}
#md5sums=('8ccbc692d84854c9b0599b6d1255f916'
# '4922e66ff0835169374b9c0569c2f569')As you all can see, I hacked parts of this script so as to run a simple ./configure make make install in $PKG/usr fakeroor, and pack it into an Arch package.
I have lots of questions, one at a time... ![]()
1.) How do I know that something wont be over written as soon as I run pacman -U my-pkg.tar.xz ?
2.) Since Directory structure of Ofeli respects Linux file structure, I decided to drop it in /usr... If it did not, I would probably ship it to /opt, but why /usr instead of /usr/local....?
3.) I tried to make a similar hack with mbdyn, http://www.aero.polimi.it/mbdyn/, but I failed. Standard autoconf install of mbdyn complies with ./configure make make install scheme, and it creates /usr/local/{bin lib libexec share }
When I ran this PKGBUILD
# Maintainer: Loui Chang <louipc dot ist at gmail company>
pkgname=mbdyn
pkgver=1.3.15
pkgrel=1
pkgdesc="A MultiBody Dynamics analysis package"
url="http://brlcad.org"
license=('LGPL' 'BSD' 'custom:BDL')
#install=brlcad.install
arch=('i686' 'x86_64')
#makedepends=('bc' 'libxslt')
#depends=('boost' 'flex' 'libpng' 'zlib' 'libgl' 'tk>=8.5')#options=('!libtool')
source=(mbdyn-1.3.15.tar.gz)
build() {
cd $srcdir/$pkgname-$pkgver./configure --prefix=/usr
# --with-opengl=/usr/lib \
# --with-tcl=/usr/lib \
# --disable-step \
# --disable-tkhtml3 \
# --disable-tkimg \
# --disable-opennurbs# For opennurbs, etc
# gcc -I/opt/brlcad/include -L/opt/brlcad/libmake || return 1
}package() {
cd $srcdir/$pkgname-$pkgvermake DESTDIR=$pkgdir install || return 1
# install -D -m755 $srcdir/brlcad.sh $pkgdir/etc/profile.d/brlcad.sh
# mkdir -p $pkgdir/usr/share/licenses/$pkgname
# cp $srcdir/$pkgname-$pkgver/doc/legal/bdl.txt \
# $pkgdir/usr/share/licenses/$pkgname
# cp $srcdir/$pkgname-$pkgver/doc/legal/bsd.txt \
# $pkgdir/usr/share/licenses/$pkgname
}#md5sums=('8ccbc692d84854c9b0599b6d1255f916'
# '4922e66ff0835169374b9c0569c2f569')
( Similar hack of BRLCAD PKGBUILD ) it failed when trying to create libexec... how can I change this....?
4.) suppose I want to untar a package.zip in /opt/package, and make a script in /usr/bin/ called "package" containing 'cd /opt/package&&./initscript.sh' properly chmoded as executable, How do I build a PKGBUILD to build a package which once installed will perform this...?
Most of these questions can seem n00bish, but i am not a great Archer yet... just a little Archer trying to learn something.... ![]()
Offline
1) pacman will yell at you if there are file conflicts. Generally, if you're packaging something that already exists, you should tack on a suffix (e.g. -git or -nox) to describe the difference. The "official" package then makes it into the conflicts array of your modified package.
2) /usr/local is generally reserved for things that won't fall under the domain of the package manager. See the FHS for more details.
3) libexec is avoided in Arch because it does not adhere to the FHS (see above link). The files that go to /usr/libexec should probably end up in /usr/lib instead. Look at the help provided by the config script (./configure --help).
4) You don't need an install scriptlet to chmod files. Set the permission bits in the package() function after they're moved into place.
Offline