mirror of
https://github.com/ostreedev/ostree.git
synced 2025-01-11 09:18:20 +03:00
45a6c109d9
On Debian and its derivatives, /bin/sh is a lightweight POSIX shell (currently dash) which does not support the bash {foo,bar} syntax. Signed-off-by: Simon McVittie <smcv@debian.org> Closes: #226 Approved by: cgwalters
41 lines
1.6 KiB
Makefile
41 lines
1.6 KiB
Makefile
# -*- mode: Makefile -*-
|
|
|
|
GITREV = $$(git describe --always --tags)
|
|
GITREV_FOR_PKG = $(shell echo "$(GITREV)" | sed -e 's,-,\.,g' -e 's,^v,,')
|
|
|
|
srcdir=$(shell dirname `pwd`)
|
|
PACKAGE=ostree
|
|
|
|
PKG_VER = $(PACKAGE)-$(GITREV_FOR_PKG)
|
|
|
|
dist-snapshot:
|
|
rm -f *.tar.xz
|
|
set -x; \
|
|
echo "PACKAGE=$(PACKAGE)"; \
|
|
TARFILE_TMP=$(PKG_VER).tar.tmp; \
|
|
echo "Archiving $(PACKAGE) at $(GITREV)"; \
|
|
(cd ..; git archive --format=tar --prefix=$(PKG_VER)/ $(GITREV)) > $${TARFILE_TMP}; \
|
|
(cd $$(git rev-parse --show-toplevel); git submodule status) | while read line; do \
|
|
rev=$$(echo $$line | cut -f 1 -d ' '); path=$$(echo $$line | cut -f 2 -d ' '); \
|
|
echo "Archiving $${path} at $${rev}"; \
|
|
(cd $(srcdir)/$$path; git archive --format=tar --prefix=$(PKG_VER)/$$path/ $${rev}) > submodule.tar; \
|
|
tar -A -f $${TARFILE_TMP} submodule.tar; \
|
|
rm submodule.tar; \
|
|
done; \
|
|
mv $(PKG_VER).tar.tmp $(PKG_VER).tar; \
|
|
rm -f $(PKG_VER).tar.xz; \
|
|
xz $(PKG_VER).tar
|
|
|
|
srpm: dist-snapshot
|
|
(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 -bs $(PACKAGE).spec && mv *.src.rpm ..)
|
|
|
|
rpm: dist-snapshot
|
|
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 ..)
|