Merge pull request #245 from philips/add-tlsdate

fix(net-misc/tlsdate): use the coreos fork
This commit is contained in:
Brandon Philips 2013-10-23 14:38:20 -07:00
commit f7ad9bc004
16 changed files with 212 additions and 3 deletions

View File

@ -3,9 +3,10 @@
# Distributed under the terms of the GNU General Public License v2
EAPI="4"
CROS_WORKON_COMMIT="260ee57ebd52eb4b57eeb9d41fd6f712ff6f5e1f"
CROS_WORKON_COMMIT="2a539af7e77135948ce587a7805f5285818c4015"
CROS_WORKON_PROJECT="coreos/init"
CROS_WORKON_LOCALNAME="init"
EGIT_REPO_URI="https://github.com/coreos/init"
inherit cros-workon systemd
@ -50,5 +51,4 @@ src_install() {
systemd_enable_service default.target sshd.socket
systemd_enable_service default.target ssh-key-proc-cmdline.service
systemd_enable_service default.target docker.service
systemd_enable_service default.target tlsdate.service
}

View File

@ -3,6 +3,7 @@
# Distributed under the terms of the GNU General Public License v2
EAPI="4"
EGIT_REPO_URI="https://github.com/coreos/init"
CROS_WORKON_PROJECT="coreos/init"
CROS_WORKON_LOCALNAME="init"
@ -48,5 +49,4 @@ src_install() {
systemd_enable_service default.target sshd.socket
systemd_enable_service default.target ssh-key-proc-cmdline.service
systemd_enable_service default.target docker.service
systemd_enable_service default.target tlsdate.service
}

View File

@ -0,0 +1 @@
DIST tlsdate-0.0.6.1.tar.gz 237594 SHA256 882ba80c61ca010862e2a8e1de45f2031a6861ddb4085e9d18754be50b369cd0 SHA512 d5739237e632d2039e311e632e68e8233bb274863473b43e772101f19679c0d3848f33261956a0fcacf990eea2256f031de32995cfabc105b8ebdf7d0c9f5b06 WHIRLPOOL 72419f166c0193e54761fdaead5403de56066fb465934e0afec601a0184a3f5b04891d99681deb9d003a9e4548234afe0dedafaffa4bc92d141cf64f2ba7ffdc

View File

@ -0,0 +1,2 @@
#!/bin/sh
exec gawk -F, '{print gensub(/[[\]]/, "", "g", $2); exit}' "$1"/configure.ac

View File

@ -0,0 +1,8 @@
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
<!-- tlsdate-dbus owns the tlsdate service -->
<policy user="tlsdate-dbus">
<allow own="org.torproject.tlsdate"/>
</policy>
</busconfig>

View File

@ -0,0 +1,8 @@
# config file for /etc/init.d/tlsdate
# Command to execute to set the time.
# This are some common tlsdate options:
# -l: leap (set time regardless of difference)
# -H: hostname to sync with
# -x: proxy URL
TLSDATE_OPTS="-l -H www.google.com"

View File

@ -0,0 +1,17 @@
#!/sbin/runscript
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-misc/tlsdate/files/tlsdate.rc,v 1.1 2012/12/11 01:49:23 vapier Exp $
description="set time once when started"
depend() {
use net
}
start() {
: ${TLSDATE_CMD:=tlsdate}
ebegin "Setting clock via tlsdate '${TLSDATE_CMD}'"
"${TLSDATE_CMD}" ${TLSDATE_OPTS}
eend $? "Failed to set clock"
}

View File

@ -0,0 +1,7 @@
[Unit]
Description=Update local time over HTTPS
[Service]
# TODO: use api.core-os.net. Unfortunatly, tlsdate doesn't like it for some reason.
ExecStart=/usr/bin/tlsdated -v
WantedBy=default.target

View File

@ -0,0 +1,22 @@
base-path /var/cache/tlsdated
dry-run no
jitter 0
max-tries 10
min-steady-state-interval 86400
should-load-disk yes
should-netlink yes
should-save-disk yes
should-sync-hwclock yes
steady-state-interval 86400
subprocess-tries 10
subprocess-wait-between-tries 3
verbose yes
wait-between-tries 10
# Host configuration.
source
host clients3.google.com
port 443
proxy none
end

View File

