Skip to content

Commit

Permalink
spec: Depend on package instead of file path
Browse files Browse the repository at this point in the history
This requires building the rpm with a correct `%{rhel}`. As it's rather
cumbersome to build this in a separate VM image, emulate what happens in
reality by defining (when appropriate) the `%{rhel}` macro during RPM
build.

https://bugzilla.redhat.com/show_bug.cgi?id=1731687

Closes #22
  • Loading branch information
martinpitt committed Jul 23, 2019
1 parent 2e61509 commit b29cf12
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ NODE_MODULES_TEST=node_modules/po2json
# one example file in dist/ from webpack to check if that already ran
WEBPACK_TEST=dist/index.html

ifeq ($(TEST_OS), rhel-atomic)
MACRO_RHEL = --define "rhel 7"
endif

all: $(WEBPACK_TEST)

#
Expand Down Expand Up @@ -108,6 +112,7 @@ rpm: dist-gzip $(PACKAGE_NAME).spec
--define "_srcrpmdir `pwd`" \
--define "_rpmdir `pwd`/output" \
--define "_buildrootdir `pwd`/build" \
$(MACRO_RHEL) \
$(PACKAGE_NAME).spec
find `pwd`/output -name '*.rpm' -printf '%f\n' -exec mv {} . \;
rm -r "`pwd`/rpmbuild"
Expand Down
7 changes: 6 additions & 1 deletion cockpit-ostree.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ Summary: Cockpit user interface for rpm-ostree
License: LGPLv2+
Requires: cockpit-bridge >= 125
Requires: cockpit-system >= 125
Requires: /usr/libexec/rpm-ostreed
# On RHEL Atomic 7, the package name is different (curiously not on CentOS Atomic)
%if 0%{?rhel} == 7
Requires: rpm-ostree-client
%else
Requires: rpm-ostree
%endif

# Download from https://github.com/cockpit-project/cockpit-ostree/releases
Source: cockpit-ostree-%{version}.tar.gz
Expand Down

0 comments on commit b29cf12

Please sign in to comment.