You are not logged in.

#1 2021-10-19 14:38:11

Mek101
Member
Registered: 2021-10-19
Posts: 5

PKGBUILD review request: duperemove-service

Hi, this is the first PKGBUILD I worked on. It packages a small script I wrote to automate block deduplication on btrfs using systemd timers and duperemove. You can find it here.

# Maintainer: Mek101 <mek101-dev.inv@slmail.me>
pkgname=duperemove-service
pkgver=1.0.1
pkgrel=1
pkgdesc="A configurable systemd service to deduplicate the filesystem"
arch=('any')
backup=("etc/duperemove-service/default.conf")
url="https://codeberg.org/mek101/duperemove-service"
license=('GPL3')
depends=('duperemove>=0.11.2', 'bash>=5.0.0')
makedepends=('make')
source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz")
sha256sums=("3da6fab62642def0694f38e770bed6cfdad8d7c5d21f1075f30ba4fa384623fa")

package() {
	cd "$pkgname/"
	make DESTDIR="$pkgdir/" SYSTEMD_SERVICE=1 install
}

In particular, I wanted to know your opinion on whatever I should include bash in the dependencies or not.
Thanks smile

Last edited by Mek101 (2021-10-19 14:39:28)

Offline

#2 2021-10-19 20:46:25

Ammako
Member
Registered: 2021-07-16
Posts: 266

Re: PKGBUILD review request: duperemove-service

It's probably not needed, given that bash is a hard dependency of systemd itself wink

That being said, it doesn't -hurt- to have it, as long as you can ensure that your version requirement never clashes with what Arch has in the repos.

It would probably make more sense to include systemd as dependency instead.

Last edited by Ammako (2021-10-19 20:50:54)

Offline

#3 2021-10-19 23:07:11

loqs
Member
Registered: 2014-03-06
Posts: 14,284

Re: PKGBUILD review request: duperemove-service

makedepends=('make')

make is in base-devel so does not need to be listed in makedepends.

Offline

#4 2021-10-19 23:20:27

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

Re: PKGBUILD review request: duperemove-service

Aside from the PKGBUILD, your duperemove-service script has syntax errors e.g. in lines 12 and 14.
I recommend you use shellcheck and integrate its use into your Makefile as a mandatory unit test.

Offline

#5 2021-10-20 09:18:30

Mek101
Member
Registered: 2021-10-19
Posts: 5

Re: PKGBUILD review request: duperemove-service

Thank you all for your feedback. I updated the PKGBUILD to take it into account.

# Maintainer: Mek101 <mek101-dev.inv@slmail.me>
pkgname=duperemove-service
pkgver=1.0.3
pkgrel=1
pkgdesc="A configurable systemd service to deduplicate the filesystem"
arch=('any')
backup=("etc/duperemove-service/default.conf")
url="https://codeberg.org/mek101/duperemove-service"
license=('GPL3')
depends=('duperemove>=0.11.2', 'systemd>=213.0')
source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz")
sha256sums=("d97a320eadff4ed8630299481a532d4505829c9d5b8ce44b41dec4fca0dbb806")

package() {
	cd "$pkgname/"
	make DESTDIR="$pkgdir/" SYSTEMD_SERVICE=1 SKIP_TEST=1 install
}

As for using shellcheck as for testing, I added it to the Makefile targets and before the default installation, however I don't want to make it mandatory, since I don't want to force the users to download 30~ MB of tooling for something they're only going to use once.

Offline

#6 2021-10-20 11:13:35

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

Re: PKGBUILD review request: duperemove-service

Mek101 wrote:

As for using shellcheck as for testing, I added it to the Makefile targets and before the default installation, however I don't want to make it mandatory, since I don't want to force the users to download 30~ MB of tooling for something they're only going to use once.

That's what makedepends is for.

Offline

#7 2021-10-21 07:12:22

Mek101
Member
Registered: 2021-10-19
Posts: 5

Re: PKGBUILD review request: duperemove-service

That's what makedepends is for.

I... hadn't thought about that

Offline

#8 2021-10-21 11:03:29

Mek101
Member
Registered: 2021-10-19
Posts: 5

Re: PKGBUILD review request: duperemove-service

Hopefully final revision

# Maintainer: Mek101 <mek101-dev.inv@slmail.me>
pkgname=duperemove-service
pkgver=1.0.4
pkgrel=1
pkgdesc="A configurable systemd service to deduplicate the filesystem"
arch=('any')
backup=("etc/duperemove-service/default.conf")
url="https://codeberg.org/mek101/duperemove-service"
license=('GPL3')
depends=('duperemove>=0.11', 'systemd>=213.0')
makedepends=('shellcheck')
source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz")
sha256sums=("fb96de2cef7c6c84d7e8dbaf977928ae5a82a95c7410f45bce2058e2155885d0")

package() {
	cd "$pkgname/"
	make DESTDIR="$pkgdir/" SYSTEMD_SERVICE=1 install
}

Offline

#9 2021-10-22 10:50:43

Mek101
Member
Registered: 2021-10-19
Posts: 5

Re: PKGBUILD review request: duperemove-service

Offline

#10 2021-10-22 14:17:37

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 9,600

Re: PKGBUILD review request: duperemove-service

depends=('duperemove>=0.11', 'systemd>=213.0')\

Archlinux users are supposed to have latest versions installed, so we normally don't have version requirements .

Systemd 213 was released in 2014 , while duperemove 0.11 is from 2018 . I suggest you remove both version requirements and just depend on systemd &  duperemove .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
Did you use the guided installer ? If yes, I can't help you.

(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#11 2021-10-22 22:50:33

loqs
Member
Registered: 2014-03-06
Posts: 14,284

Re: PKGBUILD review request: duperemove-service

Would shellcheck not be better placed in your workflow for when you are pushing commits rather than building the package?
What is a user supposed to do if shellcheck fails when building the package?

Offline

#12 2021-10-23 08:45:22

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

Re: PKGBUILD review request: duperemove-service

I actually agree. But other packages run tests on build time as well: https://bbs.archlinux.org/viewtopic.php?id=269659

Last edited by schard (2021-10-23 08:45:56)

Offline

#13 2021-10-24 08:45:55

willemw
Member
Registered: 2013-02-19
Posts: 83

Re: PKGBUILD review request: duperemove-service

Also agree with what logs said. Shellcheck is run by the maintainer, before publishing or updating to the AUR. Besides, makedepend packages are only used inside build() and this package does not include that function (or even a check() function).

Offline

Board footer

Powered by FluxBB