You are not logged in.

#1 2024-08-02 15:31:30

jahway603
Member
Registered: 2020-05-21
Posts: 11
Website

[SOLVED] PKGBUILD review: iamb-git

Looking for feedback to make this package as it does not build each time there is a git commit as other `-git` AUR packages do.

# Maintainer: Jah Way <jahway603 at protonmail dot com>

pkgname=iamb-git
_pkg=iamb
pkgver=0.1.e98d58a
pkgrel=3
pkgdesc='A Matrix client for Vim addicts'
url='https://github.com/ulyssa/iamb'
arch=('x86_64')
license=('Apache')
makedepends=('git' 'rust' 'cargo')
conflicts=('iamb' 'iamb-bin')
provides=('iamb')
source=("git+$url.git")
sha512sums=('SKIP')
options=('!lto')

build() {
  cd $_pkg
  cargo build --release
}

package() {
  install -Dm644 "$srcdir/$_pkg/LICENSE" "$pkgdir/usr/share/licenses/$_pkg/LICENSE"
  install -Dm755 "$srcdir/$_pkg/target/release/iamb" "$pkgdir/opt/$_pkg/iamb"
  install -Dm755 "$srcdir/$_pkg/README.md" "$pkgdir/opt/$_pkg/README.md"
  # Manpages
  install -Dm644 "$srcdir/$_pkg/docs/${_pkg}.1" "$pkgdir/usr/share/man/man1/${_pkg}.1"
  install -Dm644 "$srcdir/$_pkg/docs/${_pkg}.5" "$pkgdir/usr/share/man/man5/${_pkg}.5"
  # Config example
  install -Dm644 "$srcdir/$_pkg/config.example.toml" "$pkgdir/usr/share/doc/${_pkg}/config.example.toml"

  # link to /usr/bin
  install -d "$pkgdir/usr/bin"
  ln -s /opt/$_pkg/iamb "$pkgdir/usr/bin"
}

Last edited by jahway603 (2024-08-19 13:06:16)

Offline

#2 2024-08-02 15:47:28

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

Re: [SOLVED] PKGBUILD review: iamb-git

1. Why install to /opt/?  There are no bundled resources that this may look for in it's own directory, so why not just install it properly to /usr/bin?
2. The license should have a version specifier, is it Apache-2.0 or an earlier version?
3. Why is pkgrel 3? A newly submitted PKGBUILD should only have a pkgrel of 1.  And that ever increasing on VCS PKGBUILDs is extremely rare (e.g., only if you modify the PKGBUILD in the AUR prior to there being any upstream commits).

jahway603 wrote:

it does not build each time there is a git commit as other `-git` AUR packages do.

What does this even mean?  Have you tried to build it?  Has it failed?  With what error?

Last edited by Trilby (2024-08-02 15:50:10)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2024-08-02 16:13:52

jahway603
Member
Registered: 2020-05-21
Posts: 11
Website

Re: [SOLVED] PKGBUILD review: iamb-git

Thank you for your feedback.

1. When I first started making AUR packages many years ago, I saw other packages install to /opt & symlink to /usr/bin. Is there a standard practice when and when not to do that?
2. It is Apache-2.0, so I have updated that.
3. It is pkgrel 3 because it is actually the third release of this "-git" package, as seen here.

Trilby wrote:

What does this even mean?  Have you tried to build it?  Has it failed?  With what error?

What this means is that I have the package built & installed as of March 2024, but you can see from the git repo here that there are many commits since March 2024. Other AUR `-git` packages would rebuild when running `paru` or `yay` and this package I've created does not do that. I'm asking for help on what to add so that this package will have that intended behaviour. Please let me know if that is not clear enough.

Last edited by jahway603 (2024-08-02 16:22:33)

Offline

#4 2024-08-02 16:57:55

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

Re: [SOLVED] PKGBUILD review: iamb-git

RE #1: https://wiki.archlinux.org/title/Arch_p … irectories

Don't copy other people's mistakes.  /opt/ can be used if specifically needed to overcome some limitation in the software to be packaged "properly".  There does not appear to be any such limitation here.  So binaries go in /usr/bin.

RE #3: Ah, I didn't know this was already in the AUR.  In that case, increasing the pkgrel is appropriate if you revise the PKGBUILD and do not change the version number ... but that highlights that I missed a much bigger issue: where's the pkgver function??  There have been upstream commits - plenty of them - so you should not increase pkgrel as it gets reset with every increment of the version number, and the version number should increment with each upstream commit.

As for rebuilding, paru and yay are both critically broken / foolish.  Your package will rebuild just as well as any other with the officially supported tool of makepkg.  That said, paru and yay likely run the pkgver function to determine if an update is need.  Once you fix your PKGBUILD to include a proper pkgver function, then those "helpers" will likely do what you expect again.  But that still doesn't mean you should use them.

EDIT: actually there's a good chance paru and yay would *rebuild* the package, but they may just fail to install it as it matches the version number already installed.  And that is a failure of your PKGBUILD not those "helpers".  But they still should be avoided.

Last edited by Trilby (2024-08-02 16:59:13)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2024-08-02 17:13:18

gromit
Package Maintainer (PM)
From: Germany
Registered: 2024-02-10
Posts: 687
Website

Re: [SOLVED] PKGBUILD review: iamb-git

Why ist it a "-git" package and yet does not have a pkver() function? yikes
https://wiki.archlinux.org/title/VCS_package_guidelines

Offline

#6 2024-08-19 13:06:00

jahway603
Member
Registered: 2020-05-21
Posts: 11
Website

Re: [SOLVED] PKGBUILD review: iamb-git

Thanks for the help & I have now fixed this package.

Offline

Board footer

Powered by FluxBB