File tree Expand file tree Collapse file tree 3 files changed +42
-2
lines changed Expand file tree Collapse file tree 3 files changed +42
-2
lines changed Original file line number Diff line number Diff line change @@ -218,5 +218,13 @@ lint: install.tools
218
218
# CAUTION: This is not a replacement for RPMs provided by your distro.
219
219
# Only intended to build and test the latest unreleased changes.
220
220
.PHONY : rpm
221
- rpm :
222
- rpkg local
221
+ rpm : # # Build rpm packages
222
+ $(MAKE ) -C rpm
223
+
224
+ # Remember that rpms install exec to /usr/bin/buildah while a `make install`
225
+ # installs them to /usr/local/bin/buildah which is likely before. Always use
226
+ # a full path to test installed buildah or you risk to call another executable.
227
+ .PHONY : rpm-install
228
+ rpm-install : package # # Install rpm packages
229
+ $(call err_if_empty,PKG_MANAGER) -y install rpm/RPMS/* /* .rpm
230
+ /usr/bin/buildah version
Original file line number Diff line number Diff line change
1
+ .PHONY : rpm
2
+ rpm :
3
+ $(shell /usr/bin/bash ./update-spec-version.sh)
4
+ spectool -g buildah.spec
5
+ rpmbuild -ba \
6
+ --define ' _sourcedir $(shell pwd)' \
7
+ --define ' _rpmdir %{_sourcedir}/RPMS' \
8
+ --define ' _srcrpmdir %{_sourcedir}/SRPMS' \
9
+ --define ' _builddir %{_sourcedir}/BUILD' \
10
+ buildah.spec
11
+ @echo ___RPMS can be found in rpm/RPMS/.___
12
+ @echo ___Undo any changes to Version, Source0 and %autosetup in rpm/buildah.spec before committing.___
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ # This script will update the Version field in the spec which is set to 0 by
4
+ # default. Useful for local manual rpm builds where the Version needs to be set
5
+ # correctly.
6
+
7
+ set -eox pipefail
8
+
9
+ PACKAGE=buildah
10
+ SPEC_FILE=$PACKAGE .spec
11
+ VERSION=$( grep ' Version = ' ../define/types.go | cut -d\" -f2)
12
+ RPM_VERSION=$( echo $VERSION | sed -e ' s/^v//' -e ' s/-/~/g' )
13
+
14
+ # Update spec file to use local changes
15
+ sed -i " s/^Version:.*/Version: $RPM_VERSION /" $SPEC_FILE
16
+ sed -i " s/^Source:.*/Source: $PACKAGE -$VERSION .tar.gz/" $SPEC_FILE
17
+ sed -i " s/^%autosetup.*/%autosetup -Sgit -n %{name}-$VERSION /" $SPEC_FILE
18
+
19
+ # Generate Source0 archive from HEAD
20
+ (cd .. && git archive --format=tar.gz --prefix=$PACKAGE -$VERSION / HEAD -o rpm/$PACKAGE -$VERSION .tar.gz)
You can’t perform that action at this time.
0 commit comments