debian-koji-osbuild/meson.build
robojerk 568d10dc92
Some checks failed
Tests / 🐍 Lint (push) Failing after 58s
Tests / Unit tests (push) Failing after 2s
Tests / Shellcheck (push) Failing after 2s
Trigger GitLab CI / pr-info (push) Failing after 1s
Trigger GitLab CI / trigger-gitlab (push) Has been skipped
Did stuff
2025-08-26 11:49:49 -07:00

87 lines
1.9 KiB
Meson

project('koji-osbuild', license: 'ASL 2.0')
srcdir = meson.source_root()
hub_plugins_path = get_option('hub-plugins-path')
builder_plugins_path = get_option('builder-plugins-path')
install_data(
'plugins/hub/osbuild.py',
install_dir: hub_plugins_path,
)
install_data(
'plugins/builder/osbuild.py',
install_dir: builder_plugins_path
)
git = find_program('git')
gitres = run_command(
git,
['--git-dir=' + srcdir + '/.git', 'rev-parse', 'HEAD']
)
commit = gitres.stdout().strip()
archive_name = meson.project_name() + '-' + commit
full_archive_name = archive_name + '.tar.gz'
archive = custom_target(
'tarball',
command: [
git,
'-C', meson.source_root(),
'archive',
'-o', join_paths(meson.build_root(), full_archive_name),
'--prefix', archive_name + '/',
commit
],
output: full_archive_name,
)
mkdir = find_program('mkdir')
rpmdirs_target = custom_target(
'rpmdirs',
command: [
mkdir, '-p',
'rpmbuild/BUILD',
'rpmbuild/RPMS',
'rpmbuild/SPECS',
'rpmbuild/SRPMS'],
output: 'rpmbuild',
)
rpmbuild = find_program('rpmbuild', required: false)
if rpmbuild.found()
srpm_target = custom_target(
'srpm',
command: [
rpmbuild, '-bs',
'koji-osbuild.spec',
'--define', '_sourcedir ' + meson.build_root(),
'--define', '_topdir ' + rpmdirs_target.full_path(),
'--define', 'commit ' + commit
],
output: 'srpms',
depends: [archive]
)
rpm_target = custom_target(
'rpm',
command: [
rpmbuild, '-ba',
'koji-osbuild.spec',
'--define', '_sourcedir ' + meson.build_root(),
'--define', '_topdir ' + rpmdirs_target.full_path(),
'--define', 'commit ' + commit
],
output: 'rpms',
depends: [archive]
)
endif
msg = ['',
'hub plugins path: @0@'.format(hub_plugins_path),
'builder plugins path: @0@'.format(builder_plugins_path),
'',
]
message('\n '.join(msg))