File incus-ui.spec of Package incus-ui

Name:           incus-ui
Version:        6.7
Release:        1%{?dist}
Summary:        Incus UI files

License:        GPL-3.0-or-later
URL:            https://github.com/cmspam/incus-ui
Source0:        incus-ui-stable.tar.gz
Source1:        LICENSE

BuildArch:      noarch
BuildRequires:  tar
Requires:       incus

%description
This package installs the Incus UI files to /opt/incus/ and provides a systemd drop-in configuration for the Incus service.

%prep
%setup -q -n ui  # Unpacks the tarball into 'ui' directory

%build
# Nothing to build for this package.

%install
# Create the target directory in the install root.
mkdir -p %{buildroot}/opt/incus/

# Move the 'ui' directory to /opt/incus/ so it becomes /opt/incus/ui
cp -r ../ui %{buildroot}/opt/incus/

# Create the systemd drop-in directory.
mkdir -p %{buildroot}/usr/lib/systemd/system/incus.service.d/

# Add the drop-in systemd file.
cat << EOF > %{buildroot}/usr/lib/systemd/system/incus.service.d/50-incus-ui.conf
[Service]
Environment=INCUS_UI=/opt/incus/ui
EOF

# Copy the LICENSE file to the buildroot.
mkdir -p %{buildroot}/usr/share/licenses/%{name}
cp %{_sourcedir}/LICENSE %{buildroot}/usr/share/licenses/%{name}/

%files
%license /usr/share/licenses/%{name}/LICENSE
/opt/incus
/opt/incus/ui
/usr/lib/systemd/system/incus.service.d/
/usr/lib/systemd/system/incus.service.d/50-incus-ui.conf
/usr/share/licenses/%{name}/
openSUSE Build Service is sponsored by