You are not logged in.

#1 2020-08-06 08:15:14

vincentherl
Member
Registered: 2020-08-06
Posts: 4

PKGBUILD review request: short

Hello,

short it's command tool that allow to manage environment variables and launch script with them injected. Here the package : https://github.com/vincent-herlemont/short

It's the first time that I publish on the arch linux repository so the following PKGBUILD work but I don't know if I follow all the guidelines.

I have a specific question related to each steps (pkgver,build,package). It was in the wrong directory by default and I have to move with the command cd ${pkgname}; , it was normal ?

pkgname=short-git
pkgver=v0.3.2.r0.g7f26b3d
pkgrel=1
source=("${pkgname}::git+https://github.com/vincent-herlemont/short.git")
makedepends=('git' 'rust' 'cargo' 'openssl' 'libgit2')
provides=()
replaces=()
md5sums=('SKIP')
arch=('i686' 'x86_64' 'armv6h' 'armv7h')

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

build() {
    cd ${pkgname};
    cargo build --release --locked --features disabled_check_new_version
}

package() {
   cd ${pkgname};
   install -Dm 755 target/release/sht -t "${pkgdir}/usr/bin"
}

Thank you for reading.

Offline

#2 2020-08-06 10:16:02

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

Re: PKGBUILD review request: short

Yes, each step starts in $srcdir, which is populated with whatever you've specified in the source array. In this case it will have a directory containing a clone of the upstream repository. This directory will be called 'short-git', as that is what you have specified it should be named in the source array ('${pkgname}::').


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

#3 2020-08-06 15:12:57

loqs
Member
Registered: 2014-03-06
Posts: 17,192

Re: PKGBUILD review request: short

namcap detected some potential issues with the PKGBUILD

Checking PKGBUILD
PKGBUILD (short-git) W: Missing Maintainer tag
PKGBUILD (short-git) E: Missing description in PKGBUILD
PKGBUILD (short-git) E: Missing url
PKGBUILD (short-git) E: Missing license
Checking short-git-v0.3.2.r0.g7f26b3d-1-x86_64.pkg.tar.zst
short-git E: Missing license
short-git E: Missing license
short-git E: Dependency libgit2 detected and not included (libraries ['usr/lib/libgit2.so.1.0'] needed in files ['usr/bin/sht'])

Offline

#4 2020-08-06 15:57:18

Stefan Husmann
Member
From: Germany
Registered: 2007-08-07
Posts: 1,391

Re: PKGBUILD review request: short

You should cut away the leading "v" of the pkgver.

Offline

#5 2020-08-06 16:08:29

schard
Member
From: Hannover
Registered: 2016-05-06
Posts: 1,932
Website

Re: PKGBUILD review request: short

Stefan Husmann wrote:

You should cut away the leading "v" of the pkgver.

The version is generated by the pkgver() function as usual with SCM based packages.

Offline

#6 2020-08-06 16:12:21

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,461

Re: PKGBUILD review request: short

schard wrote:
Stefan Husmann wrote:

You should cut away the leading "v" of the pkgver.

The version is generated by the pkgver() function as usual with SCM based packages.

Right, which is where it should be cut away.

Offline

#7 2020-08-06 16:56:50

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: PKGBUILD review request: short

vincentherl wrote:
pkgname=short-git
pkgver=v0.3.2.r0.g7f26b3d

[...]

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

Why does your pkgver() function remove the leading "short-" from the version, when there *isn't* a leading "short-"... instead of removing the leading "v"?


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#8 2020-08-07 07:26:26

vincentherl
Member
Registered: 2020-08-06
Posts: 4

Re: PKGBUILD review request: short

Thanks so much, for your answers.

Here the final PKGBUILD file.

pkgname=short-git
pkgver=0.3.2.r1.g451352e
pkgrel=1
pkgdesc="A concise cli launcher / project manager using env files"
source=("${pkgname}::git+https://github.com/vincent-herlemont/short.git")
url="https://github.com/vincent-herlemont/short"
makedepends=('git' 'rust' 'cargo' 'openssl' 'libgit2')
provides=()
replaces=()
md5sums=('SKIP')
arch=('i686' 'x86_64' 'armv6h' 'armv7h')
license=('Apache-2.0' 'MIT')

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

build() {
    cd ${pkgname};
    cargo build --release --locked --features disabled_check_new_version
}

package() {
   cd ${pkgname};
   install -Dm 755 target/release/sht -t "${pkgdir}/usr/bin"
}

Offline

#9 2020-08-07 10:14:02

loqs
Member
Registered: 2014-03-06
Posts: 17,192

Re: PKGBUILD review request: short

