Kannel RPM

I’ve struggled in the past trying to build Kannel RPM packages or using packages built by other people. I’ve also read a lot of posts on Kannel Mailing Lists – you’re already a member isn’t it? 😉 – from people having problems with the packaged config files and/or this or that incompatibility.

Seeing this, I’ve decided to create an easy way to compile Kannel’s RPM and, at the same time get as close to a  working installation as possible only by installing the RPM’s.

I’ve decided that the more user-friendly way to achieve this was to integrate the RPM build process into the regular compile cycle for Kannel. In other words, my approach to Kannel RPM’s is as easy as:

./configure
make rpm
rpm -i /usr/src/redhat/RPMS/i386/kannel-cvs-YYYYMMDD.i386.rpm

After installing the package, you’ll get a properly installed Kannel with the following features:

  • MySQL support (for DLR’s and/or other packages.
  • PCRE (Perl-Compatible Regular Expressions) support.
  • OpenSSL support.
  • Spool based store engine (spool folder located at /var/spool/kannel/).
  • Init scripts already installed and chkconfig‘ed to run at boot time.
  • All boxes run as user kannel (which is created at install time).
  • wapbox is disabled by default (but could be easily enabled by changing one line on the init script and restarting the service).
  • Config files are on /etc/kannel/
  • Log files are on /var/log/kannel/

The config file is ready to run with a single fakesmsc connection running on port 10000 (so you can run fakesmsc from the command line and start testing your setup right after installing the RPM).

To get all this nice features working on your own box, you have to follow this easy steps:

  1. Download the latest CVS HEAD from the Kannel Website. It can be by CVS or the latest snapshot.
  2. Download this file and extract it into the Kannel Source tree. You’ll have an rpm folder at the same level as gw, gwlib, test, etc.
  3. Download this patch file, copy it to your Kannel source tree and apply the patch with:patch -p0 < kannel-rpm.patch
  4. Run autoconf to rebuild the configure file. This is only needed once after applying the patch. Sometimes I’ve got an error about a missing macro (unrelated with the patches we’ve just made), but the new configure file is created and works anyway, so I assume it’s safe to ignore it.
  5. Run ./configure . Do not put any switches here, they’ll be blatantly ignored by the RPM anyway, so if you expected to be able to put your special switches on the RPM, you’re out of luck (at least by now).
  6. Run make rpm to build the RPM’s. At the end, you’ll get a message indicating the final location of your files (which is usually /usr/src/redhat/RPMS, (unless you redefined %_topdir on your .rpmmacros or did any other similar hack for what matters).
  7. Install the RPM (you don’t need my help at this point right? 😉
  8. Start the service with service kannel start and start playing with it!

If you encounter any problems running the service, check on /var/log/kannel and see if you can figure out what went wrong.

As a side note, you’ll also get a kannel-devel and kannel-debug RPM packages, and a source RPM on the SRPMS folder. You can use this later to tweak it and build your own package if you want to.

Enough said, please try it out and let me know if it worked for you.

Alejandro Guerrieri

Comments (20)

Romulo GomezNovember 16th, 2008 at 12:03 PM

Hi Alex!

Great effort you have here providing Kannel users a quick and easy install guide of having an RPM package that can work with!

My question, can it be possible also to include on the RPM package your install guide for SQLBox as part of Kannel RPM?

thanks!

alexNovember 16th, 2008 at 4:09 PM

Romulo,

The sqlbox install guide sits on the sqlbox tree, which is a different tree so it would be confusing to mix them.

I’m working on an SQLBox RPM with the same approach (a version with basic functionality that works out of the box after installing the RPM). That package will include the install guide as well.

Regards,

Alex

Romulo GomezNovember 16th, 2008 at 9:29 PM

Hi Alex!

Thanks so much for your effort! Will wait for the RPM release of sqlbox and test it against my Ubuntu machine and report back to you my testing results..

Best of luck!

Romulo GomezNovember 16th, 2008 at 10:16 PM

I tried building the RPM instructions and gave me this error when im in the “make rpm” command:

Preparing to build the RPM files
mkdir -p “/tmp/kannel-rpm/kannel-cvs”
cp -R * “/tmp/kannel-rpm/kannel-cvs”
tar -C “/tmp/kannel-rpm” -c kannel-cvs -zf kannel-cvs.tar.gz
rm -rf “/tmp/kannel-rpm/kannel-cvs”
if [ -d /tmp/kannel-rpm ]; then rmdir “/tmp/kannel-rpm”; fi
Building the RPM
rpmbuild -ta kannel-cvs.tar.gz
error: line 5: Illegal char ‘-‘ in version: Version: cvs-20081022
make: *** [rpm] Error 1

What could I’ve done wrong?

Thanks!

alexNovember 17th, 2008 at 12:34 AM

Romulo,

There seemed to be a problem with some RPM binaries not accepting the “-” on cvs-YYYYMMDD format used by Kannel. I’ve fixed the code to use only “cvs” on the “Version” tag, and the date on the “Release” tag. Please re-download the “kannel-rpm.tar.gz” file, replace the content of the “rpm” folder and proceed from point 5 again (no need to re-run autoconf).

BTW, if you get an error on some “legacy” format or unsuported tag, please delete the 2 rather outdated .spec files on the /utils folder and try again.

Regards,

Alex

Romulo GomezNovember 17th, 2008 at 3:20 AM

Thanks for your prompt reply Alex!

However, I tried downloading the updated version and still the created kannel-cvs.spec file uses the cvs-20081022 as the kannel version.

Still, the make rpm breaks on this point.

Romulo GomezNovember 17th, 2008 at 3:52 AM

When tried to rename the version (stripping the “dash” manually), here is the error now:

Building the RPM
rpmbuild -ta kannel-cvs.tar.gz
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.51994
+ umask 022
+ cd /usr/src/rpm/BUILD
+ rm -rf /var/tmp/kannel-cvs20081022-20081117-root
+ cd /usr/src/rpm/BUILD
+ rm -rf kannel-cvs20081022
+ /bin/gzip -dc /home/earljon/temp/ubuntu/kannel/rpm/kannel-snapshot/kannel-cvs.tar.gz
+ tar -xf –
+ STATUS=0
+ [ 0 -ne 0 ]
+ cd kannel-cvs20081022
cd: 1: can’t cd to kannel-cvs20081022
error: Bad exit status from /var/tmp/rpm-tmp.51994 (%prep)

RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.51994 (%prep)
make: *** [rpm] Error 1

alexNovember 17th, 2008 at 10:51 AM

Something must have been left misconfigured from the first failed attempt. Try doing a “make distclean” and then “./configure” again. Also make sure that the new “rpm” folder has the new .spec.in file, it’s two first line should be something like this:

%define version %(echo @VERSION@ | cut -d- -f1)
%define release %(echo @VERSION@ | cut -d- -f2)

Romulo GomezNovember 17th, 2008 at 1:11 PM

will try it again here ..

by the way, just curious, what kind of linux distro are you using? Im using Ubuntu 8.10 and found on kannel-cvs.spec.in file the ff entries:

BuildRequires: libxml2-devel, openssl-devel, zlib-devel
BuildRequires: pcre-devel
BuildRequires: mysql-devel >= 3.23

which are not available on default Ubuntu distro.

alexNovember 17th, 2008 at 4:51 PM

All the development were done on RedHat and CentOS platforms. I don’t know about RPM on Debian-based distros, but I’m also working into fixing the .deb packages (those are quite outdated).

Regards,

Alex

Romulo GomezNovember 18th, 2008 at 3:33 AM

hi alex!

just downloaded again the rpm file and the spec.in doesn’t have that kind of new settings you point out on your comment.

it still shows the old one.

Romulo GomezNovember 18th, 2008 at 3:35 AM

i manually copied the header on the spec.in file and run the rpm make again and causes this error message:

Building the RPM
rpmbuild -ta kannel-cvs.tar.gz
error: Legacy syntax is unsupported: copyright
error: line 5: Unknown tag: Copyright: Open source, FreeBSD-style license; see COPYING
make: *** [rpm] Error 1

Romulo GomezNovember 18th, 2008 at 4:11 AM

Great! I finally come to an end:

**********************************************************************
* Success!
* Your files are located under /usr/src/redhat/RPMS
* The Kannel Group
**********************************************************************
Thank you for using Kannel.

very much appreciated Alex your effort on this!

alexNovember 18th, 2008 at 7:12 AM

Glad it worked, and thanks for testing it. Please let me know if you encounter any problems running the daemons.

Regards,

Alex

ishan patelJuly 2nd, 2009 at 10:38 AM

Hi Friends !!!
it worked too for me !

but i have some issues !! when i start kannel with

# service kannel start

it is gives me something like this . . .

[root@ishan ~]# service kannel status
Usage: /etc/init.d/kannel {start|stop|reload|restart|force-reload}
[root@ishan ~]# service kannel start
Starting SMS gateway: bearerbox smsbox .
[root@ishan ~]# service kannel stop
Stopping SMS gateway: smsbox bearerbox .
[root@ishan ~]#

so what should i do ..as in this i even cant able to figure out that whether service is started or not …

and if i do use “/etc/init.d/kannel ” for starting and stoping kannel then also it wont provide me “status” option so that i can see that whether service is started or not . . . .

Thanks in advance … waiting for ur reply . . .

alexJuly 5th, 2009 at 7:51 PM

The init script doesn’t support the “status” option. Kannel does have a web administration, if you didn’t modify the kannel.conf from the one the RPM installed, you should be able to access it as: http://localhost:13000/status.html?password=bar

Check the userguide for further instructions.

wow power levelingNovember 22nd, 2009 at 10:07 PM

Wow, this is very useful.. Thanks for sharing this and hoping I could implement it too.

BashirFebruary 16th, 2010 at 7:44 AM

Hi Alex,

Tried this method on Centos X64, ran into some errors, anything i should be aware of, dont recall specific errors will post again when i try but wanted to know if it should be the same procedure?

Innocent MuchedziOctober 21st, 2010 at 8:37 AM

My make rpm is failing please help. I am running fedora 11 my output is

[root@mail kannel-snapshot]# make rpm
find . -name “*.o” -o -name “*.i” -o -name “*.a” | xargs rm -f
rm -f core gw-config wmlscript/wmlsc wmlscript/wmlsdasm utils/seewbmp utils/mtbatch utils/decode_emimsg gw/bearerbox gw/smsbox gw/wapbox utils/run_kannel_box utils/start-stop-daemon test/decompile test/drive_smpp test/drive_wapbox test/fakesmsc test/fakewap test/test_boxc test/test_cfg test/test_charset test/test_cimd2 test/test_conn test/test_date test/test_dbpool test/test_dict test/test_headers test/test_hmac test/test_http test/test_http_server test/test_list test/test_md5 test/test_mem test/test_mime test/test_mime_multipart test/test_msg test/test_octstr_dump test/test_octstr_format test/test_octstr_immutables test/test_ota test/test_pap test/test_pcre test/test_pdu test/test_ppg test/test_prioqueue test/test_radius_acct test/test_radius_pdu test/test_regex test/test_si test/test_sl test/test_smsc test/test_store_dump test/test_udp test/test_urltrans test/test_uuid test/test_wakeup test/test_xmlrpc test/timestamp test/udpfeed test/wapproxy test/wml_tester checks/check_counter checks/check_date checks/check_ipcheck checks/check_list checks/check_octstr
rm -f doc/userguide/sms-gateway.png doc/userguide/wap-gateway.png doc/arch/bearerbox-arch.png doc/arch/conf-push-session.png doc/arch/external-interfaces.png doc/arch/kannel-boxes.png doc/arch/kannel-push-boxes.png doc/arch/pushbox-threads.png doc/arch/wap-arch.png doc/arch/wapbox-threads.png doc/arch/wap-session.png doc/userguide/sms-gateway.ps doc/userguide/wap-gateway.ps doc/arch/bearerbox-arch.ps doc/arch/conf-push-session.ps doc/arch/external-interfaces.ps doc/arch/kannel-boxes.ps doc/arch/kannel-push-boxes.ps doc/arch/pushbox-threads.ps doc/arch/wap-arch.ps doc/arch/wapbox-threads.ps doc/arch/wap-session.ps doc/alligata/11-1.ps doc/alligata/11-3.ps doc/alligata/11-4.ps doc/alligata/11-5.ps doc/alligata/12-10.ps doc/alligata/12-11.ps doc/alligata/12-12.ps doc/alligata/12-13.ps doc/alligata/12-2.ps doc/alligata/12-3.ps doc/alligata/12-4.ps doc/alligata/12-5.ps doc/alligata/12-6.ps doc/alligata/12-7.ps doc/alligata/12-8.ps doc/alligata/12-9.ps doc/alligata/13-5.ps doc/alligata/done.ps doc/alligata/licences.ps doc/alligata/maininst.ps doc/alligata/nearlydone.ps doc/alligata/nopro.ps doc/alligata/progress.ps doc/alligata/wapdiagsmall.ps doc/wtls/fig10o.ps doc/wtls/fig1o.ps doc/wtls/fig2o.ps doc/wtls/fig3o.ps doc/wtls/fig4o.ps doc/wtls/fig4out.ps doc/wtls/fig5o.ps doc/wtls/fig5out.ps doc/wtls/fig6o.ps doc/wtls/fig6out1.ps doc/wtls/fig6out.ps doc/wtls/fig7o.ps doc/wtls/fig8o.ps doc/wtls/fig9o.ps doc/alligata/alligata.html doc/arch/arch.html doc/userguide/userguide.html doc/wtls/wtls.html doc/alligata/alligata.rtf doc/arch/arch.rtf doc/userguide/userguide.rtf doc/wtls/wtls.rtf doc/alligata/alligata.ps doc/arch/arch.ps doc/userguide/userguide.ps doc/wtls/wtls.ps doc/alligata/alligata.pdf doc/arch/arch.pdf doc/userguide/userguide.pdf doc/wtls/wtls.pdf
rm -f benchmarks/report.pdf benchmarks/report.ps benchmarks/report.html
rm -rf “/tmp/kannel-rpm/kannel-cvs”
if [ -d /tmp/kannel-rpm ]; then rmdir “/tmp/kannel-rpm”; fi
rm -f kannel-cvs.tar kannel-cvs.tar.gz
Preparing to build the RPM files
mkdir -p “/tmp/kannel-rpm/kannel-cvs”
cp -R * “/tmp/kannel-rpm/kannel-cvs”
tar -C “/tmp/kannel-rpm” -c kannel-cvs -zf kannel-cvs.tar.gz
rm -rf “/tmp/kannel-rpm/kannel-cvs”
if [ -d /tmp/kannel-rpm ]; then rmdir “/tmp/kannel-rpm”; fi
Building the RPM
rpmbuild -ta kannel-cvs.tar.gz
error: line 140: second %prep
make: *** [rpm] Error 1
[root@mail kannel-snapshot]#

please help

CamiloJanuary 12th, 2013 at 7:34 AM

Hello, after sorting problems finally i could run “make rpm” resulting in this Error which is could not solve:

Building the RPM
rpmbuild -ta kannel-cvs.tar.gz
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.SrLLXM
+ umask 022
+ cd /root/rpmbuild/BUILD
+ rm -rf /root/rpmbuild/BUILDROOT/kannel-1.4.3-1.4.3.x86_64
+ cd /root/rpmbuild/BUILD
+ rm -rf kannel-1.4.3
+ /usr/bin/gzip -dc /usr/local/src/gateway-1.4.3/kannel-cvs.tar.gz
+ /bin/tar -xf –
+ STATUS=0
+ ‘[‘ 0 -ne 0 ‘]’
+ cd kannel-1.4.3
/var/tmp/rpm-tmp.SrLLXM: line 35: cd: kannel-1.4.3: No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.SrLLXM (%prep)

RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.SrLLXM (%prep)
make: *** [rpm] Error 1

I would greatly appreciate your help.