From eca2d0a8670efcf0676d2966cd9fd2afa3314966 Mon Sep 17 00:00:00 2001 From: Ivan Gonzalez Polanco Date: Fri, 4 Oct 2019 03:55:48 -0400 Subject: [PATCH] New package: fake-hwclock-0.11 Thanks maldridge, pulux, and bobertlo on IRC for the help provided! --- .../fake-hwclock/files/fake-hwclock/finish | 2 ++ srcpkgs/fake-hwclock/files/fake-hwclock/run | 5 +++ srcpkgs/fake-hwclock/patches/manpage.patch | 34 +++++++++++++++++++ srcpkgs/fake-hwclock/template | 22 ++++++++++++ 4 files changed, 63 insertions(+) create mode 100755 srcpkgs/fake-hwclock/files/fake-hwclock/finish create mode 100755 srcpkgs/fake-hwclock/files/fake-hwclock/run create mode 100644 srcpkgs/fake-hwclock/patches/manpage.patch create mode 100644 srcpkgs/fake-hwclock/template diff --git a/srcpkgs/fake-hwclock/files/fake-hwclock/finish b/srcpkgs/fake-hwclock/files/fake-hwclock/finish new file mode 100755 index 00000000000..2b54817ed0b --- /dev/null +++ b/srcpkgs/fake-hwclock/files/fake-hwclock/finish @@ -0,0 +1,2 @@ +#!/bin/sh +exec fake-hwclock save diff --git a/srcpkgs/fake-hwclock/files/fake-hwclock/run b/srcpkgs/fake-hwclock/files/fake-hwclock/run new file mode 100755 index 00000000000..e5f8c5a70c8 --- /dev/null +++ b/srcpkgs/fake-hwclock/files/fake-hwclock/run @@ -0,0 +1,5 @@ +#!/bin/sh +exec 1>&2 +[ -r /etc/default/fake-hwclock ] && . /etc/default/fake-hwclock +fake-hwclock load $FORCE || exit 1 +exec chpst -b fake-hwclock pause diff --git a/srcpkgs/fake-hwclock/patches/manpage.patch b/srcpkgs/fake-hwclock/patches/manpage.patch new file mode 100644 index 00000000000..f404d6ffc4a --- /dev/null +++ b/srcpkgs/fake-hwclock/patches/manpage.patch @@ -0,0 +1,34 @@ +--- o.fake-hwclock.8 2019-10-03 01:19:44.542744670 -0400 ++++ fake-hwclock.8 2019-10-03 01:21:03.241032055 -0400 +@@ -1,4 +1,4 @@ +-.TH FAKE-HWCLOCK 8 "1 October 2014" Debian ++.TH FAKE-HWCLOCK 8 "4 October 2019" Linux + .SH NAME + fake-hwclock \- Control fake hardware clock + .SH SYNOPSIS +@@ -23,6 +23,11 @@ + 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. To add \fBfake-hwclock\fP as a service, the system ++administrator must link the directory \fI/etc/sv/fake-hwclock\fP to ++\fI/var/service\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 +52,8 @@ + \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 +-.TP +-\fB/lib/systemd/system/fake-hwclock.service\fR +-systemd service used to run fake-hwclock on startup and shutdown ++\fB/etc/sv/fake-hwclock/\fR ++runit service used to run fake-hwclock on startup and 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..16731b49dfe --- /dev/null +++ b/srcpkgs/fake-hwclock/template @@ -0,0 +1,22 @@ +# Template file for 'fake-hwclock' +pkgname=fake-hwclock +version=0.11 +revision=1 +archs=noarch +wrksrc=git +short_desc="Save/restore system clock on machines without working RTC hardware" +maintainer="Ivan Gonzalez Polanco " +license="GPL-2.0-only" +homepage="https://tracker.debian.org/pkg/fake-hwclock" +distfiles="${DEBIAN_SITE}/main/f/${pkgname}/${pkgname}_${version}.tar.gz" +checksum="58e29ff272a8e8b40ab972c49f82fd8fb6ef69a7fdde5f84292f800b53ea29ce" + +conf_files="/etc/default/fake-hwclock" + +do_install() { + vbin fake-hwclock + vinstall etc/default/fake-hwclock 644 etc/default + vinstall debian/fake-hwclock.cron.hourly 755 etc/cron.hourly fake-hwclock + vman fake-hwclock.8 + vsv fake-hwclock +}