Skip to content

Commit

Permalink
Makefile: package -> rpm
Browse files Browse the repository at this point in the history
package and package-install targets have been renamed
to rpm and rpm-install respectively for clarity.

`make rpm` will now build rpm using HEAD.

Resolves: containers#18817

[NO NEW TESTS NEEDED]

Signed-off-by: Lokesh Mandvekar <[email protected]>
  • Loading branch information
lsm5 authored and openshift-cherrypick-robot committed Jul 13, 2023
1 parent af2d788 commit 145748d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -787,8 +787,8 @@ win-gvproxy: test/version/version
cp tmp-gv/bin/gvproxy.exe bin/windows/
rm -rf tmp-gv

.PHONY: package
package: ## Build rpm packages
.PHONY: rpm
rpm: ## Build rpm packages
$(MAKE) -C rpm

###
Expand All @@ -798,9 +798,9 @@ package: ## Build rpm packages
# Remember that rpms install exec to /usr/bin/podman while a `make install`
# installs them to /usr/local/bin/podman which is likely before. Always use
# a full path to test installed podman or you risk to call another executable.
.PHONY: package-install
package-install: package ## Install rpm packages
sudo $(call err_if_empty,PKG_MANAGER) -y install ${HOME}/rpmbuild/RPMS/*/*.rpm
.PHONY: rpm-install
rpm-install: package ## Install rpm packages
$(call err_if_empty,PKG_MANAGER) -y install rpm/RPMS/*/*.rpm
/usr/bin/podman version
/usr/bin/podman info # will catch a broken conmon

Expand Down
2 changes: 2 additions & 0 deletions rpm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ rpm:
--define '_srcrpmdir %{_sourcedir}/SRPMS' \
--define '_builddir %{_sourcedir}/BUILD' \
podman.spec
@echo ___RPMS can be found in rpm/RPMS/.___
@echo ___Undo any changes to Version, Source0 and %autosetup in rpm/podman.spec before committing.___
17 changes: 11 additions & 6 deletions rpm/update-spec-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@
# default. Useful for local manual rpm builds where the Version needs to be set
# correctly.

set -e
set -eox pipefail

# Script is run from git root directory
SPEC_FILE=rpm/podman.spec
PACKAGE=podman
SPEC_FILE=$PACKAGE.spec
GIT_DESCRIBE=$(git describe)
VERSION=$(echo $GIT_DESCRIBE | sed -e 's/^v//' -e 's/-/~/g')

LATEST_TAG=$(git tag --sort=creatordate | tail -1)
LATEST_VERSION=$(echo $LATEST_TAG | sed -e 's/^v//')
# Update spec file to use local changes
sed -i "s/^Version:.*/Version: $VERSION/" $SPEC_FILE
sed -i "s/^Source0:.*/Source0: $PACKAGE-$GIT_DESCRIBE.tar.gz/" $SPEC_FILE
sed -i "s/^%autosetup.*/%autosetup -Sgit -n %{name}-$GIT_DESCRIBE/" $SPEC_FILE

sed -i "s/^Version:.*/Version: $LATEST_VERSION/" $SPEC_FILE
# Generate Source0 archive from HEAD
(cd .. && git archive --format=tar.gz --prefix=$PACKAGE-$GIT_DESCRIBE/ HEAD -o rpm/$PACKAGE-$GIT_DESCRIBE.tar.gz)

0 comments on commit 145748d

Please sign in to comment.