Commit 380f0ec1 authored by Seblu's avatar Seblu
Browse files

add ntpdate pkg


git-svn-id: https://seblu.net/s/archpkg@81 02741741-5192-46b8-8916-7152b19231d9
parent 0023fe18
Loading
Loading
Loading
Loading

ntpdate/PKGBUILD

0 → 100644
+51 −0
Original line number Diff line number Diff line
# Maintainer: Sebastien Luttringer <seblu+arch@seblu.net>
pkgname=ntpdate
pkgver=4.2.6p3
pkgrel=1
pkgdesc='Client for the network time protocol'
arch=('i686' 'x86_64')
makedepends=('perl-html-parser')
conflicts=('ntp' 'ntpdate-dev')
license=('custom')
url='http://www.ntp.org/'
backup=('etc/conf.d/ntpdate')
source=("http://archive.ntp.org/ntp4/ntp-4.2/ntp-${pkgver}.tar.gz"
        'ntpdate.conf'
        'ntpdate.rc')
options=('!emptydirs')
md5sums=('59876a9009b098ff59767ee45a88ebd2'
         'c7f50632b69bd4f32cf052d0b1848463'
         '76ac18cf6f2d8a34d499143931d68ec4')

build() {
  # configure ntp
  cd "ntp-${pkgver}"
  ac_cv_header_dns_sd_h=0 ./configure --prefix=/usr --enable-ignore-dns-errors

  # build ntpdate
  cd "${pkgname}"
  make

  # gen ntpdate man page
  cd "${srcdir}/ntp-${pkgver}/html"
  ../scripts/html2man
}

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

  # install man page
  install -D -m644 "${srcdir}/ntp-${pkgver}/html/man/man8/ntpdate.8" "${pkgdir}/usr/share/man/man8/ntpdate.8"
  
  # install rc.d scripts 
  install -D -m755 "${srcdir}/ntpdate.rc" "${pkgdir}/etc/rc.d/${pkgname}"

  # install sample configs
  install -D -m644 "${srcdir}/ntpdate.conf" "${pkgdir}/etc/conf.d/${pkgname}"

  # install copyright
  install -D -m644 "${srcdir}/ntp-${pkgver}/COPYRIGHT" "${pkgdir}/usr/share/licenses/${pkgname}/COPYRIGHT"
}

# vim:set ts=2 sw=2 ft=sh et:

ntpdate/ntpdate.conf

0 → 100644
+11 −0
Original line number Diff line number Diff line
# change this to a server closer to your location
NTP_CLIENT_SERVER="pool.ntp.org"

# client options
NTP_CLIENT_OPTION="-b -u"

# timeout for the ntp-client
NTPCLIENT_TIMEOUT=10

# arguments passed to ntpd when started
NTPD_ARGS="-g"

ntpdate/ntpdate.rc

0 → 100644
+32 −0
Original line number Diff line number Diff line
#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions
. /etc/conf.d/ntpdate

case "$1" in
  start)
    stat_busy "Starting NTP Client"
    /usr/bin/ntpdate $NTP_CLIENT_OPTION -t $NTPCLIENT_TIMEOUT $NTP_CLIENT_SERVER &> /dev/null
    if [[  $? -gt 0 ]]; then
      stat_fail
    else
      add_daemon ntpdate
      stat_done
    fi
    ;;
  stop)
    stat_busy "Stopping NTP Client"
    rm_daemon ntpdate
    stat_done
    ;;
  restart)
    $0 stop
    sleep 1
    $0 start
    ;;
  *)
    echo "usage: $0 {start|stop|restart}"  
esac

# vim:set ts=2 sw=2 ft=sh et: