2007-05-21 04:41:15 +02:00
|
|
|
#
|
2011-04-19 09:23:14 +02:00
|
|
|
# spec file for package rpmlint-mini
|
2007-05-21 04:41:15 +02:00
|
|
|
#
|
2017-01-26 10:15:44 +01:00
|
|
|
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
|
2007-05-21 04:41:15 +02:00
|
|
|
#
|
2008-08-15 01:49:49 +02:00
|
|
|
# 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.
|
|
|
|
|
2007-05-21 04:41:15 +02:00
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
2008-02-13 16:13:32 +01:00
|
|
|
|
2007-05-21 04:41:15 +02:00
|
|
|
Name: rpmlint-mini
|
2017-09-28 14:33:03 +02:00
|
|
|
Version: 1.10
|
|
|
|
Release: 0
|
2007-05-21 04:41:15 +02:00
|
|
|
Summary: Rpm correctness checker
|
2011-12-06 19:00:29 +01:00
|
|
|
License: GPL-2.0+
|
2007-05-21 04:41:15 +02:00
|
|
|
Group: System/Packages
|
2011-12-21 11:57:28 +01:00
|
|
|
Url: http://rpmlint.zarb.org/
|
2016-10-28 18:23:00 +02:00
|
|
|
Source: desktop-file-utils-0.23.tar.xz
|
2007-05-21 04:41:15 +02:00
|
|
|
Source100: rpmlint-deps.txt
|
|
|
|
Source101: rpmlint.wrapper
|
2010-01-27 18:29:21 +01:00
|
|
|
Source102: rpmlint-mini.config
|
2010-02-26 01:11:01 +01:00
|
|
|
Source103: polkit-default-privs.config
|
2016-12-09 15:44:52 +01:00
|
|
|
Source104: appdata_checker.config
|
2012-11-02 17:27:55 +01:00
|
|
|
Source1000: rpmlint-mini.rpmlintrc
|
2017-09-28 14:33:03 +02:00
|
|
|
# need to fetch the file from there
|
|
|
|
BuildRequires: checkbashisms
|
|
|
|
BuildRequires: dash
|
|
|
|
BuildRequires: glib2-devel
|
|
|
|
BuildRequires: glib2-devel-static
|
|
|
|
BuildRequires: libtool
|
|
|
|
BuildRequires: pkgconfig
|
|
|
|
BuildRequires: polkit-default-privs
|
|
|
|
BuildRequires: rpmlint
|
|
|
|
#!BuildIgnore: rpmlint-mini
|
|
|
|
Requires: cpio
|
2007-05-21 04:41:15 +02:00
|
|
|
|
|
|
|
%description
|
|
|
|
Rpmlint is a tool to check common errors on rpm packages. Binary and
|
|
|
|
source packages can be checked.
|
|
|
|
|
|
|
|
%prep
|
2016-10-28 18:23:00 +02:00
|
|
|
%setup -q -n desktop-file-utils-0.23
|
2012-02-27 00:11:02 +01:00
|
|
|
[[ -r COPYING ]]
|
2007-05-21 04:41:15 +02:00
|
|
|
|
|
|
|
%build
|
2007-06-06 18:17:50 +02:00
|
|
|
%configure
|
|
|
|
pushd src
|
2017-09-28 14:33:03 +02:00
|
|
|
make %{?_smp_mflags} desktop-file-validate V=1 DESKTOP_FILE_UTILS_LIBS="%{_libdir}/libglib-2.0.a -lpthread -lrt"
|
2007-06-06 18:17:50 +02:00
|
|
|
popd
|
2007-05-21 04:41:15 +02:00
|
|
|
|
|
|
|
%install
|
2008-07-24 22:00:48 +02:00
|
|
|
# test if the rpmlint works at all
|
|
|
|
set +e
|
2017-09-28 14:33:03 +02:00
|
|
|
%{_bindir}/rpmlint rpmlint
|
2008-07-24 22:00:48 +02:00
|
|
|
test $? -gt 0 -a $? -lt 60 && exit 1
|
|
|
|
set -e
|
2008-06-28 02:02:29 +02:00
|
|
|
# okay, lets put it together
|
2017-09-28 14:33:03 +02:00
|
|
|
mkdir -p %{buildroot}/opt/testing/share/rpmlint
|
|
|
|
install -m 755 -D src/desktop-file-validate %{buildroot}/opt/testing/bin/desktop-file-validate
|
|
|
|
cp -a %{_bindir}/dash %{_bindir}/checkbashisms %{buildroot}/opt/testing/bin
|
|
|
|
mkdir -p %{buildroot}/opt/testing/%{_lib}
|
|
|
|
cp -a %{_libdir}/libedit.so.0* %{buildroot}/opt/testing/%{_lib}
|
|
|
|
cp -a %{_datadir}/rpmlint/*.py %{buildroot}/opt/testing/share/rpmlint
|
2010-01-27 18:29:21 +01:00
|
|
|
# install config files
|
2017-09-28 14:33:03 +02:00
|
|
|
install -d -m 755 %{buildroot}/opt/testing/share/rpmlint/mini
|
|
|
|
for i in %{_sysconfdir}/rpmlint/{pie,licenses}.config "%{SOURCE103}" "%{SOURCE104}"; do
|
|
|
|
cp $i %{buildroot}/opt/testing/share/rpmlint/mini
|
2010-01-27 18:29:21 +01:00
|
|
|
done
|
2017-09-28 14:33:03 +02:00
|
|
|
install -m 644 -D %{_datadir}/rpmlint/config %{buildroot}/opt/testing/share/rpmlint/config
|
|
|
|
install -m 644 "%{SOURCE102}" %{buildroot}/opt/testing/share/rpmlint
|
2010-02-26 01:11:01 +01:00
|
|
|
# extra data
|
2017-09-28 14:33:03 +02:00
|
|
|
install -m 755 -d %{buildroot}/opt/testing/share/rpmlint/data
|
|
|
|
install -m 644 %{_sysconfdir}/polkit-default-privs.standard %{buildroot}/opt/testing/share/rpmlint/data
|
2010-02-26 01:11:01 +01:00
|
|
|
#
|
2017-09-30 14:50:46 +02:00
|
|
|
cd %{_libdir}/python%{py3_ver}/
|
2007-05-21 04:41:15 +02:00
|
|
|
for f in $(<%{SOURCE100}); do
|
2017-09-30 11:19:10 +02:00
|
|
|
find -path "*/$f" -exec install -D {} %{buildroot}/opt/testing/%{_lib}/python%{py3_ver}/{} \;
|
2007-05-21 04:41:15 +02:00
|
|
|
done
|
2017-09-30 11:19:10 +02:00
|
|
|
install -D %{_bindir}/python3 %{buildroot}/opt/testing/bin/python3
|
2017-09-28 14:33:03 +02:00
|
|
|
cp -a %{_libdir}/libmagic.so.* %{buildroot}/opt/testing/%{_lib}
|
|
|
|
cp -a %{_datadir}/misc/magic* %{buildroot}/opt/testing/share
|
2017-09-30 11:19:10 +02:00
|
|
|
cp -a %{_libdir}/libpython%{py3_ver}m.so.* %{buildroot}/opt/testing/%{_lib}
|
2017-09-28 14:33:03 +02:00
|
|
|
cp -a %{_bindir}/rpmlint %{buildroot}/opt/testing/share/rpmlint/rpmlint.py
|
|
|
|
pushd %{buildroot}/opt/testing/share/rpmlint
|
2017-09-30 11:19:10 +02:00
|
|
|
PYTHONOPTIMIZE=1 python3 -m py_compile *.py
|
|
|
|
rm -v *.py
|
2012-11-02 17:27:55 +01:00
|
|
|
popd
|
2017-09-30 11:19:10 +02:00
|
|
|
pushd %{buildroot}/opt/testing/%{_lib}/python%{py3_ver}/site-packages/
|
|
|
|
PYTHONOPTIMIZE=1 find -name \*.py -exec python3 -m py_compile {} \;
|
2017-09-30 14:50:46 +02:00
|
|
|
# find -name \*.py -delete
|
2007-05-25 00:36:44 +02:00
|
|
|
popd
|
2017-09-28 14:33:03 +02:00
|
|
|
rm -rf %{buildroot}/{usr,etc}
|
|
|
|
rm -f %{buildroot}/opt/testing/bin/rpmlint
|
|
|
|
install -m 755 -D %{SOURCE101} %{buildroot}/opt/testing/bin/rpmlint
|
2007-05-21 04:41:15 +02:00
|
|
|
# hackatlon
|
|
|
|
%define my_requires %{_builddir}/%{?buildsubdir}/%{name}-requires
|
2017-09-28 14:33:03 +02:00
|
|
|
cat << EOF > %{my_requires}
|
2007-05-21 04:41:15 +02:00
|
|
|
cat - > file.list
|
|
|
|
%{__find_requires} < file.list > requires.list
|
|
|
|
%{__find_provides} < file.list > provides.list
|
|
|
|
while read i; do
|
|
|
|
grep -F -v "\$i" requires.list > requires.list.new
|
|
|
|
mv requires.list.new requires.list
|
|
|
|
done < provides.list
|
|
|
|
cat requires.list
|
|
|
|
rm -f requires.list provides.list file.list
|
|
|
|
EOF
|
2017-09-28 14:33:03 +02:00
|
|
|
chmod +x %{my_requires}
|
2007-06-05 01:17:38 +02:00
|
|
|
%define _use_internal_dependency_generator 0
|
2017-09-28 14:33:03 +02:00
|
|
|
%define __find_requires %{my_requires}
|
|
|
|
%define __find_provides %{nil}
|
2008-09-27 18:12:20 +02:00
|
|
|
# final run check to detect python dep changes
|
2017-09-28 14:33:03 +02:00
|
|
|
LD_LIBRARY_PATH=%{buildroot}/opt/testing/%{_lib}
|
|
|
|
PYTHONPATH=%{buildroot}/opt/testing/share/rpmlint
|
2017-09-30 14:50:46 +02:00
|
|
|
PYTHONHOME=%{buildroot}/opt/testing/
|
|
|
|
export PYTHONPATH LD_LIBRARY_PATH PYTHONHOME
|
|
|
|
%{buildroot}/opt/testing/bin/python3 -tt -u -O %{buildroot}/opt/testing/share/rpmlint/__pycache__/rpmlint.cpython-36.opt-1.pyc /.build.binaries/*.rpm || exit 1
|
2010-01-27 18:29:21 +01:00
|
|
|
echo ".. ok"
|
2008-09-27 18:12:20 +02:00
|
|
|
|
2007-05-21 04:41:15 +02:00
|
|
|
%files
|
|
|
|
/opt/testing
|
2012-02-27 00:11:02 +01:00
|
|
|
%doc COPYING
|
2007-11-23 01:49:10 +01:00
|
|
|
|
2007-05-21 04:41:15 +02:00
|
|
|
%changelog
|