@ -0,0 +1,15 @@
# config file for /etc/init.d/tlsdated
# Command to execute to set the time.
# This are some common tlsdate options:
# -l: leap (set time regardless of difference)
# -H: hostname to sync with
# -x: proxy URL
TLSDATED_CMD="/usr/bin/tlsdate -l -H www.google.com"
# Additional options; see `man tlsdated` for reference.
TLSDATED_OPTS=""
# Cache dir. Probably don't need to change this.
# It matches the compiled-in default.
TLSDATED_CACHE_DIR="/var/cache/tlsdated"

View File

@ -0,0 +1,19 @@
#!/sbin/runscript
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-misc/tlsdate/files/tlsdated.rc,v 1.1 2012/12/11 01:49:23 vapier Exp $
description="start a daemon to continuously set time via a helper"
command="tlsdated"
command_args="${TLSDATED_OPTS} -- ${TLSDATED_CMD}"
command_background="true"
pidfile="/var/run/${SVCNAME}.pid"
depend() {
use net
}
start_pre() {
checkpath -d -m 0700 "${TLSDATED_CACHE_DIR}"
}

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer>
<email>vapier@gentoo.org</email>
<description>feel free to fix things</description>
</maintainer>
</pkgmetadata>

View File

@ -0,0 +1,51 @@
# Copyright 2012 The Chromium OS Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="4"
CROS_WORKON_COMMIT="8dbe89e0e08d5e5adeb4f414e8f284dbf0c17b80"
CROS_WORKON_TREE="3d6b0d529e066591245a40e40731b7e2b20d3b5c"
CROS_WORKON_PROJECT="chromiumos/third_party/tlsdate"
inherit autotools flag-o-matic toolchain-funcs cros-workon systemd
DESCRIPTION="Update local time over HTTPS"
HOMEPAGE="https://github.com/ioerror/tlsdate"
LICENSE="BSD"
SLOT="0"
KEYWORDS="amd64 arm x86"
IUSE="+dbus"
DEPEND="dev-libs/openssl
dbus? ( sys-apps/dbus )"
RDEPEND="${DEPEND}"
src_prepare() {
eautoreconf
}
src_configure() {
# Our unprivileged group is called "tlsdate"
econf \
$(use_enable dbus) \
--with-unpriv-user=tlsdate \
--with-unpriv-group=tlsdate \
--with-dbus-user=tlsdate-dbus \
--with-dbus-group=tlsdate-dbus
}
src_compile() {
tc-export CC
emake CFLAGS="-Wall ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}"
}
src_install() {
default
insinto /etc/tlsdate
doins "${FILESDIR}/tlsdated.conf"
insinto /etc/dbus-1/system.d
doins "${FILESDIR}/org.torproject.tlsdate.conf"
systemd_dounit "${FILESDIR}/tlsdate.service"
systemd_enable_service default.target tlsdate.service
}

View File

@ -0,0 +1,50 @@
# Copyright 2012 The Chromium OS Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="4"
CROS_WORKON_PROJECT="chromiumos/third_party/tlsdate"
inherit autotools flag-o-matic toolchain-funcs cros-workon systemd
DESCRIPTION="Update local time over HTTPS"
HOMEPAGE="https://github.com/ioerror/tlsdate"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~arm ~x86"
IUSE="+dbus"
DEPEND="dev-libs/openssl
dbus? ( sys-apps/dbus )"
RDEPEND="${DEPEND}"
src_prepare() {
eautoreconf
}
src_configure() {
# Our unprivileged group is called "tlsdate"
econf \
$(use_enable dbus) \
--with-unpriv-user=tlsdate \
--with-unpriv-group=tlsdate \
--with-dbus-user=tlsdate-dbus \
--with-dbus-group=tlsdate-dbus
}
src_compile() {
tc-export CC
emake CFLAGS="-Wall ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}"
}
src_install() {
default
insinto /etc/tlsdate
doins "${FILESDIR}/tlsdated.conf"
insinto /etc/dbus-1/system.d
doins "${FILESDIR}/org.torproject.tlsdate.conf"
systemd_dounit "${FILESDIR}/tlsdate.service"
systemd_enable_service default.target tlsdate.service
}

View File

@ -10,3 +10,4 @@
# Use the 3.* series of syslinux, seems to work correctly with the
# chromeos build system for now
>=sys-boot/syslinux-3.90
>=net-misc/tlsdate-0.0.6