Skip to content

Commit

Permalink
Move Requires: to mini-tps.conf
Browse files Browse the repository at this point in the history
If the only purpose of those Requires: is to have those packages protected
then it's much cleaner to have them directly in the mini-tps.conf
  • Loading branch information
jpopelka committed Dec 8, 2023
1 parent 7e46665 commit 3f13182
Showing 1 changed file with 27 additions and 16 deletions.
43 changes: 27 additions & 16 deletions mini-tps.spec
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,42 @@ Summary: Mini TPS - Test Package Sanity

License: GPLv2
URL: https://github.com/fedora-ci/mini-tps
Source0: %{name}.tar.gz
# 'remove' test won't be run for these packages
Requires: yum yum-utils openssh-server
Source0: mini-tps.tar.gz
BuildArch: noarch

%if 0%{?rhel} > 7
# bug: https://bugzilla.redhat.com/show_bug.cgi?id=1641631
Requires: rpm-plugin-selinux
Requires: dnf-plugins-core
Requires: libselinux-utils
%endif
# Don't add any Requires here because those would become protected, see mini-tps.conf

%description
Light version of TPS

%prep
%autosetup -n %{name}
%autosetup -n mini-tps

%build

%install
mkdir -p %{buildroot}%{_sbindir} # epel7
install -pD -m 0755 --target-directory=%{buildroot}%{_sbindir} mtps-*

mkdir -p %{buildroot}%{_sysconfdir}/dnf/protected.d/
# Make mini-tps (and all packages mini-tps requires) protected (from removal)
echo mini-tps > %{buildroot}%{_sysconfdir}/dnf/protected.d/mini-tps.conf
cat > %{buildroot}%{_sysconfdir}/dnf/protected.d/mini-tps.conf <<EOF
# Packages for which mini-tps won't run the 'remove' test (i.e. won't try to remove them).

mini-tps
openssh-server
yum
yum-utils
EOF
%if 0%{?rhel} > 7
cat >> %{buildroot}%{_sysconfdir}/dnf/protected.d/mini-tps.conf <<EOF

# https://bugzilla.redhat.com/show_bug.cgi?id=1641631
dnf-plugins-core
libselinux-utils
rpm-plugin-selinux
EOF

%endif

# viewer
install -pD -m 0755 viewer/generate-result-json %{buildroot}%{_libexecdir}/mini-tps/viewer/generate-result-json
install -pD -m 0644 viewer/viewer.html %{buildroot}%{_datarootdir}/mini-tps/viewer/viewer.html
Expand All @@ -55,12 +65,13 @@ install -pD -m 0755 profiles/fedora/prepare-system %{buildroot}%{_libexecdir}/mi

%changelog
* Thu Dec 07 2023 Jiri Popelka <[email protected]> - 0.1-163
- remove the Requires: python-gobject-base
- Remove the Requires: python-gobject-base
- Move Requires: to mini-tps.conf

* Fri Nov 24 2023 Jiri Popelka <[email protected]> - 0.1-162
- URL update
- move mtps-* executables from /usr/local/bin/ to /usr/sbin/
- use install instead of mkdir & cp
- Move mtps-* executables from /usr/local/bin/ to /usr/sbin/
- Use install instead of mkdir & cp
- mtps-mutils Requires: python-gobject-base

* Mon Jul 31 2023 Andrei Stepanov <[email protected]> - 0.1-161
Expand Down

0 comments on commit 3f13182

Please sign in to comment.