## START: Set by rpmautospec ## (rpmautospec version 0.3.5) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 21; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec Name: trojan Version: 1.16.0 Release: %autorelease Summary: An unidentifiable mechanism that helps you avoid censorship #GPLv3+ with opelssl exceptions License: GPLv3+ URL: https://github.com/trojan-gfw/%{name} Source0: %{URL}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz # signature from release page Source1: %{URL}/releases/download/v%{version}/%{name}-%{version}.tar.gz.asc # keyid obtained from upstream auther's GitHub profile Source2: https://pgp.key-server.io/0xA1DDD486533B0112 # see: https://github.com/trojan-gfw/trojan/pull/473 # Changes/CMake to do out-of-source builds F33 make tests fail # this is a workaround Patch0: 0001-Avoid-a-race-condition-that-makes-the-test-to-fail.patch # for build BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: make BuildRequires: cmake >= 3.7.2 BuildRequires: boost-devel >= 1.66.0 BuildRequires: openssl-devel >= 1.1.0 BuildRequires: mariadb-connector-c-devel %if 0%{?fedora} >= 30 BuildRequires: systemd-rpm-macros %else BuildRequires: systemd %endif # for test BuildRequires: python3 BuildRequires: nmap-ncat BuildRequires: curl BuildRequires: openssl #for verifying the tarball BuildRequires: gnupg2 %description An unidentifiable mechanism that helps you avoid censorship. Trojan features multiple protocols over TLS to avoid both active/passive detection and ISP QoS limitations. Trojan is not a fixed program or protocol. It's an idea, an idea that imitating the most common service, to an extent that it behaves identically, could help you get across the Great FireWall permanently, without being identified ever. %prep %{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}' %autosetup # change cipher list in shipped configuration file&example into PROFILE=SYSTEM sed -i '/"cipher"/c\ "cipher": "PROFILE=SYSTEM",' examples/*.json-example sed -i '/"cipher_tls13"/c\ "cipher_tls13": "PROFILE=SYSTEM",' examples/*.json-example sed -e '/User=nobody/ s/^#*/# /;/User=nobody/i # User=nobody is not recommended\n# You can use systemctl edit trojan to re-enable this\n# While DynamicUser=yes is suggested\n#' -i examples/trojan.service-example %build %cmake %cmake_build %install %cmake_install %check %ctest %post %systemd_post %{name}.service %preun %systemd_preun %{name}.service %postun %systemd_postun_with_restart %{name}.service %files %{_bindir}/%{name} %license LICENSE %dir %{_sysconfdir}/%{name} %dir %{_pkgdocdir} %config(noreplace) %{_sysconfdir}/%{name}/config.json %{_mandir}/man1/%{name}.1.* %{_pkgdocdir}/* %{_unitdir}/%{name}.service %{_unitdir}/%{name}@.service %changelog * Thu Sep 28 2023 Michal Schorm - 1.16.0-21 - Build against the 'mariadb-connector-c-devel' package https://bugzilla.redhat.com/show_bug.cgi?id=2241091 * Sat Jul 22 2023 Fedora Release Engineering - 1.16.0-20 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild * Mon Feb 20 2023 Jonathan Wakely - 1.16.0-19 - Rebuilt for Boost 1.81 * Sat Jan 21 2023 Fedora Release Engineering - 1.16.0-18 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild * Sat Jul 23 2022 Fedora Release Engineering - 1.16.0-17 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild * Wed May 04 2022 Thomas Rodgers - 1.16.0-16 - Rebuilt for Boost 1.78 * Sat Feb 05 2022 Qiyu Yan - 1.16.0-15 - remove User=nobody from systemd unit file * Sat Jan 22 2022 Fedora Release Engineering - 1.16.0-14 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild * Tue Sep 14 2021 Sahana Prasad - 1.16.0-13 - Rebuilt with OpenSSL 3.0.0 * Sat Aug 07 2021 Jonathan Wakely - 1.16.0-11 - Rebuilt for Boost 1.76 * Fri Jul 23 2021 Fedora Release Engineering - 1.16.0-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild * Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek - 1.16.0-9 - Rebuilt for updated systemd-rpm-macros See https://pagure.io/fesco/issue/2583. * Wed Jan 27 2021 Fedora Release Engineering - 1.16.0-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild * Fri Jan 22 2021 Jonathan Wakely - 1.16.0-7 - Rebuilt for Boost 1.75 * Wed Jul 29 2020 Fedora Release Engineering - 1.16.0-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild * Fri Jul 24 2020 Qiyu Yan - 1.16.0-5 - rebuilt with new CMake macros * Sun Jun 14 2020 Qiyu Yan - 1.16.0-4 - Change due to review suggestions - see: https://bugzilla.redhat.com/show_bug.cgi?id=1846175 * Sat Jun 13 2020 Qiyu Yan - 1.16.0-3 - Do not patch source, instead, change shipped configuration file * Sat Jun 13 2020 Qiyu Yan - 1.16.0-2 - GuideLine: Package must own all directories that it creates * Fri Jun 12 2020 Qiyu Yan - 1.16.0-1 - Update to upstream and change due to suggestion by robinlee.sysu@gmail.com * Fri Jun 12 2020 Qiyu Yan - 1.15.1-5 - Add CentOS 8 support (CentOS 7 will not be supported) * Thu Jun 04 2020 Qiyu Yan - 1.15.1-4 - rebuilt * Mon Jun 01 2020 Qiyu Yan - 1.15.1-2 - rebuilt * Sun Nov 10 2019 Qiyu Yan - 1.13.0-1 - Initial release