Репозиторий Sisyphus
Последнее обновление: 12 июля 2020 | Пакетов: 17701 | Посещений: 18868608
en ru br
Репозитории ALT
5.1: 4.2.4-alt5.p7
4.1: 4.2.4-alt3.p4.M41.2
4.0: 4.2.2-alt1.p4.3
3.0: 4.1.2-alt3

Группа :: Система/Настройка/Прочее
Пакет: ntp

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

%define _unpackaged_files_terminate_build 1

Name: ntp
Version: 4.2.8p14
Release: alt1
%define srcname %name-%version%{?patchlevel:%patchlevel}

Summary: The Network Time Protocol (NTP)
License: %bsdstyle
Group: System/Configuration/Other
Url: http://www.ntp.org/

Source0: http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/%srcname.tar.gz
Source1: ntpd.init
Source2: ntpd.sysconfig
Source3: %name.conf
Source4: %name.keys

Source11: ntp.1
Source12: ntpd.8
Source13: ntpdate.8
Source14: ntpsweep.8

Source21: chrooted-ntpd.all
Source22: chrooted-ntpd.conf
Source23: chrooted-ntpd.lib

Patch1: %name-4.2.6p5-alt-compile-dirty-hack-NANO.patch

Requires: ntp-doc = %version-%release
Requires: ntp-utils = %version-%release
Requires: ntpdate = %version-%release
Requires: ntpd = %version-%release

# ntpq subpackage should not have dependency to ntp-utils subpackage:

# man8/ntpq.8 is a symlink to man1/ntp.1 which in ntp-utils
%add_findreq_skiplist %_man8dir/ntpq.*

BuildPreReq: rpm-build-licenses
BuildRequires: zlib-devel

# due to readline library linked with tinfo.

BuildPreReq: libreadline-devel >= 4.3-alt5

# due to ntp_drop_priv.

BuildRequires: libcap-devel

# ntp_crypto_rnd.c:93: undefined reference to `arc4random_buf'

BuildRequires: libssl-devel

# for sbin/update-leap

BuildRequires: perl-File-Fetch perl-Digest-SHA perl-HTTP-Tiny perl-Net-SSLeay perl-IO-Socket-SSL

# Root directory for chrooted environment, must not be same as real system root.

%define ROOT /var/lib/ntpd

%define common_description The Network Time Protocol (NTP) is used to synchronize the time\
of a computer client or server to another server or reference time\
source, such as a radio or satellite receiver or modem. It provides\
client accuracies typically within a millisecond on LANs and up to\
a few tens of milliseconds on WANs.

%package aux
Summary: The Network Time Protocol (NTP) auxiliary package
Group: System/Configuration/Other
Conflicts: ntp < 4.1.1b
BuildArch: noarch

%package doc
Summary: The Network Time Protocol (NTP) documentation
Group: Development/Other
Requires: ntp-aux = %version-%release
BuildArch: noarch

%package -n perl-NTP-Util
Summary: Perl NTP module
Group: Development/Perl
BuildArch: noarch

%package utils
Summary: The Network Time Protocol (NTP) utilities
Group: System/Base
Requires: ntpdate = %version-%release
Requires: ntpq = %version-%release

%package -n ntpdate
Summary: Set the date and time via NTP
Group: System/Base
Requires: ntp-aux = %version-%release
Requires(pre): shadow-utils
Requires: /var/empty

%package -n ntpq
Summary: The standard NTP query program
Group: System/Base

%package -n ntpd
Summary: The Network Time Protocol daemon
Group: System/Servers
Obsoletes: xntp3
Requires(pre): shadow-utils
Requires(pre): service, coreutils
# due to ntp_intres.
Requires: /var/resolv
Provides: ntp-server


%description aux

This is an auxiliary package.

%description doc

This package contains NTP documentation.

%description -n perl-NTP-Util
Perl NTP module

%description utils

This package contains various NTP utilities.

%description -n ntpdate

This package contains ntpdate program for retrieving the date and time
from remote machines via a network.

%description -n ntpq

This package contains standard NTP query program

%description -n ntpd

This package contains Network Time Protocol daemon.

