File container-snap.spec of Package container-snap
#
# spec file for package container-snap
#
# Copyright (c) 2024 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/
#
Name: container-snap
Version: 0.0.1
Release: 0
Summary: CLI tool to manage container based snapshots
License: GPL-2.0-or-later
URL: https://github.com/dcermak/container-snap
Source: %{name}-%{version}.tar.gz
Source1: vendor.tar.gz
BuildRequires: gcc-c++
BuildRequires: golang(API) >= 1.23
BuildRequires: libbtrfs-devel
BuildRequires: pkgconfig(gpgme)
Requires: libcontainers-common
%description
CLI to manage container based snapshots
%prep
%autosetup -a 1
%build
# Build the binary.
export GOFLAGS="-buildmode=pie"
go build \
-tags extended \
./bin/%{name}.go
%check
# FIXME: run some tests here, if possible at all
%install
install -D -m 0755 %{name} "%{buildroot}/%{_bindir}/%{name}"
install -D -m 0755 %{name}-new-kernel.sh "%{buildroot}/%{_bindir}/%{name}-new-kernel.sh"
install -D -m 0755 %{name}-switch-snapshot.sh "%{buildroot}/%{_bindir}/%{name}-switch-snapshot.sh"
install -D -m 0755 %{name}-first-boot.sh "%{buildroot}/%{_bindir}/%{name}-first-boot.sh"
install -D -m 0644 %{name}-first-boot.service "%{buildroot}/%{_unitdir}/%{name}-first-boot.service"
%files
%{_bindir}/%{name}
%{_bindir}/%{name}-switch-snapshot.sh
%{_bindir}/%{name}-new-kernel.sh
%{_bindir}/%{name}-first-boot.sh
%{_unitdir}/%{name}-first-boot.service
%changelog