OpenPKG CVS Repository
  http://cvs.openpkg.org/
  ____________________________________________________________________________

  Server: cvs.openpkg.org                  Name:   Ralf S. Engelschall
  Root:   /v/openpkg/cvs                   Email:  [EMAIL PROTECTED]
  Module: openpkg-src                      Date:   18-Nov-2008 22:18:18
  Branch: HEAD                             Handle: 2008111821181701

  Added files:
    openpkg-src/omnisync    omnisync.patch omnisync.spec rc.omnisync

  Log:
    new package: omnisync 0.9 (Network Time Protocol (NTP) Alternative
    Backend Driver)

  Summary:
    Revision    Changes     Path
    1.1         +51 -0      openpkg-src/omnisync/omnisync.patch
    1.1         +117 -0     openpkg-src/omnisync/omnisync.spec
    1.1         +54 -0      openpkg-src/omnisync/rc.omnisync
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-src/omnisync/omnisync.patch
  ============================================================================
  $ cvs diff -u -r0 -r1.1 omnisync.patch
  --- /dev/null 2008-11-18 22:17:39 +0100
  +++ omnisync.patch    2008-11-18 22:18:18 +0100
  @@ -0,0 +1,51 @@
  +Index: Makefile
  +--- Makefile.orig    2008-11-17 22:41:34 +0100
  ++++ Makefile 2008-11-18 22:05:09 +0100
  +@@ -1,15 +1,20 @@
  + VERSION=0.9
  + 
  +-DEBUG=-g -pedantic #-pg #-fprofile-arcs
  +-LDFLAGS=-lssl -lcrypto -lm -lsnmp $(DEBUG)
  +-CFLAGS+=-O2 -Wall -DVERSION=\"$(VERSION)\" $(DEBUG)
  ++CC=gcc
  ++CFLAGS=
  ++CPPFLAGS=-DVERSION=\"$(VERSION)\"
  ++LDFLAGS=
  ++LIBS=-lnetsnmp -lssl -lcrypto -lm
  + 
  + OBJS=error.o log.o utils.o utils2.o daytime.o time.o mssl.o http.o snts.o 
