File tiu.spec of Package tiu

#
# spec file for package tiu
#
# Copyright (c) 2021 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:           tiu
Version:        0.0+git20211018.c8c2615
Release:        0
Summary:        Transactional Image Update
License:        GPL-2.0-or-later
URL:            https://github.com/thkukuk/tiu
Source:         tiu-%{version}.tar.xz
BuildRequires:  meson
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(gio-2.0)
BuildRequires:  pkgconfig(libcrypto)
BuildRequires:  pkgconfig(libcurl)
BuildRequires:  pkgconfig(libeconf)
Requires:       casync

%description
tiu is heavily inspired by Rauc. It controls the update process on systems
using atomic updates and is both, a build host tool that allows to create
TIU archives and an update client.

%package devel
Summary:        Devel package for TIU
Requires:       libtiu0 = %{version}

%description devel
This package contains the devel and pkgconfig files for tiu.


%package -n libtiu0
Summary:        Transactional Image Update Library

%description -n libtiu0
Shared library for TIU, the Transactional Image Update tool.


%package tools
Summary:        Additional usefull utilities
Requires:       python3-PyYAML

%description tools
This package contains additional usefull utilities for TIU,
like setup-disk.py to partition and format a disk with the
correct btrfs setup.


%package firstboot
Summary:        Systemd files for first boot
Requires(pre):  chrony-pool-openSUSE

%description firstboot
This package contains configuration files and systemd units
to let systemd setup the system and populate /etc during the
first boot.

%prep
%setup -q

%build
%meson
%meson_build

%install
%meson_install
mkdir -p %{buildroot}%{_tmpfilesdir}
install -m 644 systemd/*.conf %{buildroot}%{_tmpfilesdir}
mkdir -p %{buildroot}%{_presetdir}
install -m 644 systemd/*.preset %{buildroot}%{_presetdir}

%post -n libtiu0 -p /sbin/ldconfig
%postun -n libtiu0 -p /sbin/ldconfig

%files
%doc README.md
%{_bindir}/tiu
%dir %{_libexecdir}/tiu
%{_libexecdir}/tiu/update-kernel
%dir %{_datadir}/tiu
%{_datadir}/tiu/tiu.conf

%files -n libtiu0
%{_libdir}/libtiu.so.0
%{_libdir}/libtiu.so.0.0.1

%files devel
%{_includedir}/tiu.h
%{_libdir}/libtiu.so
%{_libdir}/pkgconfig/libtiu.pc

%files tools
%dir %{_libexecdir}/tiu
%{_libexecdir}/tiu/finish
%{_libexecdir}/tiu/populate-etc
%{_libexecdir}/tiu/setup-bootloader
%{_libexecdir}/tiu/setup-disk
%{_libexecdir}/tiu/setup-root
%{_libexecdir}/tiu/setup-usr-snapper

%files firstboot
%{_tmpfilesdir}/aaa_base.conf
%{_tmpfilesdir}/audit.conf
%{_tmpfilesdir}/ca-certificates.conf
%{_tmpfilesdir}/chronyd.conf
%{_tmpfilesdir}/containers.conf
%{_tmpfilesdir}/netcfg.conf
%{_presetdir}/40-ca-certificates.preset
%{_presetdir}/40-networkd.preset
%{_presetdir}/40-snapper.preset

%changelog
openSUSE Build Service is sponsored by