First check in
This commit is contained in:
12
CONFIG/etc/ntp.conf
Normal file
12
CONFIG/etc/ntp.conf
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# Time servers
|
||||||
|
pool 0.pool.ntp.org
|
||||||
|
pool 1.pool.ntp.org
|
||||||
|
pool 2.pool.ntp.org
|
||||||
|
pool 3.pool.ntp.org
|
||||||
|
|
||||||
|
# Localhost (in case network connectivity is lost)
|
||||||
|
server 127.127.1.0
|
||||||
|
fudge 127.127.1.0 stratum 10
|
||||||
|
|
||||||
|
# Drift file
|
||||||
|
driftfile /var/lib/ntp/driftfile
|
||||||
BIN
CONFIG/ntp-4.2.8p10-0.snap
Normal file
BIN
CONFIG/ntp-4.2.8p10-0.snap
Normal file
Binary file not shown.
95
Makefile
Normal file
95
Makefile
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
# This file is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License version 2 as
|
||||||
|
# published by the Free Software Foundation here:
|
||||||
|
# (http://www.gnu.org/licenses/gpl-2.0.html)
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
|
export ARCH = x86_64
|
||||||
|
export DEPENDS = bash,glibc,libcap
|
||||||
|
export BUILDDEPS =
|
||||||
|
export SRCPKG = $(PACKAGE)
|
||||||
|
export URL = http://www.ntp.org/
|
||||||
|
REPO = main
|
||||||
|
BRIEF = NTP daemon and utilities
|
||||||
|
DESC = NTP is widely used to synchronize a computer to Internet time servers \
|
||||||
|
or other sources
|
||||||
|
SNAPVER = 0
|
||||||
|
|
||||||
|
ARCHIVE := $(PWD)/SRC/$(shell ls SRC|egrep '(bz2|gz|tar|xz)$$'|tail -1)
|
||||||
|
TYPE := $(shell file -ib $(ARCHIVE)|cut -d';' -f1|tr -d '\n')
|
||||||
|
SRCDIR := $(shell tar -tf $(ARCHIVE)|head -1|sed 's/\/.*//')
|
||||||
|
PATCHDIR := $(PWD)/SRC/patches
|
||||||
|
export VERSION := $(shell echo $(SRCDIR)|egrep -o '\-[0-9].*'| \
|
||||||
|
sed 's/^-//')-$(SNAPVER)
|
||||||
|
|
||||||
|
include /usr/share/snap/Makefile.snaplinux
|
||||||
|
|
||||||
|
DOC := $(PWD)/$(PACKAGE)-doc
|
||||||
|
DOCROOT := $(DOC)/ROOT
|
||||||
|
|
||||||
|
$(SRCDIR)/configure: $(ARCHIVE)
|
||||||
|
@if [ '$(TYPE)' == 'application/x-bzip2' ]; then \
|
||||||
|
tar -jxf $(ARCHIVE); \
|
||||||
|
elif [ '$(TYPE)' == 'application/x-gzip' ]; then \
|
||||||
|
tar -zxf $(ARCHIVE); \
|
||||||
|
elif [ '$(TYPE)' == 'application/x-tar' ]; then \
|
||||||
|
tar -xf $(ARCHIVE); \
|
||||||
|
elif [ '$(TYPE)' == 'application/x-xz' ]; then \
|
||||||
|
tar -xf $(ARCHIVE); \
|
||||||
|
else \
|
||||||
|
echo 'Unable to determine archive type'; \
|
||||||
|
exit 1; \
|
||||||
|
fi
|
||||||
|
@touch $(SRCDIR)/configure
|
||||||
|
|
||||||
|
$(SRCDIR)/config.log: $(SRCDIR)/configure
|
||||||
|
@cd $(SRCDIR) && \
|
||||||
|
for patch in `find $(PATCHDIR) -name \*.patch|sort`; do \
|
||||||
|
patch --verbose -Np1 -i $$patch; \
|
||||||
|
done
|
||||||
|
@cd $(SRCDIR); \
|
||||||
|
./configure CFLAGS="-O2 -g -fPIC" \
|
||||||
|
--prefix=/usr \
|
||||||
|
--bindir=/usr/sbin \
|
||||||
|
--sysconfdir=/etc \
|
||||||
|
--enable-linuxcaps \
|
||||||
|
--with-lineditlibs=readline \
|
||||||
|
--build=x86_64-snap-linux-gnu \
|
||||||
|
--host=x86_64-snap-linux-gnu \
|
||||||
|
--target=x86_64-snap-linux-gnu
|
||||||
|
|
||||||
|
$(SRCDIR)/ntpd/ntpd: $(SRCDIR)/config.log
|
||||||
|
@cd $(SRCDIR) && make
|
||||||
|
|
||||||
|
$(ROOT): $(SRCDIR)/ntpd/ntpd
|
||||||
|
@if [ -d $(ROOT) ]; then \
|
||||||
|
touch $(ROOT); \
|
||||||
|
else \
|
||||||
|
mkdir -v $(ROOT); \
|
||||||
|
fi
|
||||||
|
|
||||||
|
@cd $(SRCDIR) && make install DESTDIR=$(ROOT) && \
|
||||||
|
install -v -d -m 755 $(ROOT)/etc/init.d && \
|
||||||
|
install -v -d -m 755 $(ROOT)/var/lib/ntp && \
|
||||||
|
install -v -m 755 $(PWD)/SNAP/ntpd.init $(ROOT)/etc/init.d/ntpd && \
|
||||||
|
install -v -d $(DOC)/SNAP && \
|
||||||
|
install -v -d $(DOCROOT)/usr/share && \
|
||||||
|
mv -v $(ROOT)/usr/share/doc $(DOCROOT)/usr/share/doc && \
|
||||||
|
cd $(DOC) && make -f ../Makefile.$(PACKAGE)-doc && mv *.snap ../
|
||||||
|
|
||||||
|
test: $(ROOT)
|
||||||
|
@cd $(SRCDIR); \
|
||||||
|
make check
|
||||||
|
|
||||||
|
clean:
|
||||||
|
@rm -rvf $(ROOT) \
|
||||||
|
$(DOC) \
|
||||||
|
$(SNAPINFO) \
|
||||||
|
$(MANIFEST) \
|
||||||
|
$(FILES) \
|
||||||
|
$(SRCDIR)
|
||||||
|
|
||||||
16
Makefile.ntp-doc
Normal file
16
Makefile.ntp-doc
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# This file is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License version 2 as
|
||||||
|
# published by the Free Software Foundation here:
|
||||||
|
# (http://www.gnu.org/licenses/gpl-2.0.html)
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
|
DEPENDS =
|
||||||
|
REPO = main
|
||||||
|
BRIEF = HTML documentation for ntp
|
||||||
|
DESC = HTML documentation for ntp
|
||||||
|
|
||||||
|
include /usr/share/snap/Makefile.snaplinux
|
||||||
5
SNAP/README
Normal file
5
SNAP/README
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
This is the directory where the manifest, snapinfo,
|
||||||
|
and files.tar.gz files will be created. It is also
|
||||||
|
where the usher file should be placed if it is
|
||||||
|
required by the package. Any other files that need
|
||||||
|
to be included could also be placed here.
|
||||||
BIN
SNAP/config.tar.gz
Normal file
BIN
SNAP/config.tar.gz
Normal file
Binary file not shown.
59
SNAP/ntpd.init
Executable file
59
SNAP/ntpd.init
Executable file
@@ -0,0 +1,59 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
### BEGIN INIT INFO
|
||||||
|
# Provides: ntp
|
||||||
|
# Required-Start: $network $syslog
|
||||||
|
# Required-Stop: $network $syslog
|
||||||
|
# Should-Start:
|
||||||
|
# Should-Stop:
|
||||||
|
# Default-Start: 3 4 5
|
||||||
|
# Default-Stop: 0 1 2 6
|
||||||
|
# Short-Description: NTP Daemon
|
||||||
|
### END INIT INFO
|
||||||
|
|
||||||
|
. /lib/lsb/init-functions
|
||||||
|
|
||||||
|
DAEMON=/usr/sbin/ntpd
|
||||||
|
PIDFILE=/var/run/ntpd.pid
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
log_init_msg "Starting NTP server"
|
||||||
|
start_daemon -p "$PIDFILE" "$DAEMON" "-p $PIDFILE -g -u 87:87" \
|
||||||
|
&& log_success_msg || log_failure_msg
|
||||||
|
;;
|
||||||
|
stop)
|
||||||
|
pid=$(pidofproc -p "$PIDFILE" "$DAEMON")
|
||||||
|
|
||||||
|
if [ "$?" -ne 0 ]; then
|
||||||
|
log_init_msg "NTP server not running" && log_success_msg
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
log_init_msg "Stopping NTP server"
|
||||||
|
|
||||||
|
killproc -p "$PIDFILE" "$DAEMON" -TERM && log_success_msg \
|
||||||
|
|| log_failure_msg
|
||||||
|
;;
|
||||||
|
reload|restart)
|
||||||
|
log_init_msg "Restarting NTP server"
|
||||||
|
|
||||||
|
killproc -p "$PIDFILE" "$DAEMON" -HUP && log_success_msg \
|
||||||
|
|| log_failure_msg
|
||||||
|
;;
|
||||||
|
status)
|
||||||
|
pid=$(pidofproc -p "$PIDFILE" "$DAEMON")
|
||||||
|
|
||||||
|
if [ "$?" -ne 0 ]; then
|
||||||
|
echo "NTP server not running"
|
||||||
|
else
|
||||||
|
echo "NTP server running with PID: $pid"
|
||||||
|
/usr/sbin/ntpq -pn
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Usage: $0 [start|stop|reload|restart|status]"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit 0
|
||||||
34
SNAP/usher
Executable file
34
SNAP/usher
Executable file
@@ -0,0 +1,34 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
preinst)
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
postinst)
|
||||||
|
if ! getent group ntp 2>&1 > /dev/null; then
|
||||||
|
if groupadd -g 87 ntp; then
|
||||||
|
echo 'Created group ntp'
|
||||||
|
else
|
||||||
|
echo 'Failed to create group ntp!'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if ! getent passwd ntp 2>&1 > /dev/null; then
|
||||||
|
if useradd -c "NTP service" -d /var/lib/ntp -g ntp \
|
||||||
|
-s /bin/false -u 87 ntp; then
|
||||||
|
echo 'Created user ntp'
|
||||||
|
else
|
||||||
|
echo 'Failed to create user ntp!'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
prerm)
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
postrm)
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
BIN
SRC/ntp-4.2.8p10.tar.gz
Normal file
BIN
SRC/ntp-4.2.8p10.tar.gz
Normal file
Binary file not shown.
1
SRC/ntp-4.2.8p10.tar.gz.md5
Normal file
1
SRC/ntp-4.2.8p10.tar.gz.md5
Normal file
@@ -0,0 +1 @@
|
|||||||
|
745384ed0dedb3f66b33fe84d66466f9 ntp-4.2.8p10.tar.gz
|
||||||
3
SRC/patches/README
Normal file
3
SRC/patches/README
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
Place any patch files here and preface each with a
|
||||||
|
number indicating the order of execution. Patch
|
||||||
|
files are expected to use a .patch extension.
|
||||||
Reference in New Issue
Block a user