File tiu.spec of Package tiu

#
# spec file for package tiu
#
# Copyright (c) 2022 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+git20230206.dd0ec84
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:  swupdate-devel
BuildRequires:  pkgconfig(gio-2.0)
BuildRequires:  pkgconfig(libcrypto)
BuildRequires:  pkgconfig(libcurl)
BuildRequires:  pkgconfig(libeconf)
Requires:       swupdate
Requires:       swupdate-certs-public

%description
tiu is a comand line interface to swupdate, which creates the setup
around the image (disk partitioning, bootloader, etc.) and manages
the installation and update process.

%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:       libstorage-ng-python3
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 partition and filesystem 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 %{_sysconfdir} 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/logging
%{_libexecdir}/tiu/update-kernel
%{_libexecdir}/tiu/create-grub-entry
%{_libexecdir}/tiu/swupdate-preinstall
%{_libexecdir}/tiu/swupdate-postinstall
%dir %{_datadir}/tiu
%{_datadir}/tiu/tiu.conf
%dir %{_sysconfdir}/grub.d
%{_sysconfdir}/grub.d/09_partAB

%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
%{_datadir}/tiu/usr-AB.yaml

%files firstboot
%{_tmpfilesdir}/aaa_base.conf
%{_tmpfilesdir}/audit.conf
%{_tmpfilesdir}/ca-certificates.conf
%{_tmpfilesdir}/chronyd.conf
%{_tmpfilesdir}/containers.conf
%{_tmpfilesdir}/logrotate.conf
%{_tmpfilesdir}/netcfg.conf
%{_tmpfilesdir}/systemd-journald.conf
%{_tmpfilesdir}/vconsole.conf
%{_tmpfilesdir}/locale.conf
%{_presetdir}/40-ca-certificates.preset
%{_presetdir}/40-chrony.preset
%{_presetdir}/40-jeos-firstboot.preset
%{_presetdir}/40-nm.preset
%{_presetdir}/40-snapper.preset
%{_presetdir}/40-swupdate.preset

%changelog
openSUSE Build Service is sponsored by