From 281b99979ad7533e956465d4e36e5de2e38d0dff Mon Sep 17 00:00:00 2001 From: Ivan Gonzalez Polanco Date: Wed, 2 Oct 2019 16:37:03 -0400 Subject: [PATCH] New package: fake-hwclock-0.11 --- srcpkgs/fake-hwclock/files/rc.local | 4 ++ srcpkgs/fake-hwclock/files/rc.shutdown | 3 ++ srcpkgs/fake-hwclock/patches/manpage.patch | 45 ++++++++++++++++++++++ srcpkgs/fake-hwclock/template | 30 +++++++++++++++ 4 files changed, 82 insertions(+) create mode 100644 srcpkgs/fake-hwclock/files/rc.local create mode 100644 srcpkgs/fake-hwclock/files/rc.shutdown create mode 100644 srcpkgs/fake-hwclock/patches/manpage.patch create mode 100644 srcpkgs/fake-hwclock/template diff --git a/srcpkgs/fake-hwclock/files/rc.local b/srcpkgs/fake-hwclock/files/rc.local new file mode 100644 index 00000000000..b5e5a925bed --- /dev/null +++ b/srcpkgs/fake-hwclock/files/rc.local @@ -0,0 +1,4 @@ +if (command -v /sbin/fake-hwclock >/dev/null 2>&1) ; then + [ -r /etc/default/fake-hwclock ] && . /etc/default/fake-hwclock + /sbin/fake-hwclock load $FORCE +fi diff --git a/srcpkgs/fake-hwclock/files/rc.shutdown b/srcpkgs/fake-hwclock/files/rc.shutdown new file mode 100644 index 00000000000..822a0b65375 --- /dev/null +++ b/srcpkgs/fake-hwclock/files/rc.shutdown @@ -0,0 +1,3 @@ +if (command -v /sbin/fake-hwclock >/dev/null 2>&1) ; then + /sbin/fake-hwclock save +fi diff --git a/srcpkgs/fake-hwclock/patches/manpage.patch b/srcpkgs/fake-hwclock/patches/manpage.patch new file mode 100644 index 00000000000..0009bcbd9ce --- /dev/null +++ b/srcpkgs/fake-hwclock/patches/manpage.patch @@ -0,0 +1,45 @@ +--- o.fake-hwclock.8 2019-10-02 15:24:24.861930286 -0400 ++++ fake-hwclock.8 2019-10-02 16:04:14.727887488 -0400 +@@ -1,4 +1,4 @@ +-.TH FAKE-HWCLOCK 8 "1 October 2014" Debian ++.TH FAKE-HWCLOCK 8 "2 October 2019" Debian + .SH NAME + fake-hwclock \- Control fake hardware clock + .SH SYNOPSIS +@@ -23,6 +23,20 @@ + case, in which case it is possible to modify the init system + configuration to move things earlier/later as appropriate. + ++This program was originally written for Debian, which uses an init system ++different from \fBrunit\fP. In order to load the time on startup, the system ++administrator must add the command \fBfake-hwclock load\fP to ++\fI/etc/rc.local\fP. To facilitate this process, two example snippets are ++provided in \fI/usr/share/examples/fake-hwclock/\fP. They can be used like: ++ ++.nf ++cat /usr/share/examples/fake-hwclock/rc.local | sudo tee -a /etc/rc.local ++.fi ++ ++To save the time before shutdown, substitute both \fIrc.local\fP to ++\fIrc.shutdown\fP in the previous command, or manually add \fBfake-hwclock ++save\fP to \fI/etc/rc.shutdown\fP. ++ + .SH DESCRIPTION + \fBfake-hwclock\fP sets and queries a fake "hardware clock" which stores the + time in a file. This program may be run by the system administrator +@@ -47,11 +61,11 @@ + \fB/etc/fake-hwclock.data\fR + The file used to store the time + .TP +-\fB/etc/init.d/fake-hwclock\fR +-The init script used to run fake-hwclock on startup and shutdown ++\fB/usr/share/examples/fake-hwclock/rc.local\fR ++Example snippet for /etc/rc.local to run fake-hwclock on startup + .TP +-\fB/lib/systemd/system/fake-hwclock.service\fR +-systemd service used to run fake-hwclock on startup and shutdown ++\fB/usr/share/examples/fake-hwclock/rc.shutdown\fR ++Example snippet for /etc/rc.shutdown to run fake-hwclock on shutdown + .TP + \fB/etc/default/fake-hwclock\fR + Settings file for the init script. diff --git a/srcpkgs/fake-hwclock/template b/srcpkgs/fake-hwclock/template new file mode 100644 index 00000000000..3d53f97bde1 --- /dev/null +++ b/srcpkgs/fake-hwclock/template @@ -0,0 +1,30 @@ +# Template file for 'fake-hwclock' +pkgname=fake-hwclock +version=0.11 +revision=1 +short_desc="Save/restore system clock on machines without working RTC hardware" +maintainer="Ivan Gonzalez Polanco " +license="GPL-2.0" +homepage="https://tracker.debian.org/pkg/fake-hwclock" +distfiles="${DEBIAN_SITE}/main/f/${pkgname}/${pkgname}_${version}.tar.gz" +checksum="58e29ff272a8e8b40ab972c49f82fd8fb6ef69a7fdde5f84292f800b53ea29ce" +create_wrksrc=yes +archs=noarch + +do_extract() { + filename="$(basename ${distfiles})" + tar xzf ${XBPS_SRCDISTDIR}/${pkgname}-${version}/${filename} --strip-components=1 -C ${wrksrc} +} + +do_install() { + vbin ${pkgname} + vconf etc/default/${pkgname} + vinstall debian/${pkgname}.cron.hourly 755 etc/cron.hourly ${pkgname} + vman ${pkgname}.8 +} + +post_install() { + vlicense COPYING + vsconf ${FILESDIR}/rc.local + vsconf ${FILESDIR}/rc.shutdown +}