packaging: Rework to also create Docker container

This commit is contained in:
Colin Walters 2014-05-18 09:26:13 -04:00
parent 18d0d989ae
commit 97607f22d5
3 changed files with 22 additions and 10 deletions

5
packaging/Dockerfile.in Normal file
View File

@ -0,0 +1,5 @@
FROM fedora:20
RUN yum -y update
ADD @PACKAGE@ /var/tmp/@PACKAGE@
RUN yum -y localinstall /var/tmp/@PACKAGE@
ENTRYPOINT rpm-ostree treecompose

View File

@ -4,7 +4,7 @@ GITREV = $$(git describe --always --tags)
GITREV_FOR_PKG = $(shell echo "$(GITREV)" | sed -e 's,-,\.,g' -e 's,^v,,')
srcdir=$(shell pwd)
PACKAGE=$(shell basename $(srcdir))
PACKAGE=rpm-ostree
PKG_VER = $(PACKAGE)-$(GITREV_FOR_PKG)
@ -13,7 +13,7 @@ dist-snapshot:
echo "PACKAGE=$(PACKAGE)"; \
TARFILE_TMP=$(PKG_VER).tar.tmp; \
echo "Archiving $(PACKAGE) at $(GITREV)"; \
(cd $(srcdir); git archive --format=tar --prefix=$(PKG_VER)/ $(GITREV)) > $${TARFILE_TMP}; \
(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}"; \
@ -26,14 +26,8 @@ dist-snapshot:
xz $(PKG_VER).tar
srpm: dist-snapshot
(cd $(srcdir)/packaging; \
cp ../$(PKG_VER).tar.xz . ; \
sed -e "s,^Version:.*,Version: $(GITREV_FOR_PKG)," $(PACKAGE).spec.in > $(PACKAGE).spec; \
./rpmbuild-cwd -bs $(PACKAGE).spec)
./rpmbuild-cwd -bs $(PACKAGE).spec
rpm: srpm
$(srcdir)/packaging/rpmbuild-cwd --rebuild packaging/$(PKG_VER)*.src.rpm
buildinstall: rpm
sudo yum localinstall $(PKG_VER)*.src.rpm
$(srcdir)/rpmbuild-cwd --rebuild $(PKG_VER)*.src.rpm

13
packaging/Makefile.docker Normal file
View File

@ -0,0 +1,13 @@
# -*- mode: Makefile -*-
include Makefile.dist-packaging
docker-local: rpm
rm docker -rf
mkdir -p docker
cp x86_64/$(PKG_VER)*.x86_64.rpm docker/$(PACKAGE).rpm
sed \
-e s,\@PACKAGE\@,$(PACKAGE).rpm,g \
< Dockerfile.in > docker/Dockerfile
(cd docker && docker build -t cgwalters/rpm-ostree .)