## START: Set by rpmautospec ## (rpmautospec version 0.3.0) %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 6; 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 %bcond_without check %global build_timestamp %(date +"%Y%m%d") # https://github.com/Dreamacro/clash %global goipath github.com/Dreamacro/clash Version: 1.8.0 %gometa %global common_description %{expand: A rule-based tunnel in Go.} %global golicenses LICENSE %global godocs docs README.md Name: clash Release: %autorelease Summary: A rule-based tunnel in Go License: GPLv3 URL: %{gourl} Source0: %{gosource} Source1: clash.service Source2: clash@.service BuildRequires: systemd-rpm-macros BuildRequires: golang(github.com/Dreamacro/go-shadowsocks2/core) BuildRequires: golang(github.com/Dreamacro/go-shadowsocks2/shadowaead) BuildRequires: golang(github.com/Dreamacro/go-shadowsocks2/shadowstream) BuildRequires: golang(github.com/go-chi/chi/v5) BuildRequires: golang(github.com/go-chi/cors) BuildRequires: golang(github.com/go-chi/render) BuildRequires: golang(github.com/gofrs/uuid) BuildRequires: golang(github.com/gorilla/websocket) BuildRequires: golang(github.com/insomniacslk/dhcp/dhcpv4) BuildRequires: golang(github.com/miekg/dns) BuildRequires: golang(github.com/oschwald/geoip2-golang) BuildRequires: golang(github.com/sirupsen/logrus) BuildRequires: golang(go.etcd.io/bbolt) BuildRequires: golang(go.uber.org/atomic) BuildRequires: golang(go.uber.org/automaxprocs/maxprocs) BuildRequires: golang(golang.org/x/crypto/argon2) BuildRequires: golang(golang.org/x/crypto/chacha20poly1305) BuildRequires: golang(golang.org/x/net/http2) BuildRequires: golang(golang.org/x/net/publicsuffix) BuildRequires: golang(golang.org/x/sync/singleflight) BuildRequires: golang(golang.org/x/sys/unix) BuildRequires: golang(gopkg.in/yaml.v2) %if %{with check} # Tests BuildRequires: golang(github.com/docker/docker/api/types) BuildRequires: golang(github.com/docker/docker/api/types/container) BuildRequires: golang(github.com/docker/docker/client) BuildRequires: golang(github.com/docker/go-connections/nat) BuildRequires: golang(github.com/stretchr/testify/assert) %endif %description %{common_description} %gopkg %prep %goprep chmod -x docs/logo.png %build export LDFLAGS="-X github.com/Dreamacro/clash/constant.Version=%{version} \ -X github.com/Dreamacro/clash/constant.BuildTime=%{build_timestamp} \ $LDFLAGS" %gobuild -o %{gobuilddir}/bin/clash %{goipath} %install %gopkginstall install -m 0755 -vd %{buildroot}%{_bindir} install -m 0755 -vd %{buildroot}%{_userunitdir} install -m 0755 -vd %{buildroot}%{_unitdir} install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/ install -m 0755 -vp %{S:1} %{buildroot}%{_userunitdir}/ install -m 0755 -vp %{S:2} %{buildroot}%{_unitdir}/ %if %{with check} %check # some ckecks needs docker daemon and networking # so we need to ignore the result of tests # but we can leave the left part running to see # the results. %gocheck ||: %endif %post %systemd_user_post clash.service %systemd_post clash@.service %preun %systemd_user_preun clash.service # disable --now seems don't work here. if [ $1 -eq 0 ] && [ -x /usr/bin/systemctl ] ; then # Package removal, not upgrade /usr/bin/systemctl --no-reload stop clash@*.service || : /usr/bin/systemctl --no-reload disable clash@.service || : fi %postun %systemd_user_postun_with_restart clash.service %systemd_postun_with_restart clash@*.service %files %license LICENSE %doc docs README.md %{_bindir}/clash %{_userunitdir}/clash.service %{_unitdir}/clash@.service %gopkgfiles %changelog * Wed Jul 20 2022 Fedora Release Engineering 1.8.0-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild * Tue Jul 19 2022 Maxwell G 1.8.0-5 - Rebuild for CVE-2022-{1705,32148,30631,30633,28131,30635,30632,30630,1962} in golang * Sat Jun 18 2022 Robert-André Mauchin 1.8.0-4 - Rebuilt for CVE-2022-1996, CVE-2022-24675, CVE-2022-28327, CVE-2022-27191, CVE-2022-29526, CVE-2022-30629 * Fri Jun 17 2022 Robert-André Mauchin 1.8.0-3 - Rebuilt for CVE-2022-1996, CVE-2022-24675, CVE-2022-28327, CVE-2022-27191, CVE-2022-29526, CVE-2022-30629 * Wed Jan 19 2022 Fedora Release Engineering 1.8.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild * Wed Jul 21 2021 Fedora Release Engineering - 1.6.5-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild * Sat Jul 03 2021 Fedora Release Monitoring - 1.6.5-1 - Update to 1.6.5 (#1978923) * Sat Jun 12 2021 Qiyu Yan - 1.6.0-1 - Update to 1.6.0 upstream release * Sat Apr 10 2021 Qiyu Yan - 1.5.0-1 - Update to 1.5.0 upstream release * Sat Mar 20 2021 Qiyu Yan - 1.4.2-1 - Update to 1.4.2 upstream release * Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek - 1.2.0-3 - Rebuilt for updated systemd-rpm-macros See https://pagure.io/fesco/issue/2583. * Tue Jan 26 2021 Fedora Release Engineering - 1.2.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild * Fri Oct 09 2020 Qiyu Yan - 1.2.0-1 - update to 1.2.0 upstream release * Tue Aug 18 2020 Qiyu Yan - 1.1.0-1 - update to 1.1.0 upstream release * Sat Aug 01 2020 Qiyu Yan - 1.0.0-4 - Change systemd scriptlets * Mon Jul 27 2020 Qiyu Yan - 1.0.0-3 - don't use go mod * Mon Jul 27 2020 Qiyu Yan - 1.0.0-2 - Add unit files, taken from - https://github.com/archlinux/svntogit-community/tree/packages/clash/trunk