pulumi/pulumi.spec

134 lines
3.4 KiB
RPMSpec
Raw Normal View History

2021-08-24 01:35:12 +03:00
%define debug %nil
%define debug_package %nil
2024-07-02 08:45:54 +00:00
%define secscan 1
2021-08-24 01:35:12 +03:00
Name: pulumi
2024-10-08 07:48:46 +00:00
Version: 3.136.0
2021-11-23 12:55:35 +03:00
Release: 1
2021-08-24 01:35:12 +03:00
Summary: Modern Infrastructure as Code
URL: https://www.pulumi.com
Source0: https://github.com/pulumi/pulumi/archive/v%{version}/%{name}-%{version}.tar.gz
2023-06-05 20:35:40 +00:00
Source1000: %{name}.rpmlintrc
2021-08-24 01:35:12 +03:00
License: ASL 2.0
Group: Development/Other
BuildRequires: go >= 1.16
BuildRequires: git-core
2021-11-19 01:17:37 +03:00
BuildRequires: upx
2024-07-02 08:45:54 +00:00
%if %{secscan}
BuildRequires: clamav
BuildRequires: trivy
%endif
2021-08-24 01:35:12 +03:00
%description
Pulumi's Infrastructure as Code SDK is the easiest way to
create and deploy cloud software that use containers,
serverless functions, hosted services, and infrastructure,
on any cloud.
%prep
%setup -q
2024-07-02 08:45:54 +00:00
%if %{secscan}
clamscan -ir .
trivy fs --scanners vuln --format cosign-vuln .
%endif
2021-08-24 01:35:12 +03:00
2021-08-26 02:05:07 +03:00
#-------------------------------------------------------------------------------
%package -n %{name}-language-go
Summary: Pulumi laguage go
Requires: %{name} = %{EVRD}
%description -n %{name}-language-go
Pulumi language go
%files -n %{name}-language-go
%doc README.md LICENSE
%{_bindir}/%{name}-language-go
#-------------------------------------------------------------------------------
2023-06-05 20:35:40 +00:00
%package -n %{name}-language-python
Summary: Pulumi laguage python
2023-09-13 18:35:44 +00:00
Requires: %{name} = %{EVRD}
2023-06-05 20:35:40 +00:00
%description -n %{name}-language-python
Pulumi language python
%files -n %{name}-language-python
%doc README.md LICENSE
%{_bindir}/%{name}-language-python
#------------------------------------------------------------------------------
%package -n %{name}-language-nodejs
Summary: Pulumi language nodejs
Requires: %{name} = %{EVRD}
%description -n %{name}-language-nodejs
Pulumi language nodejs
%files -n %{name}-language-nodejs
%doc README.md LICENSE
%{_bindir}/%{name}-language-nodejs
#------------------------------------------------------------------------------
2021-08-24 01:35:12 +03:00
%build
2021-08-26 02:05:07 +03:00
export GO111MODULE=on
2023-11-28 22:21:49 +00:00
#export GOPROXY=direct
export GOPROXY=https://proxy.golang.org/cached-only
2023-09-26 18:33:54 +00:00
2021-08-24 01:35:12 +03:00
pushd pkg
go mod download
2021-11-19 01:17:37 +03:00
go build "-buildmode=pie" -ldflags "-s -w -X github.com/pulumi/pulumi/pkg/v3/version.Version=%{version}" -o ../bin/%{name} ./cmd/pulumi
2021-08-26 02:05:07 +03:00
popd
2023-06-05 20:35:40 +00:00
# build pulumi-language
2021-08-26 02:05:07 +03:00
pushd sdk
go mod download
2023-06-05 20:35:40 +00:00
# golang
pushd go/pulumi-language-go
go build -ldflags "-s -w -X github.com/pulumi/pulumi/sdk/v3/go/common/version.Version=%{version}" -o ../../../bin/%{name}-language-go .
2021-08-24 01:35:12 +03:00
popd
2023-06-05 20:35:40 +00:00
# python3
pushd python/cmd/pulumi-language-python
go build -ldflags "-X github.com/pulumi/pulumi/sdk/v3/go/common/version.Version=%{version}" -o ../../../../bin/%{name}-language-python .
popd
# nodejs
pushd nodejs/cmd/pulumi-language-nodejs
#make
go build -ldflags "-X github.com/pulumi/pulumi/sdk/v3/go/common/version.Version=%{version}" -o ../../../../bin/%{name}-language-nodejs .
popd
popd
2021-11-19 01:17:37 +03:00
upx bin/*
2021-08-24 01:35:12 +03:00
%install
install -Dm0755 bin/%{name} %{buildroot}%{_bindir}/%{name}
2023-06-05 20:35:40 +00:00
install -Dm0755 bin/%{name}-language-go %{buildroot}%{_bindir}/%{name}-language-go
install -Dm0755 bin/%{name}-language-python %{buildroot}%{_bindir}/%{name}-language-python
install -Dm0755 bin/%{name}-language-nodejs %{buildroot}%{_bindir}/%{name}-language-nodejs
2021-08-24 01:35:12 +03:00
2021-08-25 17:17:44 +03:00
# install bash completion
install -d %{buildroot}%{_sysconfdir}/bash_completion.d/
./bin/%{name} gen-completion bash > %{buildroot}%{_sysconfdir}/bash_completion.d/%{name}
2021-08-24 01:35:12 +03:00
%files
2021-08-26 02:05:07 +03:00
%doc sdk/go/README.md LICENSE
2021-08-24 01:35:12 +03:00
%{_bindir}/%{name}
2021-08-25 17:17:44 +03:00
%{_sysconfdir}/bash_completion.d/%{name}
2021-08-24 01:35:12 +03:00
2024-07-02 08:45:54 +00:00
%check
export GOPROXY=direct
2024-07-02 10:05:47 +00:00
#go test ./...
2024-07-02 08:45:54 +00:00
%if %{secscan}
clamscan -ir %{buildroot}
%endif