Пакет openntpd: Specfile

Name: openntpd
Version: 3.9p1
Release: alt10

%define privuser  ntpd
%define privgroup ntpd
%define privpath  /var/empty

%def_with setproctitle

Summary: Network daemon for synchronize local clock to remote NTP servers
License: ISC-style
Group: Networking/Other
Url: http://www.openntpd.org
Packager: Dmitry V. Levin <ldv@altlinux.org>

# ftp://ftp.openbsd.org/pub/OpenBSD/OpenNTPD/openntpd-%version.tar.gz
Source0: openntpd-%version.tar
Source1: ntpd.init
Source2: ntpd.control
Source3: ntpd.sysconfig
# http://www.zip.com.au/~dtucker/openntpd/patches/openntpd-3.9p1-linux-adjtimex.patch
Patch: openntpd-%version-%release.patch

Provides: ntp-server

PreReq: %privpath
Conflicts: ntpd

BuildPreReq: libssl-devel
%{?_with_setproctitle:BuildPreReq: setproctitle-devel}

Summary(ru_RU.KOI8-R): \xf3\xc5\xd4\xc5\xd7\xcf\xca \xd3\xc5\xd2\xd7\xc5\xd2 \xc4\xcc\xd1 \xd3\xc9\xce\xc8\xd2\xcf\xce\xc9\xda\xc1\xc3\xc9\xc9 \xd4\xcf\xde\xce\xcf\xc7\xcf \xd7\xd2\xc5\xcd\xc5\xce\xc9

%description
The ntpd daemon synchronizes the local clock to one or more remote NTP
servers, and can also act as an NTP server itself, redistributing the
local time.  It implements the Simple Network Time Protocol version 4,
as described in RFC 2030, and the Network Time Protocol version 3,
as described in RFC 1305.

Here is a portable implementation of OpenNTPD, small reliable NTP daemon
initially designed as part of OpenBSD.

%description -l ru_RU.KOI8-R
\xe4\xc5\xcd\xcf\xce NTP \xd3\xc9\xce\xc8\xd2\xcf\xce\xc9\xda\xc9\xd2\xd5\xc5\xd4 \xd7\xd2\xc5\xcd\xd1 \xd7 \xcc\xcf\xcb\xc1\xcc\xd8\xce\xd9\xc8 \xd3\xc9\xd3\xd4\xc5\xcd\xce\xd9\xc8 \xde\xc1\xd3\xc1\xc8 \xd3 \xd7\xce\xc5\xdb\xce\xc9\xcd\xc9
\xd3\xc5\xd2\xd7\xc5\xd2\xc1\xcd\xc9 NTP, \xc1 \xd4\xc1\xcb\xd6\xc5 \xd0\xd2\xc9 \xce\xc5\xcf\xc2\xc8\xcf\xc4\xc9\xcd\xcf\xd3\xd4\xc9 \xd3\xc1\xcd \xd7\xd9\xd3\xd4\xd5\xd0\xc1\xc5\xd4 \xd3\xc5\xd2\xd7\xc5\xd2\xcf\xcd NTP,
\xd3\xcf\xcf\xc2\xdd\xc1\xd1 \xd3\xd7ϣ \xcc\xcf\xcb\xc1\xcc\xd8\xce\xcf\xc5 \xd7\xd2\xc5\xcd\xd1 \xd0\xcf \xd3\xc5\xd4\xc9 \xc4\xd2\xd5\xc7\xc9\xcd \xcb\xcf\xcd\xd0\xd8\xc0\xd4\xc5\xd2\xc1\xcd.

\xe4\xc1\xce\xce\xd9\xca \xd0\xc1\xcb\xc5\xd4 \xd3\xcf\xc4\xc5\xd2\xd6\xc9\xd4 \xd2\xc5\xc1\xcc\xc9\xda\xc1\xc3\xc9\xc0 NTP-\xc4\xc5\xcd\xcf\xce\xc1, \xd2\xc1\xda\xd2\xc1\xc2\xcf\xd4\xc1\xce\xce\xd5\xc0 \xd7 \xd2\xc1\xcd\xcb\xc1\xc8
\xcf\xd0\xc5\xd2\xc1\xc3\xc9\xcf\xce\xce\xcf\xca \xd3\xc9\xd3\xd4\xc5\xcd\xd9 OpenBSD, \xc9 \xd0\xc5\xd2\xc5\xce\xc5ӣ\xce\xce\xd5\xc0 \xd7\xd0\xcf\xd3\xcc\xc5\xc4\xd3\xd4\xd7\xc9\xc9 \xce\xc1 \xc4\xd2\xd5\xc7\xc9\xc5
\xd0\xcc\xc1\xd4\xc6\xcf\xd2\xcd\xd9.

%prep
%setup -q
%patch -p1
bzip2 -9k ChangeLog

%build
%add_optflags -DUSE_ADJTIMEX
%{?_with_setproctitle:export LIBS=-lsetproctitle}
%configure \
	--with-mantype=doc \
	--with-privsep-user=%privuser \
	--with-privsep-path=%privpath \
	#
