Browse code

pkg/kamailio: added rpm spec version and release configuration [skip ci]

Sergey Safarov authored on 27/08/2019 18:03:33
Showing 1 changed files
... ...
@@ -6,8 +6,10 @@ else ifneq ($(MAKECMDGOALS),cfg)
6 6
 $(error Please start "make cfg" first)
7 7
 endif
8 8
 
9
-RPMBUILD_TOP := /tmp/rpmbuild
10
-DIST_ARCHIVE = ${shell echo "kamailio-$(RELEASE)_src.tar.gz" | sed -e "s/-dev[0-9]//" }
9
+RPMBUILD_TOP := /tmp/kamailio_rpmbuild
10
+RPM_VER = ${shell echo "$(RELEASE)" | sed -e "s/-dev[0-9]//" }
11
+RPM_REL = ${shell echo "$(RELEASE)." | grep -o -P "dev[0-9]\." }
12
+DIST_ARCHIVE = ${shell echo "kamailio-$(RPM_VER)_src.tar.gz"}
11 13
 APK_VERSION = ${shell echo "$(RELEASE)" | grep -o "^[0-9.]*"}
12 14
 RPMBUILD_OPT= --define "_topdir $(RPMBUILD_TOP)"
13 15
 GIT_TAG = ${shell git rev-parse HEAD 2> /dev/null}
... ...
@@ -38,7 +40,10 @@ apk:
38 38
 src.rpm: tar
39 39
 	mkdir -p ${RPMBUILD_TOP}/SOURCES
40 40
 	mv ../../kamailio-$(RELEASE)_src.tar.gz ${RPMBUILD_TOP}/SOURCES/${DIST_ARCHIVE}
41
-	sed -i -e 's/setup -n %{name}-%{ver}/setup -n kamailio-$(RELEASE)/' obs/kamailio.spec
41
+	sed -e 's/%define ver .*/%define ver ${RPM_VER}/' \
42
+            -e 's/%define rel .*/%define rel ${RPM_REL}0%{dist}/' \
43
+            -e 's/setup -n %{name}-%{ver}/setup -n kamailio-$(RELEASE)/' \
44
+            -i obs/kamailio.spec
42 45
 	rpmbuild ${RPMBUILD_OPT} -bs obs/kamailio.spec
43 46
 	mv ${RPMBUILD_TOP}/SRPMS/kamailio-$(RELEASE)*.src.rpm ../..
44 47
 	rm -Rf ${RPMBUILD_TOP}