wok view kamailio/receipt @ rev 24497

Add some current_version
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Feb 19 14:19:02 2022 +0000 (2022-02-19)
parents 7ec8a84c5522
children ce6b8763dcf8
line source
1 # SliTaz package receipt.
3 PACKAGE="kamailio"
4 VERSION="5.3.2"
5 CATEGORY="network"
6 SHORT_DESC="Open Source SIP Server."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="GPL2"
9 WEB_SITE="https://www.kamailio.org/"
11 TARBALL="$PACKAGE-${VERSION}_src.tar.gz"
12 WGET_URL="${WEB_SITE}pub/kamailio/$VERSION/src/$TARBALL"
14 DEPENDS="curl expat libldap libssl libpostgresqlclient libxml2
15 net-snmp pcre radiusclient-ng"
16 BUILD_DEPENDS="bison curl-dev expat-dev flex libxml2-dev
17 net-snmp-dev openldap-dev openssl-dev pcre-dev
18 postgresql-dev python-dev radiusclient-ng-dev"
20 CONFIG_FILES="/etc/kamailio"
22 # What is the latest version available today?
23 current_version()
24 {
25 wget -O - https://www.kamailio.org/pub/kamailio/latest/src/ 2>/dev/null | \
26 sed "/latest/d;/$PACKAGE-[0-9]/!d;/tar/!d;s|.*$PACKAGE-\\(.*\\)_src.*|\\1|" | sort -Vr | sed q
27 }
29 # Rules to configure and make the package.
30 compile_rules()
31 {
32 sed -i 's|uname -m|echo i486|' \
33 src/Makefile.defs
35 make \
36 PREFIX="/usr" \
37 include_modules="acc_radius app_python auth_radius \
38 db_postgres ldap presence_conference presence_dialoginfo presence_mwi \
39 presence_profile presence_reginfo presence_xml snmpstats xmpp dialplan" \
40 cfg &&
41 make all &&
42 make DESTDIR=$DESTDIR install
43 }
45 # Rules to gen a SliTaz package suitable for Tazpkg.
46 genpkg_rules()
47 {
48 mkdir -p $fs/var/run/kamailio
50 cp -a $install/* $fs
51 mv $fs/usr/etc $fs
52 ln -s /etc $fs/usr/etc
53 }
55 # Pre and post install commands for Tazpkg.
56 post_install()
57 {
59 local user
60 local group
62 user=kamailio
63 group=kamailio
65 if ! grep -q $user $1/etc/passwd
66 then
67 echo -n "Adding user/group $user..."
68 chroot $1/ addgroup -S $group
69 chroot $1/ adduser -s /bin/false -S -D -H -G $group $user
70 status
71 fi
72 chroot "$1/" chown $user:$group /var/run/kamailio
73 }
75 post_remove()
76 {
77 echo "Removing user/group kamailio"
78 chroot "$1/" deluser kamailio
79 }