## START: Set by rpmautospec ## (rpmautospec version 0.7.3) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 1; 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 # Generated by go2rpm 1.14.0 %bcond check 1 # https://github.com/metacubex/mihomo %global goipath github.com/metacubex/mihomo Version: 1.19.2 # Fix error about undefined reference # golang.org/x/sys/unix.sendmsg # golang.org/x/sys/unix.ioctlPtr %global gomodulesmode GO111MODULE=on %gometa -L -f %global common_description %{expand: A rule based network proxy tool, also be known as mihomo.} Name: clash-meta Release: %autorelease Summary: A rule based network proxy tool, also be known as mihomo. # Generated by go-vendor-tools License: Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND CC0-1.0 AND GPL-3.0-only AND ISC AND MIT AND MPL-2.0 URL: %{gourl} Source0: %{gosource} # Generated by go-vendor-tools Source1: %{archivename}-vendor.tar.bz2 Source2: go-vendor-tools.toml Source3: clash-meta.service BuildRequires: go-vendor-tools BuildRequires: systemd-rpm-macros %description %{common_description} %prep %goprep -A %setup -q -T -D -a1 %{forgesetupargs} %generate_buildrequires %go_vendor_license_buildrequires -c %{S:2} %build %gobuild -o %{gobuilddir}/bin/clash-meta "-tags=with_gvisor" %{goipath} %install %go_vendor_license_install -c %{S:2} install -m 0755 -vd %{buildroot}%{_bindir} install -m 0755 -vd %{buildroot}%{_unitdir} install -m 0755 -vd %{buildroot}%{_sysconfdir}/clash-meta install -m 0755 -vd %{buildroot}%{_localstatedir}/lib/clash-meta install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/ install -m 0644 -vp %{S:3} %{buildroot}%{_unitdir}/ %check %go_vendor_license_check -c %{S:2} %if %{with check} # Because of it's network related nature (tun mode, iptables rules, etc), # Check of clash-meta requires a running docker instance to run, # Which is not possible in building environment (mock) # See: https://github.com/MetaCubeX/mihomo/blob/Meta/test/README.md %endif %files -f %{go_vendor_license_filelist} %license vendor/modules.txt %doc docs README.md transport/shadowsocks/README.md %{_bindir}/clash-meta %{_unitdir}/clash-meta.service %dir %{_sysconfdir}/clash-meta %dir %{_localstatedir}/lib/clash-meta %changelog ## START: Generated by rpmautospec * Sun Feb 16 2025 John Doe - 1.19.2-1 - Uncommitted changes ## END: Generated by rpmautospec