# Generated by rust2rpm 24 %bcond_without check Name: ntpd-rs Version: 1.0.0 Release: %autorelease Summary: Full-featured implementation of NTP with NTS support SourceLicense: Apache-2.0 OR MIT # Apache-2.0 OR BSL-1.0 # Apache-2.0 OR ISC OR MIT # Apache-2.0 OR MIT # BSD-3-Clause # ISC # ISC AND MIT AND OpenSSL # MIT # MIT OR Apache-2.0 License: BSD-3-Clause AND ISC AND MIT AND OpenSSL AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR ISC OR MIT) AND (Apache-2.0 OR MIT) URL: https://github.com/pendulum-project/ntpd-rs Source0: %{url}/archive/v%{version}/ntpd-rs-%{version}.tar.gz # sysusers.d configuration Source1: ntpd-rs.sysusers # tmpfiles.d configuration Source2: ntpd-rs.tmpfiles # move default ntpd-rs-observe socket from obsolete /var/run to /run Patch: 0001-Move-default-socket-path-from-var-run-to-run.patch BuildRequires: cargo-rpm-macros >= 24 BuildRequires: systemd-rpm-macros Requires(pre): systemd-sysusers Requires(pre): systemd-tmpfiles %global _description %{expand: Full-featured implementation of NTP with NTS support.} %description %{_description} %prep %autosetup -n ntpd-rs-%{version_no_tilde} -p1 %cargo_prep %generate_buildrequires %cargo_generate_buildrequires %build %cargo_build %{cargo_license_summary} %{cargo_license} > LICENSE.dependencies %install # install binaries install -Dpm0755 target/rpm/ntp-ctl -t %{buildroot}/%{_bindir} install -Dpm0755 target/rpm/ntp-daemon -t %{buildroot}/%{_bindir} install -Dpm0755 target/rpm/ntp-metrics-exporter -t %{buildroot}/%{_bindir} # install manual pages install -Dpm0644 docs/precompiled/man/*.5 -t %{buildroot}/%{_mandir}/man5 install -Dpm0644 docs/precompiled/man/*.8 -t %{buildroot}/%{_mandir}/man8 # install default ntpd-rs configuration file install -Dpm0644 docs/examples/conf/ntp.toml.default -t %{buildroot}/%{_pkgdocdir}/ install -Dpm0644 docs/examples/conf/ntp.toml.default %{buildroot}/%{_sysconfdir}/ntpd-rs/ntp.toml # install systemd services install -Dpm0644 docs/examples/conf/ntpd-rs.service -t %{buildroot}/%{_unitdir} install -Dpm0644 docs/examples/conf/ntpd-rs-metrics.service -t %{buildroot}/%{_unitdir} # install sysusers.d configuration install -Dpm0644 %{SOURCE1} %{buildroot}/%{_sysusersdir}/ntpd-rs.conf # install tmpfiles.d configuration install -Dpm0644 %{SOURCE2} %{buildroot}/%{_tmpfilesdir}/ntpd-rs.conf # create runtime directories mkdir -p %{buildroot}/%{_sharedstatedir}/ntpd-rs mkdir -p %{buildroot}/%{_sharedstatedir}/ntpd-rs-observe mkdir -p %{buildroot}/%{_rundir}/ntpd-rs %if %{with check} %check # * skip a test that fails to panic in release mode # * skip a test that fails in containerized environments %cargo_test -- -- --skip algorithm::kalman::peer::tests::test_offset_steering_and_measurements --skip hwtimestamp::tests::get_hwtimestamp %endif %pre %sysusers_create_package ntpd-rs %{SOURCE1} %tmpfiles_create_package ntpd-rs %{SOURCE2} %post %systemd_post ntpd-rs.service %preun %systemd_preun ntpd-rs.service %postun %systemd_postun_with_restart ntpd-rs.service %files %license COPYRIGHT %license LICENSE-APACHE %license LICENSE-MIT %license LICENSE.dependencies %doc CHANGELOG.md %doc README.md %doc SECURITY.md %dir %{_sysconfdir}/ntpd-rs %config(noreplace) %{_sysconfdir}/ntpd-rs/ntp.toml %{_bindir}/ntp-ctl %{_bindir}/ntp-daemon %{_bindir}/ntp-metrics-exporter %{_mandir}/man5/ntp.toml.5* %{_mandir}/man8/ntp-{ctl,daemon,metrics-exporter}.8* %{_unitdir}/ntpd-rs.service %{_unitdir}/ntpd-rs-metrics.service %{_sysusersdir}/ntpd-rs.conf %{_tmpfilesdir}/ntpd-rs.conf %{_pkgdocdir}/ntp.toml.default %ghost %dir %attr(0700, ntpd-rs, ntpd-rs) %{_sharedstatedir}/ntpd-rs %ghost %dir %attr(0700, ntpd-rs-observe, ntpd-rs-observe) %{_sharedstatedir}/ntpd-rs-observe %ghost %dir %attr(0700, ntpd-rs-observe, ntpd-rs-observe) %{_rundir}/ntpd-rs %changelog %autochangelog