You are not logged in.
Pages: 1
Hi,
I'm trying to create a package for the FreeImage library:
http://freeimage.sourceforge.net/download.html
Anyway, in the Makefile it's got the following:
install:
install -m 644 -o root -g root $(STATICLIB) $(INSTALLDIR)
install -m 755 -o root -g root $(SHAREDLIB) $(INSTALLDIR)
ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(LIBNAME)
ldconfig
makepkg chokes on the above -- here's the error message:
install -m 644 -o root -g root libfreeimage.a /usr/lib
install: cannot create regular file `/usr/lib/libfreeimage.a': Permission denied
Do I need to make a patch for the Makefile? Are there special flags I can pass in the PKGBUILD?
Offline
you may have to do ./configure --prefix=/usr or make DESTDIR=$startdir/pkg.
Please post your PKGBUILD and we take a look at it.
Offline
There's no configure file -- the readme's installation instructions specify "make" and "make install" -- that's all my PKGBUILD does:
pkgname=freeimage
pkgver=3.9.1
pkgrel=1
pkgdesc="FreeImage libray"
url="http://freeimage.sourceforge.net/"
depends=()
source=(http://optusnet.dl.sourceforge.net/sourceforge/freeimage/FreeImage391.zip)
md5sums=('8d737a1e2ce978cc7eeb9754290aa310')
build() {
cd $startdir/src/FreeImage
make || return 1
make prefix=$startdir/pkg/usr install
}
Actually I've decided not to create this package, as it merely provides image libs for the Ogre3d graphics library, however I already have those libs (png, mng, tiff, etc) installed so I'm using the --disable-freeimage flag for Ogre3d now
Still, it would be nice to know how to overcome the above problem of the Makefile explicitly specifying a user (root) to install -- this is what I believe is causing the trouble, or at least conflicting with fakeroot perhaps?
Offline
This isn't a very flexible Makefile. This is what I had to do:
build() {
cd $startdir/src/FreeImage
dest=$startdir/pkg/usr/lib
mkdir -p $dest
sed -e "s|INSTALLDIR = /usr/lib|INSTALLDIR = $dest|g" -i Makefile || return 1
sed -e "s|ldconfig||g" -i Makefile || return 1
make || return 1
make install
}
make INSTALLDIR= would not work, as you suggested I had to physically replace that line using sed. It also errored out from trying to use ldconfig which must be run as root so I removed that line as well. You could then do a .install file for it which would run the ldconfig command after the package was built and install via pacman.
Maybe the honorable Snowman has a better solution.
Offline
Yes the Makefile isn't very flexible at all. I was thinking about using sed or using a patch to change the Makefile, so my thoughts were on the right track -- or at least on the same track as someone else
Offline
yeah, a patch would be better than using sed with the makefile because its more reliable -missed that thought.
Offline
You don't need sed or patch:
build() {
cd $startdir/src/FreeImage
make || return 1
make INSTALLDIR=$startdir/pkg/usr install
}
I don't know if the above will work because of the symlink and ldconfig command. And you might need to create some directories.
Perhaps it would be easier to forget about the make install and just install the stuff manually with install commands. There doesn't seem to be much files to install anyway.
EDIT: I'll try it myself.
EDIT2:
pkgname=freeimage
pkgver=3.9.1
pkgrel=1
pkgdesc="FreeImage libray"
url="http://freeimage.sourceforge.net/"
license=("GPL" "custom:FIPL")
depends=('gcc')
source=(http://dl.sourceforge.net/sourceforge/freeimage/FreeImage391.zip http://freeimage.sourceforge.net/freeimage-license.txt)
md5sums=('8d737a1e2ce978cc7eeb9754290aa310' '8e1438cab62c8f655288588dc43daaf6')
build() {
cd $startdir/src/FreeImage
sed -i 's/ldconfig//' Makefile
make || return 1
install -d $startdir/pkg/usr/lib
make INSTALLDIR=$startdir/pkg/usr/lib install
install -D -m644 $startdir/src/freeimage-license.txt $startdir/pkg/usr/share/licenses/custom/$pkgname/freeimage-license.txt
}
Offline
now just how in the *sam-hell* did you get that to work with make INSTALLDIR=$startdir/pkg/usr/lib install ??? Must have been the ldconfig line.
Damn you is a good package monkey...
Offline
Yeah it was his deletion of ldconfig that did the trick -- that was the only thing that choked using the simple INSTALLDIR variation. So yeah you need sed, but only for one word, and INSTALLDIR saves the day! Thanks Snowman/Penguin
Offline
Thanks for the PKGBUILD, but i fails too install the header file.
Adding one line at the bottom fixes it:
pkgname=freeimage
pkgver=3.9.1
pkgrel=1
pkgdesc="FreeImage libray"
url="http://freeimage.sourceforge.net/"
license=("GPL" "custom:FIPL")
depends=('gcc')
source=(http://switch.dl.sourceforge.net/sourceforge/freeimage/FreeImage391.zip http://freeimage.sourceforge.net/freeimage-license.txt)
md5sums=('8d737a1e2ce978cc7eeb9754290aa310' '8e1438cab62c8f655288588dc43daaf6')
build() {
cd $startdir/src/FreeImage
sed -i 's/ldconfig//' Makefile
make || return 1
install -d $startdir/pkg/usr/lib
make INSTALLDIR=$startdir/pkg/usr/lib install
install -D -m644 $startdir/src/freeimage-license.txt $startdir/pkg/usr/share/licenses/custom/$pkgname/freeimage-license.txt
install -D -m644 $startdir/src/FreeImage/Dist/FreeImage.h $startdir/pkg/usr/include/FreeImage.h
}
Offline
Pages: 1