You are not logged in.
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
Last edited by Mek101 (2021-10-19 14:39:28)
Offline
It's probably not needed, given that bash is a hard dependency of systemd itself
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
makedepends=('make')
make is in base-devel so does not need to be listed in makedepends.
Offline
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.
Inofficial first vice president of the Rust Evangelism Strike Force
Offline
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
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.
Inofficial first vice president of the Rust Evangelism Strike Force
Offline
That's what makedepends is for.
I... hadn't thought about that
Offline
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
Offline
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.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Online
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
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)
Inofficial first vice president of the Rust Evangelism Strike Force
Offline
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