Files
home-slaby-scripts/slaby-scripts.spec
Jiri Slaby 6678b2427c initial
2025-08-14 09:36:10 +02:00

148 lines
4.1 KiB
RPMSpec

#
# spec file for package slaby-scripts
#
# Copyright (c) 2025 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/
#
# from pm-utils
%define pm_libdir %{_prefix}/lib/pm-utils/
Name: slaby-scripts
Version: 1300179072
Release: 0
License: GPL-2.0-only
Group: Productivity/Other
Summary: Various scripts which are a must for me
URL: https://github.com/jirislaby/slaby-scripts
Source: %{name}-%{version}.tar.xz
# 1-4 extracted from https://orthos.arch.suse.de/sconsole/set.sh
Source1: orthos.png
Source2: orthos-cscreen.desktop
Source3: orthos-cscreen.xml
Source4: or_parse.sh
BuildRequires: meson
BuildRequires: perl-base
BuildRequires: python-rpm-macros
BuildRequires: %{python_module meson-python}
BuildRequires: %{python_module pip}
BuildRequires: systemd-rpm-macros
BuildRequires: xz
Requires: python3-termcolor
BuildArch: noarch
%python_subpackages
%description
Various scripts which are a must for me. They are mostly for working with suse
trees.
%package -n %{name}-graphics
Summary: Scripts depending on graphics
Group: Productivity/Other
%if 0%{?is_opensuse}
Requires: xdotool
%endif
%description -n %{name}-graphics
Scripts that depend on graphics (X/wayland).
%package -n %{name}-nvr
Summary: Scripts for NVR
Group: Productivity/Other
Requires: perl(Config::IniFiles)
%description -n %{name}-nvr
Scripts for recording videos known as NVR.
%package -n %{name}-orthos
Summary: Scripts for Orthos
Group: Productivity/Other
Requires(post): shared-mime-info
Requires(postun): shared-mime-info
%description -n %{name}-orthos
Scripts for controlling Orthos and serial consoles.
%package -n perl-StableHelper
Summary: StableHelper perl module
Group: Development/Libraries/Perl
%perl_requires
%description -n perl-StableHelper
StableHelper perl module for other scripts.
%package -n python-slaby-scripts
Summary: slaby-scripts python package
Group: Development/Libraries/Python
%description -n python-slaby-scripts
slaby-scripts python package with helper scripts.
%prep
%autosetup
%if 0%{?suse_version} <= 1500
ln -s meson.options meson_options.txt
%endif
%build
%pyproject_wheel --config-settings=setup-args=-Dnon_python_skip=true .
%meson -Dperllibdir=%{perl_vendorlib} -Dunitdir=%{_unitdir} -Dpython_skip=true
%install
%pyproject_install
%meson_install
install -m 0644 -D %{SOURCE1} %{buildroot}/%{_datadir}/pixmaps/orthos.png
install -m 0644 -D %{SOURCE2} %{buildroot}/%{_datadir}/applications/orthos-cscreen.desktop
install -m 0644 -D %{SOURCE3} %{buildroot}/%{_datadir}/mime/packages/orthos-cscreen.xml
install -m 0755 -D %{SOURCE4} %{buildroot}/%{_bindir}/or_parse.sh
%perl_gen_filelist
grep %perl_vendorlib %{name}.files > %{name}_1.files
%postun -n %{name}-nvr
%service_del_postun_without_restart nvr@.service
%files -n %{name}
%{_bindir}/*
%exclude %{_bindir}/nvr.pl
%exclude %{_bindir}/openterm
%exclude %{_bindir}/or_parse.sh
%{_datadir}/%{name}
%files -n %{name}-graphics
%{_bindir}/openterm
%files -n %{name}-nvr
%{_bindir}/nvr.pl
%dir %{_unitdir}/
%{_unitdir}/nvr@.service
%ghost %attr(0644,root,root) %config %{_sysconfdir}/nvr.ini
%files -n %{name}-orthos
%{_bindir}/or_parse.sh
%{_datadir}/pixmaps/orthos.png
%{_datadir}/applications/orthos-cscreen.desktop
%{_datadir}/mime/packages/orthos-cscreen.xml
%files -n perl-StableHelper -f %{name}_1.files
%files %{python_files}
%{python_sitelib}/slaby_scripts/
%{python_sitelib}/slaby_scripts-*-info/
%changelog