desktop/logrotate/PKGBUILD
2017-05-18 00:11:37 +01:00

50 lines
1.6 KiB
Bash

pkgname=logrotate
pkgver=3.12.2
pkgrel=1
pkgdesc="Rotates system logs automatically"
arch=('x86_64')
url="https://github.com/logrotate/logrotate"
license=('GPL')
groups=('base')
depends=('popt' 'gzip' 'acl')
backup=('etc/logrotate.conf')
source=("https://github.com/logrotate/logrotate/releases/download/${pkgver}/${pkgname}-${pkgver}.tar.xz"
'logrotate.conf'
logrotate.{timer,service})
sha1sums=('d9943cbac519fea75408ebf17be7d03fe2ad997d'
'2d2678ad876e292d4f4d93f92041e4a158c5c362'
'db8b531121793baaf68e05f6bd0f86da918c56e0'
'017bb1373ed4cde5b29e16932741eca7b440bb44')
build() {
cd "$srcdir/${pkgname}-${pkgver}"
./configure \
--prefix=/usr \
--sbindir=/usr/bin \
--mandir=/usr/share/man \
--with-compress-command=/usr/bin/gzip \
--with-uncompress-command=/usr/bin/gunzip \
--with-default-mail-command=/usr/bin/mail \
--with-acl
make
}
check() {
cd "$srcdir/${pkgname}-${pkgver}"
make test
}
package() {
cd "$srcdir/${pkgname}-${pkgver}"
make DESTDIR="$pkgdir" install
install -dm755 "$pkgdir/etc/logrotate.d"
install -Dm644 "$srcdir/logrotate.conf" "$pkgdir/etc/logrotate.conf"
install -D -m644 ${srcdir}/logrotate.timer ${pkgdir}/usr/lib/systemd/system/logrotate.timer
install -D -m644 ${srcdir}/logrotate.service ${pkgdir}/usr/lib/systemd/system/logrotate.service
install -d -m755 ${pkgdir}/usr/lib/systemd/system/multi-user.target.wants
ln -s ../logrotate.timer ${pkgdir}/usr/lib/systemd/system/multi-user.target.wants/logrotate.timer
}