From 871aa3ec8c59a964940af18d3ec462c797482785 Mon Sep 17 00:00:00 2001 From: Bertrand Jacquin Date: Mon, 27 May 2013 22:36:39 +0200 Subject: Add formilux tools/init-scripts --- flx/init-ntp/Manifest | 5 ++ .../files/absolute-path-reuse-do-update.diff | 29 +++++++++ flx/init-ntp/files/indent.diff | 63 +++++++++++++++++++ flx/init-ntp/files/path.diff | 30 +++++++++ flx/init-ntp/files/remove-ntptimeset.diff | 71 ++++++++++++++++++++++ flx/init-ntp/init-ntp-4.2.ebuild | 27 ++++++++ 6 files changed, 225 insertions(+) create mode 100644 flx/init-ntp/Manifest create mode 100644 flx/init-ntp/files/absolute-path-reuse-do-update.diff create mode 100644 flx/init-ntp/files/indent.diff create mode 100644 flx/init-ntp/files/path.diff create mode 100644 flx/init-ntp/files/remove-ntptimeset.diff create mode 100644 flx/init-ntp/init-ntp-4.2.ebuild (limited to 'flx/init-ntp') diff --git a/flx/init-ntp/Manifest b/flx/init-ntp/Manifest new file mode 100644 index 00000000..eddcae6b --- /dev/null +++ b/flx/init-ntp/Manifest @@ -0,0 +1,5 @@ +AUX absolute-path-reuse-do-update.diff 927 SHA256 8a8e7f3f8a1bf677bb51bdb8a15da389d117608c4fc4ff8ffd765591b9eab7d8 SHA512 b3a9e19f8755c2931c6a01cd8079e6105ad4e33fa7d64a4f5f2e0a5002fa27b89d2744af47a9e8f45a8dab265332642508f6c37571ce789a2554cc26b3c7a0f7 WHIRLPOOL 9aba493c006c9b096b5d9934a788372d048fcc395a680368f042c2298c3ec6cec02710dee5e2fcbc5dbb87bb593c51b92a2a1d2552dbd3c52c09cc6bf5d95905 +AUX indent.diff 2048 SHA256 b351deca5737c5618b2149da2051bce284e43217d9812de62348927f600985fb SHA512 38654f7a94d24796910f7d5524dafcdd5619eeee6161847b9a684d1e93447cdacb17c8153fa414e70f97082c56c4a25289acbede5fc71c6b46147cf6e6c492f4 WHIRLPOOL 9bd3bfbef98612ddc2f1d3b7f4614cb48bb9f1d72102d6fba2e84ff8bd992aed8d728276c72b2bf51070a8a747c9811eac668c98202d6eaa2e95b1b8217c8fdb +AUX path.diff 1337 SHA256 7753a9eb741fab1116b19f7e1d0e3fd05007ed12c5e868ba45942ea74b8c9498 SHA512 9fb4208a26ee92794b095fc28092fd29d0c6f20396f620855ebecd288e216fb52143021cec98eb8840ac0c03a077635d65aebf1849c394653bb3e5e715547214 WHIRLPOOL 3038064ccf5f4c875ef913624aaf9898b307ccd9f3fdbf8fe1adabb1b0735324bfa04f3a36a6648876d5f31903a7400541c0ad413ef9c68a8013f7269d00c8b2 +AUX remove-ntptimeset.diff 2322 SHA256 30c723b919d7884c05c1fa9fc34bd0a0265d81f8d0f1075a9e823df39a108e90 SHA512 2daa219f29d3b55734a5613e99618752e198d3069e3e7444b10d281abd22f546d590f8f39f401156a786abf81f2ef9d861baf9f8307c5303597c9499e5bb62c0 WHIRLPOOL 3490668064a165f795c2ecc624ca80c65c8c48d693ab9078778aa9c05293951826f2356e3d05e4fb8a611d597b2ca8cbc8b4a587c50d99e1b4ae41161526acd6 +EBUILD init-ntp-4.2.ebuild 622 SHA256 88853de9461141f703a5ef3956eace740559cd37f3fbc09c3ff1151273585232 SHA512 10edd510ce62b60de3552f3084750fb2186f2030796432c476a2c806b0f28159312adf532f34d50611e203412392407a47d575d38e3a0b333355e897b4ce324e WHIRLPOOL 3892704b9926c46c37ddc74c7a53f15ff4dea9f1d1baaa68bc76890ca916afd213beb365c1cdcf95403bba46456c8ef93a63b9bf3fca520bcf980a42ed49a424 diff --git a/flx/init-ntp/files/absolute-path-reuse-do-update.diff b/flx/init-ntp/files/absolute-path-reuse-do-update.diff new file mode 100644 index 00000000..ff8d1211 --- /dev/null +++ b/flx/init-ntp/files/absolute-path-reuse-do-update.diff @@ -0,0 +1,29 @@ +diff --git a/add-ons/ntp b/add-ons/ntp +index 73554be..81ddabd 100644 +--- a/add-ons/ntp ++++ b/add-ons/ntp +@@ -47,12 +47,9 @@ function fct_pre_start { + mkdir -p ${driftfile%/*} + fi + +- if [ "$opt_force_sync" = "1" ]; then +- echo " Using ntpdate to sync with server(s) ${opt_sync_servers[*]}..." +- if ! /usr/bin/ntpdate ${opt_unpriv_port:+-u} -t 2 ${opt_sync_servers[*]}; then +- echo " --> sync failed, starting unsynced." +- fi +- fi ++ [ "$opt_force_sync" = "1" ] \ ++ && do_update ++ + return 0 + } + +@@ -61,7 +58,7 @@ function do_update { + local synced=0 + + echo " Using ntpdate to sync with server(s) ${opt_sync_servers[*]}..." +- if /usr/bin/ntpdate ${opt_unpriv_port:+-u} -t 2 ${opt_sync_servers[*]}; then ++ if ntpdate ${opt_unpriv_port:+-u} -t 2 ${opt_sync_servers[*]}; then + synced=1 + else + echo " --> sync failed. Aborting." diff --git a/flx/init-ntp/files/indent.diff b/flx/init-ntp/files/indent.diff new file mode 100644 index 00000000..f6fb5e90 --- /dev/null +++ b/flx/init-ntp/files/indent.diff @@ -0,0 +1,63 @@ +diff --git a/add-ons/ntp b/add-ons/ntp +index 9777a3b..73554be 100644 +--- a/add-ons/ntp ++++ b/add-ons/ntp +@@ -26,15 +26,15 @@ function do_help { + echo " - unpriv_port : boolean ; def=1 ; cur=$opt_unpriv_port" + echo " - sync_servers : IP list ; def= ; cur='${opt_sync_servers[@]}'" + echo +- exit 1 ++ exit 1 + } + + # assign values after all the options have been read + function fct_end_section { + if [ -z "$opt_sync_servers" ]; then +- valueof $opt_config server > /dev/null +- opt_sync_servers=( $REPLY ) +- opt_sync_servers=( ${opt_sync_servers[@]##127.*} ) ++ valueof $opt_config server > /dev/null ++ opt_sync_servers=( $REPLY ) ++ opt_sync_servers=( ${opt_sync_servers[@]##127.*} ) + fi + } + +@@ -48,10 +48,10 @@ function fct_pre_start { + fi + + if [ "$opt_force_sync" = "1" ]; then +- echo " Using ntpdate to sync with server(s) ${opt_sync_servers[*]}..." +- if ! /usr/bin/ntpdate ${opt_unpriv_port:+-u} -t 2 ${opt_sync_servers[*]}; then +- echo " --> sync failed, starting unsynced." +- fi ++ echo " Using ntpdate to sync with server(s) ${opt_sync_servers[*]}..." ++ if ! /usr/bin/ntpdate ${opt_unpriv_port:+-u} -t 2 ${opt_sync_servers[*]}; then ++ echo " --> sync failed, starting unsynced." ++ fi + fi + return 0 + } +@@ -60,12 +60,12 @@ function fct_pre_start { + function do_update { + local synced=0 + +- echo " Using ntpdate to sync with server(s) ${opt_sync_servers[*]}..." +- if /usr/bin/ntpdate ${opt_unpriv_port:+-u} -t 2 ${opt_sync_servers[*]}; then +- synced=1 +- else +- echo " --> sync failed. Aborting." +- fi ++ echo " Using ntpdate to sync with server(s) ${opt_sync_servers[*]}..." ++ if /usr/bin/ntpdate ${opt_unpriv_port:+-u} -t 2 ${opt_sync_servers[*]}; then ++ synced=1 ++ else ++ echo " --> sync failed. Aborting." ++ fi + + test $synced -eq 1 + return $? +@@ -76,4 +76,3 @@ function do_query { + } + + load_config +- diff --git a/flx/init-ntp/files/path.diff b/flx/init-ntp/files/path.diff new file mode 100644 index 00000000..6517aa86 --- /dev/null +++ b/flx/init-ntp/files/path.diff @@ -0,0 +1,30 @@ +diff --git a/add-ons/ntp b/add-ons/ntp +index 384e845..1db7311 100644 +--- a/add-ons/ntp ++++ b/add-ons/ntp +@@ -2,8 +2,7 @@ + + . `dirname $0`/functions + +-option config standard_option /etc/ntp/ntp.conf +-option keys standard_option /etc/ntp/ntp.keys ++option config standard_option /etc/ntp.conf + option pidfile reserved_option /var/run/ntp.pid + option hard_sync boolean_option # not used anymore + option min_servers standard_option 1 +@@ -13,14 +12,13 @@ option sync_servers long_option + + option procname reserved_option ntpd + option bin reserved_option /usr/sbin/ntpd +-option cmdline reserved_option '$bin -c $opt_config -p $pidfile -k $opt_keys' ++option cmdline reserved_option '$bin -c $opt_config -p $pidfile' + + function do_help { + echo "Usage: ${0##*/} " + echo "List of config.rc options (name, type, default value, current value) :" + echo + echo " - config : file ; def='/etc/ntp/ntp.conf' ; cur=$opt_config" +- echo " - keys : file ; def='/etc/ntp/ntp.keys' ; cur=$opt_keys" + echo " - min_servers : integer ; def=1 ; cur=$opt_min_servers" + echo " - force_sync : boolean ; def=0 ; cur=$opt_force_sync" + echo " - unpriv_port : boolean ; def=1 ; cur=$opt_unpriv_port" diff --git a/flx/init-ntp/files/remove-ntptimeset.diff b/flx/init-ntp/files/remove-ntptimeset.diff new file mode 100644 index 00000000..836611cd --- /dev/null +++ b/flx/init-ntp/files/remove-ntptimeset.diff @@ -0,0 +1,71 @@ +diff --git a/add-ons/ntp b/add-ons/ntp +index f6b1990..9777a3b 100644 +--- a/add-ons/ntp ++++ b/add-ons/ntp +@@ -41,35 +41,17 @@ function fct_end_section { + # perform a forced synchronisation before starting the daemon + function fct_pre_start { + local driftfile +- local synced=0 + + valueof $opt_config driftfile > /dev/null 2>&1 ; driftfile=$REPLY + if [ -n "$driftfile" -a ! -e "${driftfile%/*}" ] ; then + mkdir -p ${driftfile%/*} + fi +- if [ "$opt_force_sync" = "1" ]; then +- if [ -x /usr/bin/ntptimeset ]; then +- echo " Using ntptimeset to sync with servers..." +- if /usr/bin/ntptimeset -l -s -c $opt_config -S $opt_min_servers \ +- -V $opt_min_servers -t 5 ${opt_unpriv_port:+-u}; then +- synced=1 +- else +- echo " --> sync failed." +- fi +- fi + +- if [ $synced -eq 0 ]; then +- if [ -z "$opt_sync_servers" ]; then +- echo " --> sync_servers not set, and ntptimeset not installed. Not forcing sync." +- else ++ if [ "$opt_force_sync" = "1" ]; then + echo " Using ntpdate to sync with server(s) ${opt_sync_servers[*]}..." +- if /usr/bin/ntpdate ${opt_unpriv_port:+-u} -t 2 ${opt_sync_servers[*]}; then +- synced=1 +- else ++ if ! /usr/bin/ntpdate ${opt_unpriv_port:+-u} -t 2 ${opt_sync_servers[*]}; then + echo " --> sync failed, starting unsynced." + fi +- fi +- fi + fi + return 0 + } +@@ -77,28 +59,13 @@ function fct_pre_start { + # execute a forced resynchronisation to sync servers + function do_update { + local synced=0 +- if [ -x /usr/bin/ntptimeset ]; then +- echo " Using ntptimeset to sync with servers..." +- if /usr/bin/ntptimeset -l -s -c $opt_config -S $opt_min_servers \ +- -V $opt_min_servers -t 5 ${opt_unpriv_port:+-u}; then +- synced=1 +- else +- echo " --> sync failed." +- fi +- fi + +- if [ $synced -eq 0 ]; then +- if [ -z "$opt_sync_servers" ]; then +- echo " --> sync_servers not set, and ntptimeset not installed. Aborting." +- else + echo " Using ntpdate to sync with server(s) ${opt_sync_servers[*]}..." + if /usr/bin/ntpdate ${opt_unpriv_port:+-u} -t 2 ${opt_sync_servers[*]}; then + synced=1 + else + echo " --> sync failed. Aborting." + fi +- fi +- fi + + test $synced -eq 1 + return $? diff --git a/flx/init-ntp/init-ntp-4.2.ebuild b/flx/init-ntp/init-ntp-4.2.ebuild new file mode 100644 index 00000000..adf1595a --- /dev/null +++ b/flx/init-ntp/init-ntp-4.2.ebuild @@ -0,0 +1,27 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI=4 +inherit git-2 flx eutils + +#SDIR="people/beber" + +HOMEPAGE="http://master.formilux.org/git/dist/pkg/ntp.git" +EGIT_REPO_URI="http://master.formilux.org/git/${SDIR}/pkg/${SVCNAME}.git" +EGIT_BRANCH="4.2-flx0" +EGIT_COMMIT="v4.2.4p4-flx0.1" + +KEYWORDS="amd64 x86" +IUSE="" + +DEPEND="" +RDEPEND=">=net-misc/ntp-${PV}" + +src_prepare () +{ + epatch "${FILESDIR}"/remove-ntptimeset.diff + epatch "${FILESDIR}"/indent.diff + epatch "${FILESDIR}"/absolute-path-reuse-do-update.diff + epatch "${FILESDIR}"/path.diff +} -- cgit v1.2.3