%global goipath github.com/refi64/nsbox %define reldir() %{lua:\ local arg = rpm.expand('%1')\ local prefix = rpm.expand('%{_prefix}')\ assert(arg:sub(1, prefix:len()) == prefix, "arg " .. arg .. " does not start with " .. prefix)\ local result = arg:sub(prefix:len() + 1):gsub('^/', '')\ print(result)} %global relbindir %{reldir %{_bindir}} %global rellibexecdir %{reldir %{_libexecdir}} %global reldatadir %{reldir %{_datadir}} # nsbox-host has missing build-ids due to being static. %undefine _missing_build_ids_terminate_build # Scripts in data/scripts intentionally use a hashbang of /bin/bash (not /usr/bin) # because the scripts are run inside container OSs that may not have performed the /usr # merge yet. Skip automatically converting those hashbangs to /usr/bin/bash. %global __brp_mangle_shebangs_exclude_from .*\.sh Name: nsbox-edge Version: 21.12.31.334 %if "%{name}" == "nsbox-edge" Release: 1%{?dist}.12e59c2 %else Release: 1%{?dist} %endif Summary: A multi-purpose, nspawn-powered container manager License: MPL-2.0 URL: https://nsbox.dev/ BuildRequires: gcc BuildRequires: gn BuildRequires: go-rpm-macros BuildRequires: golang BuildRequires: ninja-build BuildRequires: python3 BuildRequires: selinux-policy-devel BuildRequires: systemd-devel Requires: container-selinux Requires: %{name}-selinux == %{version}-%{release} Requires: polkit Requires: sudo Requires: systemd-container Source0: nsbox-sources.tar %description nsbox is a multi-purpose, nspawn-powered container manager. %package selinux BuildArch: noarch Summary: SELinux policy for %{name} %{?selinux_requires} %description selinux This is the SELinux policy for %{name}. %package bender Summary: Build images for nsbox Requires: ansible-bender Requires: podman Requires: python3 %description bender nsbox-bender is a script built on top of ansible-bender to build base images for your nsbox containers. %if "%{name}" == "nsbox-edge" %package alias Summary: Alias for nsbox-edge %description alias Installs the nsbox alias for nsbox-edge. %package bender-alias Summary: Alias for nsbox-edge-bender %description bender-alias Installs the nsbox-bender alias for nsbox-edge-bender. %endif %prep %setup -q # @ is here for substitute_file.py. cat >build/go-shim.sh <<'EOF' #!/bin/sh if [[ "$1" == "build" ]]; then shift %gobuild "$@" else go "$@" fi EOF sed -i 's/GO111MODULE=off//g' build/go-shim.sh chmod +x build/go-shim.sh %build %set_build_flags unset LDFLAGS mkdir -p out cat >out/args.gn <