dist-packaging: Don't delete 91-ostree.preset, do clean old rpms/sources

We have to copy the sources to avoid rpmbuild deleting them.  But on
the other hand there's no reason for old sources to stick around.
This commit is contained in:
Colin Walters 2015-04-05 09:18:42 -04:00
parent d3545b0661
commit dcae7dee57
1 changed files with 11 additions and 4 deletions

View File

@ -9,6 +9,7 @@ PACKAGE=ostree
PKG_VER = $(PACKAGE)-$(GITREV_FOR_PKG) PKG_VER = $(PACKAGE)-$(GITREV_FOR_PKG)
dist-snapshot: dist-snapshot:
rm -f *.tar.xz
set -x; \ set -x; \
echo "PACKAGE=$(PACKAGE)"; \ echo "PACKAGE=$(PACKAGE)"; \
TARFILE_TMP=$(PKG_VER).tar.tmp; \ TARFILE_TMP=$(PKG_VER).tar.tmp; \
@ -26,8 +27,14 @@ dist-snapshot:
xz $(PKG_VER).tar xz $(PKG_VER).tar
srpm: dist-snapshot srpm: dist-snapshot
sed -e "s,^Version:.*,Version: $(GITREV_FOR_PKG)," $(PACKAGE).spec.in > $(PACKAGE).spec; \ (tmpd=`pwd`/tmp-packaging; rm -rf "$${tmpd}"; mkdir "$${tmpd}"; \
./rpmbuild-cwd -bs $(PACKAGE).spec sed -e "s,^Version:.*,Version: $(GITREV_FOR_PKG)," $(PACKAGE).spec.in > "$${tmpd}/$(PACKAGE).spec"; \
cp 91-ostree.preset "$${tmpd}"; ln $(PKG_VER).tar.xz "$${tmpd}"; \
cd "$${tmpd}" && ../rpmbuild-cwd -bs $(PACKAGE).spec && mv *.src.rpm ..)
rpm: srpm rpm: dist-snapshot
./rpmbuild-cwd --rebuild $(PKG_VER)*.src.rpm rm -f *.rpm
(tmpd=`pwd`/tmp-packaging; rm -rf "$${tmpd}"; mkdir "$${tmpd}"; \
sed -e "s,^Version:.*,Version: $(GITREV_FOR_PKG)," $(PACKAGE).spec.in > "$${tmpd}/$(PACKAGE).spec"; \
cp 91-ostree.preset "$${tmpd}"; ln $(PKG_VER).tar.xz "$${tmpd}"; \
cd "$${tmpd}" && ../rpmbuild-cwd -bb $(PACKAGE).spec && mv $$(arch)/*.rpm ..)