From ae7c54f3737b3646edfa5c4d4d7fd553aa296da6 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Fri, 22 Jan 2016 00:47:24 +0100 Subject: Spec file becomes a template, auto filled with the date and version --- CMakeLists.txt | 9 +++++ packaging/biboumi.spec | 81 ------------------------------------------ packaging/biboumi.spec.cmake | 84 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 93 insertions(+), 81 deletions(-) delete mode 100644 packaging/biboumi.spec create mode 100644 packaging/biboumi.spec.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 7e356c9..167415e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,8 +24,11 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Mo ## Get the software version # set(ARCHIVE_NAME ${CMAKE_PROJECT_NAME}-${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}) +set(RPM_VERSION ${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}) + if(${PROJECT_NAME}_VERSION_SUFFIX MATCHES ".+") set(ARCHIVE_NAME ${ARCHIVE_NAME}${${PROJECT_NAME}_VERSION_SUFFIX}) + set(RPM_VERSION ${RPM_VERSION}${${PROJECT_NAME}_VERSION_SUFFIX}) endif() if(${PROJECT_NAME}_VERSION_SUFFIX MATCHES "^~dev$") @@ -39,6 +42,7 @@ if(${PROJECT_NAME}_VERSION_SUFFIX MATCHES "^~dev$") if(GIT_REVISION) set(${PROJECT_NAME}_VERSION_SUFFIX "${${PROJECT_NAME}_VERSION_SUFFIX} (${GIT_REVISION})") set(ARCHIVE_NAME ${ARCHIVE_NAME}${GIT_REVISION}) + set(RPM_VERSION ${RPM_VERSION}${GIT_REVISION}) endif() endif() endif() @@ -251,3 +255,8 @@ else() set(WATCHDOG_SEC "") endif() configure_file(unit/biboumi.service.cmake biboumi.service) + +execute_process(COMMAND "date" "+%a %b %d %Y" OUTPUT_VARIABLE RPM_DATE + OUTPUT_STRIP_TRAILING_WHITESPACE) + +configure_file(packaging/biboumi.spec.cmake biboumi.spec) diff --git a/packaging/biboumi.spec b/packaging/biboumi.spec deleted file mode 100644 index 5c3afb4..0000000 --- a/packaging/biboumi.spec +++ /dev/null @@ -1,81 +0,0 @@ -Name: biboumi -Version: 2.0 -Release: 1%{?dist} -Summary: Lightweight XMPP to IRC gateway - -License: zlib -URL: http://biboumi.louiz.org -Source0: http://git.louiz.org/biboumi/snapshot/biboumi-%{version}.tar.xz - -BuildRequires: libidn-devel -BuildRequires: expat-devel -BuildRequires: libuuid-devel -BuildRequires: systemd-devel -BuildRequires: cmake -BuildRequires: systemd -BuildRequires: rubygem-ronn - -%global _hardened_build 1 - -%global biboumi_confdir %{_sysconfdir}/%{name} - - -%description -An XMPP gateway that connects to IRC servers and translates between the two -protocols. It can be used to access IRC channels using any XMPP client as if -these channels were XMPP MUCs. - - -%prep -%setup -q - - -%build -cmake . -DCMAKE_CXX_FLAGS="%{optflags}" \ - -DCMAKE_BUILD_TYPE=release \ - -DCMAKE_INSTALL_PREFIX=/usr \ - -DPOLLER=EPOLL \ - -DWITHOUT_BOTAN=1 \ - -DWITH_SYSTEMD=1 \ - -DWITH_LIBIDN=1 - -# The documentation is in utf-8, ronn fails to build it if that locale is -# not specified -export LC_ALL=en_GB.utf-8 -make %{?_smp_mflags} - - -%install -make install DESTDIR=%{buildroot} - - -%check -make check %{?_smp_mflags} - - -%files -%{_bindir}/%{name} -%{_mandir}/man1/%{name}.1* -%doc README COPYING doc/biboumi.1.md -%{_unitdir}/%{name}.service -%config(noreplace) %{biboumi_confdir}/biboumi.cfg - - -%changelog -* Wed Jan 13 2016 Le Coz Florent - 2.0-2 -- Do not install the systemd unit and configuration files, because - “make install” does it itself now - -* Fri May 29 2015 Le Coz Florent - 2.0-1 -- Update to 2.0 sources - -* Wed Nov 13 2014 Le Coz Florent - 1.1-2 -- Use the -DWITH(OUT) cmake flags for all optional dependencies -- Build with the correct optflags -- Use hardened_build - -* Wed Aug 18 2014 Le Coz Florent - 1.1-1 -- Update to 1.1 release - -* Wed Jun 25 2014 Le Coz Florent - 1.0-1 -- Spec file written from scratch diff --git a/packaging/biboumi.spec.cmake b/packaging/biboumi.spec.cmake new file mode 100644 index 0000000..633a168 --- /dev/null +++ b/packaging/biboumi.spec.cmake @@ -0,0 +1,84 @@ +Name: biboumi +Version: ${RPM_VERSION} +Release: 1%{?dist} +Summary: Lightweight XMPP to IRC gateway + +License: zlib +URL: http://biboumi.louiz.org +Source0: http://git.louiz.org/biboumi/snapshot/biboumi-%{version}.tar.xz + +BuildRequires: libidn-devel +BuildRequires: expat-devel +BuildRequires: libuuid-devel +BuildRequires: systemd-devel +BuildRequires: cmake +BuildRequires: systemd +BuildRequires: rubygem-ronn + +%global _hardened_build 1 + +%global biboumi_confdir %{_sysconfdir}/%{name} + + +%description +An XMPP gateway that connects to IRC servers and translates between the two +protocols. It can be used to access IRC channels using any XMPP client as if +these channels were XMPP MUCs. + + +%prep +%setup -q + + +%build +cmake . -DCMAKE_CXX_FLAGS="%{optflags}" \ + -DCMAKE_BUILD_TYPE=release \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DPOLLER=EPOLL \ + -DWITHOUT_BOTAN=1 \ + -DWITH_SYSTEMD=1 \ + -DWITH_LIBIDN=1 + +# The documentation is in utf-8, ronn fails to build it if that locale is +# not specified +export LC_ALL=en_GB.utf-8 +make %{?_smp_mflags} + + +%install +make install DESTDIR=%{buildroot} + + +%check +make check %{?_smp_mflags} + + +%files +%{_bindir}/%{name} +%{_mandir}/man1/%{name}.1* +%doc README COPYING doc/biboumi.1.md +%{_unitdir}/%{name}.service +%config(noreplace) %{biboumi_confdir}/biboumi.cfg + + +%changelog +* ${RPM_DATE} Le Coz Florent - ${RPM_VERSION}-1 +- Build latest git revision + +* Wed Jan 13 2016 Le Coz Florent - 2.0-2 +- Do not install the systemd unit and configuration files, because + “make install” does it itself now + +* Fri May 29 2015 Le Coz Florent - 2.0-1 +- Update to 2.0 sources + +* Thu Nov 13 2014 Le Coz Florent - 1.1-2 +- Use the -DWITH(OUT) cmake flags for all optional dependencies +- Build with the correct optflags +- Use hardened_build + +* Mon Aug 18 2014 Le Coz Florent - 1.1-1 +- Update to 1.1 release + +* Wed Jun 25 2014 Le Coz Florent - 1.0-1 +- Spec file written from scratch -- cgit v1.2.3