[gentoo-commits] repo/gentoo:master commit in: net-misc/omnisync/files/, net-misc/omnisync/

2018-06-14 Thread Brian Evans
commit: 06cbece7cf78f7cf9589ee01b2dd862fd47d833c
Author: Brian Evans  gentoo  org>
AuthorDate: Fri Jun 15 01:47:22 2018 +
Commit: Brian Evans  gentoo  org>
CommitDate: Fri Jun 15 01:47:22 2018 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=06cbece7

net-misc/omnisync: Add new snapshot release

This snapshot incorporates Robin Johnson's (robbat2) patches.

A real configuration with cmake now exists.

Also, a move to GnuTLS to fill memory leaks due to improper use of OpenSSL,
and poorly documented on how to call it so a connecting client does not leak.

Package-Manager: Portage-2.3.40, Repoman-2.3.9

 net-misc/omnisync/Manifest |  1 +
 .../omnisync/files/omnisync-1.0-openssl11.patch| 24 +++
 net-misc/omnisync/omnisync-1.0-r1.ebuild   |  1 +
 ...1.0-r1.ebuild => omnisync-1.0_p20180614.ebuild} | 27 ++
 4 files changed, 33 insertions(+), 20 deletions(-)

diff --git a/net-misc/omnisync/Manifest b/net-misc/omnisync/Manifest
index 176a959130c..cae6a303707 100644
--- a/net-misc/omnisync/Manifest
+++ b/net-misc/omnisync/Manifest
@@ -1 +1,2 @@
 DIST omnisync-1.0.tgz 27725 BLAKE2B 
00e546e3a04c8483f4a3995207fe6715e25526ca639f517220725c31d50d1c01fe0d15927e11e84143f3b2c8aa80ede1317c818945f0249147548bb03d27f744
 SHA512 
742ffc0a85bd923b99ae7e4f50a6aaa29107eaa987039e902797c78a9673e914e1fa61b2484c6777f62b0caf8b3110a071fd103c8b18456083883df534a1ef4d
+DIST omnisync-1.0_p20180614.tar.bz2 26335 BLAKE2B 
fbb6e4d39f16e307b5355c1e25c656bfdd3b280888468e64bed692c52af28b35d813e3e5a19c6dd4c13bfa8c64b62f01826bdb8a4a40f358cc665e5050ccfbf1
 SHA512 
fd21907574abe9801999efa8dae6e19e80198536cd79a1261cd2c006b7beaa3637f5b9da578659baa9e14eca1756fa41551458f14bad44f9636d76634031f262

diff --git a/net-misc/omnisync/files/omnisync-1.0-openssl11.patch 
b/net-misc/omnisync/files/omnisync-1.0-openssl11.patch
new file mode 100644
index 000..8c0d9c24333
--- /dev/null
+++ b/net-misc/omnisync/files/omnisync-1.0-openssl11.patch
@@ -0,0 +1,24 @@
+diff -aurN a/mssl.c b/mssl.c
+--- a/mssl.c   2009-01-02 04:03:20.0 -0500
 b/mssl.c   2018-06-01 20:59:26.447052020 -0400
+@@ -136,14 +136,20 @@
+   if (!bio_err)
+   {
+   SSL_library_init();
++#if OPENSSL_API_COMPAT < 0x1010L
+   SSL_load_error_strings();
++#endif
+ 
+   /* error write context */
+   bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
+   }
+ 
+   /* create context */
++#if OPENSSL_API_COMPAT < 0x1010L
+   meth = SSLv23_method();
++#else
++  meth = TLS_method();
++#endif
+ 
+   return SSL_CTX_new(meth);
+ }

