You are not logged in.
Pages: 1
I wrote a little program that I want to add to the AUR.
After I completed the sources, I created a makefile, that works. ($make and #make install needed).
I then made a tarball of the sources.
Here are the build and install functions of the PKGBUILD I use for this project:
build() {
cd "$srcdir/"
make
}
package() {
cd "$srcdir/"
make DESTDIR="$pkgdir/" install
}However, when I run makepkg, makepkg occurs an error within the fakeroot environment.
The makefile tries to install directly to the root in stead of to the fakeroot, like this:
install -m 755 hiberbat /usr/bin
install: cannot create regular file `/usr/bin/hiberbat': Permission denied
make: *** [install] Error 1
[1m Aborting...(B[m
I already tried putting install -m 755 hiberbat ./usr/bin in the makefile.
What am I doing wrong?
Tim
Offline
A link to the source code would help. While we're waiting for that, check that your Makefile is using the DESTDIR variable correctly - from your description, it seems to be ignoring it.
Offline
I hadn't uploaded it yet, but here it is: http://easy-upload.nl/f/FaBuQ6WL
My makefile is just a basic one, it's in the tar.gz.
How should I make it use DESTDIR?
Tim
Offline
Your install target needs to explicitly use DESTDIR:
install:
install -Dm755 hiberbat ${DESTDIR}/usr/bin/hiberbat
install -Dm644 hiberbat.conf ${DESTDIR}/etc/hiberbat.conf
install -Dm744 ./rc.d/hiberbat ${DESTDIR}/etc/rc.d/hiberbat
@echo "=> Hiberbat has been installed."
@echo "=> Add 'hiberbat' to your deamons array in rc.conf to use it."I'd also recommend that you package your source files in a subdirectory inside the tarball ($pkgname-$pkgver/).
Offline
Hi, thank you very much for your reply.
so I should have a "src" dir inside the tarball? Anything in the root of it?
Offline
No, you should have a directory with a unique name, according to the $pkgname and $pkgver. For example...
tig-0.16.2/
tig-0.16.2/.gitignore
tig-0.16.2/BUGS
tig-0.16.2/COPYING
tig-0.16.2/INSTALL
...or...
wget-1.12/
wget-1.12/INSTALL
wget-1.12/configure.bat
wget-1.12/GNUmakefile
wget-1.12/ChangeLog
wget-1.12/doc/
...Do not put files in the root of the tarball.
Offline
Thank you for your help. My package compiles and installs with makepkg now.
Offline
Pages: 1