irc.o icmp.o ntpd.o snmp.o simpleptp.o socks5sntp.o main.o
  + 
  + all: omnisync
  + 
  ++.c.o:
  ++    $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $<
  ++
  + omnisync: $(OBJS)
  +-    $(CC) -Wall $(OBJS) $(LDFLAGS) -o omnisync
  ++    $(CC) $(LDFLAGS) $(OBJS) -o omnisync $(LIBS)
  + 
  + install: omnisync
  +     cp omnisync $(DESTDIR)/usr/local/sbin
  +Index: icmp.c
  +--- icmp.c.orig      2008-11-17 22:41:34 +0100
  ++++ icmp.c   2008-11-18 22:05:09 +0100
  +@@ -48,6 +48,7 @@
  + #include <sys/types.h>
  + #include <sys/socket.h>
  + #include <arpa/inet.h>
  ++#include <netinet/in.h>
  + #include <netinet/in_systm.h>
  + #include <netinet/ip.h>
  + #include <netinet/ip_icmp.h>
  +Index: time.c
  +--- time.c.orig      2008-11-17 22:41:34 +0100
  ++++ time.c   2008-11-18 22:05:33 +0100
  +@@ -17,7 +17,7 @@
  +             (in[1] << 16) +
  +             (in[2] <<  8) +
  +             (in[3]      );
  +-    epoch -= 2208988800; /* 'time' returns seconds since january 1, 1900 
00:00  */
  ++    epoch -= 2208988800UL; /* 'time' returns seconds since january 1, 1900 
00:00  */
  + 
  +     return (double)epoch;
  + }
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/omnisync/omnisync.spec
  ============================================================================
  $ cvs diff -u -r0 -r1.1 omnisync.spec
  --- /dev/null 2008-11-18 22:17:39 +0100
  +++ omnisync.spec     2008-11-18 22:18:18 +0100
  @@ -0,0 +1,117 @@
  +##
  +##  omnisync.spec -- OpenPKG RPM Package Specification
  +##  Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/>
  +##
  +##  Permission to use, copy, modify, and distribute this software for
  +##  any purpose with or without fee is hereby granted, provided that
  +##  the above copyright notice and this permission notice appear in all
  +##  copies.
  +##
  +##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  +##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  +##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  +##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  +##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  +##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  +##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  +##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  +##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  +##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  +##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  +##  SUCH DAMAGE.
  +##
  +
  +#   package information
  +Name:         omnisync
  +Summary:      Network Time Protocol (NTP) Alternative Backend Driver
  +URL:          http://www.vanheusden.com/time/omnisync/
  +Vendor:       Vanheusden
  +Packager:     OpenPKG Foundation e.V.
  +Distribution: OpenPKG Community
  +Class:        EVAL
  +Group:        Network
  +License:      Open Source
  +Version:      0.9
  +Release:      20081118
  +
  +#   list of sources
  +Source0:      http://www.vanheusden.com/time/omnisync/omnisync-%{version}.tgz
  +Source1:      rc.omnisync
  +Patch0:       omnisync.patch
  +
  +#   build information
  +Prefix:       %{l_prefix}
  +BuildRoot:    %{l_buildroot}
  +BuildPreReq:  OpenPKG, openpkg >= 20060823, make, gcc
  +PreReq:       OpenPKG, openpkg >= 20060823
  +AutoReq:      no
  +AutoReqProv:  no
  +
  +%description
  +    OmniSync is a driver for NTPd for situations where the NTP protocol
  +    cannot be spoken directly, i.e., it enables systems to sync time
  +    when port 123 (UDP) is blocked. It allows you to sync against the
  +    daytime service (port 13 tcp/udp), time (port 37 tcp/udp), SNTS,
  +    ICMP, SNMP, precision time protocol (PTP - IEEE 1588), (S)NTP via a
  +    socks5 proxy server, http and https (both also via proxy server).
  +    It doesn't directly set the clock but uses NTPd for this as this
  +    enables you to have multiple time sources as well as bad-chimer
  +    detection etc.
  +
  +%track
  +    prog omnisync = {
  +        version   = %{version}
  +        url       = http://www.vanheusden.com/time/omnisync/
  +        regex     = omnisync-(__VER__)\.tgz
  +    }
  +
  +%prep
  +    %setup -q
  +    %patch -p0
  +
  +%build
  +    %{l_make} %{l_mflags} \
  +        CC="%{l_cc}" \
  +        CFLAGS="%{l_cflags -O} %{l_cppflags}" \
  +        LDFLAGS="%{l_ldflags}"
  +
  +%install
  +    rm -rf $RPM_BUILD_ROOT
  +    %{l_shtool} mkdir -f -p -m 755 \
  +        $RPM_BUILD_ROOT%{l_prefix}/sbin \
  +        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
  +        $RPM_BUILD_ROOT%{l_prefix}/var/omnisync
  +    %{l_shtool} install -c -s -m 755 \
  +        omnisync $RPM_BUILD_ROOT%{l_prefix}/sbin/
  +    %{l_shtool} install -c -m 755 %{l_value -s -a} \
  +        %{SOURCE rc.omnisync} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  +    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  +        %{l_files_std} \
  +        '%attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/omnisync'
  +
  +%files -f files
  +
  +%clean
  +    rm -rf $RPM_BUILD_ROOT
  +
  +%post
  +    #   after upgrade, restart service
  +    if [ $1 -eq 1 ]; then
  +        #   display information about next steps
  +        ( echo "Configure NTP with:"
  +          echo "    # $RPM_INSTALL_PREFIX/etc/ntp/ntp.conf:"
  +          echo "    server 127.127.28.0"
  +        ) | %{l_rpmtool} msg -b -t notice
  +    fi
  +    [ $1 -eq 2 ] || exit 0
  +    eval `%{l_rc} omnisync status 2>/dev/null`
  +    [ ".$omnisync_active" = .yes ] && %{l_rc} omnisync restart
  +    exit 0
  +
  +%preun
  +    #   before erase, stop service and remove log files
  +    [ $1 -eq 0 ] || exit 0
  +    %{l_rc} omnisync stop 2>/dev/null
  +    rm -f $RPM_INSTALL_PREFIX/var/omnisync/*
  +    exit 0
  +
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/omnisync/rc.omnisync
  ============================================================================
  $ cvs diff -u -r0 -r1.1 rc.omnisync
  --- /dev/null 2008-11-18 22:17:39 +0100
  +++ rc.omnisync       2008-11-18 22:18:18 +0100
  @@ -0,0 +1,54 @@
  [EMAIL PROTECTED]@/bin/openpkg rc
  +##
  +##  rc.omnisync -- Run-Commands
  +##
  +
  +%config
  +    omnisync_enable="$openpkg_rc_def"
  +    omnisync_flags="-M daytime/tcp -h 127.0.0.1"
  +    omnisync_unit="0"
  +
  +%common
  +    omnisync_pidfile="@l_prefix@/var/omnisync/omnisync.pid"
  +    omnisync_signal () {
  +        [ -f $omnisync_pidfile ] && kill -$1 `cat $omnisync_pidfile`
  +    }
  +
  +%status -u @l_susr@ -o
  +    omnisync_usable="no"
  +    omnisync_active="no"
  +    rcService omnisync enable yes && \
  +        omnisync_signal 0 && omnisync_active="yes"
  +    echo "omnisync_enable=\"$omnisync_enable\""
  +    echo "omnisync_usable=\"$omnisync_usable\""
  +    echo "omnisync_active=\"$omnisync_active\""
  +
  +%start -p 100 -u @l_susr@
  +    rcService omnisync enable yes || exit 0
  +    rcService omnisync active yes && exit 0
  +    @l_prefix@/sbin/omnisync \
  +        -U @l_nusr@ \
  +        -P $omnisync_pidfile \
  +        -u $omnisync_unit \
  +        $omnisync_flags
  +
  +%stop -p 900 -u @l_susr@
  +    rcService omnisync enable yes || exit 0
  +    rcService omnisync active no  && exit 0
  +    omnisync_signal TERM
  +    sleep 2
  +    rm -f $omnisync_pidfile >/dev/null 2>&1 || true
  +
  +%restart -p 100 -u @l_susr@
  +    rcService omnisync enable yes || exit 0
  +    rcService omnisync active no  && exit 0
  +    rc omnisync stop start
  +
  +%reload -p 100 -u @l_susr@
  +    rcService omnisync enable yes || exit 0
  +    rcService omnisync active no  && exit 0
  +    @l_prefix@/sbin/rndc reload
  +
  +%daily -u @l_susr@
  +    rcService omnisync enable yes || exit 0
  +
  @@ .
______________________________________________________________________
OpenPKG                                             http://openpkg.org
CVS Repository Commit List                     [email protected]

Reply via email to