Files
ntpsec/ntpsec.spec
Martin Pluskal 2895b8871d Accepting request 1189105 from home:mnhauke
- Updat to version 1.2.3
  * Change mode6 alignment to four, which may break some
    compatibility with classic NTP.
  * Seccomp should now also yield invalid syscall names when dying.
  * Make ntpq stop dropping output timestamp leading zeroes.
  * Update documents in quite a few places.
  * Reset some stats hourly, even when not logged into files.
  * Add error logging, and stats for ms-sntp.
  * Add spacing between multiple peer views in ntpq.
  * We think we have fixed ms-sntp but we can’t test it.
  * ntpd and ntpq both treat SHA-1 as an alias for SHA1 NIST
    uses SHA-1. The crypto package from OpenSSL uses SHA1.
  * The default crypto type for ntpq is now AES. RFC 8573
    deprecated MD5.
  * There are now log files with hourly statistics for NTS and
    NTS-KE traffic: filegen ntsstats and filegen ntskestats,
  * Update ntpsnmpd to use python built-in to get uname information.
  * Update license file names for REUSE compliance.
  * Fix ntploggps issue where count_used_satellites checked before
    it is initialized.
  * Print out OpenSSL version at configure time.
  * Enable debug symbols by default, with only an option to disable.
  * Add support for ecdhcurves list.
  * Fix ntpdig crash when using 2.ntp.pool.org with a host without
    IPv6 support.
  * Do not install libaes_siv test anymore.
  * Add update option to buildprep.
  * ntpdig shows packet delay in JSON output.

OBS-URL: https://build.opensuse.org/request/show/1189105
OBS-URL: https://build.opensuse.org/package/show/network:time/ntpsec?expand=0&rev=99
2024-07-23 10:53:56 +00:00

