File portainer.spec of Package portainer

# Copyright (c) 2020 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/
# 

# needs to match path in source5
%define homedir /var/lib/%{name}

Name:           portainer
Version:        2.27.2+git.0.f9f51a5
Release:        0
License:        Zlib
Summary:        Lightweight service delivery platform
Url:            https://github.com/portainer/portainer
Group:          Development/Languages/Other
Source0:        %{name}-%{version}.tar.gz
Source1:        vendor.tar.gz
Source2:        npm-packages-offline-cache.tar.gz
Source99:       README.yarn
Patch0:         build.patch
Patch1:         package.json.patch
BuildRequires:  golang-packaging
BuildRequires:  xz
BuildRequires:  jq
BuildRequires:  yarn
BuildRequires:  docker
BuildRequires:  docker-compose
BuildRequires:  kubernetes1.31-client
BuildRequires:  nodejs-default
BuildRequires:  yarn
BuildRequires:  yarn-packaging
BuildRequires:  nodejs-husky
# 
BuildRequires:  glibc-locale-base
BuildRequires:  glibc-devel
BuildRequires:  git-core
Requires(post): %fillup_prereq

%{go_nostrip}
%{go_provides}

%description
Portainer Community Edition is a lightweight service delivery platform for
containerized applications that can be used to manage Docker, Swarm, Kubernetes
and ACI environments. It is designed to be as simple to deploy as it is to use.
The application allows you to manage all your orchestrator resources
(containers, images, volumes, networks and more) through a ‘smart’ GUI and/or
an extensive API.

Portainer consists of a single container that can run on any cluster. It can be
deployed as a Linux container or a Windows native container.

%prep
%autosetup -a0 -a1 -p1
tar xzf %{SOURCE2}
yarn install --offline --verbose --force

%build
export SKIP_GO_GET="skip"
export REV="%{version}"
export REV="${REV##*.}"
export GIT_COMMIT_HASH=${REV}
export COMPOSE_VERSION=$(rpm -q --qf '%{VERSION}' docker-compose)
export WEBPACK_VERSION=$(ls npm-packages-offline-cache/webpack-* | head -n1 | sed 's/.*-\(.*\).tgz/\1/')
#make build-all
#commenct go get in build/build_binary.sh
# set Variables: WEBPACK_VERSION=5.96.1 GIT_COMMIT_HASH=0.a904c74 
yarn storybook:build
yarn build --config webpack/webpack.development.js
make build-server

#go build \
#  -mod=vendor \
#  -buildmode=pie \
#  -ldflags "-X main.VERSION=%{version}"

%install

mkdir -p %{buildroot}%{_bindir}
cp dist/portainer %{buildroot}%{_bindir}
cp -a dist/mustache-templates %{buildroot}
cp -a dist/public %{buildroot}


%files
%doc README.md
%license LICENSE
%{_bindir}/portainer
/mustache-templates
/public

%changelog
openSUSE Build Service is sponsored by