Move the source-RPM generation out of do_release into its own "srpm"
target, so that "make release" only creates the source tarball and the
source RPM is built on demand from it:
$ make release
$ make srpm
The stale source RPM is removed by srpm instead of do_release, since that
is where it is rebuilt.
Assisted-by: LLM
Signed-off-by: Dave Young <yangrr.2009(a)tsinghua.org.cn>
---
Makefile | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 70dc880eeb8e..1fb9a9817e42 100644
--- a/Makefile
+++ b/Makefile
@@ -710,7 +710,6 @@ do_release:
@chmod 666 crash-release
@rm -rf ./RELDIR; mkdir ./RELDIR; mkdir ./RELDIR/${PROGRAM}-${VERSION}
@rm -f ${PROGRAM}-${VERSION}.tar.gz
- @rm -f ${PROGRAM}-${VERSION}-${RELEASE}.src.rpm
@chown root ./RELDIR/${PROGRAM}-${VERSION}
@tar cf - ${SOURCE_FILES} Makefile ${GDB_FILES} ${GDB_PATCH_FILES} ${GPL_FILES} \
crash-release crash.8 ${EXTENSION_SOURCE_FILES} ${MEMORY_DRIVER_FILES} | \
@@ -727,6 +726,14 @@ do_release:
@rm -rf ./RELDIR
@echo
@ls -l ${PROGRAM}-${VERSION}.tar.gz
+
+#
+# Create the source RPM from the tarball built by "make release".
+#
+srpm: make_configure
+ @if [ "${VERSION}" = "" ] || [ ! -f ${PROGRAM}-${VERSION}.tar.gz ];
then \
+ echo "make srpm: run \"make release\" first"; echo; exit 1; fi
+ @rm -f ${PROGRAM}-${VERSION}-${RELEASE}.src.rpm
@./configure -s > ${PROGRAM}.spec
@if [ -s ${PROGRAM}.spec ]; then \
rm -rf ./RPMBUILD; \
--
2.51.1