2007-05-21 04:41:15 +02:00
|
|
|
#
|
2010-11-15 18:17:38 +01:00
|
|
|
# spec file for package rpmlint-mini (Version 1.0)
|
2007-05-21 04:41:15 +02:00
|
|
|
#
|
2010-01-27 18:29:21 +01:00
|
|
|
# Copyright (c) 2010 SUSE LINUX Products 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/
|
|
|
|
#
|
|
|
|
|
|
|
|
# norootforbuild
|
2009-09-02 18:04:20 +02:00
|
|
|
# icecream 0
|
2007-05-21 04:41:15 +02:00
|
|
|
|
2008-02-13 16:13:32 +01:00
|
|
|
|
2007-05-21 04:41:15 +02:00
|
|
|
Name: rpmlint-mini
|
2010-10-18 16:57:33 +02:00
|
|
|
BuildRequires: glib2-devel glib2-devel-static pkg-config python-xml rpm-python rpmlint
|
2009-09-28 17:46:39 +02:00
|
|
|
BuildRequires: python-magic
|
2010-02-26 01:11:01 +01:00
|
|
|
# need to fetch the file from there
|
|
|
|
BuildRequires: polkit-default-privs
|
2010-09-20 16:05:58 +02:00
|
|
|
BuildRequires: checkbashisms dash libtool
|
2007-05-21 04:41:15 +02:00
|
|
|
Summary: Rpm correctness checker
|
2010-11-15 18:17:32 +01:00
|
|
|
Version: 1.0
|
2010-11-15 18:17:38 +01:00
|
|
|
Release: 222
|
2007-11-08 23:32:09 +01:00
|
|
|
Url: http://rpmlint.zarb.org/
|
2010-01-27 18:29:21 +01:00
|
|
|
License: GPLv2+
|
2007-05-21 04:41:15 +02:00
|
|
|
Group: System/Packages
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2010-09-20 16:05:58 +02:00
|
|
|
Source: desktop-file-utils-0.17.tar.bz2
|
2007-06-06 18:17:50 +02:00
|
|
|
Patch10: static-desktop-file-validate.diff
|
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
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Authors:
|
|
|
|
--------
|
|
|
|
Frederic Lepied <flepied@mandriva.com>
|
|
|
|
Gwenole Beauchesne <gbeauchesne@mandriva.com>
|
|
|
|
|
|
|
|
%prep
|
2010-09-20 16:05:58 +02:00
|
|
|
%setup -q -n desktop-file-utils-0.17
|
2007-06-06 18:17:50 +02:00
|
|
|
%patch10
|
2007-05-21 04:41:15 +02:00
|
|
|
|
|
|
|
%build
|
2007-06-06 18:17:50 +02:00
|
|
|
autoreconf -fi
|
|
|
|
%configure
|
|
|
|
pushd src
|
|
|
|
make desktop-file-validate
|
|
|
|
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
|
|
|
|
/usr/bin/rpmlint rpmlint
|
|
|
|
test $? -gt 0 -a $? -lt 60 && exit 1
|
|
|
|
set -e
|
2008-06-28 02:02:29 +02:00
|
|
|
# okay, lets put it together
|
2007-06-05 01:17:38 +02:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/opt/testing/share/rpmlint
|
2007-06-06 18:17:50 +02:00
|
|
|
install -m 755 -D src/desktop-file-validate $RPM_BUILD_ROOT/opt/testing/bin/desktop-file-validate
|
2010-08-03 15:32:45 +02:00
|
|
|
cp /bin/dash /usr/bin/checkbashisms $RPM_BUILD_ROOT/opt/testing/bin
|
2007-06-05 01:17:38 +02:00
|
|
|
cp -a /usr/share/rpmlint/*.py $RPM_BUILD_ROOT/opt/testing/share/rpmlint
|
2010-01-27 18:29:21 +01:00
|
|
|
# install config files
|
|
|
|
install -d -m 755 $RPM_BUILD_ROOT/opt/testing/share/rpmlint/mini
|
2010-02-26 12:06:19 +01:00
|
|
|
for i in /etc/rpmlint/rpmgroups.config "%{SOURCE103}"; do
|
|
|
|
cp $i $RPM_BUILD_ROOT/opt/testing/share/rpmlint/mini
|
2010-01-27 18:29:21 +01:00
|
|
|
done
|
|
|
|
install -m 644 -D /usr/share/rpmlint/config $RPM_BUILD_ROOT/opt/testing/share/rpmlint/config
|
2010-02-26 12:06:19 +01:00
|
|
|
install -m 644 "%{SOURCE102}" $RPM_BUILD_ROOT/opt/testing/share/rpmlint
|
2010-02-26 01:11:01 +01:00
|
|
|
# extra data
|
|
|
|
install -m 755 -d $RPM_BUILD_ROOT/opt/testing/share/rpmlint/data
|
|
|
|
install -m 644 /etc/polkit-default-privs.standard $RPM_BUILD_ROOT/opt/testing/share/rpmlint/data
|
2010-09-18 01:39:30 +02:00
|
|
|
install -m 644 -D /usr/include/python%{py_ver}/pyconfig.h $RPM_BUILD_ROOT/opt/testing/include/python%{py_ver}/pyconfig.h
|
2010-02-26 01:11:01 +01:00
|
|
|
#
|
2007-05-21 04:41:15 +02:00
|
|
|
cd %{py_libdir}
|
|
|
|
for f in $(<%{SOURCE100}); do
|
2007-06-05 01:17:38 +02:00
|
|
|
find -path "*/$f" -exec install -D {} $RPM_BUILD_ROOT/opt/testing/%{_lib}/python%{py_ver}/{} \;
|
2007-05-21 04:41:15 +02:00
|
|
|
done
|
|
|
|
install -D /usr/bin/python $RPM_BUILD_ROOT/opt/testing/bin/python
|
2009-09-28 17:46:39 +02:00
|
|
|
cp -a %_libdir/libmagic.so.* $RPM_BUILD_ROOT/opt/testing/%{_lib}
|
2007-05-21 04:41:15 +02:00
|
|
|
cp -a %_libdir/libpython%{py_ver}.so.* $RPM_BUILD_ROOT/opt/testing/%{_lib}
|
2007-05-25 00:36:44 +02:00
|
|
|
pushd $RPM_BUILD_ROOT/opt/testing/share/rpmlint
|
2007-06-05 01:17:38 +02:00
|
|
|
PYTHONOPTIMIZE=1 python %py_libdir/py_compile.py *.py
|
2007-05-25 00:36:44 +02:00
|
|
|
popd
|
2007-06-05 01:17:38 +02:00
|
|
|
rm -f $RPM_BUILD_ROOT/opt/testing/share/rpmlint/*.py
|
2007-05-21 04:41:15 +02:00
|
|
|
rm -rf $RPM_BUILD_ROOT/{usr,etc}
|
|
|
|
rm -f $RPM_BUILD_ROOT/opt/testing/bin/rpmlint
|
|
|
|
install -m 755 -D %{SOURCE101} $RPM_BUILD_ROOT/opt/testing/bin/rpmlint
|
|
|
|
# hackatlon
|
|
|
|
%define my_requires %{_builddir}/%{?buildsubdir}/%{name}-requires
|
|
|
|
cat << EOF > %my_requires
|
|
|
|
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
|
|
|
|
chmod +x %my_requires
|
2007-06-05 01:17:38 +02:00
|
|
|
%define _use_internal_dependency_generator 0
|
2007-05-21 04:41:15 +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
|
|
|
|
LD_LIBRARY_PATH=$RPM_BUILD_ROOT/opt/testing/%_lib
|
|
|
|
PYTHONPATH=$RPM_BUILD_ROOT/opt/testing/share/rpmlint
|
|
|
|
export PYTHONPATH LD_LIBRARY_PATH
|
2009-09-02 18:04:20 +02:00
|
|
|
$RPM_BUILD_ROOT/opt/testing/bin/python -tt -u -O $RPM_BUILD_ROOT/opt/testing/share/rpmlint/rpmlint.pyo --help || 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
|
|
|
%clean
|
|
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root,0755)
|
|
|
|
/opt/testing
|
2007-11-23 01:49:10 +01:00
|
|
|
|
2007-05-21 04:41:15 +02:00
|
|
|
%changelog
|