263 lines
7.2 KiB
RPMSpec
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#
# spec file for package ntpsec
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2016 Malcolm J Lewis <malcolmlewis@opensuse.org>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: ntpsec
Version: 1.2.3
Release: 0
Summary: Improved implementation of Network Time Protocol
License: BSD-2-Clause AND NTP AND BSD-3-Clause AND MIT
URL: https://www.ntpsec.org/
Source0: https://ftp.ntpsec.org/pub/releases/%{name}-%{version}.tar.gz
Source1: https://ftp.ntpsec.org/pub/releases/%{name}-%{version}.tar.gz.asc
# https://ftp.ntpsec.org/pub/releases/ntpsec.gpg.pub.asc
Source2: ntpsec.keyring
Source3: %{name}.changes
Source4: logrotate.ntp
Source8: ntp.conf
Patch0: harden_ntp-wait.service.patch
Patch1: harden_ntpd.service.patch
Patch2: harden_ntplogtemp.service.patch
Patch3: harden_ntpviz-daily.service.patch
Patch4: harden_ntpviz-weekly.service.patch
BuildRequires: asciidoc
BuildRequires: avahi-compat-mDNSResponder-devel
BuildRequires: bison
BuildRequires: fdupes
# Needed for waf init in the git snapshot
BuildRequires: git-core
BuildRequires: libcap-devel
BuildRequires: libxslt-tools
# Required for tests to pass
BuildRequires: netcfg
BuildRequires: openssl-devel
BuildRequires: pkgconfig
BuildRequires: pps-tools-devel
BuildRequires: python3-curses
BuildRequires: python3-gpsd
BuildRequires: pkgconfig(libbsd)
BuildRequires: pkgconfig(libevent)
BuildRequires: pkgconfig(libseccomp)
BuildRequires: pkgconfig(python3)
Requires: netcfg
Requires: ntpsec-utils
Requires(pre): user(ntp)
Recommends: logrotate
# For ntpleapfetch
Recommends: wget
Conflicts: ntp-daemon
Provides: ntp-daemon
%description
A more secure implementation of NTP, derived from NTP Classic, Dave
Millss original.
%package -n python3-ntp
Summary: Python ntpsec bindings
%description -n python3-ntp
The ntpsec python bindings used by various ntp utilities.
%package -n libntpc1
Summary: Shared library for NTP client applications
Group: System/Libraries
%description -n libntpc1
This package provides the shared library for ntp clients.
%package devel
Summary: Development files for ntpsec
Group: Development/Libraries/C and C++
Requires: libntpc1 = %{version}
%description devel
This package contains libraries needed to develop application
that use %{name}.
%package utils
Summary: Utilities and commands for ntp
Requires: %{name} = %{version}
# For ntpmon
Requires: python3-curses
# For ntploggps
Requires: python3-gpsd
Requires: python3-ntp
# For ntpviz
Recommends: python3-psutil
# Same binaries
Conflicts: ntp
BuildArch: noarch
%description utils
The ntpsec utilities relying on the python module of ntp
%package doc
Summary: Documentation for %{name}
BuildArch: noarch
%description doc
Documentation files generated from asciidoc for %{name}.
%prep
%setup -q
# Fix python shebangs
sed -i -e 's:#!%{_bindir}/env python:#!%{_bindir}/python3:' \
ntpclients/*
# there is no actual reason for 3.18 gpsd version
sed -i -e 's:, condition="ver >= num(3, 18)"::' \
pylib/wscript
%patch -P 0 -p1
%patch -P 1 -p1
%patch -P 2 -p1
%patch -P 3 -p1
%patch -P 4 -p1
%build
%global _lto_cflags %{nil}
export CFLAGS="%{optflags}"
export CCFLAGS="%{optflags}"
python3 ./waf configure \
--enable-debug \
--enable-doc --htmldir=%{_docdir}/ntpsec/html \
--prefix=%{_prefix} \
--mandir="%{_mandir}" \
--python=%{_bindir}/python3 \
--pythonarchdir=%{python3_sitearch} \
--pythondir=%{python3_sitearch} \
--pyshebang="/usr/bin/python3" \
--sbindir=%{_sbindir} \
--bindir=%{_bindir} \
--enable-seccomp \
--enable-early-droproot \
--enable-leap-smear \
--enable-mssntp \
--refclock=all
python3 ./waf build --verbose %{?_smp_mflags}
%install
python3 ./waf install --destdir=%{buildroot}
# Use correct path in unit file
ln -s service %{buildroot}%{_sbindir}/rcntpd
ln -s service %{buildroot}%{_sbindir}/rcntplogtemp
ln -s service %{buildroot}%{_sbindir}/rcntpviz-daily
ln -s service %{buildroot}%{_sbindir}/rcntpviz-weekly
ln -s service %{buildroot}%{_sbindir}/rcntp-wait
install -pm 0644 -D %{SOURCE4} %{buildroot}%{_sysconfdir}/logrotate.d/ntp
install -pm 0644 -D %{SOURCE8} %{buildroot}%{_sysconfdir}/ntp.conf
%fdupes -s %{buildroot}
%check
python3 ./waf check --verbose %{?_smp_mflags}
%pre
%service_add_pre ntp.service ntpd.service
exit 0
%pre utils
%service_add_pre ntp-wait.service ntplogtemp.service ntpviz-daily.service ntpviz-weekly.service
%post
%service_add_post ntpd.service
%post utils
%service_add_post ntp-wait.service ntplogtemp.service ntpviz-daily.service ntpviz-weekly.service
%preun
%service_del_preun ntpd.service
%preun utils
%service_del_preun ntp-wait.service ntplogtemp.service ntpviz-daily.service ntpviz-weekly.service
%postun
%service_del_postun ntpd.service
%postun utils
%service_del_postun ntp-wait.service ntplogtemp.service ntpviz-daily.service ntpviz-weekly.service
%post -n libntpc1 -p /sbin/ldconfig
%postun -n libntpc1 -p /sbin/ldconfig
%files -n python3-ntp
%{python3_sitearch}/ntp
%{python3_sitearch}/ntp-1.2.3.egg-info
%files utils
%{_bindir}/ntploggps
%{_bindir}/ntpdig
%{_bindir}/ntpkeygen
%{_bindir}/ntpmon
%{_bindir}/ntpq
%{_bindir}/ntpsweep
%{_bindir}/ntptrace
%{_bindir}/ntpviz
%{_bindir}/ntpwait
%{_bindir}/ntplogtemp
%{_bindir}/ntpsnmpd
%{_mandir}/man1/ntploggps.1%{?ext_man}
%{_mandir}/man1/ntpdig.1%{?ext_man}
%{_mandir}/man8/ntpkeygen.8%{?ext_man}
%{_mandir}/man1/ntpmon.1%{?ext_man}
%{_mandir}/man1/ntpq.1%{?ext_man}
%{_mandir}/man1/ntpsweep.1%{?ext_man}
%{_mandir}/man1/ntptrace.1%{?ext_man}
%{_mandir}/man1/ntpviz.1%{?ext_man}
%{_mandir}/man8/ntpwait.8%{?ext_man}
%{_mandir}/man1/ntplogtemp.1%{?ext_man}
%{_mandir}/man8/ntpsnmpd.8%{?ext_man}
%{_sbindir}/rcntp-wait
%{_sbindir}/rcntplogtemp
%{_sbindir}/rcntpviz-daily
%{_sbindir}/rcntpviz-weekly
%{_unitdir}/ntp-wait.service
%{_unitdir}/ntplogtemp.*
%{_unitdir}/ntpviz-*
%files doc
%dir %{_docdir}/%{name}/html
%doc %{_docdir}/%{name}/html/*
%files -n libntpc1
%{_libdir}/libntpc.so.1*
%files devel
%{_libdir}/libntpc.so
%files
%license LICENSES/*
%doc NEWS.adoc README.adoc
%config(noreplace) %{_sysconfdir}/ntp.conf
%{_sbindir}/rcntpd
%{_bindir}/ntpfrob
%{_bindir}/ntpleapfetch
%{_bindir}/ntptime
%{_sbindir}/ntpd
%{_mandir}/man5/ntp.conf.5%{?ext_man}
%{_mandir}/man5/ntp.keys.5%{?ext_man}
%{_mandir}/man8/ntpd.8%{?ext_man}
%{_mandir}/man8/ntpfrob.8%{?ext_man}
%{_mandir}/man8/ntpleapfetch.8%{?ext_man}
%{_mandir}/man8/ntptime.8%{?ext_man}
%config %{_sysconfdir}/logrotate.d/ntp
%{_unitdir}/ntpd.service
%changelog