sipwise / rtpengine

The Sipwise media proxy for Kamailio
GNU General Public License v3.0
788 stars 371 forks source link

RPM build problems #758

Open ivangirko opened 5 years ago

ivangirko commented 5 years ago

Hi, I don`t understand how to build rpm package on on centos 7.

First try:

[root@deneb rtpengine]# git archive --output ~/rpmbuild/SOURCES/ngcp-rtpengine-7.2.1.4+0~mr7.2.1.4.tar.gz --prefix=ngcp-rtpengine-7.2.1.4+0~mr7.2.1.4/ 7.2.1.4+0~mr7.2.1.4
fatal: Not a valid object name

ok, next try:

[root@deneb rtpengine]# git archive --output /root/rpmbuild/SOURCES/ngcp-rtpengine-7.2.1.4+0~mr7.2.1.4.tar.gz --prefix=ngcp-rtpengine-7.2.1.4+0~mr7.2.1.4/ mr7.2.1.4

No errors, and next step:

[root@deneb rtpengine]# rpmbuild -ta ~/rpmbuild/SOURCES/ngcp-rtpengine-7.2.1.4+0~mr7.2.1.4.tar.gz 
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.vutcTQ
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd /root/rpmbuild/BUILD
+ rm -rf rtpengine-mr7.2.1.4+0~mr7.2.1.4
+ /usr/bin/gzip -dc /root/rpmbuild/SOURCES/ngcp-rtpengine-7.2.1.4+0~mr7.2.1.4.tar.gz
+ /usr/bin/tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd rtpengine-mr7.2.1.4+0~mr7.2.1.4
/var/tmp/rpm-tmp.vutcTQ: line 35: cd: rtpengine-mr7.2.1.4+0~mr7.2.1.4: No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.vutcTQ (%prep)

RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.vutcTQ (%prep)

[root@deneb rtpengine]# ll ~ /rpmbuild/SOURCES/ total 440 -rw-r--r--. 1 root root 448668 Apr 22 17:49 ngcp-rtpengine-7.2.1.4+0~mr7.2.1.4.tar.gz

[root@deneb rtpengine]# ll ~ /rpmbuild/BUILD total 4 drwxrwxr-x. 15 root root 4096 Apr 3 21:44 ngcp-rtpengine-7.2.1.4+0~mr7.2.1.4


What I am doing wrong, thanks?
 (Why is it trying cd to rtpengine-mr7.2.1.4+0~mr7.2.1.4)
rfuchs commented 5 years ago

We don't support the RPM build system. Leaving this open in case somebody else wants to chime in.

ivangirko commented 5 years ago

ok, thanks

amessina commented 5 years ago

@ivangirko you're welcome to take a look at the RPM spec and associated files I use: https://messinet.com/rpms/browser/rtpengine

I don't build for CentOS but it shouldn't be too hard to adapt.

kdoren commented 5 years ago

Thanks @amessina I adapted your RPM spec to build for CentOS 7 including DKMS kernel mod.

Install dependencies, as root: yum -y install epel-release yum install gcc make pkgconfig redhat-rpm-config rpm-build glib2-devel libcurl-devel pcre-devel yum -y --enablerepo=updates install openssl-devel systemd-devel yum -y install xmlrpc-c-devel zlib-devel hiredis-devel libpcap-devel libevent-devel json-glib-devel shadow-utils nc mysql-devel yum localinstall --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm yum -y install ffmpeg ffmpeg-libs ffmpeg-devel yum -y install iptables iptables-ipv6 dkms iptables-devel gperf perl-generators perl-IPC-Cmd yum -y --enablerepo=epel-testing install bcg729-devel yum -y --enablerepo=updates install "kernel-devel-uname-r == $(uname -r)" yum -y install kmodtool elfutils-libelf-devel

As non-root user: mkdir -p ~/rpmbuild/{SOURCES,SPECS,BUILD,BUILDROOT,SRPMS} // copy attached file rtpengine.spec (see below) to ~/rpmbuild/SPECS/rtpengine.spec // build (repeat if result is redefinition error in ssllib.c) : rpmbuild --undefine=_disable_source_fetch -ba ~/rpmbuild/SPECS/rtpengine.spec // install: sudo yum install ~/rpmbuild/RPMS/x86_64/{rtpengine-7.3.1.1-0.el7.x86_64.rpm,rtpengine-kernel-7.3.1.1-0.el7.x86_64.rpm,rtpengine-recording-daemon-7.3.1.1-0.el7.x86_64.rpm} sudo yum install ~/rpmbuild/RPMS/noarch/rtpengine-firewalld-7.3.1.1-0.el7.noarch.rpm ~/rpmbuild/RPMS/noarch/rtpengine-dkms-7.3.1.1-0.el7.noarch.rpm

// configure: edit file /etc/rtpengine/rtpengine.conf // in section [rtpengine] interface = ip.ad.dr.ess recording-dir = /var/spool/rtpengine recording-method = proc recording-format = raw

If using recording daemon, add section: [rtpengine-recording] table = 0

// run systemctl start rtpengine systemctl start rtpengine-recording

rtpengine.spec file (in zip archive because filetype .spec upload is not allowed): rtpengine.zip