You are not logged in.

#1 2018-01-03 11:20:34

mipi
Member
From: Germany
Registered: 2018-01-03
Posts: 44

Feedback to PKGBUILD wanted

Hi,
because it's the first time I build a package I would like to get feedback regarding the PKGBUILD file. namcap doesn't complain and also makepkg runs through.

It's a tool written in Go. In addition to the tool itself a mime type XML and a desktop file are also created / copied into the /usr/ tree.

Thanks,
mipi

# Maintainer: Michael Picht <michael dot picht at ussenterprise dot de>
# Contributor: Michael Picht <michael dot picht at ussenterprise dot de>

pkgname=gool
pkgver=0.9.5
pkgrel=1
pkgdesc='Go - Online TV Recorder on Linux'
arch=('x86_64' 'i686')
url="http://github.com/mipimipi/$pkgname/"
license=('GPL3')
depends=('mkvtoolnix-cli')
makedepends=('go' 'git')
source=("git://github.com/mipimipi/$pkgname.git")
sha256sums=('SKIP')

prepare() {
  cd "$pkgname"
  export GOPATH=$(pwd)
  mkdir src
  ln -s -r vendor/github.com src/github.com
  ln -s -r vendor/golang.org src/golang.org
}

build() {
  cd "$pkgname"
  export GOPATH=$(pwd)
  make
}

package() {
  cd "$pkgname"

  install -Dm755 "$pkgname" "$pkgdir/usr/bin/$pkgname"
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  install -Dm644 resources/gool.desktop "$pkgdir/usr/share/applications/gool.desktop"
  install -Dm644 resources/otrkey_mime.xml "$pkgdir/usr/share/mime/packages/otrkey_mime.xml"
}

Offline

#2 2018-01-03 11:59:08

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,515
Website

Re: Feedback to PKGBUILD wanted

Your sources are coming from git, so you definitely need 2 changes: 1) use a pkgver function, 2) append "-git" to the package name:
https://wiki.archlinux.org/index.php/VC … guidelines

Also while harmless, you don't need your name at the top twice.

You also don't need to / shouldn't install a copy of the license for common licenses including GPL3.

As you are also the author of the upstream source, why not fix your Makefile to properly use DESTDIR rather than working around the improper install directive in the package function?

Last edited by Trilby (2018-01-03 12:03:06)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2018-01-03 14:51:58

mipi
Member
From: Germany
Registered: 2018-01-03
Posts: 44

Re: Feedback to PKGBUILD wanted

Thanks, Trilby. Done:

# Maintainer: Michael Picht <michael dot picht at ussenterprise dot de>

pkgname=gool-git
_pkgname=gool
pkgver=0.9.5.r0.gd42032d
pkgrel=1
pkgdesc='Go - Online TV Recorder on Linux'
arch=('x86_64' 'i686')
url="http://github.com/mipimipi/$pkgname/"
license=('GPL3')
depends=('mkvtoolnix-cli')
makedepends=('go' 'git')
source=("git://github.com/mipimipi/$_pkgname.git")
sha256sums=('SKIP')

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

prepare() {
  cd "$_pkgname"
  export GOPATH=$(pwd)
  mkdir src
  ln -s -r vendor/github.com src/github.com
  ln -s -r vendor/golang.org src/golang.org
}

build() {
  cd "$_pkgname"
  export GOPATH=$(pwd)
  make
}

package() {
  cd "$_pkgname"
  make DESTDIR=$pkgdir install
}

Offline

#4 2018-01-03 14:57:30

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,515
Website

Re: Feedback to PKGBUILD wanted

I'm not a GO user to evaluate those parts, but now it looks like a quality PKGBUILD to me.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

Board footer

Powered by FluxBB