summaryrefslogtreecommitdiff
path: root/community/chrony/PKGBUILD
blob: 3446c4752d194483dc9ce5484f8e1a3120b6627e (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
# $Id: PKGBUILD 105122 2014-01-31 23:52:20Z thestinger $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Maintainer: Daniel Micay <danielmicay@gmail.com>
# Contributor: Bartłomiej Piotrowski <nospam@bpiotrowski.pl>
# Contributor: Patrick Leslie Polzer <leslie.polzer@gmx.net>
# Contributor: cdhotfire <cdhotfire@gmail.com>
# Contributor: Shinlun Hsieh <yngwiexx@yahoo.com.tw>
# Contributor: Elisamuel Resto <ryuji@simplysam.us>

pkgname=chrony
pkgver=1.29.1
pkgrel=1
pkgdesc='Lightweight NTP client and server'
arch=('i686' 'x86_64' 'mips64el')
url="http://chrony.tuxfamily.org/"
options=(strip emptydirs)
license=('GPL')
depends=('readline' 'libcap')
backup=('etc/chrony.conf')
source=(http://download.tuxfamily.org/chrony/${pkgname}-${pkgver}.tar.gz
        service)
sha256sums=('658c9bb4d8c8d8ec7d0908429aa266e5f8413ba86bd4acbfd2f9669f6065af27'
            'bef4305fa7e5828e1a1fd43aa8e631f22f21902f6cdc2d3b5b41a57bd9a175dc')

build() {
  cd $pkgname-$pkgver
  ./configure --prefix=/usr
  make
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install

  install -Dm0644 "$srcdir/$pkgname-$pkgver/examples/chrony.conf.example" "$pkgdir/etc/chrony.conf"

  echo -e "\n# Enable kernel RTC sync\nrtcsync" >> "$pkgdir/etc/chrony.conf"

  sed -i '/^! rtconutc$/ s/^! //' "$pkgdir/etc/chrony.conf"

  mv "$pkgdir/usr/sbin/chronyd" "$pkgdir/usr/bin"
  rmdir "$pkgdir/usr/sbin"

  install -Dm644 "$srcdir/service" "$pkgdir/usr/lib/systemd/system/chrony.service"

  install -dm755 "$pkgdir/usr/lib/systemd/ntp-units.d"
  echo "$pkgname.service" > "$pkgdir/usr/lib/systemd/ntp-units.d/$pkgname.list"
}