# Maintainer: Oleg Rakhmanov <orakhmanov [at] gmail [dot] com>
# Contributor: Peter Wu <peter (at) lekensteyn (dot) nl>
#
# Reworked Alexander Manning's rc.d script for systemd
# Reference: http://archplusplus.co.uk/post/31401843803/fake-hwclock-for-arch-linux-arm-on-raspberry-pi

pkgname=fake-hwclock
pkgver=0.3
pkgrel=1
pkgdesc="Saves time on shutdown and restores it on boot from a file"
arch=('any')
license=('GPL')
install=fake-hwclock.install
source=('fake-hwclock.sh'
        'fake-hwclock.service'
        'fake-hwclock-save.service'
        'fake-hwclock-save.timer')

md5sums=('713f9cd5d8dc0073b5eca5dd14de1271'
         'fa52aac3db246575c3cc8c1bf608766c'
         '9f93ed2b74260d204a9c285d35ee2daa'
         'b2b494cb4ba99eb12df3cb4188902ca4')

package() {
  install -D -m755 "${srcdir}/fake-hwclock.sh" "${pkgdir}/usr/lib/systemd/scripts/fake-hwclock.sh"
  for unit in \
    fake-hwclock.service \
    fake-hwclock-save.service \
    fake-hwclock-save.timer
  do
    install -D -m644 "${srcdir}/$unit" "${pkgdir}/usr/lib/systemd/system/$unit"
  done
}