summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3962d0d7e13533a8a70c37d5469737e4bc02c0b0 (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
# Maintainer: Muflone http://www.muflone.com/contacts/english/
# Contributor: S├ębastien Luttringer <seblu@aur.archlinux.org>

pkgname=ntpdate
_pkgname=ntp
_pkgver=4.2.8p10
pkgver=${_pkgver/p/.p}
pkgrel=1
pkgdesc='Client for the Network Time Protocol (NTP)'
url='http://www.ntp.org/'
license=('custom')
arch=('i686' 'x86_64')
makedepends=('perl-html-parser')
depends=('openssl')
conflicts=('ntp' 'ntpdate-dev')
backup=('etc/conf.d/ntpdate.conf')
source=("http://archive.ntp.org/ntp4/ntp-${pkgver%*.*.*}/${_pkgname}-${_pkgver}.tar.gz"
        "${pkgname}.conf"
        "${pkgname}.service"
        "restore-html2man.patch")
sha256sums=('ddd2366e64219b9efa0f7438e06800d0db394ac5c88e13c17b70d0dcdf99b99f'
            '1ddbf0f51e030c6ec48d50e1b0eb6682f2d51567fbbb8fdd695a0e38a6036fd7'
            '2267e19120de4a73703ed0d83a4a0088309600ce3fed88c3c17a950fa0c1aa85'
            '66abd6828171661f531d221e8ac57baeca7bf6ac96008cf4fa76f8fb840404ce')

prepare() {
  cd "${srcdir}/${_pkgname}-${_pkgver}"
  patch -p1 -i "../restore-html2man.patch"
  cp -f "scripts/deprecated/html2man.in" "scripts/"
}

build() {
  cd "${srcdir}/${_pkgname}-${_pkgver}"
  ./configure --prefix=/usr --libexecdir=/usr/lib
  make
  # Convert the html page to man page
  cd "html"
  "../scripts/html2man"
}

package() {
  install -m 755 -d "${pkgdir}/etc/conf.d"
  install -m 644 -t "${pkgdir}/etc/conf.d" "${pkgname}.conf"
  install -m 755 -d "${pkgdir}/usr/lib/systemd/system"
  install -m 644 -t "${pkgdir}/usr/lib/systemd/system" "${pkgname}.service"

  cd "${srcdir}/${_pkgname}-${_pkgver}"
  install -m 755 -d "${pkgdir}/usr/bin"
  install -m 755 -t "${pkgdir}/usr/bin" "${pkgname}/${pkgname}"
  install -m 755 -d "${pkgdir}/usr/share/licenses/${pkgname}"
  install -m 644 -t "${pkgdir}/usr/share/licenses/${pkgname}" "COPYRIGHT"
  install -m 755 -d "${pkgdir}/usr/share/man/man1"
  install -m 644 -t "${pkgdir}/usr/share/man/man1" "html/man/man1/ntpdate.1"
}