Skip to content

Commit ec0cab1

Browse files
committed
Fix and modernize RPM spec file.
- Update version to 1.4.5 - Fix license identifier (use SPDX format) - Remove duplicate BuildRequires - Add libcmocka-devel for tests - Add proper Requires with systemd dependencies - Use modern meson macros (%meson, %meson_build, %meson_test, %meson_install) - Add %check section to run tests during build - Add %pre section to create systemd-journal-netlog user - Add proper systemd scriptlets (%post, %preun, %postun) - Fix file paths (config, binary, service, man page) - Add license and documentation files - Add examples directory - Add state directory with correct permissions - Update changelog with all recent improvements
1 parent 1bac6d6 commit ec0cab1

1 file changed

Lines changed: 64 additions & 33 deletions

File tree

systemd-netlogd.spec

Lines changed: 64 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,92 @@
11
Name: systemd-netlogd
2-
Version: 1.4
2+
Version: 1.4.5
33
Release: 1%{?dist}
44
Summary: Forwards messages from the journal to other hosts over the network using syslog format RFC 5424
55

6-
License: GPLv2 and LGPL-2.1+ and CC0
6+
License: LGPL-2.1-or-later AND GPL-2.0-only
77
URL: https://github.com/systemd/systemd-netlogd
88
Source0: %{URL}/archive/v%{version}.tar.gz
99

10+
BuildRequires: gcc
11+
BuildRequires: meson >= 0.43
12+
BuildRequires: ninja-build
1013
BuildRequires: gperf
1114
BuildRequires: libcap-devel
12-
BuildRequires: pkg-config
13-
BuildRequires: systemd-devel
15+
BuildRequires: systemd-devel >= 230
16+
BuildRequires: openssl-devel
1417
BuildRequires: python3-sphinx
15-
BuildRequires: meson >= 0.43
18+
BuildRequires: python3-devel
19+
BuildRequires: python3-lxml
20+
BuildRequires: libcmocka-devel
21+
22+
Requires: systemd >= 230
23+
Requires(pre): shadow-utils
24+
Requires(post): systemd
25+
Requires(preun): systemd
26+
Requires(postun): systemd
1627

1728
%description
1829
Forwards messages from the journal to other hosts over the network
1930
using the Syslog Protocol (RFC 5424 and RFC 3339). It can be configured
20-
to send messages to both unicast and multicast addresses. systemd-netlogd
21-
runs with own user systemd-journal-netlog. Starts sending logs when network
22-
is up and stops sending as soon as network is down (uses sd-network).
23-
It reads from journal and forwards to network one by one. It does not
24-
use any extra disk space. systemd-netlogd supports UDP, TCP, TLS and DTLS
25-
(Datagram Transport Layer Security RFC 6012).
31+
to send messages to both unicast and multicast addresses.
2632

27-
BuildRequires: gcc
28-
BuildRequires: libcap-devel
29-
BuildRequires: docbook-style-xsl
30-
BuildRequires: gperf
31-
BuildRequires: python3-devel
32-
BuildRequires: python3-lxml
33-
BuildRequires: git
34-
BuildRequires: meson >= 0.43
35-
BuildRequires: systemd-devel
36-
BuildRequires: openssl-devel
33+
systemd-netlogd runs with its own user systemd-journal-netlog. It starts
34+
sending logs when network is up and stops sending as soon as network is
35+
down (uses sd-network). It reads from journal and forwards to network
36+
sequentially without local buffering or disk usage.
37+
38+
Supported transports: UDP, TCP, TLS (RFC 5425), DTLS (RFC 6012)
3739

3840
%prep
3941
%autosetup
40-
rm -rf build && mkdir build
4142

4243
%build
43-
pushd build
44-
meson ..
45-
ninja-build -v
46-
popd
44+
%meson
45+
%meson_build
46+
47+
%check
48+
%meson_test
4749

4850
%install
49-
pushd build
50-
DESTDIR=%{buildroot} ninja-build -v install
51-
popd
51+
%meson_install
52+
53+
%pre
54+
getent group systemd-journal >/dev/null 2>&1 || groupadd -r systemd-journal 2>/dev/null || :
55+
getent passwd systemd-journal-netlog >/dev/null || \
56+
useradd -r -g systemd-journal -d / -s /sbin/nologin \
57+
-c "systemd Network Logging" systemd-journal-netlog 2>/dev/null || :
58+
59+
%post
60+
%systemd_post systemd-netlogd.service
61+
62+
%preun
63+
%systemd_preun systemd-netlogd.service
64+
65+
%postun
66+
%systemd_postun_with_restart systemd-netlogd.service
5267

5368
%files
54-
%{_sysconfdir}/systemd/system/netlogd.conf
55-
%{_sysconfdir}/systemd/system/systemd-netlogd.service
56-
/lib/systemd/systemd-netlogd
69+
%license LICENSE.LGPL2.1 LICENSE.GPL2
70+
%doc README.md CONTRIBUTING.md ARCHITECTURE.md TESTING.md FAQ.md
71+
%doc examples/
72+
%config(noreplace) %{_sysconfdir}/systemd/netlogd.conf
73+
%{_prefix}/lib/systemd/systemd-netlogd
74+
%{_unitdir}/systemd-netlogd.service
5775
%{_mandir}/man8/systemd-netlogd.8*
76+
%dir %attr(0755,systemd-journal-netlog,systemd-journal) /var/lib/systemd-netlogd
5877

5978
%changelog
60-
* Tue May 14 2024 Susant Sahani <ssahani@gmail.com> - 1.4
79+
* Mon Jan 20 2025 Susant Sahani <ssahani@gmail.com> - 1.4.5-1
80+
- Update to version 1.4.5
81+
- Add comprehensive test suite with cmocka
82+
- Add GitHub Actions CI integration
83+
- Add extensive documentation (CONTRIBUTING.md, ARCHITECTURE.md, TESTING.md, FAQ.md)
84+
- Add configuration examples directory
85+
- Enhance man page with security and performance sections
86+
- Modernize README with Quick Start and troubleshooting
87+
- Fix spec file: remove duplicate BuildRequires, add user creation, use systemd macros
88+
- Add %check section to run tests during build
89+
- Include documentation and examples in package
90+
91+
* Tue May 14 2024 Susant Sahani <ssahani@gmail.com> - 1.4-1
6192
- Initial spec

0 commit comments

Comments
 (0)