forked from pool/chrony
- clean up build section - the configure script can actually import CC/CFLAGS from the environment. no need to break any CFLAGS it might set in the configure script. - remove unneeded prefix from the make calls. - enable building the binaries with PIE/relro now - Update to version 1.29.1: * Modify chronyc protocol to prevent amplification attacks (CVE-2014-0021) (incompatible with previous protocol version, chronyc supports both) - Additional changes from 1.29 * Fix crash when processing crafted commands (CVE-2012-4502) (possible with IP addresses allowed by cmdallow and localhost) * Don't send uninitialized data in SUBNETS_ACCESSED and CLIENT_ACCESSES replies (CVE-2012-4503) (not used by chronyc) * Drop support for SUBNETS_ACCESSED and CLIENT_ACCESSES commands - Updated chrony-config.patch: - lots of config values were fixed upstream already - key file patching is unnecessary OBS-URL: https://build.opensuse.org/request/show/223745 OBS-URL: https://build.opensuse.org/package/show/network:time/chrony?expand=0&rev=5
140 lines
4.3 KiB
RPMSpec
140 lines
4.3 KiB
RPMSpec
#
|
||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||
#
|
||
|
||
Name: chrony
|
||
Version: 1.29.1
|
||
Release: 0
|
||
License: GPL-2.0+
|
||
Summary: System Clock Synchronization Client and Server
|
||
Url: http://chrony.tuxfamily.org/
|
||
Group: Productivity/Networking/Other
|
||
Source: http://download.tuxfamily.org/chrony/chrony-%{version}.tar.gz
|
||
Source1: chrony.init
|
||
Source2: chrony.sysconfig
|
||
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
|
||
Patch1: chrony-config.patch
|
||
BuildRequires: gcc
|
||
BuildRequires: glibc-devel
|
||
BuildRequires: libcap-devel
|
||
BuildRequires: make
|
||
BuildRequires: mozilla-nss-devel
|
||
BuildRequires: ncurses-devel
|
||
BuildRequires: pkg-config
|
||
BuildRequires: readline-devel
|
||
BuildRequires: texinfo
|
||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||
|
||
|
||
Requires(pre): %fillup_prereq
|
||
Requires(pre): %insserv_prereq
|
||
Requires(pre): %install_info_prereq
|
||
Requires(pre): /usr/sbin/groupadd
|
||
Requires(pre): /usr/sbin/useradd
|
||
|
||
%description
|
||
Chrony is a pair of programs which are used to maintain the accuracy of the
|
||
system clock on a computer. The two programs are called chronyd and chronyc.
|
||
|
||
Chronyd is a daemon which runs in background on the system. It obtains
|
||
measurements via the network of the system clock’s offset relative to time
|
||
servers on other systems and adjusts the system time accordingly. For isolated
|
||
systems, the user can periodically enter the correct time by hand (using
|
||
Chronyc). In either case, Chronyd determines the rate at which the computer
|
||
gains or loses time, and compensates for this. Chronyd implements the NTP
|
||
protocol and can act as either a client or a server.
|
||
|
||
Chronyc provides a user interface to Chronyd for monitoring its performance and
|
||
configuring various settings. It can do so while running on the same computer
|
||
as the Chronyd instance it is controlling or a different computer.
|
||
|
||
%prep
|
||
%setup -q
|
||
%patch1
|
||
|
||
%build
|
||
# not autoconf:
|
||
export CC="gcc"
|
||
export CFLAGS="%{optflags} -Wall -fpic -DPIC"
|
||
export LDFLAGS="-pie -Wl,-z,relro,-z,now"
|
||
./configure \
|
||
--prefix="%{_prefix}" \
|
||
--exec-prefix="%{_exec_prefix}" \
|
||
--sysconfdir="%{_sysconfdir}" \
|
||
--bindir="%{_bindir}" \
|
||
--sbindir="%{_sbindir}" \
|
||
--datarootdir="%{_datadir}" \
|
||
--infodir="%{_infodir}" \
|
||
--mandir="%{_mandir}" \
|
||
--docdir="%{_docdir}/%{name}"
|
||
|
||
make %{?_smp_mflags}
|
||
make chrony.txt
|
||
make chrony.info
|
||
|
||
%install
|
||
%makeinstall
|
||
rm -rf "%{buildroot}%{_docdir}/%{name}"
|
||
|
||
install -d "%{buildroot}%{_infodir}"
|
||
install -m0644 chrony.info "%{buildroot}%{_infodir}"/
|
||
|
||
install -D -m0755 "%{SOURCE1}" "%{buildroot}%{_initddir}/chronyd"
|
||
install -d "%{buildroot}%{_prefix}/sbin"
|
||
ln -s ../../etc/init.d/chronyd "%{buildroot}%{_sbindir}/rcchronyd"
|
||
|
||
install -D -m0644 "%{SOURCE2}" "%{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.chronyd"
|
||
|
||
install -d "%{buildroot}%{_localstatedir}/lib/chrony"
|
||
install -d "%{buildroot}%{_localstatedir}/log/chrony"
|
||
|
||
|
||
%if 0%{?suse_version} >= 1030 && 0%{?suse_version} <= 1140
|
||
h=/usr/share/doc/licenses/md5/$(md5sum COPYING|cut -f1 -d" ")
|
||
test -e "$h" && ln -s -f "$h" .
|
||
%endif
|
||
|
||
install -d "%{buildroot}%{_sysconfdir}"
|
||
install -m0644 examples/chrony.conf.example "%{buildroot}%{_sysconfdir}/chrony.conf"
|
||
install -m0600 examples/chrony.keys.example "%{buildroot}%{_sysconfdir}/chrony.keys"
|
||
|
||
%pre
|
||
/usr/sbin/groupadd -r chrony || :
|
||
/usr/sbin/useradd -r -g chrony -c "Chrony Daemon" -d "%{_localstatedir}/lib/chrony" chrony || :
|
||
|
||
%post
|
||
%{fillup_only -an chronyd}
|
||
%install_info --info-dir="%{_infodir}" "%{_infodir}/chrony.info%{ext_info}"
|
||
|
||
%preun
|
||
%stop_on_removal chronyd
|
||
|
||
%postun
|
||
%restart_on_update chronyd
|
||
%insserv_cleanup
|
||
%install_info_delete --info-dir="%{_infodir}" "%{_infodir}/chrony.info%{ext_info}"
|
||
|
||
%clean
|
||
rm -rf %{buildroot}
|
||
|
||
%files
|
||
%defattr(-,root,root)
|
||
%doc README chrony.txt COPYING
|
||
%doc examples
|
||
%config(noreplace) %{_sysconfdir}/chrony.conf
|
||
%config(noreplace) %{_sysconfdir}/chrony.keys
|
||
%{_bindir}/chronyc
|
||
%{_sbindir}/chronyd
|
||
%doc %{_mandir}/man1/chrony.1%{ext_man}
|
||
%doc %{_mandir}/man1/chronyc.1%{ext_man}
|
||
%doc %{_mandir}/man5/chrony.conf.5%{ext_man}
|
||
%doc %{_mandir}/man8/chronyd.8%{ext_man}
|
||
%doc %{_infodir}/chrony.info%{ext_info}
|
||
%config %{_sysconfdir}/init.d/chronyd
|
||
%{_sbindir}/rcchronyd
|
||
%{_localstatedir}/adm/fillup-templates/sysconfig.chronyd
|
||
%attr(0750,chrony,chrony) %{_localstatedir}/lib/chrony
|
||
%attr(0750,chrony,chrony) %{_localstatedir}/log/chrony
|
||
|
||
%changelog
|