Checking PKGBUILD
PKGBUILD (short-git) W: Missing Maintainer tag
Checking short-git-0.3.2.r2.g58096a7-1-x86_64.pkg.tar.zst
short-git E: Apache-2.0 is not a common license (it's not in /usr/share/licenses/common/)
short-git E: Missing custom license directory (usr/share/licenses/short-git)
short-git E: Dependency libgit2 detected and not included (libraries ['usr/lib/libgit2.so.1.0'] needed in files ['usr/bin/sht'])

Checking if libgit2 is really required:

$ pacman -U short-git-0.3.2.r2.g58096a7-1-x86_64.pkg.tar.zst
loading packages...
resolving dependencies...
looking for conflicting packages...

Packages (1) short-git-0.3.2.r2.g58096a7-1

Total Installed Size:  3.26 MiB

:: Proceed with installation? [Y/n] y
(1/1) checking keys in keyring                     [######################] 100%
(1/1) checking package integrity                   [######################] 100%
(1/1) loading package files                        [######################] 100%
(1/1) checking for file conflicts                  [######################] 100%
(1/1) checking available disk space                [######################] 100%
:: Processing package changes...
(1/1) installing short-git                         [######################] 100%
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...
$ sht
sht: error while loading shared libraries: libgit2.so.1.0: cannot open shared object file: No such file or directory

Offline

#10 2020-08-07 13:18:54

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: PKGBUILD review request: short

vincentherl wrote:

Thanks so much, for your answers.

Here the final PKGBUILD file.

There is nothing final about this PKGBUILD! You asked for reviews, got some, and proceeded straight to posting what you're sure is the final version, but did you check to make sure the people you asked for review, agree? (The purpose of review is I assume to see if other people think it's ready for publication, so it's valuable to wait and see if they have any last insights...)

You haven't fixed all of loqs' review comments, and you implemented an incorrect license declaration that now needs to be fixed too. Please see https://wiki.archlinux.org/index.php/PKGBUILD#license

Please also remove the empty "provides=()" and "replaces=()" since they don't do anything.

Last edited by eschwartz (2020-08-07 13:24:33)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#11 2020-08-10 15:52:34

vincentherl
Member
Registered: 2020-08-06
Posts: 4

Re: PKGBUILD review request: short

Thanks you @loqs for your review and my apology @eschwartz for the "final" term, sure I am totally agree with what you have said. I will be more carefull in the future.
The fact was, that I ditn't know that "namcap" can be check the tar ball, now .. I known.

loqs wrote:

Checking if libgit2 is really required:

libgit2 is requried for the compilation and at the runtime, yes, so I have moved "libgit2" from "makedepends"  to "depends" now.
But I keep it mind that can it be removed from the project in the next update.

Here the PKGBUILD updated :

pkgname=short-git
pkgver=0.3.2.r2.g58096a7
pkgrel=1
pkgdesc="A concise cli launcher / project manager using env files"
source=("${pkgname}::git+https://github.com/vincent-herlemont/short.git")
url="https://github.com/vincent-herlemont/short"
depends=('libgit2')
makedepends=('git' 'rust' 'cargo' 'openssl')
md5sums=('SKIP')
arch=('i686' 'x86_64' 'armv6h' 'armv7h')
license=('APACHE' 'MIT')

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

build() {
    cd ${pkgname};
    cargo build --release --locked --features disabled_check_new_version
}

package() {
   cd ${pkgname};

   # sht binary:
   install -Dm 755 target/release/sht -t "${pkgdir}/usr/bin"

   # Licenses:
   install -d "${pkgdir}/usr/share/licenses/${pkgname}"
   install -m 644 LICENSE-APACHE \
      "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE-APACHE"
   install -m 644 LICENSE-MIT    \
      "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE-MIT"

}

I run this commands for test :

$> namcap PKGBUILD
$> namcap short-git-0.3.2.r2.g58096a7-1-x86_64.pkg.tar.zst

Last edited by vincentherl (2020-08-10 16:00:37)

Offline

#12 2020-08-10 16:07:41

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: PKGBUILD review request: short

The Apache licenae is available in the "licenses" package FWIW: /usr/share/licenses/common/Apache/license.txt

So you only need the PKGBUILD to copy over the MIT one (although adding both isn't harmful, just lacking in usefulness).

Thanks for fixing the remaining review comments. Please remember to update the .SRCINFO as well (you can do this with githooks e.g. https://github.com/eli-schwartz/aurpublish/#hooks)

Last edited by eschwartz (2020-08-10 16:07:59)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#13 2020-08-11 18:42:14

vincentherl
Member
Registered: 2020-08-06
Posts: 4

Re: PKGBUILD review request: short

I have removed the copy of Apache licence of the PKGBUILD.

Thanks for the git hooks, it will be very usefull !

Last edited by vincentherl (2020-08-11 18:42:49)

Offline

Board footer

Powered by FluxBB