koji-osbuild.spec: don't generate from .in file

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.
This commit is contained in:
Lars Karlitski 2020-11-20 18:08:16 +01:00
parent 1c13e8106f
commit 5bd74d3fa2
2 changed files with 16 additions and 35 deletions

View file

@ -1,8 +1,7 @@
%global commit @commit@
%global forgeurl https://github.com/osbuild/koji-osbuild %global forgeurl https://github.com/osbuild/koji-osbuild
Name: koji-osbuild Name: koji-osbuild
Version: @version@ Version: 3
Release: 0%{?dist} Release: 0%{?dist}
Summary: Koji integration for osbuild composer Summary: Koji integration for osbuild composer
@ -152,5 +151,8 @@ Integration tests for koji-osbuild. To be run on a dedicated system.
%changelog %changelog
* @longdate@ osbuild <osbuilders@osbuild.org> - @version@-@reltag@ # the changelog is distribution-specific, therefore there's just one entry
- build from git sources. # to make rpmlint happy.
* Tue Aug 25 2020 Image Builder team <osbuilders@osbuild.org> - 0-1
- On this day, this project was born.

View file

@ -1,4 +1,4 @@
project('koji-osbuild', license: 'ASL 2.0', version: '3') project('koji-osbuild', license: 'ASL 2.0')
srcdir = meson.source_root() srcdir = meson.source_root()
@ -16,33 +16,12 @@ install_data(
) )
git = find_program('git') git = find_program('git')
gitres = run_command(
subs = configuration_data() git,
subs.set('version', meson.project_version()) ['--git-dir=@0@/.git'.format(srcdir), 'rev-parse', 'HEAD'],
check=True
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<scm><revision>
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
) )
commit = gitres.stdout().strip()
archive_name = meson.project_name() + '-' + gitrev archive_name = meson.project_name() + '-' + gitrev
full_archive_name = archive_name + '.tar.gz' full_archive_name = archive_name + '.tar.gz'
@ -79,7 +58,8 @@ srpm_target = custom_target(
rpmbuild, '-bs', rpmbuild, '-bs',
spec_file, spec_file,
'--define', '_sourcedir ' + meson.build_root(), '--define', '_sourcedir ' + meson.build_root(),
'--define', '_topdir ' + rpmdirs_target.full_path() '--define', '_topdir ' + rpmdirs_target.full_path(),
'--define', 'commit ' + commit
], ],
output: 'srpms', output: 'srpms',
depends: [archive] depends: [archive]
@ -91,15 +71,14 @@ rpm_target = custom_target(
rpmbuild, '-ba', rpmbuild, '-ba',
spec_file, spec_file,
'--define', '_sourcedir ' + meson.build_root(), '--define', '_sourcedir ' + meson.build_root(),
'--define', '_topdir ' + rpmdirs_target.full_path() '--define', '_topdir ' + rpmdirs_target.full_path(),
'--define', 'commit ' + commit
], ],
output: 'rpms', output: 'rpms',
depends: [archive] depends: [archive]
) )
msg = ['', msg = ['',
'version: @0@'.format(meson.project_version()),
'',
'hub plugins path: @0@'.format(hub_plugins_path), 'hub plugins path: @0@'.format(hub_plugins_path),
'builder plugins path: @0@'.format(builder_plugins_path), 'builder plugins path: @0@'.format(builder_plugins_path),
'', '',