File formae.spec of Package formae
#
# spec file for package formae
#
# Copyright (c) 2025 SUSE LLC and contributors
#
# 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/
#
Name: formae
Version: 0.74.2
Release: 0
Summary: Infrastructure-as-Code Platform Built for the Future
License: FSL-1.1-ALv2
URL: https://github.com/platform-engineering-labs/formae
Source: formae-%{version}.tar.gz
Source1: vendor.tar.gz
Source2: vendor-plugin-auth-basic.tar.gz
Source3: vendor-plugin-aws.tar.gz
Source4: vendor-plugin-fake-aws.tar.gz
Source5: vendor-plugin-json.tar.gz
Source6: vendor-plugin-pkl.tar.gz
Source7: vendor-plugin-tailscale.tar.gz
BuildRequires: bash-completion
BuildRequires: fish
BuildRequires: golang(API) >= 1.25
BuildRequires: zsh
# math.MaxUint32 (untyped int constant 4294967295) overflows int
ExcludeArch: %{ix86} armv7hl armv7l armv7l:armv6l:armv5tel armv6hl
%description
formae is a 100% code-based, agentic IaC (Infrastructure-as-Code) tool built
from scratch for the modern age. We believe that code is the only medium every
engineer on every level understands and wants. So formae implements
infrastructure entirely as code - in and out, and in any granularity. formae
doesn't require its user to maintain any secondary artifacts such as state
files, and keeps the infrastructure code automatically in sync with the
reality.
formae capabilities
* The single source of truth is code: It unifies every infrastructure resource
and change into fully versioned infrastructure code.
* Always up-to-data infrastructure code: It sees when things change outside the
tool. It merges these changes into your infrastructure code instead of just
ignoring or undoing them. This way, important outside changes are never lost,
and are immediately incorporated into the infrastructure code.
* Prevents avoidable mistakes: It is built around a very robust, enforced
schema.
* Made for everyone: It welcomes all kinds of engineers, whether they are new
or experienced, be they in Ops, DevOps, SRE or Platform Engineering.
* Perfect for Platform Engineering: It allows platform engineers to work on the
low level of detail, and developers consume reusable services by just providing
a few predefined, schema-safe properties.
* Built for co-existence: It is not necessary to migrate or to import anything
- formae will automatically discover and update resources and happily co-exist
with other IaC and Infrastructure Management tools and even ClickOps.
* Perfect for Day 0 and onward: It is equally great for setting up new systems
and for making small, safe changes with minimal blast radius as you go.
%prep
%autosetup -p 1 -a 1
tar xf %{SOURCE2} -C ./plugins/auth-basic/
tar xf %{SOURCE3} -C ./plugins/aws/
tar xf %{SOURCE4} -C ./plugins/fake-aws/
tar xf %{SOURCE5} -C ./plugins/json/
tar xf %{SOURCE6} -C ./plugins/pkl/
tar xf %{SOURCE7} -C ./plugins/tailscale/
%build
sed -i '/const DefaultInstallPrefix/ s#/opt/pel#%{_libdir}/%{name}/plugins/#g' meta.go
go build -C plugins/auth-basic -ldflags="-X 'main.Version=%{version}'" -buildmode=plugin -o auth-basic.so
go build -C plugins/aws -ldflags="-X 'main.Version=%{version}'" -buildmode=plugin -o aws.so
go build -C plugins/pkl -ldflags="-X 'main.Version=%{version}'" -buildmode=plugin -o pkl.so
go build -C plugins/json -ldflags="-X 'main.Version=%{version}'" -buildmode=plugin -o json.so
go build -C plugins/yaml -ldflags="-X 'main.Version=%{version}'" -buildmode=plugin -o yaml.so
go build -C plugins/fake-aws -ldflags="-X 'main.Version=%{version}'" -buildmode=plugin -o fake-aws.so
go build -C plugins/tailscale -ldflags="-X 'main.Version=%{version}'" -buildmode=plugin -o tailscale.so
go build \
-mod=vendor \
-buildmode=pie \
-ldflags="-X github.com/platform-engineering-labs/formae.Version=%{version}" \
-o formae ./cmd/formae/main.go
%install
# Install the binary.
install -D -m 0755 %{name} %{buildroot}/%{_bindir}/%{name}
mkdir -p %{buildroot}%{_libdir}/%{name}/plugins/
for plugin in ./plugins/*/*.so
do
install -D -m 0755 ${plugin} %{buildroot}/%{_libdir}/%{name}/plugins/
done
%files
%doc README.md examples
%license LICENSES/FSL-1.1-ALv2.md LICENSES/Apache-2.0.md
%{_bindir}/%{name}
%{_libdir}/%{name}
%changelog