diff options
author | astokes <astokes@ef72aa8b-4018-0410-8976-d6e080ef94d8> | 2010-03-31 20:25:51 +0000 |
---|---|---|
committer | astokes <astokes@ef72aa8b-4018-0410-8976-d6e080ef94d8> | 2010-03-31 20:25:51 +0000 |
commit | 13e8fe8bd5e7d13e7b24b7f34e1689c8e23a9c9a (patch) | |
tree | 79986cac6d3551058f10f720cc45017cee01658d /Makefile | |
parent | 2ec604e72be5cc67867ba192666b31da9ac2d571 (diff) | |
download | sos-13e8fe8bd5e7d13e7b24b7f34e1689c8e23a9c9a.tar.gz |
make file
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/sos/trunk@908 ef72aa8b-4018-0410-8976-d6e080ef94d8
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 30 |
1 files changed, 20 insertions, 10 deletions
@@ -8,12 +8,20 @@ RELEASE = $(shell echo `awk '/^Release:/ {gsub(/\%.*/,""); print $2}' sos.spec`) REPO = http://svn.fedorahosted.org/svn/sos TMPDIR = /tmp/$(NAME)-$(VERSION) -SUBDIRS = po sos sos/plugins +SUBDIRS = po sos sos/plugins testsuite PYFILES = $(wildcard *.py) -all: subdirs +RPM_BUILD_DIR = rpm-build +RPM_DEFINES = --define "_topdir %(pwd)/$(RPM_BUILD_DIR)" \ + --define "_builddir %{_topdir}" \ + --define "_rpmdir %{_topdir}" \ + --define "_srcrpmdir %{_topdir}" \ + --define "_specdir %{_topdir}" \ + --define "_sourcedir %{_topdir}" +RPM = rpmbuild +RPM_WITH_DIRS = $(RPM) $(RPM_DEFINES) -subdirs: +build: for d in $(SUBDIRS); do make -C $$d; [ $$? = 0 ] || exit 1 ; done install: @@ -29,30 +37,32 @@ install: install -m644 gpgkeys/rhsupport.pub $(DESTDIR)/usr/share/$(NAME)/. for d in $(SUBDIRS); do make DESTDIR=`cd $(DESTDIR); pwd` -C $$d install; [ $$? = 0 ] || exit 1; done -archive: gpgkey +$(NAME)-$(VERSION).tar.gz: gpgkey @rm -rf $(NAME)-$(VERSION).tar.gz @rm -rf $(TMPDIR) @svn export --force $(PWD) $(TMPDIR) @mkdir -p $(TMPDIR)/gpgkeys @cp gpgkeys/rhsupport.pub $(TMPDIR)/gpgkeys/. @tar Ccvzf /tmp $(NAME)-$(VERSION).tar.gz $(NAME)-$(VERSION) - @cp $(NAME)-$(VERSION).tar.gz $(shell rpm -E '%_sourcedir') + @mkdir $(RPM_BUILD_DIR) + @cp $(NAME)-$(VERSION).tar.gz $(RPM_BUILD_DIR)/. @rm -rf $(NAME)-$(VERSION).tar.gz @echo "Archive is $(NAME)-$(VERSION).tar.gz" clean: @rm -fv *~ .*~ changenew ChangeLog.old $(NAME)-$(VERSION).tar.gz sosreport.1.gz - @rm -rfv {dist,build,sos.egg-info} - @rm -rf MANIFEST + @rm -rf rpm-build @rm -rfv $(TMPDIR) @for i in `find . -iname *.pyc`; do \ rm $$i; \ done; \ for d in $(SUBDIRS); do make -C $$d clean ; done -rpm: - @$(MAKE) archive - @rpmbuild -ba sos.spec +srpm: clean $(NAME)-$(VERSION).tar.gz + $(RPM_WITH_DIRS) -ts $(RPM_BUILD_DIR)/$(NAME)-$(VERSION).tar.gz + +rpm: clean $(NAME)-$(VERSION).tar.gz + $(RPM_WITH_DIRS) -tb $(RPM_BUILD_DIR)/$(NAME)-$(VERSION).tar.gz gpgkey: @echo "Building gpg key" |