Skip to content

Commit 970057e

Browse files
committed
Preparation for packit
1 parent 83a8170 commit 970057e

3 files changed

Lines changed: 113 additions & 234 deletions

File tree

.packit.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
upstream_package_name: bitmath
2+
downstream_package_name: python-bitmath
3+
specfile_path: python-bitmath.spec
4+
upstream_tag_template: "v{version}"
5+
6+
jobs:
7+
# Copr build on every pull request
8+
- job: copr_build
9+
trigger: pull_request
10+
owner: tbielawa
11+
project: bitmath-ci
12+
targets:
13+
- fedora-rawhide-x86_64
14+
- fedora-42-x86_64
15+
- epel-9-x86_64
16+
- epel-10-x86_64
17+
18+
# Copr build on RC tags (v*-rc* pattern)
19+
- job: copr_build
20+
trigger: release
21+
upstream_tag_include: "v.*-rc.*"
22+
owner: tbielawa
23+
project: bitmath-ci
24+
targets:
25+
- fedora-rawhide-x86_64
26+
- fedora-42-x86_64
27+
- epel-9-x86_64
28+
- epel-10-x86_64
29+
30+
# propose_downstream on production tags (clean vX.Y.Z, no RC suffix)
31+
- job: propose_downstream
32+
trigger: release
33+
upstream_tag_exclude: ".*-rc.*"
34+
dist_git_branches:
35+
- rawhide
36+
- f42
37+
- epel9
38+
- epel10
39+
40+
# Koji build triggers after dist-git PR is merged
41+
- job: koji_build
42+
trigger: commit
43+
dist_git_branches:
44+
- rawhide
45+
- f42
46+
- epel9
47+
- epel10
48+
49+
# Bodhi update after successful Koji build (stable branches only, not rawhide)
50+
- job: bodhi_update
51+
trigger: commit
52+
dist_git_branches:
53+
- f42
54+
- epel9
55+
- epel10
56+
bodhi_extra_params:
57+
update_type: enhancement
58+
notes: "New upstream release. See https://github.com/timlnx/bitmath/releases for details."

Makefile

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ PKGNAME := python-$(NAME)
3030

3131
# VERSION file provides one place to update the software version.
3232
VERSION := $(shell cat VERSION)
33-
RPMRELEASE = $(shell awk '/global _short_release/{print $$NF; exit}' $(RPMSPEC).in)
33+
RPMRELEASE := 1
3434

3535
RPMSPECDIR := .
3636
RPMSPEC := $(RPMSPECDIR)/$(PKGNAME).spec
@@ -97,10 +97,6 @@ viewcover: ci-unittests
9797
conf.py: docsite/source/conf.py.in
9898
sed "s/%VERSION%/$(VERSION)/" $< > docsite/source/conf.py
9999

100-
# Build the spec file on the fly. Substitute version numbers from the
101-
# canonical VERSION file.
102-
python-bitmath.spec: python-bitmath.spec.in
103-
sed "s/%VERSION%/$(VERSION)/" $< > $@
104100

105101
build: clean
106102
@echo "#############################################"
@@ -140,18 +136,18 @@ install:
140136
mkdir -p /usr/share/man/man1/
141137
gzip -9 -c bitmath.1 > /usr/share/man/man1/bitmath.1.gz
142138

143-
sdist: clean
139+
sdist: clean virtualenv
144140
@echo "#############################################"
145141
@echo "# Creating SDIST"
146142
@echo "#############################################"
147-
python -m build --sdist
143+
. $(NAME)env3/bin/activate && pip install build && python -m build --sdist
148144

149-
rpmcommon: sdist python-bitmath.spec
145+
rpmcommon: sdist
150146
@echo "#############################################"
151147
@echo "# Building (S)RPM Now"
152148
@echo "#############################################"
153149
@mkdir -p rpm-build
154-
@cp dist/$(NAME)-$(VERSION).$(RPMRELEASE).tar.gz rpm-build/$(VERSION).$(RPMRELEASE).tar.gz
150+
@cp dist/$(NAME)-$(VERSION).tar.gz rpm-build/$(VERSION).tar.gz
155151

156152
srpm: rpmcommon
157153
rpmbuild --define "_topdir %(pwd)/rpm-build" \
@@ -160,6 +156,8 @@ srpm: rpmcommon
160156
--define "_srcrpmdir %{_topdir}" \
161157
--define "_specdir $(RPMSPECDIR)" \
162158
--define "_sourcedir %{_topdir}" \
159+
--define "_pkgversion $(VERSION)" \
160+
--define "_pkgrelease $(RPMRELEASE)" \
163161
-bs $(RPMSPEC)
164162
@echo "#############################################"
165163
@echo "$(PKGNAME) SRPM is built:"
@@ -173,6 +171,8 @@ rpm: rpmcommon
173171
--define "_srcrpmdir %{_topdir}" \
174172
--define "_specdir $(RPMSPECDIR)" \
175173
--define "_sourcedir %{_topdir}" \
174+
--define "_pkgversion $(VERSION)" \
175+
--define "_pkgrelease $(RPMRELEASE)" \
176176
-ba $(RPMSPEC)
177177
@echo "#############################################"
178178
@echo "$(PKGNAME) RPMs are built:"

0 commit comments

Comments
 (0)