Name: coturn Version: 4.5.0.7 Release: 1%{dist} Summary: TURN/STUN & ICE Server License: BSD URL: https://github.com/coturn/coturn/ Source0: https://github.com/coturn/coturn/archive/%{version}.tar.gz Source1: coturn.service Source2: coturn.sysconfig # NOTE: Use the sysusers.d macro when available #Source3: coturn-sysusers.conf Source4: coturn-tmpfiles.conf Source5: coturn-init.service Source6: 80-coturn.preset Patch0: coturn-4.5.0.7-ssl_cipher_lists.patch BuildRequires: gcc BuildRequires: hiredis-devel BuildRequires: libevent-devel >= 2.0.0 BuildRequires: make BuildRequires: mariadb-devel BuildRequires: openssl-devel BuildRequires: postgresql-devel BuildRequires: sqlite-devel BuildRequires: systemd %{?systemd_requires} # NOTE: Use the sysusers.d macro when available Requires(pre): shadow-utils Requires: hiredis Requires: libevent >= 2.0.0 Requires: openssl Requires: perl-DBI Requires: perl-libwww-perl Requires: telnet Requires: %{name}-database = %{version}-%{release} Provides: turnserver = %{version} %description The Coturn 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 client-devel Summary: Coturn client development headers Requires: openssl Requires: libevent >= 2.0.0 %description client-devel This package contains the TURN client development headers. %package utils Summary: Coturn utils %description utils This package contains the TURN client utils. %prep %setup -q -n %{name}-%{version} %patch0 -p1 %build %configure --confdir=%{_sysconfdir}/%{name} \ --examplesdir=%{_docdir}/%{name} \ --schemadir=%{_datadir}/%{name} \ --manprefix=%{_datadir} \ --docdir=%{_docdir}/%{name} \ --disable-rpath %make_build %pre # NOTE: Use the sysusers.d macro when available getent group GROUPNAME >/dev/null || groupadd -r coturn getent passwd USERNAME >/dev/null || \ useradd -r -g coturn -d %{_datadir}/%{name} -s /sbin/nologin \ -c "TURN Server daemon" coturn exit 0 %check make test %install %make_install install -Dpm 0644 %{SOURCE1} %{buildroot}%{_unitdir}/coturn.service install -Dpm 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/coturn # NOTE: Use the sysusers.d macro when available #install -Dpm 0644 %%{SOURCE3} %%{buildroot}%%{_sysconfdir}/sysusers.d/coturn.conf install -Dpm 0644 %{SOURCE4} %{buildroot}%{_tmpfilesdir}/coturn.conf install -Dpm 0644 %{SOURCE5} %{buildroot}%{_unitdir}/coturn-init.service install -Dpm 0644 %{SOURCE6} %{buildroot}%{_libdir}/systemd/system-preset/80-coturn.preset sed -i \ -e "s/#syslog/syslog/g" \ -e "s/#no-stdout-log/no-stdout-log/g" \ -e "s/#cert=\/usr\/local\/etc\/turn_server_cert.pem/cert=\/etc\/pki\/coturn\/public\/turn_server_cert.pem/g" \ -e "s/#pkey=\/usr\/local\/etc\/turn_server_pkey.pem/pkey=\/etc\/pki\/coturn\/private\/turn_server_pkey.pem/g" \ %{buildroot}%{_sysconfdir}/%{name}/turnserver.conf.default mv %{buildroot}%{_sysconfdir}/%{name}/turnserver.conf.default %{buildroot}%{_sysconfdir}/%{name}/turnserver.conf # NOTE: Removing sqlite db, static lib, certs and keys rm -rf %{buildroot}%{_localstatedir}/db rm %{buildroot}%{_libdir}/libturnclient.a rm %{buildroot}%{_docdir}/%{name}/etc/turn_client_cert.pem rm %{buildroot}%{_docdir}/%{name}/etc/turn_client_pkey.pem rm %{buildroot}%{_docdir}/%{name}/etc/turn_server_cert.pem rm %{buildroot}%{_docdir}/%{name}/etc/turn_server_pkey.pem %post %systemd_post coturn.service %preun %systemd_preun coturn.service %postun %systemd_postun_with_restart coturn.service %files # NOTE: The autotools installation doesn't set attributes on files and dirs # see https://github.com/coturn/coturn/pull/216 %license %{_docdir}/%{name}/LICENSE %{_bindir}/turnserver %{_bindir}/turnadmin %dir %attr(0755,-,-) %{_datadir}/%{name} %attr(0644,-,-) %{_datadir}/%{name}/*.redis %attr(0644,-,-) %{_datadir}/%{name}/*.sql %attr(0755,-,-) %{_datadir}/%{name}/*.sh %dir %attr(0755,-,-) %{_docdir}/%{name} %attr(0644,-,-) %{_docdir}/%{name}/README.* %exclude %{_docdir}/%{name}/README.turnutils %exclude %{_docdir}/%{name}/INSTALL %exclude %{_docdir}/%{name}/LICENSE %exclude %{_docdir}/%{name}/postinstall.txt %dir %attr(0755,-,-) %{_docdir}/%{name}/etc %doc %attr(0644,-,-) %{_docdir}/%{name}/etc/* %dir %attr(0755,-,-) %{_docdir}/%{name}/scripts %dir %attr(0755,-,-) %{_docdir}/%{name}/scripts/* %attr(0755,-,-) %{_docdir}/%{name}/scripts/*.sh %attr(0644,-,-) %{_docdir}/%{name}/scripts/readme.txt %doc %attr(0644,-,-) %{_docdir}/%{name}/scripts/*/* # NOTE: These schema files are installed twice. Excluding copies in docs. %exclude %doc %{_docdir}/%{name}/schema.mongo.sh %exclude %doc %{_docdir}/%{name}/schema.sql %exclude %doc %{_docdir}/%{name}/schema.stats.redis %exclude %doc %{_docdir}/%{name}/schema.userdb.redis %attr(0644,-,-) %{_mandir}/man1/coturn.1.* %attr(0644,-,-) %{_mandir}/man1/turnserver.1.* %attr(0644,-,-) %{_mandir}/man1/turnadmin.1.* %dir %attr(-,coturn,coturn) %{_sysconfdir}/%{name} %config(noreplace) %attr(0644,coturn,coturn) %{_sysconfdir}/%{name}/turnserver.conf %config(noreplace) %{_sysconfdir}/sysconfig/coturn # NOTE: Use the sysusers.d macro when available #%%{_sysconfdir}/sysusers.d/coturn.conf %{_tmpfilesdir}/coturn.conf %{_unitdir}/coturn.service %{_unitdir}/coturn-init.service %{_libdir}/systemd/system-preset/80-coturn.preset %files utils %{_bindir}/turnutils_peer %{_bindir}/turnutils_stunclient %{_bindir}/turnutils_uclient %{_bindir}/turnutils_oauth %{_bindir}/turnutils_natdiscovery %doc %attr(0644,-,-) %{_docdir}/%{name}/README.turnutils %attr(0644,-,-) %{_mandir}/man1/turnutils.1.* %attr(0644,-,-) %{_mandir}/man1/turnutils_*.1.* %files client-devel %dir %attr(0755,-,-) %{_includedir}/turn %attr(0644,-,-) %{_includedir}/turn/*.h %dir %attr(0755,-,-) %{_includedir}/turn/client %attr(0644,-,-) %{_includedir}/turn/client/* %changelog * Sun Feb 18 2018 Christian Glombek - 4.5.0.7-1 - RPM packaging for Coturn in Fedora - Update to 4.5.0.7 - Introduce consistent naming, rename service to coturn - Add configure, make and systemd macros - Add systemd preset to disable coturn service by default - Add coturn-init service for OpenSSL cert generation - Add source files for configuration - Remove dependencies on mariadb, mysql, postgresql and sqlite - Forked from https://github.com/coturn/coturn/blob/af674368d120361603342ff4ff30b44f147a38ff/rpm/turnserver.spec