Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:zzndb
hysteria2
hysteria2.spec
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File hysteria2.spec of Package hysteria2
# # spec file for package hysteria # # Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # %if 0%{?fedora_version} || 0%{?centos_version} || 0%{?rhel_version} %global debug_package %{nil} %endif Name: hysteria2 Version: 2.4.4 Release: 0 Summary: A feature-packed network utility optimized for networks of poor quality License: MPL-2.0 URL: https://github.com/HyNetwork/hysteria Source0: %{name}-%{version}.tar.xz # FIXME: manual `go build ./app/cmd` pkg/mod/cache tarball, use `go mod vendor` after it support go.work Source1: vendor.tar.xz Source2: %{name}-server.service Source3: %{name}-server@.service Source5: %{name}-user.conf BuildRequires: fdupes BuildRequires: glibc BuildRequires: golang(API) = 1.21 BuildRequires: pkgconfig BuildRequires: sysuser-shadow BuildRequires: sysuser-tools BuildRequires: pkgconfig(systemd) %{?systemd_ordering} %{?sysusers_requires} %description Hysteria is a feature-packed network utility optimized for networks of poor quality powered by a custom version of QUIC protocol. %prep %setup -q -a 1 mkdir -p %{_builddir}/go mv pkg %{_builddir}/go %build export GOPATH=%{_builddir}/go %define cmd_pkg "github.com/apernet/hysteria/app/cmd" info="-X '%cmd_pkg.appVersion=v%{version}' -X '%cmd_pkg.appDate=$(date '+%F %T')' -X '%cmd_pkg.appType=release' -X '%cmd_pkg.appCommit=$(grep 'commit:' %{_sourcedir}/hysteria2.obsinfo | cut -d' ' -f2)' -X '%cmd_pkg.appPlatform=$(go env GOOS)' -X '%cmd_pkg.appArch=$(go env GOARCH)'" pushd app go build -buildmode pie -trimpath -ldflags "-s -w -linkmode=external -buildid= ${info}" -o %{name} . popd %sysusers_generate_pre %{SOURCE5} %{name} %install install -d %{buildroot}%{_bindir} install -m0755 app/%{name} %{buildroot}%{_bindir}/ install -d %{buildroot}%{_unitdir}/%{name} install -m0644 %{SOURCE2} %{buildroot}%{_unitdir}/ install -m0644 %{SOURCE3} %{buildroot}%{_unitdir}/ install -d %{buildroot}%{_sysconfdir}/%{name} install -d %{buildroot}%{_sbindir} ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name} %pre -f %{name}.pre %if 0%{?suse_version} %service_add_pre %{name}-server.service %{name}-server@.service ## No need for Fedora/CentOS %endif %post %if 0%{?suse_version} %service_add_post %{name}-server.service %{name}-server@.service %else %{systemd_post} %{name}-server.service %{name}-server@.service %endif %preun %if 0%{?suse_version} %service_del_preun %{name}-server.service %{name}-server@.service %else %systemd_preun %{name}-server.service %{name}-server@.service %endif %postun %if 0%{?suse_version} %service_del_postun %{name}-server.service %{name}-server@.service %else %{systemd_postun_with_restart} %{name}-server.service %{name}-server@.service %endif %files %license LICENSE.md %doc README.md CHANGELOG.md %{_bindir}/%{name} %{_unitdir}/%{name}-server.service %{_unitdir}/%{name}-server@.service %dir %{_sysconfdir}/%{name} %{_sbindir}/rc%{name} %changelog
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor