# Generated by go2rpm 1.19.0 %bcond check 1 # Disables -debuginfo package because the `go build` command doesn't seem to generate it properly. This might be revisited in the future. %global debug_package %{nil} # https://github.com/xtls/xray-core %global goipath github.com/xtls/xray-core Version: 26.6.1 %gometa -L -f Name: xray # Add -n for non Fedora infra builds. Release: %autorelease Summary: Xray, Penetrates Everything # Generated by go-vendor-tools License: Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND GPL-3.0-only AND ISC AND LGPL-3.0-only AND LGPL-3.0-or-later WITH LGPL-3.0-linking-exception AND MIT AND MPL-2.0 URL: %{gourl} Source0: %{gosource} # rpmlint: ignore=invalid-url Source1: %{archivename}-vendor.tar.bz2 Source2: go-vendor-tools.toml Source3: xray.service Source4: xray@.service Source5: config.json BuildRequires: go-vendor-tools systemd-rpm-macros %{?systemd_requires} Group: Productivity/Networking/Web/Proxy # Currently being packaged separately in the same COPR repository. It's not a hard requirement (program functions with corresponding files in /usr/local only, and usage of geodata is configurable), but functionality is impaired when it is not available. Recommends: xray-geodata ExclusiveArch: x86_64 aarch64 %description Xray, Penetrates Everything. Also the best v2ray-core. Where the magic happens. An open platform for various uses. %prep # Upstream packages the release with a leading upper case letter. This manually overrides just enough of the macros to not run into case issues. %setup -q -n Xray-core-%{version} tar -xf %{S:1} %generate_buildrequires %go_vendor_license_buildrequires -c %{S:2} %build %global gomodulesmode GO111MODULE=on export GO_LDFLAGS="-s -w -buildid=" # Upstream build command: CGO_ENABLED=0 go build -o xray -trimpath -buildvcs=false -ldflags="-s -w -buildid=" -v ./main # Not including CGO_ENABLED=0 since %%gobuild has -linkmode=external which is incompatible. # Not including -v since %%gobuild already includes it. %gobuild -trimpath -buildvcs=false -o %{gobuilddir}/bin/%{name} ./main %install %go_vendor_license_install -c %{S:2} %{__install} -dm 0755 %{buildroot}%{_bindir} %{__install} -pm 0755 %{gobuilddir}/bin/* %{buildroot}%{_bindir} %{__install} -dm 0755 %{buildroot}%{_unitdir} %{__install} -pm 0644 %{S:3} %{buildroot}%{_unitdir}/%{name}.service %{__install} -pm 0644 %{S:4} %{buildroot}%{_unitdir}/%{name}@.service %{__install} -dm 0755 %{buildroot}%{_sysconfdir}/%{name} # This installs an empty config that will almost certainly not work. But it is consistent with upstream behavior... %{__install} -pm 0644 %{S:5} %{buildroot}%{_sysconfdir}/%{name}/config.json %post %systemd_post %{name}.service %preun %systemd_preun %{name}.service %postun %systemd_postun_with_restart %{name}.service %check %go_vendor_license_check -c %{S:2} # Checks are currently not enabled as the program is functionally a web server, and tests involve both inbound and outbound connections on the Internet. This might be revisited to configure for a list of checks that can be run locally to run in the future. # %%gocheck2 %files -f %{go_vendor_license_filelist} %doc README.md %{_bindir}/%{name} %{_unitdir}/%{name}.service %{_unitdir}/%{name}@.service %dir %{_sysconfdir}/%{name} %config(noreplace) %{_sysconfdir}/%{name}/config.json %changelog * Wed Jun 3 2026 Linus Xu - 26.6.1-1 - Update version to 26.6.1, and continue compliance rewrite with Fedora guidelines * Fri May 29 2026 Linus Xu - 26.5.9-1 - Update version to 26.5.9, and rewrite specfile with go2rpm * Fri May 22 2026 Linus Xu - 26.3.27-5 - Further cleanup in preparation of next core update. * Fri May 22 2026 Linus Xu - 26.3.27-4 - Various fixes around action issues. * Fri May 22 2026 Linus Xu - 26.3.27-3 - Add -geodata as a weak dependency for the main package, and add postinstall script to relay the info. * Fri May 22 2026 Linus Xu - 26.3.27-2 - Splitting geodata to subpackage, to allow standalone list updates * Tue May 12 2026 Linus Xu - 26.3.27-1 - Update version to 26.3.27, attempt to utilize forge macros, and various fixes around Fedora packaging guidelines. * Sat Nov 30 2024 Teddysun - 24.11.30-1 - Update version to 24.11.30 * Thu Nov 21 2024 Teddysun - 24.11.21-1 - Update version to 24.11.21 * Mon Nov 11 2024 Teddysun - 24.11.11-1 - Update version to 24.11.11 * Tue Nov 05 2024 Teddysun - 24.11.5-1 - Update version to 24.11.5 * Thu Oct 31 2024 Teddysun - 24.10.31-1 - Update version to 24.10.31 * Wed Oct 16 2024 Teddysun - 24.10.16-1 - Update version to 24.10.16 * Mon Sep 30 2024 Teddysun - 24.9.30-1 - Update version to 24.9.30 * Thu Sep 19 2024 Teddysun - 24.9.19-1 - Update version to 24.9.19 * Mon Sep 16 2024 Teddysun - 24.9.16-1 - Update version to 24.9.16 * Sat Sep 07 2024 Teddysun - 24.9.7-1 - Update version to 24.9.7 (New version naming rule, based release date) * Fri Aug 30 2024 Teddysun - 1.8.24-1 - Update version to 1.8.24 * Sun Aug 04 2024 Teddysun - 1.8.23-1 - Update to version 1.8.23 * Wed Jul 17 2024 Teddysun - 1.8.19-1 - Update to version 1.8.19 * Mon Jul 15 2024 Teddysun - 1.8.18-1 - Update to version 1.8.18 * Fri Jul 12 2024 Teddysun - 1.8.17-1 - Update to version 1.8.17 * Fri Jun 21 2024 Teddysun - 1.8.16-1 - Update to version 1.8.16 * Tue Jun 18 2024 Teddysun - 1.8.15-1 - Update to version 1.8.15 * Thu May 23 2024 Teddysun - 1.8.13-1 - Update to version 1.8.13 * Wed May 22 2024 Teddysun - 1.8.12-1 - Update to version 1.8.12 * Fri Apr 26 2024 Teddysun - 1.8.11-1 - Update to version 1.8.11 * Sat Mar 30 2024 Teddysun - 1.8.10-1 - Update to version 1.8.10 * Mon Mar 11 2024 Teddysun - 1.8.9-1 - Update to version 1.8.9 * Mon Feb 26 2024 Teddysun - 1.8.8-1 - Update to version 1.8.8 * Mon Jan 08 2024 Teddysun - 1.8.7-1 - Update to version 1.8.7 * Sat Nov 18 2023 Teddysun - 1.8.6-1 - Update to version 1.8.6 * Tue Nov 14 2023 Teddysun - 1.8.5-1 - Update to version 1.8.5 * Wed Oct 18 2023 Teddysun - 1.8.4-1 - Update to version 1.8.4