You can build SipXcom on the system you are working with or you can create RPM files (CentOS/Fedora/RHEL) to make it installable on another machine. DPKG files (Debian/Ubuntu) are not supported right now.
RPM files are created in a chroot environment called Mock. With this you can build RPM files for other distributions then the one hosting the files. CentOS 6 is not supported anymore since release 19.04, the main distribution is CentOS 7 (== RHEL7).
Disclaimer: the latest modifications to this guide describe creating 64 bit RPM files from SipXcom 19.12 on a CentOS 7 64 bit host system, using a CentOS 7 64 bit Mock environment. So only this part has been verified. Also, local building on CentOS 7 is tried, however this is not finished, the lessons learned however are included as well.
Note: It's advised not to build from the root user. This will cause that some scripts wil run as user root, which is not the way things are designed, this will cause looping scripts which will crash your system. You must start SipXcom as root though; this process will start parts of it with the right user.
Create a different user with sudo permissions.
Login again as the sipx user and checkout source code, specific branch and update submodules. SipXcom consists of a lot of seperate git repositories, which are all submodules. I noticed the .gitmodules file expects a public-private authentication to github.com to be in place, so I changed it to https with sed, so it works without that.
Configure the build:
Or, for creating RPM's (default distro is centos-6-x86_64):
To build for a different DISTRO submit this in the configure like so:
Finalize setting up your build system. You can edit setup.sh if needed for your specific situation.
Before starting building, first some more information about this. In the past SipXcom needed some extra packages from epel (Extra Packages for Enterprise Linux) to build. However these days this tree contain the wrong versions of these packages. However, download.sipxcom.org offers all the right ones. So, to avoid issues with dependencies add this to /etc/yum.conf:
If any epel settings are in there (or in /etc/yum.conf.d/), remove them.
Now some information about the make process that SipXcom offers for building. It's pretty extensive with a lot of interesting features but also complicated.
First of all run 'make' without any arguments, you'll get:
At the moment of writing some of those commands won't work, and this overview of features is not complete, use make help for that. For more information you can look in the makefile and the included ones: mak/*.mk. You can try the commands to learn something.
If you want to build, install and run on your local machine you'll need the dependencies on it. You should be able to use 'make sipx.deps' and 'make sipx.deps-missing' for that. However the make system checks if you use CentOS, and if that's the case, no matter the version, and old binary included with the sources will be used in those processes. It won't work.
Here's a fix:
Then you can install all dependencies with this (so only if you want to build locally!):
Then you should be able to build with:
This however will try to install things in different directories then /usr/local/sipx. It might be ok to run 'sudo make sipx' to avoid that, I'm not sure if this won't cause any other issues.
If you want to create RPM files, then you will only need one additional package on the host system which is needed for some generation task when building sipXconfig.
Then the Mock environment is required, which is using a centos-7-x86_64.cfg file for setting the repositories to use in the chroot environment. This however also has the previously described epel issues. So edit mak/mock/centos-7-x86_64.cfg, disable all epel entries and add the sipxcom repo from above.
Then initialise the Mock environment, which will be used as a chroot environment to build everything.
This step can be skipped, but you can build all libraries required to run SipXcom. You can put those on your repo server so that all dependencies are there. It also possible to get the dependencies from download.sipxcom.org, which is the preferred method.
Before starting the actual build there's one more issue. SipXcom uses oss_core as a component. I have not succeeded in building this package, so you should use the package provided by download.sipxcom.org and not try to build the rpm:
As stated before more packages can be excluded if no changes have been made to the original versions. Disabling beyond oss_core has not been tested.
Then make SipXcom RPM's and get a coffee:
The resulting packages will be in repo/CentOS_7/x86_64/
The RPM build process only rebuilds modules that have changes in source code. If you want to force rebuilding a specific module you can remove the checksum files for that module from the build directory:
If something goes wrong in the mock environment you can enter a shell and look around. If needed, you can install packages to it as well: