Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37047074
en ru br
Репозитории ALT
S:4.2.8p15-alt4
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
+backports:4.2.4-alt0.M30.3.p4
www.altlinux.org/Changes

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

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

Name: ntp
Version: 4.2.4
%define vers_rc p7
Release: alt5%{?vers_rc:.%vers_rc}
%define srcname %name-%version%{?vers_rc:-%vers_rc}

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

Packager: Dmitry Lebkov <dlebkov at altlinux.ru>

Source0: ftp://ftp.udel.edu/pub/ntp/ntp4/%srcname.tar.bz2
Source1: ntpd.init
Source2: ntpd.sysconfig
Source3: %name.conf
Source4: %name.keys

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

Patch1: %name-4.2.4-p7-alt-compile-dirty-hack-NANO.patch

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

# due to readline library linked with tinfo.

BuildPreReq: libreadline-devel >= 4.3-alt5

# due to ntp_drop_priv.

BuildRequires: libcap-devel

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

%define ROOT /var/lib/ntpd

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

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

%package utils
Summary: The Network Time Protocol (NTP) utilities
Group: System/Base
Requires: ntpdate = %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 ntpd
Summary: The Network Time Protocol daemon
Group: System/Servers
Requires: ntpdate = %version-%release
Obsoletes: xntp3
Requires(pre): shadow-utils
PreReq: service, coreutils
# due to ntp_intres.
Requires: /var/resolv
Provides: ntp-server

%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.

%description aux
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.

This is an auxiliary package.

%description doc
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.

This package contains NTP documentation.

%description utils
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.

This package contains various NTP utilities.

%description -n ntpd
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.

This package contains Network Time Protocol daemon.

%description -n ntpdate
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.

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

%prep
%setup -q -n %srcname

%patch1 -p1

# Fix progname initialization when argc==0.

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

%__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' --

%build
%add_optflags -D_GNU_SOURCE
%define _bindir %_sbindir
#autoreconf --force --verbose
%configure --without-openssl-libdir --without-openssl-incdir --without-crypto --without-readline \
--enable-linuxcaps
echo '#define HAVE_LIBREADLINE 1' >>config.h

%make_build

%install
%makeinstall transform=
%__install -p -m755 scripts/ntpsweep $RPM_BUILD_ROOT%_sbindir/

# Manpages.

%__mkdir_p $RPM_BUILD_ROOT{%_man1dir,%_man8dir}
%__install -p -m644 ntp.1 $RPM_BUILD_ROOT%_man1dir/
%__install -p -m644 {ntpd,ntpdate,ntpsweep}.8 $RPM_BUILD_ROOT%_man8dir/
for f in $RPM_BUILD_ROOT%_sbindir/*; do
t="$RPM_BUILD_ROOT%_man8dir/${f##*/}.8"
[ -f "$t" ] || %__ln_s ../man1/ntp.1 "$t"
done

# Docs.

%define docdir %_docdir/%name-%version
%__mkdir_p $RPM_BUILD_ROOT%docdir
%__cp -a COPYRIGHT NEWS TODO WHERE-TO-START README.bk README.hackers README.refclocks README.versions html \
$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

%__mkdir_p $RPM_BUILD_ROOT%ROOT/tmp
%__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/

%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 ||:
f=%r_link
if [ -d "$f" -a ! -L "$f" ]; then
%__rm -rf "$f"
/bin/touch "$f.RPMLOCK"
fi

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

%preun -n ntpd
%preun_service ntpd

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

%files

%files aux

%files doc
%dir %docdir
%docdir/html

%files utils
%_sbindir/*
%_mandir/man?/*
%exclude %_sbindir/ntpd
%exclude %_sbindir/ntpdate
%exclude %_man8dir/ntpd.*
%exclude %_man8dir/ntpdate.*

%files -n ntpdate
%_sbindir/ntpdate
%_man8dir/ntpdate.*
%dir %docdir
%docdir/[A-Z]*

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

%defattr(640,root,ntpd,710)
%dir %ROOT
%dir %ROOT%_sysconfdir
%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

%changelog

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

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