forked from containers/ramalama
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.packit-copr-rpm.sh
More file actions
23 lines (16 loc) · 859 Bytes
/
.packit-copr-rpm.sh
File metadata and controls
23 lines (16 loc) · 859 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env bash
# This script handles any custom processing of the spec file using the `fix-spec-file`
# action in .packit.yaml. These steps only work on copr builds, not on official
# Fedora builds.
set -exo pipefail
# Extract version from Python module since pyproject.toml uses dynamic versioning
# Note:
# cd into ramalama directory so that the version module can be imported individually
# and additional dependencies such as pyyaml or jsonschema are not required
VERSION=$(cd ramalama && python3 -c "import version; print(version.version())")
SPEC_FILE=rpm/ramalama.spec
# RPM Spec modifications
# Use the Version from HEAD in rpm spec
sed -i "s/^Version:.*/Version: $VERSION/" "$SPEC_FILE"
# Use Packit's supplied variable in the Release field in rpm spec.
sed -i "s/^Release:.*/Release: 1000.$PACKIT_RPMSPEC_RELEASE%{?dist}/" "$SPEC_FILE"