kazoo: add missing log line breaks, partially by conversion to mem log helper
[sip-router] / pkg / kamailio / Makefile
1 # Makefile to help building packages
2
3 ifneq ("$(wildcard ../../src/config.mak)","")
4 include ../../src/Makefile.defs
5 else ifneq ($(MAKECMDGOALS),cfg)
6 $(error Please start "make cfg" first)
7 endif
8
9 RPMBUILD_TOP := /tmp/rpmbuild
10 DIST_ARCHIVE = ${shell echo "kamailio-$(RELEASE)_src.tar.gz" | sed -e "s/-dev[0-9]//" }
11 APK_VERSION = ${shell echo "$(RELEASE)" | grep -o "^[0-9.]*"}
12 RPMBUILD_OPT= --define "_topdir $(RPMBUILD_TOP)"
13 GIT_TAG = ${shell git rev-parse HEAD 2> /dev/null}
14
15 # generate config.mak and modules.lst
16 .PHONY: cfg
17 cfg:
18         $(MAKE) -C ../../src cfg
19
20 # generate the tarball with source tree
21 .PHONY: tar
22 tar:
23         rm -f ../../kamailio*_src.tar.gz
24         $(MAKE) -C ../.. tar
25
26 # build alpine apk packages
27 .PHONY: apk
28 apk:
29         echo Building alpine packages using commit ${GIT_TAG}
30         sed -e "s/^_gitcommit=.*/_gitcommit=${GIT_TAG}/" \
31             -e "s/^pkgver=.*/pkgver=${APK_VERSION}/" \
32             -i alpine/APKBUILD
33         cd alpine && abuild snapshot
34         @echo \"abuild\" cannot be start from Makefile please start manualy \"cd alpine \&\& abuild -r\"
35
36 # build source rpm package
37 .PHONY: src.rpm
38 src.rpm: tar
39         mkdir -p ${RPMBUILD_TOP}/SOURCES
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
42         rpmbuild ${RPMBUILD_OPT} -bs obs/kamailio.spec
43         mv ${RPMBUILD_TOP}/SRPMS/kamailio-$(RELEASE)*.src.rpm ../..
44         rm -Rf ${RPMBUILD_TOP}
45
46 # build rpm packages
47 .PHONY: rpm
48 rpm: src.rpm
49         mock ../../kamailio-$(RELEASE).*.src.rpm
50
51 # build debian packages
52 .PHONY: deb
53 deb:
54         $(MAKE) -C ../.. deb