Skip to content

Commit

Permalink
build: make bwrap-oci.spec a template
Browse files Browse the repository at this point in the history
anx 'make rpm'

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #4
Approved by: yuqi-zhang
  • Loading branch information
giuseppe authored and rh-atomic-bot committed Jul 10, 2017
1 parent 08aae7f commit 954694c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
12 changes: 9 additions & 3 deletions Makefile.am
Expand Up @@ -17,13 +17,19 @@ XSLTPROC_FLAGS = \
# Written by Colin Walters <walters@verbum.org>
WD := $(shell pwd)

rpm:
.PHONY: rpm

bwrap-oci.spec: $(srcdir)/rpm/bwrap-oci.spec.template
sed -e 's|#VERSION#|$(VERSION)|g' < $< > $@

rpm: dist-gzip bwrap-oci.spec
echo $(VERSION)
$(MAKE) -C $(WD) dist-xz
rpmbuild -ba --define "_sourcedir $(WD)" --define "_specdir $(WD)" --define "_builddir $(WD)" --define "_srcrpmdir $(WD)" --define "_rpmdir $(WD)" --define "_buildrootdir $(WD)/.build" bwrap-oci.spec

man_MANS = bwrap-oci.1

CLEANFILES = $(man_MANS)
CLEANFILES = $(man_MANS) bwrap-oci.spec

AM_CFLAGS = $(WARN_CFLAGS)

Expand Down Expand Up @@ -53,7 +59,7 @@ TESTS = tests/bind.conf tests/cwd.conf tests/env.conf tests/hostname.conf \
TEST_EXTENSIONS = .conf
CONF_LOG_COMPILER = $(top_srcdir)/tests/tests-runner

EXTRA_DIST = autogen.sh bwrap-oci.xml safe-read-write.h util.h list.h run.h kill.h
EXTRA_DIST = autogen.sh bwrap-oci.xml safe-read-write.h util.h list.h run.h kill.h subugidmap.h

EXTRA_DIST += $(TESTS:.conf=.conf.expected)
EXTRA_DIST += $(TESTS:.conf=.conf.command)
4 changes: 2 additions & 2 deletions rpm/bwrap-oci.spec → rpm/bwrap-oci.spec.template
@@ -1,6 +1,6 @@
Summary: Run OCI containers with bubblewrap
Name: bwrap-oci
Version: 0.1.1
Version: #VERSION#
Release: 5%{?dist}
Source0: %{url}/archive/%{name}-%{version}.tar.gz
License: LGPLv2+
Expand All @@ -21,7 +21,7 @@ BuildRequires: pkgconfig(gio-unix-2.0)
bwrap-oci uses Bubblewrap to run a container from an OCI spec file.

%prep
%autosetup -n %{name}-%{name}-%{version}
%autosetup -n %{name}-%{version}

%build
env NOCONFIGURE=1 ./autogen.sh
Expand Down

0 comments on commit 954694c

Please sign in to comment.