-
Notifications
You must be signed in to change notification settings - Fork 784
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[skip-ci] Makefile: update rpm target
rpkg is now deprecated. This commit makes the rpm target consistent with the one in Podman. Using skip-ci as we don't need to run cirrus tests for this change. Signed-off-by: Lokesh Mandvekar <[email protected]>
- Loading branch information
Showing
3 changed files
with
42 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.PHONY: rpm | ||
rpm: | ||
$(shell /usr/bin/bash ./update-spec-version.sh) | ||
spectool -g buildah.spec | ||
rpmbuild -ba \ | ||
--define '_sourcedir $(shell pwd)' \ | ||
--define '_rpmdir %{_sourcedir}/RPMS' \ | ||
--define '_srcrpmdir %{_sourcedir}/SRPMS' \ | ||
--define '_builddir %{_sourcedir}/BUILD' \ | ||
buildah.spec | ||
@echo ___RPMS can be found in rpm/RPMS/.___ | ||
@echo ___Undo any changes to Version, Source0 and %autosetup in rpm/buildah.spec before committing.___ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This script will update the Version field in the spec which is set to 0 by | ||
# default. Useful for local manual rpm builds where the Version needs to be set | ||
# correctly. | ||
|
||
set -eox pipefail | ||
|
||
PACKAGE=buildah | ||
SPEC_FILE=$PACKAGE.spec | ||
VERSION=$(grep 'Version = ' ../define/types.go | cut -d\" -f2) | ||
RPM_VERSION=$(echo $VERSION | sed -e 's/^v//' -e 's/-/~/g') | ||
|
||
# Update spec file to use local changes | ||
sed -i "s/^Version:.*/Version: $RPM_VERSION/" $SPEC_FILE | ||
sed -i "s/^Source:.*/Source: $PACKAGE-$VERSION.tar.gz/" $SPEC_FILE | ||
sed -i "s/^%autosetup.*/%autosetup -Sgit -n %{name}-$VERSION/" $SPEC_FILE | ||
|
||
# Generate Source0 archive from HEAD | ||
(cd .. && git archive --format=tar.gz --prefix=$PACKAGE-$VERSION/ HEAD -o rpm/$PACKAGE-$VERSION.tar.gz) |