pulumi/pulumi.spec
2024-09-24 08:08:42 +00:00

134 lines
No EOL
3.4 KiB
RPMSpec

%define debug %nil
%define debug_package %nil
%define secscan 1
Name: pulumi
Version: 3.134.0
Release: 1
Summary: Modern Infrastructure as Code
URL: https://www.pulumi.com
Source0: https://github.com/pulumi/pulumi/archive/v%{version}/%{name}-%{version}.tar.gz
Source1000: %{name}.rpmlintrc
License: ASL 2.0
Group: Development/Other
BuildRequires: go >= 1.16
BuildRequires: git-core
BuildRequires: upx
%if %{secscan}
BuildRequires: clamav
BuildRequires: trivy
%endif
%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
%if %{secscan}
clamscan -ir .
trivy fs --scanners vuln --format cosign-vuln .
%endif
#-------------------------------------------------------------------------------
%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
#-------------------------------------------------------------------------------
%package -n %{name}-language-python
Summary: Pulumi laguage python
Requires: %{name} = %{EVRD}
%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
#------------------------------------------------------------------------------
%build
export GO111MODULE=on
#export GOPROXY=direct
export GOPROXY=https://proxy.golang.org/cached-only
pushd pkg
go mod download
go build "-buildmode=pie" -ldflags "-s -w -X github.com/pulumi/pulumi/pkg/v3/version.Version=%{version}" -o ../bin/%{name} ./cmd/pulumi
popd
# build pulumi-language
pushd sdk
go mod download
# 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 .
popd
# 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
upx bin/*
%install
install -Dm0755 bin/%{name} %{buildroot}%{_bindir}/%{name}
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
# install bash completion
install -d %{buildroot}%{_sysconfdir}/bash_completion.d/
./bin/%{name} gen-completion bash > %{buildroot}%{_sysconfdir}/bash_completion.d/%{name}
%files
%doc sdk/go/README.md LICENSE
%{_bindir}/%{name}
%{_sysconfdir}/bash_completion.d/%{name}
%check
export GOPROXY=direct
#go test ./...
%if %{secscan}
clamscan -ir %{buildroot}
%endif