%make_build

%install
%makeinstall
install -pD -m755 %_sourcedir/ntpd.init %buildroot%_initdir/ntpd
install -pD -m755 %_sourcedir/ntpd.control %buildroot%_controldir/ntpd
install -pD -m640 %_sourcedir/ntpd.sysconfig %buildroot%_sysconfdir/sysconfig/ntpd

%pre
/usr/sbin/groupadd -r -f %privgroup
/usr/sbin/useradd -r -s /dev/null -g %privgroup -d %privpath -c 'OpenNTP daemon' %privuser >/dev/null 2>&1 ||:

%post
%post_service ntpd

%preun
%preun_service ntpd

%files
%config(noreplace) %attr(640,root,wheel) %_sysconfdir/ntpd.conf
%config(noreplace) %attr(640,root,wheel) %_sysconfdir/sysconfig/ntpd
%config %_initdir/ntpd
%config %_controldir/ntpd
%_sbindir/ntpd
%_mandir/man?/ntpd.*
%doc CREDITS ChangeLog.bz2 LICENCE README

%changelog
* Sat Apr 04 2009 Stanislav Ievlev <inger@altlinux.org> 3.9p1-alt10
- Provides ntp-server

* Tue Dec 02 2008 Dmitry V. Levin <ldv@altlinux.org> 3.9p1-alt9
- Removed obsolete dependencies.

* Wed May 02 2007 Dmitry V. Levin <ldv@altlinux.org> 3.9p1-alt8
- Fixed typos in startup script.

* Mon Apr 09 2007 Dmitry V. Levin <ldv@altlinux.org> 3.9p1-alt7
- Fixed package dependencies, reported by Michael Shigorin.
- Disabled service by default.

* Fri Mar 02 2007 Dmitry V. Levin <ldv@altlinux.org> 3.9p1-alt6
- Moved ntpd engine process stderr redirection after dropping privileges.
- Made ntpd parent process exit with non-zero code when child process fails.

* Tue Feb 06 2007 Grigory Batalov <bga@altlinux.ru> 3.9p1-alt5
- Clear maxerror and STA_UNSYNC on adjtimex.

* Tue Jan 23 2007 Grigory Batalov <bga@altlinux.ru> 3.9p1-alt4
- Merge Ilya Evseev's changes.
- Another way to adjust system clock with adjtimex(2).

* Mon Jan 22 2007 Ilya Evseev <evseev@altlinux.ru> 3.9p1-alt3
- Support 'rpmbuild --without setproctitle', needed for backporting to ALM24
- Added adjtimex patch, bugfix #10023

* Fri Dec 29 2006 ALT QA Team Robot <qa-robot@altlinux.org> 3.9p1-alt2.1
- Rebuilt due to libcrypto.so.4 -> libcrypto.so.6 soname change.

* Sat Aug 26 2006 Dmitry V. Levin <ldv@altlinux.org> 3.9p1-alt2
- Removed Owl patch (merged upstream).
- Build with arcfour implementation from libcrypto.
- Enabled setproctitle.
- Cleaned up (ab)use of rpm macros.
- Cleaned up %%pre script.
- Renamed source files.
- Packaged manpages in mdoc format.
- Packaged CREDITS, ChangeLog, LICENCE and README files.
- Marked startup and control scripts with %%config flag.
- Marked configuration files with %%config(noreplace) flag.
- %_initdir/ntpd:
  Cleaned up, added check for networking, corrected file permissions.
- %_sysconfdir/sysconfig/ntpd:
  Documented ntpd parameters, corrected file ownership.
- %_controldir/ntpd:
  Added summary, documented facility modes.

* Fri Aug 25 2006 Ilya Evseev <evseev@altlinux.ru> 3.9p1-alt1
- updated to new version 3.9p1, update patch #0, remove #1

* Tue Jan 24 2006 Ilya Evseev <evseev@altlinux.ru> 3.7p1-alt4
- replace segfault patch by the official one
- bugfix 8910: control file was not executable
- bugfix 8911: replace Provides/Obsoletes by 'Conflicts: ntpd'

* Wed Jan 18 2006 Ilya Evseev <evseev@altlinux.ru> 3.7p1-alt3
- added patch that fixes ntpd segfaults in combination with TEQL
  from Bernhard Fischer to owl-devel@ mailing list at 16 January 2006
- added sysconfig file for overriding default settings used by service script
- preinstall script bugfix: useradd was commented wrong, enable it back
- postuninstall message is completely away

* Sun Jan 15 2006 Ilya Evseev <evseev@altlinux.ru> 3.7p1-alt2
- added patch from Owl for selecting chroot directory at build time, not at startup
- fixing of home directory in preinstall script is no more needed
- removed suppression of groupadd output/result in preinstall script
- added control file from Owl
- postuninstall message is skipped when package is upgraded, not removed

* Mon Jan  9 2006 Ilya Evseev <evseev@altlinux.ru> 3.7p1-alt1
- Initial build for ALTLinux

## EOF ##