diff options
author | Niels de Vos <ndevos@redhat.com> | 2017-02-23 12:15:32 +0100 |
---|---|---|
committer | Prasanna Kumar Kalever <prasanna.kalever@redhat.com> | 2017-02-25 16:26:46 +0530 |
commit | ceb5a8a96becee3d3d5df9a51428e629d66d0585 (patch) | |
tree | 68083e0853a0ebba7e77e72bdb6e48e1d67890d3 | |
parent | cf23c6e16217a9bc52e73799ad70cae22dc7a746 (diff) |
build: cleaner build RPMs with "make rpms"
There is no need to copy all the files everywhere, this can be
controlled with --define options to rpmbuild.
Also add a "make srpm" target for building the source RPM that can then
be built with 'mock' or uploaded to build systems from different
distributions.
Change-Id: Ib66bfe9b981fd9bf12f997d416ff3b9f53da90d8
Signed-off-by: Niels de Vos <ndevos@redhat.com>
-rw-r--r-- | Makefile.am | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/Makefile.am b/Makefile.am index 97cc3be..60c14d4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -8,16 +8,18 @@ CLEANFILES = *~ gluster-block.spec EXTRA_DIST = autogen.sh README.md COPYING-GPLV2 COPYING-LGPLV3 -rpms: prep - QA_RPATHS=17 rpmbuild --define '_topdir $(abs_top_builddir)/build/rpmbuild' \ - -ba $(abs_top_builddir)/build/rpmbuild/SPECS/gluster-block.spec +rpms: prep + rpmbuild --define '_topdir $(abs_top_builddir)/build/rpmbuild' \ + --define '_sourcedir $(abs_top_builddir)' \ + -ba gluster-block.spec + +srpm: prep + rpmbuild --define '_topdir $(abs_top_builddir)/build/rpmbuild' \ + --define '_sourcedir $(abs_top_builddir)' \ + -bs gluster-block.spec prep: dist - mkdir -p build/rpmbuild && cd build/rpmbuild \ - && mkdir BUILD SPECS RPMS SRPM SOURCES && cd ../.. - rm -rf rpmbuild/SOURCES/* - cp *.tar.gz build/rpmbuild/SOURCES - cp gluster-block.spec build/rpmbuild/SPECS + @mkdir -p build/rpmbuild/{BUILD,SPECS,RPMS,SRPMS,SOURCES} uninstall-local: cd $(DESTDIR)$(bindir) && rm -f gluster-block gluster-blockd |