diff options
author | Anas Nashif <anas.nashif@intel.com> | 2012-11-21 16:48:25 -0800 |
---|---|---|
committer | Anas Nashif <anas.nashif@intel.com> | 2012-11-21 16:48:25 -0800 |
commit | 9771186016b0b391ccaaf8bf9fbd96138000ac44 (patch) | |
tree | 4a3a6b30627008ab1f646b34ffd229dd64b6a66f | |
download | rpmlint-mini-9771186016b0b391ccaaf8bf9fbd96138000ac44.tar.gz rpmlint-mini-9771186016b0b391ccaaf8bf9fbd96138000ac44.tar.bz2 rpmlint-mini-9771186016b0b391ccaaf8bf9fbd96138000ac44.zip |
initial
-rw-r--r-- | packaging/desktop-file-utils-0.20.tar.xz | bin | 0 -> 124388 bytes | |||
-rw-r--r-- | packaging/polkit-default-privs.config | 2 | ||||
-rw-r--r-- | packaging/rpmlint-deps.txt | 243 | ||||
-rw-r--r-- | packaging/rpmlint-mini.config | 19 | ||||
-rw-r--r-- | packaging/rpmlint-mini.rpmlintrc | 3 | ||||
-rw-r--r-- | packaging/rpmlint-mini.spec | 118 | ||||
-rw-r--r-- | packaging/rpmlint.wrapper | 11 |
7 files changed, 396 insertions, 0 deletions
diff --git a/packaging/desktop-file-utils-0.20.tar.xz b/packaging/desktop-file-utils-0.20.tar.xz Binary files differnew file mode 100644 index 0000000..8024519 --- /dev/null +++ b/packaging/desktop-file-utils-0.20.tar.xz diff --git a/packaging/polkit-default-privs.config b/packaging/polkit-default-privs.config new file mode 100644 index 0000000..26b8e48 --- /dev/null +++ b/packaging/polkit-default-privs.config @@ -0,0 +1,2 @@ +# vim: syntax=python +setOption("PolkitPrivsFiles", [ "/opt/testing/share/rpmlint/data/polkit-default-privs.standard" ]) diff --git a/packaging/rpmlint-deps.txt b/packaging/rpmlint-deps.txt new file mode 100644 index 0000000..d4a9463 --- /dev/null +++ b/packaging/rpmlint-deps.txt @@ -0,0 +1,243 @@ +_abcoll.pyo +abc.pyo +base64.pyo +binasciimodule.so +binascii.pyo +binascii.so +bisect.pyo +calendar.pyo +codecsmodule.so +codecs.pyo +codecs.so +collections.pyo +commandsmodule.so +commands.pyo +commands.so +copy.pyo +copy_regmodule.so +copy_reg.pyo +copy_reg.so +ctypes/__init__.pyo +ctypes/_endian.pyo +ctypes/util.pyo +ctypes/wintypes.pyo +cStringIOmodule.so +cStringIO.pyo +cStringIO.so +datetime.so +encodings/aliasesmodule.so +encodings/aliases.pyo +encodings/aliases.so +encodings/asciimodule.so +encodings/ascii.pyo +encodings/ascii.so +encodings/codecsmodule.so +encodings/codecs.pyo +encodings/codecs.so +encodings/encodingsmodule.so +encodings/encodings.pyo +encodings/encodings.so +encodings/__init__module.so +encodings/__init__.pyo +encodings/__init__.so +encodings/iso8859_1.pyo +encodings/latin_1.pyo +encodings/string_escape.pyo +encodings/typesmodule.so +encodings/types.pyo +encodings/types.so +encodings/utf_8.pyo +fcntl.so +fnmatchmodule.so +fnmatch.pyo +fnmatch.so +functools.pyo +__future__.pyo +genericpath.pyo +getoptmodule.so +getopt.pyo +getopt.so +globmodule.so +glob.pyo +glob.so +hashlib.pyo +heapq.pyo +httplib.pyo +io.pyo +keyword.pyo +lib-dynload/array.so +lib-dynload/binascii.so +lib-dynload/_bisect.so +lib-dynload/_collections.so +lib-dynload/cStringIO.so +lib-dynload/_functools.so +lib-dynload/_io.so +lib-dynload/_locale.so +lib-dynload/_md5.so +lib-dynload/_ctypes.so +lib-dynload/operator.so +lib-dynload/pyexpat.so +lib-dynload/rpmmodule.so +lib-dynload/rpm.pyo +lib-dynload/rpm.so +lib-dynload/_sha256.so +lib-dynload/_sha512.so +lib-dynload/_sha.so +lib-dynload/sitecustomizemodule.so +lib-dynload/sitecustomize.pyo +lib-dynload/sitecustomize.so +lib-dynload/_socket.so +lib-dynload/strop.so +lib-dynload/_struct.so +lib-dynload/time.so +lib-dynload/zlib.so +lib-dynload/itertools.so +lib-dynload/_weakref.so +linecachemodule.so +linecache.pyo +linecache.so +_localemodule.so +localemodule.so +_locale.pyo +locale.pyo +_locale.so +locale.so +Makefile +math.so +md5.pyo +mimetools.pyo +operatormodule.so +operator.pyo +operator.so +osmodule.so +os.pyo +os.so +pickle.pyo +plat-linux2/binasciimodule.so +plat-linux2/binascii.pyo +plat-linux2/binascii.so +plat-linux2/cStringIOmodule.so +plat-linux2/cStringIO.pyo +plat-linux2/cStringIO.so +plat-linux2/_localemodule.so +plat-linux2/_locale.pyo +plat-linux2/_locale.so +plat-linux2/operatormodule.so +plat-linux2/operator.pyo +plat-linux2/operator.so +plat-linux2/rpmmodule.so +plat-linux2/rpm.pyo +plat-linux2/rpm.so +plat-linux2/sitecustomizemodule.so +plat-linux2/sitecustomize.pyo +plat-linux2/sitecustomize.so +plat-linux2/stropmodule.so +plat-linux2/strop.pyo +plat-linux2/strop.so +plat-linux2/_structmodule.so +plat-linux2/_struct.pyo +plat-linux2/_struct.so +plat-linux2/timemodule.so +plat-linux2/time.pyo +plat-linux2/time.so +plat-linux2/zlibmodule.so +plat-linux2/zlib.pyo +plat-linux2/zlib.so +posixpathmodule.so +posixpath.pyo +posixpath.so +pyconfig.h +random.pyo +_random.so +remodule.so +re.pyo +re.so +rfc822.pyo +rpmmodule.so +rpm.pyo +rpm.so +select.so +shutil.pyo +sitecustomizemodule.so +sitecustomize.pyo +sitecustomize.so +sitemodule.so +site-packages +site-packages/rpm/__init__module.so +site-packages/rpm/__init__.pyo +site-packages/rpm/__init__.so +site-packages/rpm/_rpmmodule.so +site-packages/rpm/_rpm.so +site-packages/rpm/transaction.pyo +site-packages/sitecustomizemodule.so +site-packages/sitecustomize.pyo +site-packages/sitecustomize.so +site.pyo +site.so +socket.pyo +sre_compilemodule.so +sre_compile.pyo +sre_compile.so +sre_constantsmodule.so +sre_constants.pyo +sre_constants.so +sre_parsemodule.so +sre_parse.pyo +sre_parse.so +statmodule.so +stat.pyo +stat.so +StringIO.pyo +stringmodule.so +string.pyo +string.so +stropmodule.so +strop.pyo +strop.so +_structmodule.so +structmodule.so +_struct.pyo +struct.pyo +_struct.so +struct.so +_strptime.pyo +subprocess.pyo +sysconfig.pyo +tempfile.pyo +textwrapmodule.so +textwrap.pyo +textwrap.so +timemodule.so +time.pyo +time.so +traceback.pyo +typesmodule.so +types.pyo +types.so +urllib2.pyo +urllib.pyo +urlparse.pyo +UserDictmodule.so +UserDict.pyo +UserDict.so +warningsmodule.so +warnings.pyo +warnings.so +weakref.pyo +_weakrefset.pyo +xml/dom/domreg.pyo +xml/dom/expatbuilder.pyo +xml/dom/__init__.pyo +xml/dom/minicompat.pyo +xml/dom/minidom.pyo +xml/dom/NodeFilter.pyo +xml/dom/xmlbuilder.pyo +xml/__init__.pyo +xml/parsers/expat.pyo +xml/parsers/__init__.pyo +zipfilemodule.so +zipfile.pyo +zipfile.so +zlibmodule.so +zlib.pyo +zlib.so diff --git a/packaging/rpmlint-mini.config b/packaging/rpmlint-mini.config new file mode 100644 index 0000000..c3c746c --- /dev/null +++ b/packaging/rpmlint-mini.config @@ -0,0 +1,19 @@ +#!/usr/bin/python + +import os, glob, Pkg + +configs = [ '/opt/testing/share/rpmlint/config' ] +if os.environ.get("RPMLINT_MINI_CONFIG", None): + configs += os.environ.get("RPMLINT_MINI_CONFIG", '').split(' ') +else: + configs += glob.glob("/home/abuild/rpmbuild/SOURCES/*rpmlintrc") + configs += glob.glob("/usr/src/packages/SOURCES/*rpmlintrc") +configs += glob.glob('/opt/testing/share/rpmlint/mini/*.config') + +for f in configs: + try: + execfile(f) + except IOError: + pass + except Exception, E: + Pkg.warn('(none): W: error loading %s, skipping: %s' % (f, E)) diff --git a/packaging/rpmlint-mini.rpmlintrc b/packaging/rpmlint-mini.rpmlintrc new file mode 100644 index 0000000..66882ef --- /dev/null +++ b/packaging/rpmlint-mini.rpmlintrc @@ -0,0 +1,3 @@ +addFilter("library-without-ldconfig") +addFilter("python-bytecode-without-source") +addFilter("devel-file-in-non-devel-package") diff --git a/packaging/rpmlint-mini.spec b/packaging/rpmlint-mini.spec new file mode 100644 index 0000000..af2a63c --- /dev/null +++ b/packaging/rpmlint-mini.spec @@ -0,0 +1,118 @@ +Name: rpmlint-mini +BuildRequires: glib2-devel +BuildRequires: glib2-devel-static +BuildRequires: pkg-config +BuildRequires: python-magic +BuildRequires: python-xml +BuildRequires: python-rpm +BuildRequires: rpmlint +# need to fetch the file from there +#BuildRequires: checkbashisms +BuildRequires: dash +BuildRequires: libtool +BuildRequires: polkit-default-privs +Requires: cpio +Summary: Rpm correctness checker +License: GPL-2.0+ +Group: System/Packages +Version: 1.3 +Release: 0 +Url: http://rpmlint.zarb.org/ +BuildRoot: %{_tmppath}/%{name}-%{version}-build +Source: desktop-file-utils-0.20.tar.xz +Source100: rpmlint-deps.txt +Source101: rpmlint.wrapper +Source102: rpmlint-mini.config +Source103: polkit-default-privs.config +Source1000: rpmlint-mini.rpmlintrc + +%description +Rpmlint is a tool to check common errors on rpm packages. Binary and +source packages can be checked. + +%prep +%setup -q -n desktop-file-utils-0.20 +[[ -r COPYING ]] + +%build +%configure +pushd src +make desktop-file-validate V=1 DESKTOP_FILE_UTILS_LIBS="%{_libdir}/libglib-2.0.a -lpthread -lrt" +popd + +%install +# test if the rpmlint works at all +set +e +/usr/bin/rpmlint rpmlint +test $? -gt 0 -a $? -lt 60 && exit 1 +set -e +# okay, lets put it together +mkdir -p $RPM_BUILD_ROOT/opt/testing/share/rpmlint +install -m 755 -D src/desktop-file-validate $RPM_BUILD_ROOT/opt/testing/bin/desktop-file-validate +cp -a /bin/dash /usr/bin/checkbashisms $RPM_BUILD_ROOT/opt/testing/bin +cp -a /usr/share/rpmlint/*.py $RPM_BUILD_ROOT/opt/testing/share/rpmlint +# install config files +install -d -m 755 $RPM_BUILD_ROOT/opt/testing/share/rpmlint/mini +for i in /etc/rpmlint/{rpmgroups,pie,licenses}.config "%{SOURCE103}"; do + cp $i $RPM_BUILD_ROOT/opt/testing/share/rpmlint/mini +done +install -m 644 -D /usr/share/rpmlint/config $RPM_BUILD_ROOT/opt/testing/share/rpmlint/config +install -m 644 "%{SOURCE102}" $RPM_BUILD_ROOT/opt/testing/share/rpmlint +# 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 +install -m 644 -D /usr/include/python%{py_ver}/pyconfig.h $RPM_BUILD_ROOT/opt/testing/include/python%{py_ver}/pyconfig.h +# +cd %{py_libdir} +for f in $(<%{SOURCE100}); do + find -path "*/$f" -exec install -D {} $RPM_BUILD_ROOT/opt/testing/%{_lib}/python%{py_ver}/{} \; +done +install -m 644 /usr/lib/python%{py_ver}/site-packages/magic.py $RPM_BUILD_ROOT/opt/testing/%{_lib}/python%{py_ver}/site-packages/magic.py +install -D /usr/bin/python $RPM_BUILD_ROOT/opt/testing/bin/python +cp -a %_libdir/libmagic.so.* $RPM_BUILD_ROOT/opt/testing/%{_lib} +cp -a %_libdir/libpython%{py_ver}.so.* $RPM_BUILD_ROOT/opt/testing/%{_lib} +cp -a %_bindir/rpmlint $RPM_BUILD_ROOT/opt/testing/share/rpmlint/rpmlint.py +pushd $RPM_BUILD_ROOT/opt/testing/share/rpmlint +PYTHONOPTIMIZE=1 python %py_libdir/py_compile.py *.py +rm *.py +popd +pushd $RPM_BUILD_ROOT/opt/testing/%{_lib}/python%{py_ver}/site-packages/ +PYTHONOPTIMIZE=1 python %py_libdir/py_compile.py *.py +rm *.py +popd +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 +%define _use_internal_dependency_generator 0 +%define __find_requires %my_requires +%define __find_provides %nil +# 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 +$RPM_BUILD_ROOT/opt/testing/bin/python -tt -u -O $RPM_BUILD_ROOT/opt/testing/share/rpmlint/rpmlint.pyo --help || exit 1 +echo ".. ok" + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root,0755) +/opt/testing +%doc COPYING + +%changelog diff --git a/packaging/rpmlint.wrapper b/packaging/rpmlint.wrapper new file mode 100644 index 0000000..23705b1 --- /dev/null +++ b/packaging/rpmlint.wrapper @@ -0,0 +1,11 @@ +#!/bin/sh +if test -d /opt/testing/lib64; then + LD_LIBRARY_PATH=/opt/testing/lib64 +else + LD_LIBRARY_PATH=/opt/testing/lib +fi +PATH="/opt/testing/bin:$PATH" +rpmlintdir="/opt/testing/share/rpmlint" +PYTHONPATH="$rpmlintdir" +export PYTHONPATH LD_LIBRARY_PATH +exec /opt/testing/bin/python -tt -u -O "$rpmlintdir"/rpmlint.pyo -C "$rpmlintdir" -f "$rpmlintdir"/rpmlint-mini.config "$@" |