You are not logged in.

#1 2014-02-24 14:00:21

rebootl
Member
Registered: 2012-01-10
Posts: 427
Website

[SOLVED] git PKGBUILD (sinit) almost there, package() fails

So, I'm trying to make my first PKGBUILD for sinit.

Here's what I have so far:

# Maintainer: Cem Aydin (rebootl) <cem.aydin gmx.ch>
_gitname=sinit
pkgname=${_gitname}-git
pkgver=0.7.r1.g3a953ea
pkgrel=1
pkgdesc="sinit - suckless init (patched for a custom minirc)"
arch=('i686' 'x86_64')
url="http://git.2f30.org/sinit/"
license=('MIT')
depends=('')
makedepends=('git')
conflicts=('')
provides=('sinit')
source=('git://git.2f30.org/sinit'
  'call-minirc-sinit.patch')
md5sums=('SKIP'
  'ad798476614abd1e78f372e60fcc779e')

pkgver() {
  cd "${_gitname}"
  # Using most recent unannotated tag, removing prefix v
  git describe --long --tags | sed -r 's/^v//;s/([^-]*-g)/r\1/;s/-/./g'
}

prepare() {
  cd "${_gitname}"
  patch -uN config.def.h ../call-minirc-sinit.patch || return 1
}

build() {
  cd "${_gitname}"
  make
}

package() {
  cd "${_gitname}"
  make PREFIX=/usr DESTDIR="${pkgdir}" install
}

It works up to package() where it fails:

makepkg
==> Making package: sinit-git 0.7.r1.g3a953ea-1 (Mon Feb 24 14:53:12 CET 2014)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Updating sinit git repo...
Fetching origin
  -> Found call-minirc-sinit.patch
==> Validating source files with md5sums...
    sinit ... Skipped
    call-minirc-sinit.patch ... Passed
==> Extracting sources...
  -> Creating working copy of sinit git repo...
Cloning into 'sinit'...
done.
==> Starting pkgver()...
==> Starting prepare()...
patching file config.def.h
==> Removing existing pkg/ directory...
==> Starting build()...
sinit build options:
CFLAGS   = -Wextra -Werror -Wall -Os 
LDFLAGS  = -static
CC       = cc
creating config.h from config.def.h
CC util/eprintf.c
AR util.a
make bin
make[1]: Entering directory '/home/cem/Setups_hplaptop/sinit-git/src/sinit'
CC sinit.c
LD sinit
make[1]: Leaving directory '/home/cem/Setups_hplaptop/sinit-git/src/sinit'
==> Entering fakeroot environment...
==> Starting package()...
sinit build options:
CFLAGS   = -Wextra -Werror -Wall -Os 
LDFLAGS  = -static
CC       = cc
make bin
make[1]: Entering directory '/home/cem/Setups_hplaptop/sinit-git/src/sinit'
make[1]: Nothing to be done for 'bin'.
make[1]: Leaving directory '/home/cem/Setups_hplaptop/sinit-git/src/sinit'
installing executable to /home/cem/Setups_hplaptop/sinit-git/pkg/sinit-git/usr/bin
cp: cannot create regular file ‘/home/cem/Setups_hplaptop/sinit-git/pkg/sinit-git/usr/bin’: No such file or directory
Makefile:47: recipe for target 'install' failed
make: *** [install] Error 1
==> ERROR: A failure occurred in package().
    Aborting...

I can see that it's missing the directory usr/bin under pkg/sinit-git/.. but I don't understand why.

I also tried to replace all the cd "${_gitname}" by cd "$srcdir/$_gitname" but I get the same error...

I can't see the difference to e.g. following reference:
https://aur.archlinux.org/packages/al/a … t/PKGBUILD

Last edited by rebootl (2014-02-24 19:01:39)


Personal website: cem.revamp-it.ch
GitHub: github.com/rebootl

Offline

#2 2014-02-24 16:52:32

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 4,786

Re: [SOLVED] git PKGBUILD (sinit) almost there, package() fails

It's a problem with their makefiles, not with your PKGBUILD. To get around it, try adding `install -dm755 "$pkgdir/usr/bin"` to the package function before the make install.

Offline

#3 2014-02-24 16:55:39

WorMzy
Forum Moderator
From: England
Registered: 2010-06-16
Posts: 5,022

Re: [SOLVED] git PKGBUILD (sinit) almost there, package() fails

Also, report it upstream so they can fix it. They shouldn't assume that $DESTDIR/usr/bin exists, they should try to create it anyway.


Sakura:-
Mobo: ASUS P8Z77-V PRO // Processor: Intel Core i7-3770K 3.4GHz // GFX: nVidia GeForce GTX 970 Ti // RAM: 32GB (4x 8GB) Corsair DDR3 (@ 2133MHz) // Storage: 1x 3TB Seagate SATAII 5x 1TB Samsung SATAII, 2x 120GB Corsair SSD

Offline

#4 2014-02-24 19:01:00

rebootl
Member
Registered: 2012-01-10
Posts: 427
Website

Re: [SOLVED] git PKGBUILD (sinit) almost there, package() fails

Hey, thanks a lot for your replies. Ah, that explains it, didn't look at the Makefile, don't know how this works honestly...

@Scimmia: Your workaround works!
@WorMzy: I'll do so.

Regards


Personal website: cem.revamp-it.ch
GitHub: github.com/rebootl

Offline

#5 2014-02-27 15:33:40

dimigon
Member
Registered: 2009-03-07
Posts: 139
Website

Re: [SOLVED] git PKGBUILD (sinit) almost there, package() fails

I fixed this upstream smile

Offline

#6 2014-02-27 15:36:22

dimigon
Member
Registered: 2009-03-07
Posts: 139
Website

Re: [SOLVED] git PKGBUILD (sinit) almost there, package() fails

@rebootl

Did you get anywhere with this?  Might sharing your pkg files?

Offline

Board footer

Powered by FluxBB