|
|
@ -10,6 +10,7 @@ Source0: https://github.com/sipwise/rtpengine/archive/mr%{version}/%{name}-%{ver |
|
|
Conflicts: %{name}-kernel < %{version}-%{release} |
|
|
Conflicts: %{name}-kernel < %{version}-%{release} |
|
|
|
|
|
|
|
|
%global with_transcoding 1 |
|
|
%global with_transcoding 1 |
|
|
|
|
|
%{?_unitdir:%define has_systemd_dirs 1} |
|
|
|
|
|
|
|
|
BuildRequires: gcc make pkgconfig redhat-rpm-config |
|
|
BuildRequires: gcc make pkgconfig redhat-rpm-config |
|
|
BuildRequires: glib2-devel libcurl-devel openssl-devel pcre-devel |
|
|
BuildRequires: glib2-devel libcurl-devel openssl-devel pcre-devel |
|
|
@ -109,12 +110,22 @@ install -D -p -m755 recording-daemon/%{binname}-recording %{buildroot}%{_sbindir |
|
|
%endif |
|
|
%endif |
|
|
|
|
|
|
|
|
## Install the init.d script and configuration file |
|
|
## Install the init.d script and configuration file |
|
|
|
|
|
%if 0%{?has_systemd_dirs} |
|
|
|
|
|
install -D -p -m755 el/%{binname}.service \ |
|
|
|
|
|
%{buildroot}%{_unitdir}/%{binname}.service |
|
|
|
|
|
%else |
|
|
install -D -p -m755 el/%{binname}.init \ |
|
|
install -D -p -m755 el/%{binname}.init \ |
|
|
%{buildroot}%{_initrddir}/%{name} |
|
|
%{buildroot}%{_initrddir}/%{name} |
|
|
|
|
|
%endif |
|
|
%if 0%{?with_transcoding} > 0 |
|
|
%if 0%{?with_transcoding} > 0 |
|
|
|
|
|
%if 0%{?has_systemd_dirs} |
|
|
|
|
|
install -D -p -m755 el/%{binname}-recording.service \ |
|
|
|
|
|
%{buildroot}%{_unitdir}/%{binname}-recording.service |
|
|
|
|
|
%else |
|
|
install -D -p -m755 el/%{binname}-recording.init \ |
|
|
install -D -p -m755 el/%{binname}-recording.init \ |
|
|
%{buildroot}%{_initrddir}/%{name}-recording |
|
|
%{buildroot}%{_initrddir}/%{name}-recording |
|
|
%endif |
|
|
%endif |
|
|
|
|
|
%endif |
|
|
install -D -p -m644 el/%{binname}.sysconfig \ |
|
|
install -D -p -m644 el/%{binname}.sysconfig \ |
|
|
%{buildroot}%{_sysconfdir}/sysconfig/%{binname} |
|
|
%{buildroot}%{_sysconfdir}/sysconfig/%{binname} |
|
|
%if 0%{?with_transcoding} > 0 |
|
|
%if 0%{?with_transcoding} > 0 |
|
|
@ -163,7 +174,11 @@ getent passwd %{name} >/dev/null || /usr/sbin/useradd -r -g %{name} \ |
|
|
|
|
|
|
|
|
%post |
|
|
%post |
|
|
if [ $1 -eq 1 ]; then |
|
|
if [ $1 -eq 1 ]; then |
|
|
|
|
|
%if 0%{?has_systemd_dirs} |
|
|
|
|
|
systemctl daemon-reload |
|
|
|
|
|
%else |
|
|
/sbin/chkconfig --add %{name} || : |
|
|
/sbin/chkconfig --add %{name} || : |
|
|
|
|
|
%endif |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -187,11 +202,16 @@ true |
|
|
|
|
|
|
|
|
%preun |
|
|
%preun |
|
|
if [ $1 = 0 ] ; then |
|
|
if [ $1 = 0 ] ; then |
|
|
|
|
|
%if 0%{?has_systemd_dirs} |
|
|
|
|
|
systemctl stop %{binname}.service |
|
|
|
|
|
systemctl disable %{binname}.service |
|
|
|
|
|
|
|
|
|
|
|
%else |
|
|
/sbin/service %{name} stop >/dev/null 2>&1 |
|
|
/sbin/service %{name} stop >/dev/null 2>&1 |
|
|
/sbin/chkconfig --del %{name} |
|
|
/sbin/chkconfig --del %{name} |
|
|
|
|
|
%endif |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%preun dkms |
|
|
%preun dkms |
|
|
# Remove from DKMS registry |
|
|
# Remove from DKMS registry |
|
|
dkms remove -m %{name} -v %{version}-%{release} --rpm_safe_upgrade --all |
|
|
dkms remove -m %{name} -v %{version}-%{release} --rpm_safe_upgrade --all |
|
|
@ -204,7 +224,11 @@ true |
|
|
# CLI (command line interface) |
|
|
# CLI (command line interface) |
|
|
%{_sbindir}/%{binname}-ctl |
|
|
%{_sbindir}/%{binname}-ctl |
|
|
# init.d script and configuration file |
|
|
# init.d script and configuration file |
|
|
|
|
|
%if 0%{?has_systemd_dirs} |
|
|
|
|
|
%{_unitdir}/%{binname}.service |
|
|
|
|
|
%else |
|
|
%{_initrddir}/%{name} |
|
|
%{_initrddir}/%{name} |
|
|
|
|
|
%endif |
|
|
%config(noreplace) %{_sysconfdir}/sysconfig/%{binname} |
|
|
%config(noreplace) %{_sysconfdir}/sysconfig/%{binname} |
|
|
%attr(0750,%{name},%{name}) %dir %{_sharedstatedir}/%{name} |
|
|
%attr(0750,%{name},%{name}) %dir %{_sharedstatedir}/%{name} |
|
|
# default config |
|
|
# default config |
|
|
@ -229,7 +253,11 @@ true |
|
|
# Recording daemon |
|
|
# Recording daemon |
|
|
%{_sbindir}/%{binname}-recording |
|
|
%{_sbindir}/%{binname}-recording |
|
|
# Init script |
|
|
# Init script |
|
|
|
|
|
%if 0%{?has_systemd_dirs} |
|
|
|
|
|
%{_unitdir}/%{binname}-recording.service |
|
|
|
|
|
%else |
|
|
%{_initrddir}/%{name}-recording |
|
|
%{_initrddir}/%{name}-recording |
|
|
|
|
|
%endif |
|
|
# Sysconfig |
|
|
# Sysconfig |
|
|
%config(noreplace) %{_sysconfdir}/sysconfig/%{binname}-recording |
|
|
%config(noreplace) %{_sysconfdir}/sysconfig/%{binname}-recording |
|
|
# Default config |
|
|
# Default config |
|
|
|