-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: port the build system to meson
- Remove the custom Makefile in favor of meson - Move the systemd files and other data files into a data directory - Move the srpm and spec file into a dist/srpm subdirectory
- Loading branch information
Showing
19 changed files
with
337 additions
and
313 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
install_data( | ||
'rhc.bash', | ||
rename: 'rhc', | ||
install_dir: bash_completion.get_variable(pkgconfig: 'completionsdir'), | ||
) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
subdir('completion') | ||
subdir('systemd') |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
systemd_system_unit_dir = systemd.get_variable(pkgconfig: 'systemdsystemunitdir') | ||
systemd_system_preset_dir = systemd.get_variable(pkgconfig: 'systemdsystempresetdir') | ||
|
||
install_data('80-rhc.preset', install_dir: systemd_system_preset_dir) | ||
install_data('rhc-canonical-facts.service', install_dir: systemd_system_unit_dir) | ||
install_data('rhc-canonical-facts.timer', install_dir: systemd_system_unit_dir) |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
if get_option('build_srpm') | ||
subdir('srpm') | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
git = find_program('git') | ||
rpmbuild = find_program('rpmbuild') | ||
tar = find_program('tar') | ||
bash = find_program('bash') | ||
|
||
commit = run_command(git, 'rev-parse', 'HEAD', capture: true, check: true).stdout().strip() | ||
|
||
systemd_sysusers_dir = systemd.get_variable(pkgconfig: 'sysusersdir') | ||
|
||
if get_option('vendor') | ||
run_command( | ||
[bash, files(meson.project_source_root() / 'scripts' / 'vendor.sh')], | ||
check: true, | ||
) | ||
endif | ||
|
||
build_root_basename = meson.project_build_root().split('/').get(-1) | ||
tarball = custom_target( | ||
'tarball', | ||
command: [ | ||
tar, | ||
'--create', | ||
'--gzip', | ||
'--absolute-names', | ||
'--file', '@OUTPUT@', | ||
'--transform', 's+@0@+@1@-@2@+'.format( | ||
meson.project_source_root(), | ||
meson.project_name(), | ||
meson.project_version(), | ||
), | ||
'--exclude', build_root_basename, | ||
'--exclude', '.git', | ||
'--exclude', '.vscode', | ||
'--exclude', '.github', | ||
'--exclude', '.copr', | ||
meson.project_source_root(), | ||
], | ||
output: '@0@-@1@.tar.gz'.format(meson.project_name(), meson.project_version()), | ||
) | ||
|
||
specfile = configure_file( | ||
input: 'rhc.spec.in', | ||
output: '@BASENAME@', | ||
configuration: { | ||
'COMMIT': commit, | ||
'VERSION': meson.project_version(), | ||
}, | ||
) | ||
|
||
run_target( | ||
'srpm', | ||
command: [ | ||
rpmbuild, | ||
'-bs', | ||
'--define', 'commit @0@'.format(commit), | ||
'--define', '_srcrpmdir @0@'.format(meson.current_build_dir()), | ||
'--define', '_sourcedir @0@'.format(meson.current_build_dir()), | ||
specfile, | ||
], | ||
depends: [tarball], | ||
) |
Oops, something went wrong.