%setup -n %srcname
%ifarch %e2k
sed -i 's,-Wnormalized=id,,' sntp/libevent/configure*

#patch1 -p1

# Fix progname initialization when argc==0.

fgrep -rl --include='*.c' 'progname = argv[0];' . |
xargs grep -l 'main *(' |
while read f; do
subst 's/progname = argv\[0\];/progname = argc ? argv[0] : "PROGNAME";/' "$f"
subst "s/PROGNAME/$n/" "$f"

%__install -p -m644 %SOURCE2 ntpd.sysconfig
%__install -p -m644 $RPM_SOURCE_DIR/{ntp.1,{ntpd,ntpdate,ntpsweep}.8} .

find -type f -print0 |
xargs -r0 %__grep -FZl ' at ROOT at ' -- |
xargs -r0 %__subst -p 's, at ROOT at ,%ROOT,g' --

%add_optflags -D_GNU_SOURCE
%define _bindir %_sbindir

%configure \
--enable-ntp-signd \
--enable-linuxcaps \
echo '#define HAVE_LIBREADLINE 1' >>config.h


# https://lists.altlinux.org/pipermail/devel/2020-March/210366.html
%ifnarch ppc64le
make check

make DESTDIR=$RPM_BUILD_ROOT perllibdir=%perl_vendor_privlib install

%__install -p -m755 scripts/ntpsweep/ntpsweep $RPM_BUILD_ROOT%_sbindir/

# Manpages.

