rpmlint-mini/rpmlint-mini.spec

88 lines
2.6 KiB
RPMSpec
Raw Normal View History

#
# spec file for package rpmlint-mini (Version 1.0)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
Name: rpmlint-mini
BuildRequires: rpm-python rpmlint
Summary: Rpm correctness checker
Version: 1.0
Release: 1
URL: http://rpmlint.zarb.org/
License: GNU General Public License (GPL)
Group: System/Packages
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source100: rpmlint-deps.txt
Source101: rpmlint.wrapper
%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
%build
%install
# test if the rpmlint works at all
. /.buildenv
/usr/bin/rpmlint /.rpm-cache/$BUILD_BASENAME/m4.rpm || exit 1
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/opt/testing/share/
cp -a /usr/share/rpmlint $RPM_BUILD_ROOT/opt/testing/share/
cd %{py_libdir}
for f in $(<%{SOURCE100}); do
find -name "$f" -exec install -D {} $RPM_BUILD_ROOT/opt/testing/%{_lib}/python%{py_ver}/{} \;
done
install -D /usr/bin/python $RPM_BUILD_ROOT/opt/testing/bin/python
cp -a %_libdir/libpython%{py_ver}.so.* $RPM_BUILD_ROOT/opt/testing/%{_lib}
cp -a %{py_sitedir}/rpm $RPM_BUILD_ROOT/opt/testing/%{_lib}/python%{py_ver}/
sed -i -e "s,/usr/share/rpmlint,/opt/testing/share/rpmlint," $RPM_BUILD_ROOT/opt/testing/share/rpmlint/*.py
rm -f $RPM_BUILD_ROOT/opt/testing/share/rpmlint/Config.py{c,o}
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
install -D /usr/share/rpmlint/config $RPM_BUILD_ROOT/opt/testing/share/rpmlint/config
# 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
%define __find_requires %my_requires
%define __find_provides %nil
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,0755)
/opt/testing
/opt/testing/bin/rpmlint
%changelog
* Tue May 15 2007 - dmueller@suse.de
- Initial package