summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 4cbff835c141a50fc0947d0dae7598fc82b3ef1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Maintainer: Chocobo1 <chocobo1 AT archlinux DOT net>

pkgname=logrotate-git
pkgver=3.21.0.r26.g7029565
pkgrel=1
pkgdesc="Rotates system logs automatically"
arch=('i686' 'x86_64')
url="https://github.com/logrotate/logrotate"
license=('GPL2')
depends=('glibc' 'acl' 'gzip' 'popt')
makedepends=('git')
provides=("logrotate=$pkgver")
conflicts=('logrotate')
backup=('etc/logrotate.conf')
source=("git+https://github.com/logrotate/logrotate.git"
        "logrotate.conf::https://gitlab.archlinux.org/archlinux/packaging/packages/logrotate/-/raw/main/logrotate.conf")
sha256sums=('SKIP'
            'SKIP')


pkgver() {
  cd "logrotate"

  git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd "logrotate"

  ./autogen.sh
  ./configure \
    --prefix="/usr" \
    --sbindir="/usr/bin" \
    --with-compress-command="/usr/bin/gzip" \
    --with-uncompress-command="/usr/bin/gunzip" \
    --with-default-mail-command="/usr/bin/mail"
  make
}

check() {
  cd "logrotate"

  make check
}

package() {
  cd "logrotate"

  make DESTDIR="$pkgdir" install

  install -Dm644 "$srcdir/logrotate.conf" -t "$pkgdir/etc"
  install -dm755 "$pkgdir/etc/logrotate.d"

  install -Dm644 "examples/logrotate.timer" -t "$pkgdir/usr/lib/systemd/system"
  install -Dm644 "examples/logrotate.service" -t "$pkgdir/usr/lib/systemd/system"

  install -dm755 "$pkgdir/usr/lib/systemd/system/timers.target.wants"
  ln -s ../logrotate.timer "$pkgdir/usr/lib/systemd/system/timers.target.wants/logrotate.timer"
}