aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Healy <lmiphay@gmail.com>2024-07-24 23:26:08 +0100
committerPaul Healy <lmiphay@gmail.com>2024-07-24 23:26:08 +0100
commitee508ae6b6cd8c2e3228f0678b3542ed65e8b09e (patch)
tree43ee73137df91efc6cd70d59ffa3659acc503f32
parentmove to eapi 8 for git-r3 (diff)
downloadlmiphay-ee508ae6b6cd8c2e3228f0678b3542ed65e8b09e.tar.gz
lmiphay-ee508ae6b6cd8c2e3228f0678b3542ed65e8b09e.tar.bz2
lmiphay-ee508ae6b6cd8c2e3228f0678b3542ed65e8b09e.zip
add ebuild for fake-hwclock
Signed-off-by: Paul Healy <lmiphay@gmail.com>
-rw-r--r--sys-apps/fake-hwclock/Manifest2
-rw-r--r--sys-apps/fake-hwclock/fake-hwclock-0.14.ebuild47
-rw-r--r--sys-apps/fake-hwclock/files/fake-hwclock.init.d21
3 files changed, 70 insertions, 0 deletions
diff --git a/sys-apps/fake-hwclock/Manifest b/sys-apps/fake-hwclock/Manifest
new file mode 100644
index 0000000..fd6d3c6
--- /dev/null
+++ b/sys-apps/fake-hwclock/Manifest
@@ -0,0 +1,2 @@
+AUX fake-hwclock.init.d 399 BLAKE2B c11d2c961671b3811645776ce5243a9f326be656c63ef67da6c92047d73a5821f4abaf8bf42f7252ffb30e43c19519e0c5c34960bd2338bb0e90609bf9b99543 SHA512 0a5145f6add853f1cf4d95aca1bb57c9bd998b428771d2945df777658976d5224546dfbf545fd71387aba90e0cec552c529f8eabf17e39c2623487f846dd6e8d
+EBUILD fake-hwclock-0.14.ebuild 1287 BLAKE2B cd7cd2185802e6024d80c323541abaa1165f691b2b6aa82535fbf6541c8665a30cd39f792d89cae69acc1f601c47d59ce685ea302aed56ecddb7fac248541893 SHA512 9ef062fe0063003e5363b472018557a9b47effd56eb6440849921ad6e7a2e335a7e847a0ddafcbf859dc1d8b646800ee6a45467abbae6ca3924d737a9e25179c
diff --git a/sys-apps/fake-hwclock/fake-hwclock-0.14.ebuild b/sys-apps/fake-hwclock/fake-hwclock-0.14.ebuild
new file mode 100644
index 0000000..3ed89c4
--- /dev/null
+++ b/sys-apps/fake-hwclock/fake-hwclock-0.14.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# see: https://bugs.gentoo.org/704920
+
+EAPI="8"
+
+inherit systemd git-r3
+
+DESCRIPTION="Save/restore system clock on machines without working RTC hardware"
+HOMEPAGE="https://tracker.debian.org/pkg/fake-hwclock"
+EGIT_REPO_URI="https://git.einval.com/git/fake-hwclock.git"
+EGIT_COMMIT="00a0feb706bfc11e1e0dbaa887c603b8f9875c78"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64"
+
+src_prepare() {
+ sed -i -e 's:/etc/fake-hwclock.data:/var/lib/fake-hwclock/data:' fake-hwclock
+
+ eapply_user
+}
+
+src_install() {
+ insinto "/var/lib/fake-hwclock"
+ date -u '+%Y-%m-%d %H:%M:%S' > "${T}/data"
+ doins "${T}/data"
+
+ into /
+ dosbin fake-hwclock
+
+ newinitd "${FILESDIR}/fake-hwclock.init.d" fake-hwclock
+
+ systemd_dounit debian/fake-hwclock-load.service
+ systemd_dounit debian/fake-hwclock-save.service
+ systemd_dounit debian/fake-hwclock-save.timer
+
+ doman fake-hwclock.8
+ dodoc debian/changelog
+}
+
+pkg_postinst() {
+ elog "To enable and start the services do:"
+ elog "systemctl enable fake-hwclock-load.service fake-hwclock-save.service fake-hwclock-save.timer"
+ elog "systemctl start fake-hwclock-load.service fake-hwclock-save.service fake-hwclock-save.timer"
+}
diff --git a/sys-apps/fake-hwclock/files/fake-hwclock.init.d b/sys-apps/fake-hwclock/files/fake-hwclock.init.d
new file mode 100644
index 0000000..a75e4d7
--- /dev/null
+++ b/sys-apps/fake-hwclock/files/fake-hwclock.init.d
@@ -0,0 +1,21 @@
+#!/sbin/openrc-run
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+description="Save/restore system clock on machines without working RTC hardware"
+
+depend() {
+ after bootmisc
+}
+
+start() {
+ ebegin "Restore the current clock"
+ fake-hwclock load
+ eend $?
+}
+
+stop() {
+ ebegin "Save the current clock"
+ fake-hwclock save
+ eend $?
+} \ No newline at end of file