Skip to content

Commit

Permalink
spec: Use vdsm.spec directly rather than generating it
Browse files Browse the repository at this point in the history
We currently generate vdsm.spec from vdsm.spec.in.  This means that
whatever we want to do regarding building Vdsm packages, we must run
auto* stuff first and having all the necessary tools available before
we start with the building process, which is not always convenient or
even possible.

The only thing that is replaced in vdsm.spec.in when generating
vdsm.spec from it is @PACKAGE_RELEASE@.  We can set 1 as its default
value and use vdsm.spec instead of vdsm.spec.in directly.  If the
value needs to be different, it can be overridden using
‘rpmbuild --define’.  This is what ‘rpm’ target in Makefile.am already
does so the release is set as intended as long as ‘make rpm’ is used
to build the rpm’s.  Tagged releases work fine with the default value.
  • Loading branch information
mz-pdm committed Sep 5, 2022
1 parent b2c35a6 commit 85079d2
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 12 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ tests/other.crt
tests/other.csr
tests/other.key
vdsm-*.tar.gz
vdsm.spec
vdsm/vdscli.py
static/usr/share/man/man1/vdsm-tool.1
static/usr/share/man/man8/vdsmd.8
Expand Down
7 changes: 1 addition & 6 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2008-2020 Red Hat, Inc.
# Copyright 2008-2022 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -59,12 +59,10 @@ EXTRA_DIST = \
contrib/repostat \
pylintrc \
vdsm.spec \
vdsm.spec.in \
tox.ini \
$(NULL)

CLEANFILES = \
vdsm.spec \
$(DIST_ARCHIVES) \
$(NULL)

Expand Down Expand Up @@ -165,9 +163,6 @@ storage:
clean-storage:
python3 tests/storage/userstorage.py teardown

all-local: \
vdsm.spec

clean-local: clean-build

.PHONY: upgrade
Expand Down
2 changes: 1 addition & 1 deletion build-aux/pkg-version
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ AWK_SPEC_VERSION='

PKG_VERSION=`cat VERSION 2> /dev/null || git describe --tags --match "v[0-9]*"`
if [ -d .git ]; then
SPEC_VERSION=`awk "$AWK_SPEC_VERSION" vdsm.spec.in`
SPEC_VERSION=`awk "$AWK_SPEC_VERSION" vdsm.spec`
if [ "$PKG_VERSION" != "$SPEC_VERSION" ] && [ "${PKG_VERSION#$SPEC_VERSION-}" = "$PKG_VERSION" ]; then
# New version, not yet tagged.
PKG_VERSION="$SPEC_VERSION"
Expand Down
4 changes: 2 additions & 2 deletions doc/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ For more information about testing see [/tests/README.md](/tests/README.md).
Release process of Vdsm version `VERSION` consists of the following
steps:

- Changing `Version:` field value in `vdsm.spec.in` to `VERSION`.
- Changing `Version:` field value in `vdsm.spec` to `VERSION`.

- Updating `%changelog` line in `vdsm.spec.in` to the current date,
- Updating `%changelog` line in `vdsm.spec` to the current date,
the committer, and `VERSION`.

- Committing these changes, with subject "New release: `VERSION`" and
Expand Down
1 change: 0 additions & 1 deletion tests/check_distpkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ for i in $(git ls-files \*.in); do
for f in \
static/libexec/vdsm/vdsm-gencerts.sh \
static/usr/share/man/man1/vdsm-tool.1 \
vdsm.spec \
; do
if test "$FILE" = "$f" ; then
KEEP=1
Expand Down
2 changes: 1 addition & 1 deletion vdsm.spec.in → vdsm.spec
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
# - generated using ./build-aux/make-dist script
# - passed to rpmbuild as
# --define="vdsm_release $(./build-aux/pkg-version --release)"
%{!?vdsm_release: %global vdsm_release @PACKAGE_RELEASE@}
%{!?vdsm_release: %global vdsm_release 1}

Name: %{vdsm_name}
Version: 4.50.2.2
Expand Down

0 comments on commit 85079d2

Please sign in to comment.