You are not logged in.

#1 2013-05-27 23:18:33

pivotraze
Member
From: Missoula, MT
Registered: 2011-08-21
Posts: 113

[SOLVED] PKGBUILD doesn't work as expected?

When I use makepkg --source, it makes a file named:

wifiz--1.src.tar.gz

However, when I run the same command I use for pkgver, it returns this:

0.9.2.2.r1.g8147a9f

Here is my PKGBUILD:

# Maintainer: Cody Dostal <dostalcody@gmail.com>

pkgname=wifiz
_gitname=WiFiz
pkgver=
pkgrel=1
pkgdesc="NetCTL GUI Frontend, written in wxPython. Stable Version."
arch=('any')
url="https://github.com/codywd/WiFiz"
license=('MIT')
depends=('python2' 'wxpython' 'wireless_tools' 'netctl'
'wpa_supplicant')
makedepends=('git')
optdepends=('gedit: Manually editing profiles.')
conflicts=('wifiz-nightly')
provides=('wifiz')
source=('git://github.com/codywd/WiFiz.git')
# Because the sources are not static, skip Git checksum:
md5sums=('SKIP')

pkgver() {
  cd "$_gitname"
  echo $(git describe --always --long | sed -E 's/([^-]*-g)/r\1/;s/-/./g')
}

package() {
  cd $srcdir/$_gitname
  pwd
  python2 setup.py install --root="$pkgdir/" --optimize=1
}

Why isn't it returning the expected package name

wifiz-0.9.2.2.r1.g8147a9f-1.src.tar.gz

?

Last edited by pivotraze (2013-05-28 00:36:14)

Offline

#2 2013-05-27 23:59:50

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,222
Website

Re: [SOLVED] PKGBUILD doesn't work as expected?

I think that's expected;  have a look here: https://wiki.archlinux.org/index.php/VC … 9_function

The sample PKGBUILD at the bottom of that page uses 0.0.0 as the version which makes sense since in a PKGBUILD that builds from a revision control system, the PKGBUILD itself doesn't refer to a specific version (that's the point of building from a git/svn/etc source)

EDIT: using your PKGBUILD and setting pkgver to 0.0.0 produces the expected output on my machine:

$ ls wifiz-*
wifiz-0.9.2.2.r1.g8147a9f-1-any.pkg.tar.xz  wifiz-0.9.2.2.r1.g8147a9f-1.src.tar.gz

Last edited by fukawi2 (2013-05-28 00:01:16)

Offline

#3 2013-05-28 00:03:41

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: [SOLVED] PKGBUILD doesn't work as expected?

VCS PKGBUILDs need to include the VCS type at the end of the pkgname. In this case your package should be named "wifiz-git".

Here's an updated version of your PKGBUILD:

# Maintainer: Cody Dostal <dostalcody@gmail.com>

pkgname=wifiz-git
_gitname=WiFiz
pkgver=0.9.2.2.r1.g8147a9f
pkgrel=1
pkgdesc="NetCTL GUI Frontend, written in wxPython. Stable Version."
arch=('any')
url="https://github.com/codywd/$_gitname"
license=('MIT')
depends=('python2' 'wxpython' 'wireless_tools' 'netctl' 'wpa_supplicant')
makedepends=('git')
optdepends=('gedit: manually edit profiles')
conflicts=('wifiz' 'wifiz-nightly')
provides=('wifiz')
source=("git://github.com/codywd/$_gitname.git")
sha256sums=('SKIP')

pkgver() {
  cd "$srcdir/$_gitname"
  git describe --always --long | sed -E 's/([^-]*-g)/r\1/;s/-/./g'
}

package() {
  cd "$srcdir/$_gitname"
  python2 setup.py install --root="$pkgdir/" --optimize=1
}

Note the following changes:

  • pkgname

  • conflicts with "wifiz" (all VCS packages should provide and conflict with their non-VCS equivalents)

  • removed redundant echo and shell invocation from pkgver function

  • "$srcdir/$_gitname" instead of "$_gitname" in pkgver function: the git repo will not be in the same directory if the user sets SRCDIR in makepkg.conf


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#4 2013-05-28 00:35:53

pivotraze
Member
From: Missoula, MT
Registered: 2011-08-21
Posts: 113

Re: [SOLVED] PKGBUILD doesn't work as expected?

You're both heroes! Thank you very much! Although, there is now wifiz and wifiz-git in the AUR. The first one, "wifiz" needs to either be removed or merged into "wifiz-git". I emailed the AUR list about it.

Last edited by pivotraze (2013-05-28 00:36:47)

Offline

Board footer

Powered by FluxBB