diff --git a/pkg/docker b/pkg/docker index 9f04def5040..5e6a821c3ab 160000 --- a/pkg/docker +++ b/pkg/docker @@ -1 +1 @@ -Subproject commit 9f04def504051dc8da3989b1f96e4b6633d31a75 +Subproject commit 5e6a821c3ab9b4c07729daa49ce2c6eb17ddbc15 diff --git a/pkg/kamailio/Makefile b/pkg/kamailio/Makefile index 766c52409dd..86f826a7887 100644 --- a/pkg/kamailio/Makefile +++ b/pkg/kamailio/Makefile @@ -1,10 +1,21 @@ # Makefile to help building packages +ifneq ("$(wildcard ../../src/config.mak)","") include ../../src/Makefile.defs +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]//" } +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} + +# generate config.mak and modules.lst +.PHONY: cfg +cfg: + $(MAKE) -C ../../src cfg # generate the tarball with source tree .PHONY: tar @@ -12,6 +23,16 @@ tar: rm -f ../../kamailio*_src.tar.gz $(MAKE) -C ../.. tar +# build alpine apk packages +.PHONY: apk +apk: + echo Building alpine packages using commit ${GIT_TAG} + sed -e "s/^_gitcommit=.*/_gitcommit=${GIT_TAG}/" \ + -e "s/^pkgver=.*/pkgver=${APK_VERSION}/" \ + -i alpine/APKBUILD + cd alpine && abuild snapshot + @echo \"abuild\" cannot be start from Makefile please start manualy \"cd alpine \&\& abuild -r\" + # build source rpm package .PHONY: src.rpm src.rpm: tar diff --git a/pkg/kamailio/README.md b/pkg/kamailio/README.md index acf1b93c17f..a2157f9f3c9 100644 --- a/pkg/kamailio/README.md +++ b/pkg/kamailio/README.md @@ -42,7 +42,7 @@ To build RPM packages for CentOS, RHEL, Fedora, OpenSUSE and Oracle linux execut make rpm ``` -When utility is finished, you can see tge directory where compiled RPM files +When utility is finished, you can see the directory where compiled RPM files are located. Example: @@ -74,4 +74,16 @@ maintained, being quite old. ## Solaris ## -Not actively maintained, being quite old. \ No newline at end of file +Not actively maintained, being quite old. + +## Alpine Linux ## + +To build apk packages please execute + +``` +make cfg +make apk +cd alpine && abuild -r +``` + +NOTICE: Now `abuild -r` command is failed when called from `Makefile`. This reason why need to execute command from shell. \ No newline at end of file diff --git a/pkg/kamailio/alpine/APKBUILD b/pkg/kamailio/alpine/APKBUILD index eebe8d64c31..4333ad90c6b 100644 --- a/pkg/kamailio/alpine/APKBUILD +++ b/pkg/kamailio/alpine/APKBUILD @@ -8,7 +8,7 @@ pkgver=5.1.0 pkgrel=0 # If building from a git snapshot, specify the gitcommit -# If building a proper release, leave gitcommit blank +# If building a proper release, leave gitcommit blank or commented _gitcommit=991fe9b28e0e201309048f3b38a135037e40357a [ ! -z "${_gitcommit}" ] && pkgver="${pkgver}.$(date +%Y%m%d)" @@ -24,6 +24,7 @@ pkggroups="kamailio" arch="all" license="GPL2+" depends="gawk" +options="!check" makedepends="bison db-dev flex freeradius-client-dev expat-dev lksctp-tools-dev perl-dev postgresql-dev python2-dev pcre-dev mariadb-dev libxml2-dev curl-dev unixodbc-dev confuse-dev ncurses-dev sqlite-dev lua-dev openldap-dev libressl-dev net-snmp-dev libuuid libev-dev @@ -250,11 +251,22 @@ source="${pkgname}-${pkgver}${_suffix}.tar.gz::https://github.com/kamailio/$pkgn kamailio.initd " +get_source_from_local_git(){ + cd ../../.. && git archive --format=tar.gz --prefix=${pkgname}-${_gitcommit}/ -o "$SRCDEST"/${pkgname}-${pkgver}${_suffix}.tar.gz ${_gitcommit} && cd pkg/kamailio/alpine || return 1 + echo Created dist archive "$SRCDEST"/${pkgname}-${pkgver}${_suffix}.tar.gz +} + +get_source_from_github(){ + echo Cannot create archive using local git repo. Trying create source from GutHub. + wget -O "$SRCDEST"/${pkgname}-${pkgver}${_suffix}.tar.gz https://github.com/kamailio/$pkgname/archive/${_gitcommit}.tar.gz || return 1 + echo Created dist archive "$SRCDEST"/${pkgname}-${pkgver}${_suffix}.tar.gz +} + snapshot() { if [ ! -f "$SRCDEST"/${pkgname}-${pkgver}${_suffix}.tar.gz ]; then - wget -O "$SRCDEST"/${pkgname}-${pkgver}${_suffix}.tar.gz https://github.com/kamailio/$pkgname/archive/$_gitcommit.tar.gz + get_source_from_local_git || get_source_from_github fi - SHA512SUM=$(sha512sum "$SRCDEST"/${pkgname}-${pkgver}${_suffix}.tar.gz | sed -e "s:$SRCDEST/::") + SHA512SUM=$(sha512sum "$SRCDEST"/${pkgname}-${pkgver}${_suffix}.tar.gz | sed -e "s:${SRCDEST}/::") sed -i -e "s/^\(sha512sums=.\).*/\1$SHA512SUM/" APKBUILD }