@@ -30,7 +30,7 @@ PKGNAME := python-$(NAME)
3030
3131# VERSION file provides one place to update the software version.
3232VERSION := $(shell cat VERSION)
33- RPMRELEASE = $( shell awk '/global _short_release/{print $$NF; exit}' $( RPMSPEC ) .in)
33+ RPMRELEASE := 1
3434
3535RPMSPECDIR := .
3636RPMSPEC := $(RPMSPECDIR ) /$(PKGNAME ) .spec
@@ -97,10 +97,6 @@ viewcover: ci-unittests
9797conf.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
105101build : 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
156152srpm : 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