%global debug_package %{nil} %global _hardened_build 1 %global commit 6488bbaf7ce012cf40eb323cb66a72de5407d695 %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global commitdate 20220420 Summary: TNFSD server Name: tnfsd Version: 0.1git%{shortcommit}.%{commitdate} Release: 3%{?dist} License: MIT URL: https://github.com/FujiNetWIFI/spectranet Source0: https://github.com/FujiNetWIFI/spectranet/archive/%{commit}/%{name}-%{shortcommit}.tar.gz Source1: %{name}.service Source2: %{name}.xml Source3: %{name}.logrotate Requires(pre): shadow-utils Requires: (tnfsd-firewalld = %{?epoch}:%{version}-%{release} if firewalld) %{?systemd_requires} BuildRequires: systemd BuildRequires: gcc BuildRequires: firewalld-filesystem %description This is a version of the Spectranet TNFSD server that has been extended for use with #FujiNet devices. %package firewalld Summary: FirewallD metadata file for TNFSD Requires: firewalld-filesystem Requires(post): firewalld-filesystem %description firewalld This package contains FirewallD file for TNFSD. %prep %autosetup -n spectranet-%{commit} %build cd tnfs/tnfsd %make_build OS=LINUX USAGELOG=yes %install install -d $RPM_BUILD_ROOT/%{_var}/lib/tnfs install -D -m 0755 tnfs/tnfsd/bin/%{name} $RPM_BUILD_ROOT/%{_bindir}/%{name} install -D -m 644 %{SOURCE1} $RPM_BUILD_ROOT/%{_unitdir}/%{name}.service install -D -m 0644 %{SOURCE2} $RPM_BUILD_ROOT/%{_prefix}/lib/firewalld/services/%{name}.xml install -D -m 0644 %{SOURCE3} $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/%{name} %pre getent group tnfs >/dev/null || groupadd -r tnfs getent passwd tnfs >/dev/null || \ useradd -r -g tnfs -d %{_var}/lib/tnfs -s /usr/sbin/nologin -c "TNFS Server" tnfs exit 0 %post %systemd_post %{name}.service %preun %systemd_preun %{name}.service %postun %systemd_postun_with_restart %{name}.service %files %doc tnfs/tnfsd/README.txt tnfs/tnfs-protocol.md %{_sysconfdir}/logrotate.d/%{name} %{_bindir}/%{name} %{_unitdir}/%{name}.service %dir %attr(0755,tnfs,tnfs) %{_var}/lib/tnfs %files firewalld %{_prefix}/lib/firewalld/services/%{name}.xml %changelog * Thu Nov 17 2022 Greg Wildman - 0.1git6488bba-3 - Remove DEBUG and create systemd service log file * Sun Oct 16 2022 Greg Wildman - 0.1git6488bba-1 - Initial spec.