%set_compress_method skip
%__mkdir_p $RPM_BUILD_ROOT{%_man1dir,%_man8dir}
#__install -p -m644 ntp.1 $RPM_BUILD_ROOT%_man1dir/
sed "s| at VERSION at |%version|" < ntp.1 > $RPM_BUILD_ROOT%_man1dir/ntp.1
%__install -p -m644 {ntpd,ntpdate,ntpsweep}.8 $RPM_BUILD_ROOT%_man8dir/
find $RPM_BUILD_ROOT%_mandir -type f -regex '.*\.[1-8]$' -print0 | xargs -r0 bzip2 -9
for f in $RPM_BUILD_ROOT%_sbindir/*; do
[ -f "$t" ] || %__ln_s ../man1/ntp.1.bz2 "$t"

# Docs.

%define docdir %_docdir/%name-%version
%__mkdir_p $RPM_BUILD_ROOT%docdir
mv $RPM_BUILD_ROOT%_docdir/ntp  $RPM_BUILD_ROOT%docdir
mv $RPM_BUILD_ROOT%_docdir/sntp $RPM_BUILD_ROOT%docdir

%__install -pD -m755 %SOURCE1 $RPM_BUILD_ROOT%_initdir/ntpd
%__install -pD -m644 ntpd.sysconfig $RPM_BUILD_ROOT%_sysconfdir/sysconfig/ntpd
%__install -pD -m600 %SOURCE3 $RPM_BUILD_ROOT%_sysconfdir/%name.conf

# Prepare for chroot

%__mkdir_p $RPM_BUILD_ROOT%ROOT/tmp
%__mkdir_p $RPM_BUILD_ROOT%ROOT/%_lib
%__install -pD -m600 %SOURCE4 $RPM_BUILD_ROOT%ROOT%_sysconfdir/%name/keys
touch $RPM_BUILD_ROOT%ROOT%_sysconfdir/%name/{drift,step-tickers}
%__ln_s ..%ROOT%_sysconfdir/%name $RPM_BUILD_ROOT%_sysconfdir/
# scripts for update_chrooted
%__mkdir_p $RPM_BUILD_ROOT%_sysconfdir/chroot.d
%__install -pD -m700 %SOURCE21 $RPM_BUILD_ROOT%_sysconfdir/chroot.d/ntpd.all
%__install -pD -m700 %SOURCE22 $RPM_BUILD_ROOT%_sysconfdir/chroot.d/ntpd.conf
%__install -pD -m700 %SOURCE23 $RPM_BUILD_ROOT%_sysconfdir/chroot.d/ntpd.lib
# ghost files from update_chrooted
touch $RPM_BUILD_ROOT%ROOT%_sysconfdir/host.conf
touch $RPM_BUILD_ROOT%ROOT%_sysconfdir/hosts
touch $RPM_BUILD_ROOT%ROOT%_sysconfdir/localtime
touch $RPM_BUILD_ROOT%ROOT%_sysconfdir/nsswitch.conf
touch $RPM_BUILD_ROOT%ROOT%_sysconfdir/resolv.conf
touch $RPM_BUILD_ROOT%ROOT%_sysconfdir/services
touch $RPM_BUILD_ROOT%ROOT/%_lib/libnsl.so.1
touch $RPM_BUILD_ROOT%ROOT/%_lib/libnss_dns.so.2
touch $RPM_BUILD_ROOT%ROOT/%_lib/libnss_files.so.2
touch $RPM_BUILD_ROOT%ROOT/%_lib/libresolv.so.2

%define r_dir %ROOT%_sysconfdir/%name
%define r_link %_sysconfdir/%name

%pre -n ntpdate
/usr/sbin/groupadd -r -f ntpd
/usr/sbin/useradd -r -g ntpd -d /dev/null -s /dev/null -n ntpd >/dev/null 2>&1 ||:

%pre -n ntpd
/usr/sbin/groupadd -r -f ntpd
/usr/sbin/useradd -r -g ntpd -d /dev/null -s /dev/null -n ntpd >/dev/null 2>&1 ||:
if [ -d "$f" -a ! -L "$f" ]; then
%__rm -rf "$f"
/bin/touch "$f.RPMLOCK"

%post -n ntpd
if [ $1 = 1 ]; then
       /sbin/chkconfig --add ntpd
if [ -f "$f.RPMLOCK" -a -d "$f" -a ! -d "$d.RPMSAVE" ]; then
%__mv "$d" "$d.RPMSAVE"
%__rm -f "$f.RPMLOCK"
/sbin/service ntpd condrestart ||:

%preun -n ntpd
%preun_service ntpd

%triggerpostun -n ntpd -- %name < 4.1.1b
if [ -d "$d.RPMSAVE" -a ! -d "$d" ]; then
%__mv "$d.RPMSAVE" "$d"
/sbin/service ntpd condrestart ||:


%files aux

%files doc
%dir %docdir

%files -n perl-NTP-Util
%dir %perl_vendor_privlib/NTP

%files utils
%exclude %_sbindir/ntpd
%exclude %_sbindir/ntpq
%exclude %_sbindir/ntpdate
%exclude %_man1dir/ntpd.*
%exclude %_man1dir/ntpq.*
%exclude %_man8dir/ntpd.*
%exclude %_man8dir/ntpq.*
%exclude %_man8dir/ntpdate.*

%files -n ntpdate

%files -n ntpq

%files -n ntpd
%config %_initdir/ntpd
%config(noreplace) %_sysconfdir/sysconfig/ntpd
%config(noreplace) %_sysconfdir/%name.conf

%dir %ROOT
%dir %ROOT%_sysconfdir
%dir %ROOT/%_lib
%attr(1770,root,ntpd) %dir %ROOT/tmp
%attr(1770,root,ntpd) %dir %ROOT%_sysconfdir/%name
%config(noreplace) %ROOT%_sysconfdir/%name/keys
%config(noreplace) %verify(not md5 size mtime) %ROOT%_sysconfdir/%name/step-tickers
%attr(640,ntpd,ntpd) %ghost %ROOT%_sysconfdir/%name/drift

# ghost files from update_chrooted

%ghost %ROOT%_sysconfdir/host.conf
%ghost %ROOT%_sysconfdir/hosts
%ghost %ROOT%_sysconfdir/localtime
%ghost %ROOT%_sysconfdir/nsswitch.conf
%ghost %ROOT%_sysconfdir/resolv.conf
%ghost %ROOT%_sysconfdir/services
%ghost %ROOT/%_lib/libnsl.so.1
%ghost %ROOT/%_lib/libnss_dns.so.2
%ghost %ROOT/%_lib/libnss_files.so.2
%ghost %ROOT/%_lib/libresolv.so.2


Полный changelog можно просмотреть здесь

дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin