You are not logged in.

#1 2015-09-29 06:07:29

marten
Member
Registered: 2011-11-22
Posts: 2

First Arch Package

Hi guys,

out of curiosity I built my first Archlinux Package. The software is a fairly simple password generator called Qt-SESAM.
It would be nice if you can quickly check the PKGBUILD. Do you think it's worth uploading it to the AUR?

Thank you for your help!

# Maintainer: maa <marten.andrejewski@gmail.com>

pkgname=qt-sesam-git
_gitname=Qt-SESAM
pkgver=2.0.6
pkgrel=1
pkgdesc="Super Easy & Secure Authentication Manager"
arch=('i686' 'x86_64')
url="https://github.com/ola-ct/Qt-SESAM/"
license=('GPL')
depends=('qt5-base')
makedepends=('gcc')
source=("git+https://github.com/ola-ct/Qt-SESAM/")
md5sums=('SKIP')

build() {
  cd ${srcdir}/${_gitname}
  lrelease Qt-SESAM/Qt-SESAM.pro
  qmake
  make
}

check() {
  cd ${srcdir}/${_gitname}
  make check
}

package() {
  cd ${srcdir}/${_gitname}
  make INSTALL_ROOT="$pkgdir/" install
}

Offline

#2 2015-09-29 08:09:12

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: First Arch Package

Either add a pkgver() function and put 'git' in makedepends [1] or drop the -git part and specify a tarball for version 2.0.6 in the source array (with a checksum).

Currently you're checking out the most recent commit (HEAD) but the version is fixed at 2.0.6.

[1] https://wiki.archlinux.org/index.php/VC … guidelines

Offline

#3 2015-09-29 08:47:45

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,858
Website

Re: First Arch Package

Always doublequote any instances of $srcdir and $pkgdir, since these variables could possibly contain spaces. e.g. cd "${srcdir}/${_gitname}".

If the current build places things in /usr/local, check the Makefile and see if you can override that. Packages should install into /usr (except where they dump stuff to /opt).

There is no need to specify gcc in the makedepends array, people should have that installed already because it's part of base-devel.

Try building the package in a clean chroot and see what else (if anything) the package depends on.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#4 2015-09-29 09:24:32

marten
Member
Registered: 2011-11-22
Posts: 2

Re: First Arch Package

Thanks for your comments, tried to add them to the script.

The binary is installed to /usr/bin/Qt-SESAM. Hope thats ok?

New Version:

# Maintainer: maa <marten.andrejewski@gmail.com>

pkgname=qt-sesam-git
_gitname=Qt-SESAM
pkgver=2.0.6.r12.g843f67a
pkgrel=1
pkgdesc="Super Easy & Secure Authentication Manager"
arch=('i686' 'x86_64')
url="https://github.com/ola-ct/Qt-SESAM/"
license=('GPL')
makedepends=('git' 'qt5-tools')
source=("git+https://github.com/ola-ct/Qt-SESAM/")
md5sums=('SKIP')

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

build() {
  cd "${srcdir}/${_gitname}"
  lrelease Qt-SESAM/Qt-SESAM.pro
  qmake
  make
}

check() {
  cd "${srcdir}/${_gitname}"
  make check
}

package() {
  cd "${srcdir}/${_gitname}"
  make INSTALL_ROOT="{$pkgdir}/" install
} 

Edit: Built it in a clean chroot, added qt5-tools as makedepend

Last edited by marten (2015-09-29 09:40:06)

Offline

#5 2015-09-29 10:07:36

Alad
Wiki Admin/IRC Op
From: Bagelstan
Registered: 2014-05-04
Posts: 2,412
Website

Re: First Arch Package

You don't need an extra variable, just do source=("$pkgname::git+https://github.com/ola-ct/Qt-SESAM/") and cd "$pkgname". Also, $srcdir is a no-op - you always start there.

Last edited by Alad (2015-09-29 10:07:48)


Mods are just community members who have the occasionally necessary option to move threads around and edit posts. -- Trilby

Offline

Board footer

Powered by FluxBB