diff --git a/net-misc/omnisync/omnisync-1.0-r1.ebuild 
b/net-misc/omnisync/omnisync-1.0-r1.ebuild
index 5875550ac80..d82752e6f70 100644
--- a/net-misc/omnisync/omnisync-1.0-r1.ebuild
+++ b/net-misc/omnisync/omnisync-1.0-r1.ebuild
@@ -21,6 +21,7 @@ PATCHES=(
"${FILESDIR}"/omnisync-1.0-help.patch
"${FILESDIR}"/omnisync-1.0-maxshm.patch
"${FILESDIR}"/omnisync-1.0-statfile.patch
+   "${FILESDIR}"/omnisync-1.0-openssl11.patch
 )
 
 src_prepare() {

diff --git a/net-misc/omnisync/omnisync-1.0-r1.ebuild 
b/net-misc/omnisync/omnisync-1.0_p20180614.ebuild
similarity index 58%
copy from net-misc/omnisync/omnisync-1.0-r1.ebuild
copy to net-misc/omnisync/omnisync-1.0_p20180614.ebuild
index 5875550ac80..c074a15980d 100644
--- a/net-misc/omnisync/omnisync-1.0-r1.ebuild
+++ b/net-misc/omnisync/omnisync-1.0_p20180614.ebuild
@@ -3,38 +3,25 @@
 
 EAPI=6
 
-inherit toolchain-funcs
+inherit cmake-utils vcs-snapshot
+
+SNAPSHOT="b3a759af454552f4bbd3b1e097b41bd0d1d7fcf5"
 
 DESCRIPTION="A driver for NTPd for people who are firewall-challenged"
 HOMEPAGE="https://www.vanheusden.com/time/omnisync;
 LICENSE="GPL-2"
-SRC_URI="https://www.vanheusden.com/time/${PN}/${P}.tgz;
+SRC_URI="https://gitlab.com/grknight/omnisync/-/archive/${SNAPSHOT}/omnisync-${SNAPSHOT}.tar.bz2
 -> ${P}.tar.bz2"
 
 SLOT="0"
 KEYWORDS="~amd64 ~x86"
-IUSE="debug"
+IUSE=""
 
-RDEPEND="dev-libs/openssl:0= net-analyzer/net-snmp:="
+RDEPEND="net-libs/gnutls:= net-analyzer/net-snmp:="
 DEPEND="${RDEPEND}"
 DOCS=( readme.txt Changes )
-PATCHES=(
-   "${FILESDIR}"/omnisync-1.0-help.patch
-   "${FILESDIR}"/omnisync-1.0-maxshm.patch
-   "${FILESDIR}"/omnisync-1.0-statfile.patch
-)
-
-src_prepare() {
-   default
-   tc-export CC
-   sed -i \
-   -e 's/-O2 -Wall/-Wall/' \
-   -e 's/-lsnmp/-lnetsnmp/' \
-   "${S%/}/Makefile" || die
-   use debug ||  sed -i -e 's/$(DEBUG)//' "${S%/}/Makefile" || die
-}
 
 src_install() {
-   dosbin omnisync
+   cmake-utils_src_install
newinitd "${FILESDIR%/}/${PN}.initd" ${PN}
newconfd "${FILESDIR%/}/${PN}.confd" ${PN}
einstalldocs



[gentoo-commits] repo/gentoo:master commit in: net-misc/omnisync/files/, net-misc/omnisync/

2018-06-01 Thread Robin H. Johnson
commit: 47d734b5d4acb322b1db5b57a45e59c936380b06
Author: Robin H. Johnson  gentoo  org>
AuthorDate: Fri Jun  1 21:48:45 2018 +
Commit: Robin H. Johnson  gentoo  org>
CommitDate: Fri Jun  1 21:51:46 2018 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=47d734b5

net-misc/omnisync: fix bugs, allow multiple instances

Code bugs:
- Fix --help display
- Raise SHM unit limit
- getopt loop failed to apply stats_file setting.

Init improvement:
- allow multiple instances.
- write pidfile
- declare that we use DNS (in case it starts before local resolver)

Signed-off-by: Robin H. Johnson  gentoo.org>
Package-Manager: Portage-2.3.33, Repoman-2.3.9

 net-misc/omnisync/files/omnisync-1.0-help.patch| 16 
 net-misc/omnisync/files/omnisync-1.0-maxshm.patch  | 18 
 .../omnisync/files/omnisync-1.0-statfile.patch | 18 
 net-misc/omnisync/files/omnisync.initd | 11 -
 net-misc/omnisync/omnisync-1.0-r1.ebuild   | 48 ++
 5 files changed, 109 insertions(+), 2 deletions(-)

diff --git a/net-misc/omnisync/files/omnisync-1.0-help.patch 
b/net-misc/omnisync/files/omnisync-1.0-help.patch
new file mode 100644
index 000..47ff5201c03
--- /dev/null
+++ b/net-misc/omnisync/files/omnisync-1.0-help.patch
@@ -0,0 +1,16 @@
+main: fix help missing newline
+
+Signed-off-by: Robin H. Johnson 
+
+diff -Nuar --exclude '*~' omnisync-1.0.orig/main.c omnisync-1.0/main.c
+--- omnisync-1.0.orig/main.c   2009-01-02 01:03:20.0 -0800
 omnisync-1.0/main.c2018-06-01 14:31:25.720686155 -0700
+@@ -139,7 +139,7 @@
+   printf("-c x   community (snmp only)\n");
+   printf("-h x   host to connect to\n");
+   printf("-u x   ntpd shared memory unit\n");
+-  printf("-z x   do an initial step, to speed up syncing, parameter is 
number of samples");
++  printf("-z x   do an initial step, to speed up syncing, parameter is 
number of samples\n");
+   printf("-S x   write measurements to file x\n");
+   printf("-n do NOT submit to NTPd/set clock, query only (use in 
combination with -v and -f)\n");
+   printf("-f do not fork\n");

diff --git a/net-misc/omnisync/files/omnisync-1.0-maxshm.patch 
b/net-misc/omnisync/files/omnisync-1.0-maxshm.patch
new file mode 100644
index 000..678c6e0072d
--- /dev/null
+++ b/net-misc/omnisync/files/omnisync-1.0-maxshm.patch
@@ -0,0 +1,18 @@
+main: raise SHM unit limit
+
+Signed-off-by: Robin H. Johnson 
+
+diff -Nuar --exclude '*~' omnisync-1.0.orig/main.c omnisync-1.0/main.c
+--- omnisync-1.0.orig/main.c   2009-01-02 01:03:20.0 -0800
 omnisync-1.0/main.c2018-06-01 14:32:34.630066839 -0700
+@@ -346,8 +346,8 @@
+   unit_nr = atoi(optarg);
+   if (unit_nr < 0)
+   error_exit("-u requires a positive 
value\n");
+-  if (unit_nr > 3)
+-  error_exit("NTPd normally supports only 
4 shared memory devices, still continuing though\n");
++  if (unit_nr > 254)
++  error_exit("NTPd normally supports only 
254 shared memory devices\n");
+   break;
+ 
+   case 'v':

diff --git a/net-misc/omnisync/files/omnisync-1.0-statfile.patch 
b/net-misc/omnisync/files/omnisync-1.0-statfile.patch
new file mode 100644
index 000..972316a33bd
--- /dev/null
+++ b/net-misc/omnisync/files/omnisync-1.0-statfile.patch
@@ -0,0 +1,18 @@
+main: wire up stats_file variable
+
+Signed-off-by: Robin H. Johnson 
+
+diff -Nuar --exclude '*~' omnisync-1.0.orig/main.c omnisync-1.0/main.c
+--- omnisync-1.0.orig/main.c   2009-01-02 01:03:20.0 -0800
 omnisync-1.0/main.c2018-06-01 14:39:22.115229735 -0700
+@@ -358,6 +358,10 @@
+   version();
+   return 0;
+ 
++  case 'S':
++  stats_file = optarg;
++  break;
++
+   default:
+   help();
+   return 1;

diff --git a/net-misc/omnisync/files/omnisync.initd 
b/net-misc/omnisync/files/omnisync.initd
index 7820af6e94e..c71e63d4d3e 100644
--- a/net-misc/omnisync/files/omnisync.initd
+++ b/net-misc/omnisync/files/omnisync.initd
@@ -3,11 +3,18 @@
 # Distributed under the terms of the GNU General Public License v2
 
 depend() {
-   use net
+   use net dns
 }
 
+INSTANCE=${SVCNAME#*.}
+if [ -n "${INSTANCE}" ] && [ ${SVCNAME} != "omnisync" ]; then
+pidfile="/var/run/omnisync.${INSTANCE}.pid"
+else
+pidfile="/var/run/omnisync.pid"
+fi
+
 command="/usr/sbin/omnisync"
-command_args="-M ${OMNISYNC_MODE} ${OMNISYNC_ARGS}"
+command_args="-P ${pidfile} -M ${OMNISYNC_MODE} ${OMNISYNC_ARGS}"
 
 start_pre() {
if [ -z "${OMNISYNC_MODE}" ] 

[gentoo-commits] repo/gentoo:master commit in: net-misc/omnisync/files/, net-misc/omnisync/

2018-06-01 Thread Brian Evans
commit: 6eb170217d70df674dccf0973f6d933c8e88305a
Author: Brian Evans  gentoo  org>
AuthorDate: Fri Jun  1 19:10:14 2018 +
Commit: Brian Evans  gentoo  org>
CommitDate: Fri Jun  1 19:10:14 2018 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6eb17021

net-misc/omnisync: New package

Driver for NTPd for people who are firewall-challenged

Package-Manager: Portage-2.3.40, Repoman-2.3.9

 net-misc/omnisync/Manifest |  1 +
 net-misc/omnisync/files/omnisync.confd | 21 ++
 net-misc/omnisync/files/omnisync.initd | 20 +
 net-misc/omnisync/metadata.xml |  8 +++
 net-misc/omnisync/omnisync-1.0.ebuild  | 40 ++
 5 files changed, 90 insertions(+)

diff --git a/net-misc/omnisync/Manifest b/net-misc/omnisync/Manifest
new file mode 100644
index 000..176a959130c
--- /dev/null
+++ b/net-misc/omnisync/Manifest
@@ -0,0 +1 @@
+DIST omnisync-1.0.tgz 27725 BLAKE2B 
00e546e3a04c8483f4a3995207fe6715e25526ca639f517220725c31d50d1c01fe0d15927e11e84143f3b2c8aa80ede1317c818945f0249147548bb03d27f744
 SHA512 
742ffc0a85bd923b99ae7e4f50a6aaa29107eaa987039e902797c78a9673e914e1fa61b2484c6777f62b0caf8b3110a071fd103c8b18456083883df534a1ef4d

diff --git a/net-misc/omnisync/files/omnisync.confd 
b/net-misc/omnisync/files/omnisync.confd
new file mode 100644
index 000..c2ab3cc58f0
--- /dev/null
+++ b/net-misc/omnisync/files/omnisync.confd
@@ -0,0 +1,21 @@
+# REQUIRED, must be one of time/tcp time/udp daytime/tcp daytime/udp http https
+# snts irc icmp icmp snmp simpleptpl socks5sntp sntp
+OMNISYNC_MODE=""
+
+# Options to add
+# -F x   fudge factor (default: 0.00)  
  -m x   max. offset 
(default: 7200.00)
+# -p x   proxy-server (http/https/socks5sntp only)
+# -B x   bind to interface x (not for snmp)
+# -I x   username[:password] (irc/socks5 auth. only)
+# -c x   community (snmp only)
+# -h x   host to connect to
+# -u x   ntpd shared memory unit
+# -z x   do an initial step, to speed up syncing, parameter is number of 
samples-S x   write measurements to file x
+# -n do NOT submit to NTPd/set clock, query only (use in combination with 
-v and -f)
+# -f do not fork
+# -i x   check interval (default: 60)
+# -d x   timeout
+# -U x   set user to run as
+# -P x   write pid to file x
+# -v increase verbosity
+OMNISYNC_ARGS=""

diff --git a/net-misc/omnisync/files/omnisync.initd 
b/net-misc/omnisync/files/omnisync.initd
new file mode 100644
index 000..7820af6e94e
--- /dev/null
+++ b/net-misc/omnisync/files/omnisync.initd
@@ -0,0 +1,20 @@
+#!/sbin/openrc-run
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+   use net
+}
+
+command="/usr/sbin/omnisync"
+command_args="-M ${OMNISYNC_MODE} ${OMNISYNC_ARGS}"
+
+start_pre() {
+   if [ -z "${OMNISYNC_MODE}" ] ; then
+   eerror 'Configuration incomplete! OMNISYNC_MODE not set'
+   return 1
+   fi
+   return 0
+}
+
+# vim: filetype=gentoo-init-d sw=2 ts=2 sts=2 noet:

diff --git a/net-misc/omnisync/metadata.xml b/net-misc/omnisync/metadata.xml
new file mode 100644
index 000..b651dc535e3
--- /dev/null
+++ b/net-misc/omnisync/metadata.xml
@@ -0,0 +1,8 @@
+
+http://www.gentoo.org/dtd/metadata.dtd;>
+
+
+   grkni...@gentoo.org
+   Brian Evans
+
+

diff --git a/net-misc/omnisync/omnisync-1.0.ebuild 
b/net-misc/omnisync/omnisync-1.0.ebuild
new file mode 100644
index 000..6c0ff7635dc
--- /dev/null
+++ b/net-misc/omnisync/omnisync-1.0.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit toolchain-funcs
+
+DESCRIPTION="A driver for NTPd for people who are firewall-challenged"
+HOMEPAGE="https://www.vanheusden.com/time/omnisync;
+LICENSE="GPL-2"
+SRC_URI="https://www.vanheusden.com/time/${PN}/${P}.tgz;
+
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug"
+
+RDEPEND="dev-libs/openssl:0= net-analyzer/net-snmp:="
+DEPEND="${RDEPEND}"
+DOCS=( readme.txt Changes )
+
+src_prepare() {
+   default
+   tc-export CC
+   sed -i -e 's/-O2 -Wall/-Wall/' -e 's/-lsnmp/-lnetsnmp/' 
"${S%/}/Makefile" || die
+   use debug ||  sed -i -e 's/$(DEBUG)//' "${S%/}/Makefile" || die
+}
+
+src_install() {
+   dosbin omnisync
+   newinitd "${FILESDIR%/}/${PN}.initd" ${PN}
+   newconfd "${FILESDIR%/}/${PN}.confd" ${PN}
+   einstalldocs
+}
+
+pkg_postinst() {
+   local isConfigured=$(grep 'OMNISYNC_MODE=""' 
"${ROOT%/}/etc/conf.d/${PN}")
+   if [[ -n "${isConfigured}" ]] ; then
+   elog "Be sure to configure ${PN} in ${ROOT%/}/etc/conf.d before 
trying to start the service"
+   fi
+}