Module: kamailio
Branch: master
Commit: ab0a69eb01953be97ccdfdb230e5af06bac9649c
URL:
https://github.com/kamailio/kamailio/commit/ab0a69eb01953be97ccdfdb230e5af0…
Author: Sergey Safarov <s.safarov(a)gmail.com>
Committer: Sergey Safarov <s.safarov(a)gmail.com>
Date: 2019-09-10T13:43:39+03:00
pkg/kamailio: added rpm spec version and release configuration [skip ci]
---
Modified: pkg/kamailio/Makefile
---
Diff:
https://github.com/kamailio/kamailio/commit/ab0a69eb01953be97ccdfdb230e5af0…
Patch:
https://github.com/kamailio/kamailio/commit/ab0a69eb01953be97ccdfdb230e5af0…
---
diff --git a/pkg/kamailio/Makefile b/pkg/kamailio/Makefile
index 63c024c158..a221ff085c 100644
--- a/pkg/kamailio/Makefile
+++ b/pkg/kamailio/Makefile
@@ -6,8 +6,10 @@ else ifneq ($(MAKECMDGOALS),cfg)
$(error Please start "make cfg" first)
endif
-RPMBUILD_TOP := /tmp/rpmbuild
-DIST_ARCHIVE = ${shell echo "kamailio-$(RELEASE)_src.tar.gz" | sed -e
"s/-dev[0-9]//" }
+RPMBUILD_TOP := /tmp/kamailio_rpmbuild
+RPM_VER = ${shell echo "$(RELEASE)" | sed -e "s/-dev[0-9]//" }
+RPM_REL = ${shell echo "$(RELEASE)." | grep -o -P "dev[0-9]\." }
+DIST_ARCHIVE = ${shell echo "kamailio-$(RPM_VER)_src.tar.gz"}
APK_VERSION = ${shell echo "$(RELEASE)" | grep -o "^[0-9.]*"}
RPMBUILD_OPT= --define "_topdir $(RPMBUILD_TOP)"
GIT_TAG = ${shell git rev-parse HEAD 2> /dev/null}
@@ -38,7 +40,10 @@ apk:
src.rpm: tar
mkdir -p ${RPMBUILD_TOP}/SOURCES
mv ../../kamailio-$(RELEASE)_src.tar.gz ${RPMBUILD_TOP}/SOURCES/${DIST_ARCHIVE}
- sed -i -e 's/setup -n %{name}-%{ver}/setup -n kamailio-$(RELEASE)/'
obs/kamailio.spec
+ sed -e 's/%define ver .*/%define ver ${RPM_VER}/' \
+ -e 's/%define rel .*/%define rel ${RPM_REL}0%{dist}/' \
+ -e 's/setup -n %{name}-%{ver}/setup -n kamailio-$(RELEASE)/' \
+ -i obs/kamailio.spec
rpmbuild ${RPMBUILD_OPT} -bs obs/kamailio.spec
mv ${RPMBUILD_TOP}/SRPMS/kamailio-$(RELEASE)*.src.rpm ../..
rm -Rf ${RPMBUILD_TOP}