A new user interface for you! Read more...

File rpmlint-backports.spec of Package rpmlint-backports

#
# spec file for package rpmlint-backports
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#

%define botuser _opensuse_org-rpmlint-backports

Name:           rpmlint-backports
Version:        15.0+git20180806.9059126
Release:        0
Summary:        Collection of rpmlint checks for the openSUSE Backports project
License:        GPL-2.0+
Group:          Development/Tools/Other
BuildRequires:  python systemd-rpm-macros
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Source:         %{name}-%{version}.tar.xz
Requires:       %{name}-data
Requires:       python3-dbm
# for useradd
BuildRequires:  shadow
Requires(pre):  %{_sbindir}/useradd
BuildArch:      noarch

%package tool
Summary:        Tool to update the data of the rpmlint checks for the openSUSE Backports project
License:        GPL-2.0+
Group:          Development/Tools/Other
Requires:       git-core screen
%if 0%{?suse_version} >= 1500
Requires(pre):  group(nogroup)
%endif

%description
Collection of rpmlint checks for testing packages built in the SLE
Backports project.

%description tool
The tool to update the data of the rpmlint checks for the openSUSE
Backports project

%prep
%setup -q

%build
make

%install
%make_install BACKPORTS=15
touch %buildroot/var/cache/opensuse-backports-data/.osc_cookiejar
touch %buildroot/var/cache/opensuse-backports-data/.oscrc

%pre tool
getent passwd %botuser >/dev/null || useradd -r -g nogroup -d /var/cache/opensuse-backports-data \
  -s /sbin/nologin -c "openSUSE backports checker" %botuser
#
%service_add_pre opensuse-rpmlint-backports.service

%post tool
%service_add_post opensuse-rpmlint-backports.service
if [ ! -e /var/cache/opensuse-backports-data/.oscrc ]; then
	install -o %botuser  -m 400 /dev/null /var/cache/opensuse-backports-data/.oscrc
	cat > /var/cache/opensuse-backports-data/.oscrc <<-EOF
	[general]
	apiurl = https://FIXME

	[https://FIXME]
	user = FIXME
	pass = FIXME
	EOF
fi
if [ ! -e /var/cache/opensuse-backports-data/.osc_cookiejar ]; then
	install -o %botuser  -m 600 /dev/null /var/cache/opensuse-backports-data/.osc_cookiejar
fi

%preun tool
%service_del_preun opensuse-rpmlint-backports.service

%postun tool
%service_del_postun opensuse-rpmlint-backports.service


%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root,0755)
%doc COPYING
%dir %{_datadir}/rpmlint
%{_datadir}/rpmlint/*.py*
%config %{_sysconfdir}/rpmlint/*.config

%files tool
%defattr(-,root,root,0755)
%{_bindir}/*
%{_unitdir}/opensuse-rpmlint-backports@.service
%dir /var/cache/opensuse-backports-data
%dir /etc/xdg/rpmlint-backports-tool/
%config /etc/xdg/rpmlint-backports-tool/*
#
%dir %attr(0755 %botuser,root)/var/cache/opensuse-backports-data/
%ghost %config(noreplace) %attr(0400 %botuser,root) /var/cache/opensuse-backports-data/.oscrc
%ghost %config(noreplace) %attr(0600 %botuser,root) /var/cache/opensuse-backports-data/.osc_cookiejar

%changelog