%global groupname daemoner %global username daemoner %global homedir / Name: daemon Version: daemon.0.2 Release: 1.20251027083516333219.pr18.14.gf6ab42d%{?dist} Summary: Example of daemon License: GPL URL: https://github.com/jirihnidek/daemon Source0: daemon-daemon.0.2.tar.gz Requires(pre): shadow-utils BuildRequires: gcc BuildRequires: make BuildRequires: cmake BuildRequires: systemd BuildRequires: systemd-rpm-macros %description This package contains example of simple UNIX daemon %pre getent group %{groupname} >/dev/null || groupadd -r %{groupname} getent passwd %{username} >/dev/null || \ useradd -r -g %{groupname} -d %{homedir} -s /sbin/nologin \ -c "User used for running example of daemon" %{username} exit 0 # Section for preparation of build %prep # Following macro just has to be here. It unpacks the original source from # tag.gz archive. It is "interesting" that rpmbuild does not do this # automatically, when Source0 is defined, but you have to call it explicitly. %setup -q -n daemon-daemon.0.2 # Build section %build # We have to use build type "Debug" to be able to create all variants of # rpm packages (debuginfo, debug source). The normal rpm is stripped from # debug information. Following macro just run cmake and it generates Makefile %cmake -DCMAKE_BUILD_TYPE="Debug" # This macro runs make -f Makefile generated in previous step %cmake_build # Install section %install # Remove previous build results rm -rf $RPM_BUILD_ROOT # This macro runs make -f Makefile install and it installs # all files to $RPM_BUILD_ROOT %cmake_install # This is special section again. You have to list here all files # that are part of final RPM package. You can specify owner of # files and permissions to files %files # Files and directories owned by root:root %attr(755,root,root) %{_bindir}/daemon %attr(755,root,root) %dir %{_sysconfdir}/daemon %attr(644,root,root) %{_unitdir}/simple-daemon.service %attr(644,root,root) %{_unitdir}/forking-daemon.service # File owned by root, but group can read it %attr(640,root,%{groupname}) %{_sysconfdir}/daemon/daemon.conf # Files and directories owned by daemoner:daemoner user %attr(755,%{username},%{groupname}) %{_var}/log/daemon %attr(755,%{username},%{groupname}) %{_rundir}/daemon # This is section, where you should describe all important changes # in RPM %changelog * Mon Oct 27 2025 Packit - daemon.0.2-1.20251027083516333219.pr18.14.gf6ab42d - Bump actions/upload-artifact from 4 to 5 (dependabot[bot]) - Bump actions/checkout from 4 to 5 (dependabot[bot]) - fix: removed RHELs and Centos Stream 8 from .packit. (Jiri Hnidek) - feat: Create dependabot.yml (Jiri Hnidek) - fix: update versions of github actions. (Jiri Hnidek) - fix: Do not set any version in CMakeLists.txt (Jiri Hnidek) - fix: Small typo in comment. (Jiri Hnidek) - fix: Small changes of daemon.spec file (Jiri Hnidek) - feat: Added initial packit conf file to git repository (Jiri Hnidek) - Added two BuildRequires related to systemd. (Jiri Hnidek) - Fix building of rpm on github action. (Jiri Hnidek) - Fixed warning and marked project as C project. (Jiri Hnidek) * Mon Jan 22 2024 Jiri Hnidek - Add initial support for Packit - Updated version of daemon to 0.2 * Tue Oct 24 2023 Jiri Hnidek - Fix building of RPM on COPR * Wed Sep 29 2021 Jiri Hnidek - Use non-root user for runnig daemon * Mon Sep 27 2021 Jiri Hnidek - Use GitHub Actions for building RPM * Fri Aug 27 2021 Jiri Hnidek - RPM package built with tito * Fri Aug 27 2021 Jiri Hnidek - Added first version of daemon.spec