# # spec file for package coturn # # Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # %define sname turnserver %if 0%{?suse_version} > 1500 %define _lto_cflags %{nil} %endif Name: coturn Version: 4.5.1.1 Release: lp152.8.1 Summary: Free open source implementation of TURN and STUN Server License: BSD-3-Clause and MIT Group: Productivity/Networking/Other URL: https://github.com/coturn/coturn/ Source0: https://github.com/coturn/coturn/archive/%{version}/%{sname}-%{version}.tar.gz Source2: %{name}.firewalld Source3: %{name}.logrotate Source90: README.SUSE Source99: %{name}-rpmlintrc Patch1: %{name}-fix_missing-call-to-setgroups-before-setuid.patch BuildRequires: pkgconfig(hiredis) BuildRequires: pkgconfig(openssl) >= 1.0.2 BuildRequires: pkgconfig(libevent) >= 2.0 BuildRequires: pkgconfig(sqlite3) BuildRequires: pkgconfig(libpq) #BuildRequires: systemd-rpm-macros #BuildRequires: firewall-macros BuildRequires: sqlite3 BuildRequires: libmysqld-devel Requires(pre): shadow Requires(pre): %fillup_prereq %{?systemd_requires} Recommends: logrotate %description The TURN Server is a VoIP media traffic NAT traversal server and gateway. It can be used as a general-purpose network traffic TURN server/gateway, too. This implementation also includes some extra features. Supported RFCs: TURN specs: - RFC 5766 - base TURN specs - RFC 6062 - TCP relaying TURN extension - RFC 6156 - IPv6 extension for TURN - Experimental DTLS support as client protocol. STUN specs: - RFC 3489 - "classic" STUN - RFC 5389 - base "new" STUN specs - RFC 5769 - test vectors for STUN protocol testing - RFC 5780 - NAT behavior discovery support The implementation fully supports the following client-to-TURN-server protocols: - UDP (per RFC 5766) - TCP (per RFC 5766 and RFC 6062) - TLS (per RFC 5766 and RFC 6062); TLS1.0/TLS1.1/TLS1.2 - DTLS (experimental non-standard feature) Supported relay protocols: - UDP (per RFC 5766) - TCP (per RFC 6062) Supported user databases (for user repository, with passwords or keys, if authentication is required): - SQLite - MySQL - PostgreSQL - Redis Redis can also be used for status and statistics storage and notification. Supported TURN authentication mechanisms: - long-term - TURN REST API (a modification of the long-term mechanism, for time-limited secret-based authentication, for WebRTC applications) The load balancing can be implemented with the following tools (either one or a combination of them): - network load-balancer server - DNS-based load balancing - built-in ALTERNATE-SERVER mechanism. %package devel Summary: TURN client development headers Group: Development/Libraries/C and C++ Requires: coturn = %{version}-%{release} %description devel This package contains the TURN client development headers. %prep %setup -q -n %{name}-%{version} %patch1 -p1 install -m644 %{SOURCE90} . %build %configure \ -libdir=%{_libdir} \ -confdir=%{_sysconfdir}/%{name} \ -turndbdir=%{_localstatedir}/lib/%{name} \ -docsdir=%{_defaultdocdir}/%{name}/doc \ -examplesdir=%{_defaultdocdir}/%{name}/examples \ -schemadir=%{_defaultdocdir}/%{name}/schema \ -mandir=%{_datadir} \ -disable-rpath %make_build %make_build sqlite/turndb %install %make_install mv %{buildroot}%{_sysconfdir}/%{name}/%{sname}.conf.default %{buildroot}%{_sysconfdir}/%{name}/%{sname}.conf install -D -m 0644 rpm/%{sname}.sysconfig %{buildroot}%{_fillupdir}/sysconfig.%{name} mkdir -p %{buildroot}%{_localstatedir}/log/%{name} mkdir -p %{buildroot}%{_rundir}/%{name} install -D -p -m 0644 rpm/%{sname}-tmpfiles.conf %{buildroot}%{_tmpfilesdir}/%{name}.conf # systemd install -D -p -m 0644 rpm/%{sname}.service.fc %{buildroot}%{_unitdir}/%{name}.service install -d -m 0755 %{buildroot}%{_sbindir}/ ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name} # firewalld install -D -m0644 %{SOURCE2} %{buildroot}%{_libexecdir}/firewalld/services/coturn.xml # logrotate install -D -m0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/logrotate.d/%{name} # change coturn/turnserver.conf sed -i -e 's/#no-stdout-log/no-stdout-log/g' \ %{buildroot}/%{_sysconfdir}/%{name}/%{sname}.conf sed -i -e 's/#userdb/userdb/g' \ -e 's|/var/db/turndb|/var/lib/%{name}/turndb|g' \ %{buildroot}%{_sysconfdir}/%{name}/%{sname}.conf sed -i -e 's/#log-file/log-file/g' \ -e 's|/var/tmp/turn.log|/var/log/%{name}/turn.log|g' \ %{buildroot}%{_sysconfdir}/%{name}/%{sname}.conf sed -i -e 's/#pidfile/pidfile/g' \ -e 's|/var/run/%{sname}.pid|%{_rundir}/%{name}/%{sname}.pid|g' \ %{buildroot}%{_sysconfdir}/%{name}/%{sname}.conf # fix paths in coturn.service sed -i -e 's|EnvironmentFile=\/etc\/sysconfig\/turnserver|EnvironmentFile=\/etc\/sysconfig\/%{name}|g' \ %{buildroot}%{_unitdir}/%{name}.service sed -i -e 's|\/var\/run\/turnserver\/turnserver.pid|%{_rundir}\/%{name}\/turnserver.pid|g' \ %{buildroot}%{_unitdir}/%{name}.service sed -i -e 's|\/etc\/turnserver\/turnserver.conf|\/etc\/%{name}\/turnserver.conf|g' \ %{buildroot}%{_unitdir}/%{name}.service # fix user and group in coturn.service sed -i -e 's|User=turnserver|User=%{name}|g' \ %{buildroot}%{_unitdir}/%{name}.service sed -i -e 's|Group=turnserver|Group=%{name}|g' \ %{buildroot}%{_unitdir}/%{name}.service # fix path tmpfile sed -i -e 's|turnserver|%{name}|g' \ %{buildroot}%{_tmpfilesdir}/%{name}.conf # rpmlint - fix perm chmod -x %{buildroot}%{_defaultdocdir}/%{name}/doc/* chmod -x %{buildroot}%{_defaultdocdir}/%{name}/schema/*.sql chmod -x %{buildroot}%{_defaultdocdir}/%{name}/schema/*.redis chmod -x %{buildroot}%{_mandir}/man1/* chmod -x %{buildroot}%{_includedir}/turn/ns_turn_defs.h chmod -x %{buildroot}%{_libdir}/libturnclient.a %check %make_build check %pre %service_add_pre coturn.service %{_sbindir}/groupadd -r coturn 2> /dev/null || : %{_sbindir}/useradd -r -g coturn -s /bin/false -c "Coturn TURN Server daemon" -d \ %{_datadir}/%{name} coturn 2> /dev/null || : %preun %service_del_preun coturn.service %post %service_add_post coturn.service %tmpfiles_create %{_tmpfilesdir}/%{name}.conf %{fillup_only -n coturn} %firewalld_reload %postun %service_del_postun coturn.service if [ $1 -eq 0 ]; then %{_sbindir}/userdel coturn %{_sbindir}/groupdel coturn rm -rf %{_sysconfdir}/sysconfig/coturn else true fi %files %license LICENSE %doc AUTHORS ChangeLog NOTE STATUS TODO README.SUSE %{_defaultdocdir}/%{name} %{_bindir}/turnserver %{_bindir}/turnadmin %{_bindir}/turnutils_* %{_mandir}/man1/*.1.gz %ghost %{_rundir}/%{name} %dir %attr(-,coturn,coturn) %{_localstatedir}/lib/%{name} %attr(0640,coturn,coturn) %{_localstatedir}/lib/%{name}/turndb %dir %attr(-,coturn,coturn) %{_sysconfdir}/%{name} %config(noreplace) %attr(0644,coturn,coturn) %{_sysconfdir}/%{name}/%{sname}.conf %config(noreplace) %{_sysconfdir}/logrotate.d/%{name} %dir %attr(0750,coturn,coturn) %{_localstatedir}/log/coturn %dir %attr(0750,coturn,coturn) %{_rundir}/%{name} %dir %{_libexecdir}/firewalld %dir %{_libexecdir}/firewalld/services %{_libexecdir}/firewalld/services/%{name}.xml %{_fillupdir}/sysconfig.%{name} %{_unitdir}/%{name}.service %{_sbindir}/rc%{name} %{_tmpfilesdir}/%{name}.conf %files devel %license LICENSE %dir %{_includedir}/turn %{_includedir}/turn/ns_turn_defs.h %dir %{_includedir}/turn/client %{_includedir}/turn/client/ns_turn_*.h %{_includedir}/turn/client/TurnMsgLib.h %{_libdir}/libturnclient.a %changelog * Fri Jan 10 2020 ecsos@schirra.net - Fix build error for Tumbleweed. * Sat Mar 16 2019 ecsos@opensuse.org - Update to 4.5.1.1 - merge PR #330 missing \r\n after http Connection:close - merge PR #303 fix typo enpoint - merge PR #129 seperate http web-admin listener - regression from 4.5.1.0 * readd pwd check * add to config missing web-admin-listen-on-workers option - merge docker branch * Add Docker file for all database backend. - merge sparc64 branch * Fix mem alingment issue on 64 bit architecture That issue caused earlier "bus error" on sparc64 and armhf - merge PR #336 Clarify Debian install - merge PR #339 RPM build fix - Add coturn-fix_missing-call-to-setgroups-before-setuid.patch * Sat Mar 2 2019 ecsos@opensuse.org - initial verion 4.5.1.0