You are not logged in.

#1 2010-12-05 22:14:51

tripox
Member
From: Denmark
Registered: 2009-07-15
Posts: 44
Website

Unable to build package

For some reason I can't build my package.

cp: cannot create regular file `/home/tripox/aur/pkg/usr/bin/': No such file or directory

If I create the directories myself, they are gone when I run makepkg again.

However, it does compile the program.

I'm new to this but followed the article on the wiki.

Here's my PKGBUILD:

# Maintainer: Mathias R. Larsen <tripox@tripox.dk>

pkgname=xbattbar-acpi
pkgver=0.3.2
pkgrel=1
pkgdesc="A simple battery indicator bar"
arch=('any')
url="http://sharesource.org/project/xbattbar/"
license=('GPL2')
groups=()
depends=('libacpi')
makedepends=()
optdepends=()
conflicts=()
replaces=()
source=(http://dl.sharesource.org/xbattbar/$pkgname-$pkgver.tar.gz)
md5sums=('996a0e41a7256c575fb9be1caae21f9a')

build() {
  cd "$srcdir/xbattbar"
  make
}

package() {
  cd "$srcdir/xbattbar"
  make DESTDIR="$pkgdir" install
}

Any ideas?

Last edited by tripox (2010-12-05 22:56:30)

Offline

#2 2010-12-05 22:41:46

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

Re: Unable to build package

It'd be good to post the PKGBUILD you're working from.

Offline

#3 2010-12-05 22:55:19

tripox
Member
From: Denmark
Registered: 2009-07-15
Posts: 44
Website

Re: Unable to build package

falconindy wrote:

It'd be good to post the PKGBUILD you're working from.

I've posted it now. smile

Offline

#4 2010-12-05 23:11:47

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,600
Website

Re: Unable to build package

Looks like you got a bad url...

==> Retrieving Sources...
  -> Downloading xbattbar-acpi-0.3.2.tar.gz...
--2010-12-05 18:11:14--  http://dl.sharesource.org/xbattbar/xbattbar-acpi-0.3.2.tar.gz
Resolving dl.sharesource.org... failed: Name or service not known.
wget: unable to resolve host address "dl.sharesource.org"
==> ERROR: Failure while downloading xbattbar-acpi-0.3.2.tar.gz
    Aborting...

CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#5 2010-12-05 23:19:45

tripox
Member
From: Denmark
Registered: 2009-07-15
Posts: 44
Website

Re: Unable to build package

graysky wrote:

Looks like you got a bad url...

==> Retrieving Sources...
  -> Downloading xbattbar-acpi-0.3.2.tar.gz...
--2010-12-05 18:11:14--  http://dl.sharesource.org/xbattbar/xbattbar-acpi-0.3.2.tar.gz
Resolving dl.sharesource.org... failed: Name or service not known.
wget: unable to resolve host address "dl.sharesource.org"
==> ERROR: Failure while downloading xbattbar-acpi-0.3.2.tar.gz
    Aborting...

Works fine here.

==> Retrieving Sources...
  -> Downloading xbattbar-acpi-0.3.2.tar.gz...
--2010-12-06 00:18:18--  http://dl.sharesource.org/xbattbar/xbattbar-acpi-0.3.2.tar.gz
Resolving dl.sharesource.org... 128.177.28.254
Connecting to dl.sharesource.org|128.177.28.254|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12458 (12K) [application/x-gzip]
Saving to: "xbattbar-acpi-0.3.2.tar.gz.part"

Offline

#6 2010-12-05 23:29:21

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

Re: Unable to build package

Your Makefile assumes that $pkgdir/usr/bin exists -- a poor assumption. You should be using install(1):

install:
  install -Dm755 xbattbar-acpi ${DESTDIR}/usr/bin/xbattbar
  install -Dm644 xbattbar-acpi.1.gz ${DESTDIR}/usr/share/man/man1/xbattbar-acpi.1.gz

Offline

#7 2010-12-05 23:42:24

tripox
Member
From: Denmark
Registered: 2009-07-15
Posts: 44
Website

Re: Unable to build package

falconindy wrote:

Your Makefile assumes that $pkgdir/usr/bin exists -- a poor assumption. You should be using install(1):

install:
  install -Dm755 xbattbar-acpi ${DESTDIR}/usr/bin/xbattbar
  install -Dm644 xbattbar-acpi.1.gz ${DESTDIR}/usr/share/man/man1/xbattbar-acpi.1.gz

Thank you very much!
It worked! But I needed to run it as root.

Offline

#8 2010-12-05 23:53:34

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

Re: Unable to build package

That implies that DESTDIR was never set and you installed the files directly to /usr/bin, without the $pkgdir prefix. Not sure where you went wrong... the Makefile below worked for me, as expected:

CC = gcc
CFLAGS = -O2 -D_BSD_SOURCE -D_XOPEN_SOURCE -D_SVID_SOURCE
LDFLAGS = -lXext -lacpi

all:
    $(CC) $(CFLAGS) -c -o xbattbar-acpi.o xbattbar-acpi.c
    $(CC) $(LDFLAGS) -o xbattbar-acpi xbattbar-acpi.o

clean:
    rm -rf xbattbar-acpi
    rm -rf xbattbar-acpi.o

install:
    install -Dm755 xbattbar-acpi $(DESTDIR)/usr/bin/xbattbar-acpi
    install -Dm644 xbattbar-acpi.1 $(DESTDIR)/usr/share/man/man1/xbattbar-acpi.1

uninstall:
    rm -rf $(DESTDIR)/usr/bin/xbattbar-acpi
    rm -rf $(DESTDIR)/usr/share/man/man1/xbattbar-acpi.1.gz

Just a heads up: if you're interested in making this more portable, there's a few other things you'll want to take care of in this Makefile.

Offline

#9 2010-12-06 01:34:42

tripox
Member
From: Denmark
Registered: 2009-07-15
Posts: 44
Website

Re: Unable to build package

Wow, that was a bit difficult.
The Wiki just confused me.

Thanks, falconindy.

Check it out now.
I think I finally made it. smile

Offline

Board footer

Powered by FluxBB