1+ %global _hardened_build 1
2+
3+ %if 0%{?rhel } && 0%{?rhel } < 7
4+ # If it's RHEL6 and older
5+ %bcond_with systemd
6+ %else
7+ %bcond_without systemd
8+ %endif
9+
10+ %if "%{_vendor }" == "debbuild"
11+ # Set values to make debian builds work well
12+ %global _defaultdocdir /usr/share/doc/%{name }
13+ %global _buildshell /bin/bash
14+ %global _lib lib/%(%{__dpkg_architecture} -qDEB_HOST_MULTIARCH)
15+ %endif
16+
17+ # Compatibility macros
18+ %{! ?_tmpfilesdir:%global _tmpfilesdir %{_prefix }/lib/tmpfiles.d}
19+ %{! ?make_build:%global make_build %{__make} %{?_smp_mflags }}
20+
121Vendor: Microsoft Corporation
222Distribution: Azure Linux
3- Name: tlog
4- Version: 9
5- Release: 2%{?dist }
6- Summary: Terminal I/O logger
23+ Name: tlog
24+ Version: 14
25+ Release: 3%{?dist }
26+ Summary: Terminal I/O logger
27+
28+ %if "%{_vendor }" == "debbuild"
29+ # Required for Debian
30+ Packager: Justin Stephenson < jstephen@redhat.com>
31+ Group: admin
32+ License: GPL-2.0 +
33+ %else
34+ Group: Applications/System
35+ License: GPL-2.0 -or-later
36+ %endif
737
8- License : GPLv2+
9- URL : https://github.com/Scribery /%{name }
10- Source : https://github.com/Scribery/%{ name }/releases/download/v%{ version }/%{ name }-%{ version }.tar.gz
38+ URL : https://github.com/Scribery/%{ name }
39+ Source0 : %{ url }/releases/download/v%{ version } /%{name }-%{ version }.tar.gz
40+ Source1 : tlog.sysusers
1141
12- BuildRequires: gcc
13- BuildRequires: json-c-devel
14- BuildRequires: curl-devel
42+ BuildRequires: autoconf
43+ BuildRequires: automake
44+ BuildRequires: libtool
1545BuildRequires: m4
16- # If it's not RHEL6 and older
17- %if 0%{?rhel } == 0 || 0%{?rhel } >= 7
18- BuildRequires: systemd-devel
19- BuildRequires: systemd-units
46+ BuildRequires: gcc
47+ BuildRequires: make
48+
49+ %if "%{_vendor }" == "debbuild"
50+ BuildRequires: libjson-c-dev
51+ BuildRequires: libcurl4-gnutls-dev
52+ BuildRequires: libutempter-dev
53+ # Debian/Ubuntu doesn't automatically pull this in...
54+ BuildRequires: pkg-config
55+
56+ %if %{with systemd }
57+ BuildRequires: libsystemd-dev
58+ # Expanded form of systemd_requires macro
59+ Requires: systemd-sysv
60+ Requires(preun): systemd
61+ Requires(post): systemd
62+ Requires(postun): systemd
63+ %{?sysusers_requires_compat }
2064%endif
21- Requires(post): sed
22- Requires(postun): sed
2365
66+ %else
67+ BuildRequires: pkgconfig(json-c)
68+ BuildRequires: pkgconfig(libcurl)
69+ %if %{defined suse_version }
70+ BuildRequires: utempter-devel
71+ %else
72+ BuildRequires: libutempter-devel
73+ %endif
74+
75+ %if %{with systemd }
76+ BuildRequires: pkgconfig(libsystemd)
77+ %{?systemd_requires }
78+ %endif
79+ %endif
2480
2581%description
2682Tlog is a terminal I/O recording program similar to "script", but used in
2783place of a user's shell, starting the recording and executing the real user's
2884shell afterwards. The recorded I/O can then be forwarded to a logging server
2985in JSON format.
3086
31- %global _hardened_build 1
32-
3387%prep
3488%setup -q
3589
3690%build
37- # If it's not RHEL6 and older
38- %if 0%{?rhel } == 0 || 0%{?rhel } > = 7
39- %configure --disable-rpath --disable-static
40- # Else, if it's RHEL6 or older
41- %else
42- %configure --disable-rpath --disable-static --disable-journal
43- %endif
44- make %{?_smp_mflags }
91+ %configure --disable-rpath --disable-static --enable-utempter %{! ? with_systemd:--disable-journal} --docdir=%{_defaultdocdir }/%{name }
92+ %make_build
4593
4694%check
47- make %{?_smp_mflags } check
48-
49- %pre
50- getent group %{name } > /dev/null ||
51- groupadd -r %{name }
52- getent passwd %{name } > /dev/null ||
53- useradd -r -g %{name } -d %{_localstatedir }/run/%{name } -s /usr/sbin/nologin \
54- -c " Tlog terminal I/O logger" %{name }
95+ %make_build check
5596
5697%install
57- make install DESTDIR=%{ buildroot }
98+ % make_install
5899rm %{buildroot }/%{_libdir }/* .la
100+
59101# Remove development files as we're not doing a devel package yet
60102rm %{buildroot }/%{_libdir }/*.so
61103rm -r %{buildroot }/usr/include/%{name }
62104
63- # If it's not RHEL6 and older
64- %if 0%{?rhel } == 0 || 0%{?rhel } >= 7
105+ %if %{with systemd }
65106 # Create tmpfiles.d configuration for the lock dir
66107 mkdir -p %{buildroot }%{_tmpfilesdir }
67108 {
68109 echo "# Type Path Mode UID GID Age Argument"
69110 echo "d /run/%{name } 0755 %{name } %{name }"
70111 } > %{buildroot }%{_tmpfilesdir }/%{name }.conf
71- # Create the lock dir
72- mkdir -p %{buildroot }/run
73- install -d -m 0755 %{buildroot }/run/%{name }
74112# Else, if it's RHEL6 or older
75113%else
76114 # Create the lock dir
77115 mkdir -p %{buildroot }%{_localstatedir }/run
78116 install -d -m 0755 %{buildroot }%{_localstatedir }/run/%{name }
79117%endif
80118
119+ install -p -D -m 0644 %{SOURCE1 } %{buildroot }%{_sysusersdir }/%{name }.conf
120+
81121%files
82122%{! ? _licensedir:%global license %doc }
83123%license COPYING
@@ -89,29 +129,98 @@ rm -r %{buildroot}/usr/include/%{name}
89129%{_datadir }/%{name }
90130%{_mandir }/man5/*
91131%{_mandir }/man8/*
92- # If it's not RHEL6 and older
93- %if 0%{?rhel } == 0 || 0%{?rhel } > = 7
94- %config(noreplace) %{_tmpfilesdir }/%{name }.conf
95- %dir %attr(-,%{name},%{name}) /run/%{name }
96- # Else if it's RHEL6 or older
132+ %if %{with systemd }
133+ %{_tmpfilesdir }/%{name }.conf
97134%else
135+ # If it's RHEL6 and older
98136%dir %attr(-,%{name},%{name}) %{_localstatedir }/run/%{name }
99137%endif
100138%dir %{_sysconfdir }/%{name }
101139%config(noreplace) %{_sysconfdir }/%{name }/%{name }-rec.conf
102140%config(noreplace) %{_sysconfdir }/%{name }/%{name }-rec-session.conf
103141%config(noreplace) %{_sysconfdir }/%{name }/%{name }-play.conf
142+ %{_sysusersdir }/%{name }.conf
143+
144+ %pre
145+ %sysusers_create_compat %{SOURCE1 }
104146
105147%post
106148/sbin/ldconfig
149+ %if 0%{?el7 } || 0%{?suse_version } > = 1315
150+ # For RHEL7 and SUSE Linux distributions, creation doesn't happen automatically
151+ %tmpfiles_create %{name }.conf
152+ %endif
153+ %if 0%{?ubuntu } || 0%{?debian }
154+ # For Debian/Ubuntu, creation doesn't happen automatically
155+ systemd-tmpfiles --create %{name }.conf > /dev/null 2>&1 || :
156+ %endif
107157
108158%postun
109159/sbin/ldconfig
110160
111161%changelog
112- * Fri Apr 30 2021 Pawel Winogrodzki <pawelwi@microsoft.com> - 9-2
113- - Initial CBL-Mariner import from Fedora 33 (license: MIT).
114- - Making binaries paths compatible with CBL-Mariner's paths.
162+ * Wed Jan 15 2025 Archana Shettigar <v-shettigara@microsoft.com> - 14-3
163+ - Initial Azure Linux import from Fedora 41 (license: MIT).
164+ - License verified
165+
166+ * Sat Jul 20 2024 Fedora Release Engineering <releng@fedoraproject.org> - 14-2
167+ - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
168+
169+ * Tue Feb 06 2024 Justin Stephenson <jstephen@redhat.com> - 14-1
170+ - Release v14
171+ - configure: correctly handle systemd versions before 245
172+
173+ * Sat Jan 27 2024 Fedora Release Engineering <releng@fedoraproject.org> - 13-4
174+ - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
175+
176+ * Sat Jul 22 2023 Fedora Release Engineering <releng@fedoraproject.org> - 13-3
177+ - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
178+
179+ * Fri Jul 14 2023 Justin Stephenson <jstephen@redhat.com> - 13-2
180+ - Provide a sysusers.d file to get user() and group() provides
181+ (see https://fedoraproject.org/wiki/Changes/Adopting_sysusers.d_format).
182+
183+ * Fri Apr 14 2023 Justin Stephenson <jstephen@redhat.com> - 13-1
184+ - Release v13
185+ - Update the Fedora license
186+ - MAN: Add missing comma in tlog-rec-session.conf
187+
188+ * Sat Jan 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 12.1-3
189+ - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
190+
191+ * Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 12.1-2
192+ - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
193+
194+ * Wed Apr 20 2022 Justin Stephenson <jstephen@redhat.com> - 12.1
195+ - Exit transfer loop when output fd is closed
196+ - Revert "Prevent infinite transfer loop on GDM login"
197+
198+ * Sat Jan 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 12-2
199+ - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
200+
201+ * Tue Nov 16 2021 Justin Stephenson <jstephen@redhat.com> - 12-1
202+ - Release v12
203+ - Prevent infinite transfer loop on GDM login.
204+ - tlog-play: add journal namespace support.
205+ - tlitest: extend delay for limit-action delay test.
206+
207+ * Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 11-4
208+ - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
209+
210+ * Sat Jul 10 2021 Björn Esser <besser82@fedoraproject.org> - 11-3
211+ - Rebuild for versioned symbols in json-c
212+
213+ * Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 11-2
214+ - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
215+
216+ * Tue Jan 19 2021 Justin Stephenson <jstephen@redhat.com> - 11-1
217+ - Release v11
218+ - Fire SIGCHLD after utempter_add_record since it probably eats it.
219+
220+ * Fri Jan 8 2021 Justin Stephenson <jstephen@redhat.com> - 10-1
221+ - Release v10
222+ - Correct suse rpmbuild
223+ - Update debbuild for travis CI
115224
116225* Tue Oct 13 2020 Justin Stephenson <jstephen@redhat.com> - 9-1
117226- Release v9
0 commit comments