File wails.spec of Package wails
#
# spec file for package wails
#
# Copyright (c) 2019 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/
#
%define import_path github.com/wailsapp/wails
Name: wails
Version: 2.11.0
Release: 0
Summary: Create desktop apps using Go and Web Technologies
License: MIT
Group: Productivity/Publishing/Other
URL: https://wails.app/
Source: https://github.com/wailsapp/wails/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1: vendor.tar.xz
#Source2: series
#Patch: local_only.patch
BuildRequires: gcc-c++
BuildRequires: golang(API)
BuildRequires: golang-packaging
BuildRequires: pkgconfig(gtk+-3.0)
BuildRequires: pkgconfig(webkit2gtk-4.0)
BuildRequires: rsync
BuildRequires: sed
#BuildRequires: npm
#Requires: pkgconfig(gtk+-3.0)
#Requires: pkgconfig(webkit2gtk-4.0)
#Requires: golang(API) = %{go_version}
%{go_nostrip}
%description
The traditional method of providing web interfaces to Go programs is via a built-in web server. Wails offers a different approach: it provides the ability to wrap both Go code and a web frontend into a single binary. Tools are provided to make this easy for you by handling project creation, compilation and bundling. All you have to do is get creative!
%prep
%autosetup -p1 -a1
mv vendor v2
#sed -i -E '/v[0-9]+\.[0-9]+\.[0-9]+(-[0-9a-zA-Z]+)*[^\/]*$/!b; s~(.*\s+v[0-9]+\.[0-9]+\.[0-9]+(-[0-9a-zA-Z]+)*)\s*(// indirect)?~\1 // indirect~g' v2/go.mod
%build
pushd v2
export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
go build -mod=vendor -buildmode=pie -o build/ ./cmd/wails
popd
%install
install -vDm 755 v2/build/%{name} -t "%{buildroot}%{_bindir}"
#install -vDm 644 {CHANGELOG,CONTRIBUTORS,README}.md -t "%{buildroot}%{_datadir}/doc/%{name}/"
#install -vDm 644 LICENSE -t "%{buildroot}%{_datadir}/licenses/%{name}/"
%files
%{_bindir}/%{name}
%license LICENSE
%doc *.md
%changelog