You are not logged in.

#1 2011-03-10 10:37:28

x5x_tim
Member
Registered: 2010-06-13
Posts: 86

Makepkg fakeroot failing

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

#2 2011-03-10 12:02:29

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Makepkg fakeroot failing

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

#3 2011-03-10 13:03:29

x5x_tim
Member
Registered: 2010-06-13
Posts: 86

Re: Makepkg fakeroot failing

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

#4 2011-03-10 13:55:28

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: Makepkg fakeroot failing

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

#5 2011-03-10 14:13:55

x5x_tim
Member
Registered: 2010-06-13
Posts: 86

Re: Makepkg fakeroot failing

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

#6 2011-03-10 14:41:12

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: Makepkg fakeroot failing

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

#7 2011-03-10 20:05:28

x5x_tim
Member
Registered: 2010-06-13
Posts: 86

Re: Makepkg fakeroot failing

Thank you for your help. My package compiles and installs with makepkg now.

Offline

Board footer

Powered by FluxBB