Add check and avoid editing inplace source

This commit is contained in:
Balakrishnan Balasubramanian 2024-04-04 10:35:09 -04:00
parent 0170478785
commit 880084af2d

View File

@ -2,7 +2,7 @@
pkgname=mail4one pkgname=mail4one
pkgver=1.1 pkgver=1.1
pkgrel=1 pkgrel=2
pkgdesc="Personal Mail Server" pkgdesc="Personal Mail Server"
arch=('any') arch=('any')
url='https://github.com/mail4one/mail4one' url='https://github.com/mail4one/mail4one'
@ -16,13 +16,17 @@ install="$pkgname.install"
build() { build() {
cd "$pkgname" cd "$pkgname"
make build make build
sed -i '/ExecStart/s/local.bin/bin/' deploy_configs/mail4one.service }
check() {
cd "$pkgname"
PYTHONPATH=mail4one.pyz python3 -m unittest discover
} }
package() { package() {
cd "$pkgname" cd "$pkgname"
install -Dm755 mail4one.pyz "$pkgdir/usr/bin/mail4one" install -Dm755 mail4one.pyz "$pkgdir/usr/bin/mail4one"
install -Dm644 deploy_configs/mail4one.service -t "$pkgdir/usr/lib/systemd/system" sed '/ExecStart/s/local.bin/bin/' deploy_configs/mail4one.service | install -Dm644 /dev/stdin "$pkgdir/usr/lib/systemd/system/mail4one.service"
install -Dm644 deploy_configs/mail4one.conf -t "$pkgdir/usr/lib/sysusers.d" install -Dm644 deploy_configs/mail4one.conf -t "$pkgdir/usr/lib/sysusers.d"
install -Dm644 README.md deploy_configs/mail4one_cert_copy.sh deploy_configs/config.sample -t "$pkgdir/usr/share/doc/$pkgname" install -Dm644 README.md deploy_configs/mail4one_cert_copy.sh deploy_configs/config.sample -t "$pkgdir/usr/share/doc/$pkgname"
install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname" install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"