diff options
author | Igor Gnatenko <i.gnatenko.brain@gmail.com> | 2016-10-08 16:54:03 +0200 |
---|---|---|
committer | Igor Gnatenko <i.gnatenko.brain@gmail.com> | 2016-10-08 17:12:20 +0200 |
commit | 0d58ddd739c1d7f8c0e6e49b721dd3df965167c0 (patch) | |
tree | 0020b8dd40e814546a5a3eb59d6129b01b5351e5 /mesonbuild/modules/rpm.py | |
parent | 6c50253645dad81afbfd2e1bca2c5d9e08f42e05 (diff) | |
download | meson-0d58ddd739c1d7f8c0e6e49b721dd3df965167c0.zip meson-0d58ddd739c1d7f8c0e6e49b721dd3df965167c0.tar.gz meson-0d58ddd739c1d7f8c0e6e49b721dd3df965167c0.tar.bz2 |
rpm: couple of improvements and fixes
* Don't hardcode /usr/bin, use %{_bindir}
* Implement %meson_build / %meson_install / %meson_test
* Automatic handling of out-of-tree builds
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Diffstat (limited to 'mesonbuild/modules/rpm.py')
-rw-r--r-- | mesonbuild/modules/rpm.py | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/mesonbuild/modules/rpm.py b/mesonbuild/modules/rpm.py index 89194e9..13aa20b 100644 --- a/mesonbuild/modules/rpm.py +++ b/mesonbuild/modules/rpm.py @@ -104,7 +104,7 @@ class RPMModule: mlog.bold('dnf provides %s' % lib.fullpath)) for prog in state.environment.coredata.ext_progs.values(): if not prog.found(): - fn.write('BuildRequires: /usr/bin/%s # FIXME\n' % + fn.write('BuildRequires: %{_bindir}/%s # FIXME\n' % prog.get_name()) else: fn.write('BuildRequires: %s\n' % ' '.join(prog.fullpath)) @@ -115,32 +115,25 @@ class RPMModule: if devel_subpkg: fn.write('%package devel\n') fn.write('Summary: Development files for %{name}\n') - fn.write('Requires: %{name}%{?_isa} = %{version}-%{release}\n') + fn.write('Requires: %{name}%{?_isa} = %{?epoch:%{epoch}:}{version}-%{release}\n') fn.write('\n') fn.write('%description devel\n') fn.write('Development files for %{name}.\n') fn.write('\n') fn.write('%prep\n') fn.write('%autosetup\n') - fn.write('rm -rf rpmbuilddir && mkdir rpmbuilddir\n') fn.write('\n') fn.write('%build\n') - fn.write('pushd rpmbuilddir\n') - fn.write(' %meson ..\n') - fn.write(' ninja-build -v\n') - fn.write('popd\n') + fn.write('%meson\n') + fn.write('%meson_build\n') fn.write('\n') fn.write('%install\n') - fn.write('pushd rpmbuilddir\n') - fn.write(' DESTDIR=%{buildroot} ninja-build -v install\n') - fn.write('popd\n') + fn.write('%meson_install\n') if len(to_delete) > 0: - fn.write('rm -rf %s\n' % ' '.join(to_delete)) + fn.write('rm -vf %s\n' % ' '.join(to_delete)) fn.write('\n') fn.write('%check\n') - fn.write('pushd rpmbuilddir\n') - fn.write(' ninja-build -v test\n') - fn.write('popd\n') + fn.write('%meson_test\n') fn.write('\n') fn.write('%files\n') for f in files: @@ -153,7 +146,6 @@ class RPMModule: fn.write('\n') if so_installed: fn.write('%post -p /sbin/ldconfig\n') - fn.write('\n') fn.write('%postun -p /sbin/ldconfig\n') fn.write('\n') fn.write('%changelog\n') |