From 78fec6507417e1906e473e7b3c9601bdb7e913bf Mon Sep 17 00:00:00 2001 From: Jiri Hnidek Date: Fri, 27 Aug 2021 15:08:41 +0200 Subject: [PATCH 1/2] Initialized to use tito. --- .tito/packages/.readme | 3 +++ .tito/tito.props | 5 +++++ 2 files changed, 8 insertions(+) create mode 100644 .tito/packages/.readme create mode 100644 .tito/tito.props diff --git a/.tito/packages/.readme b/.tito/packages/.readme new file mode 100644 index 0000000..b9411e2 --- /dev/null +++ b/.tito/packages/.readme @@ -0,0 +1,3 @@ +the .tito/packages directory contains metadata files +named after their packages. Each file has the latest tagged +version and the project's relative directory. diff --git a/.tito/tito.props b/.tito/tito.props new file mode 100644 index 0000000..eab3f19 --- /dev/null +++ b/.tito/tito.props @@ -0,0 +1,5 @@ +[buildconfig] +builder = tito.builder.Builder +tagger = tito.tagger.VersionTagger +changelog_do_not_remove_cherrypick = 0 +changelog_format = %s (%ae) From 2261289ff3daa10550f01c63a4a961d1e9683e81 Mon Sep 17 00:00:00 2001 From: Jiri Hnidek Date: Fri, 27 Aug 2021 22:07:32 +0200 Subject: [PATCH 2/2] Added daemon.spec file * It is possible to puild rpm package using e.g. tito --- .tito/packages/daemon | 0 CMakeLists.txt | 4 +-- daemon.spec | 70 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 .tito/packages/daemon create mode 100644 daemon.spec diff --git a/.tito/packages/daemon b/.tito/packages/daemon new file mode 100644 index 0000000..e69de29 diff --git a/CMakeLists.txt b/CMakeLists.txt index e58e927..6ff8bae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,8 +15,8 @@ project (Daemon) # The version number set (${PROJECT_NAME}_VERSION_MAJOR 0) -set (${PROJECT_NAME}_VERSION_MINOR 0) -set (${PROJECT_NAME}_PATCH_LEVEL 1) +set (${PROJECT_NAME}_VERSION_MINOR 1) +set (${PROJECT_NAME}_PATCH_LEVEL 0) set (${PROJECT_NAME}_VERSION "${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}") diff --git a/daemon.spec b/daemon.spec new file mode 100644 index 0000000..837a692 --- /dev/null +++ b/daemon.spec @@ -0,0 +1,70 @@ +Name: daemon +Version: 0.1 +Release: 1%{?dist} +Summary: Example of daemon + +License: GPL +URL: https://github.com/jirihnidek/daemon +Source0: %{name}-%{version}.tar.gz + +BuildRequires: gcc +BuildRequires: make +BuildRequires: cmake + + +%description +This package contains example of simple UNIX daemon + + +# 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 + + +# Build section +%build + +# We have to use build type "Debug" to be able to create all variants of +# rpm packages (debuginfo, debugsource). 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. +%files + +%attr(755,root,root) %{_bindir}/daemon +%attr(755,root,root) %dir %{_sysconfdir}/daemon +%attr(750,root,root) %{_sysconfdir}/daemon/daemon.conf +%attr(644,root,root) %{_unitdir}/simple-daemon.service +%attr(644,root,root) %{_unitdir}/forking-daemon.service + + +# This is section, where you should describe all important changes +# in RPM +%changelog + +* Fri Aug 27 2021 Jiri Hnidek +- new package built with tito + +* Fri Aug 27 2021 Jiri Hnidek +- Added first version of daemon.spec