From 5bd74d3fa2c83af27d9dffaad467aad6c95d1bd8 Mon Sep 17 00:00:00 2001 From: Lars Karlitski Date: Fri, 20 Nov 2020 18:08:16 +0100 Subject: [PATCH] koji-osbuild.spec: don't generate from .in file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove koji-osbuild.spec.in and the bits in meson.build that generate the final spec file out of it. Pull in the changelog from how Ondřej Budai does it in osbuild-composer, because it's adorable. When releasing, the version now has to be bumped in the spec file. This is to make it consistent with other osbuild projects, and to simplify reverse dependency testing. --- koji-osbuild.spec.in => koji-osbuild.spec | 10 +++--- meson.build | 41 ++++++----------------- 2 files changed, 16 insertions(+), 35 deletions(-) rename koji-osbuild.spec.in => koji-osbuild.spec (96%) diff --git a/koji-osbuild.spec.in b/koji-osbuild.spec similarity index 96% rename from koji-osbuild.spec.in rename to koji-osbuild.spec index f0b5730..8846678 100644 --- a/koji-osbuild.spec.in +++ b/koji-osbuild.spec @@ -1,8 +1,7 @@ -%global commit @commit@ %global forgeurl https://github.com/osbuild/koji-osbuild Name: koji-osbuild -Version: @version@ +Version: 3 Release: 0%{?dist} Summary: Koji integration for osbuild composer @@ -152,5 +151,8 @@ Integration tests for koji-osbuild. To be run on a dedicated system. %changelog -* @longdate@ osbuild - @version@-@reltag@ -- build from git sources. +# the changelog is distribution-specific, therefore there's just one entry +# to make rpmlint happy. + +* Tue Aug 25 2020 Image Builder team - 0-1 +- On this day, this project was born. diff --git a/meson.build b/meson.build index 96cb8a0..deb6867 100644 --- a/meson.build +++ b/meson.build @@ -1,4 +1,4 @@ -project('koji-osbuild', license: 'ASL 2.0', version: '3') +project('koji-osbuild', license: 'ASL 2.0') srcdir = meson.source_root() @@ -16,33 +16,12 @@ install_data( ) git = find_program('git') - -subs = configuration_data() -subs.set('version', meson.project_version()) - -longdate = run_command('date', '+%a %b %d %Y').stdout().strip() -subs.set('longdate', longdate) - -gitres = run_command(git, ['--git-dir=@0@/.git'.format(srcdir), - 'rev-parse', - '--short=7', - 'HEAD']) - -if gitres.returncode() == 0 - commit = gitres.stdout().strip() - subs.set('commit', commit) - - gitrev = gitres.stdout().strip() - gitdate = run_command('date', '+%Y%m%d').stdout().strip() - # YYYYMMDD - subs.set('reltag', '@0@git@1@'.format(gitdate, gitrev)) -endif - -spec_file = configure_file( - input: 'koji-osbuild.spec.in', - output: 'koji-osbuild.spec', - configuration: subs +gitres = run_command( + git, + ['--git-dir=@0@/.git'.format(srcdir), 'rev-parse', 'HEAD'], + check=True ) +commit = gitres.stdout().strip() archive_name = meson.project_name() + '-' + gitrev full_archive_name = archive_name + '.tar.gz' @@ -79,7 +58,8 @@ srpm_target = custom_target( rpmbuild, '-bs', spec_file, '--define', '_sourcedir ' + meson.build_root(), - '--define', '_topdir ' + rpmdirs_target.full_path() + '--define', '_topdir ' + rpmdirs_target.full_path(), + '--define', 'commit ' + commit ], output: 'srpms', depends: [archive] @@ -91,15 +71,14 @@ rpm_target = custom_target( rpmbuild, '-ba', spec_file, '--define', '_sourcedir ' + meson.build_root(), - '--define', '_topdir ' + rpmdirs_target.full_path() + '--define', '_topdir ' + rpmdirs_target.full_path(), + '--define', 'commit ' + commit ], output: 'rpms', depends: [archive] ) msg = ['', - 'version: @0@'.format(meson.project_version()), - '', 'hub plugins path: @0@'.format(hub_plugins_path), 'builder plugins path: @0@'.format(builder_plugins_path), '',