b8345dfd89cdc8912f19cb2557d8b75b3da771aa
[platform/upstream/rpmlint.git] / packaging / rpmlint.spec
1 Name:           rpmlint
2 BuildRequires:  python-rpm
3 BuildRequires:  xz
4 Summary:        Rpm correctness checker
5 License:        GPL-2.0+
6 Group:          Development/Packaging
7 Version:        1.4
8 Release:        0
9 Source0:        http://rpmlint.zarb.org/download/rpmlint-%{version}.tar.bz2
10 Source1:        rpmlint-checks-master.tar.gz
11 Source2:        config
12 Source10:       rpmgroups.config
13 Source11:       pie.config
14 Source12:       licenses.config
15 Source100:      syntax-validator.py
16 Url:            http://rpmlint.zarb.org/
17 Requires:       /usr/bin/readelf
18 Requires:       bash
19 Requires:       cpio
20 Requires:       dash
21 Requires:       desktop-file-utils
22 Requires:       file
23 Requires:       findutils
24 Requires:       python-magic
25 Requires:       python-rpm
26 BuildArch:      noarch
27
28 %description
29 Rpmlint is a tool to check common errors on rpm packages. Binary and
30 source packages can be checked.
31 Source1001:     rpmlint.manifest
32
33 %prep
34 %setup -q -n rpmlint-%{version}  -a1
35 cp %{SOURCE1001} .
36 cp %{S:2} .
37 # Only move top-level python files 
38 chmod 0755 rpmlint-checks-master/*.py
39 mv rpmlint-checks-master/*.py .
40
41 %build
42 make %{?_smp_mflags}
43
44 %install
45 make install DESTDIR=$RPM_BUILD_ROOT
46 # the provided bash-completion does not work and only prints bash errors
47 rm -rf  $RPM_BUILD_ROOT/etc/bash_completion.d
48 mv $RPM_BUILD_ROOT/etc/rpmlint/config $RPM_BUILD_ROOT/usr/share/rpmlint/config
49 head -n 8 $RPM_BUILD_ROOT/usr/share/rpmlint/config > $RPM_BUILD_ROOT/etc/rpmlint/config
50 # make sure that the package is sane
51 python -tt %{SOURCE100} $RPM_BUILD_ROOT/usr/share/rpmlint/*.py $RPM_BUILD_ROOT/usr/share/rpmlint/config
52 %__install -m 644 %{SOURCE10} %{buildroot}/%{_sysconfdir}/rpmlint/
53 %__install -m 644 %{SOURCE11} %{buildroot}/%{_sysconfdir}/rpmlint/
54 %__install -m 644 %{SOURCE12} %{buildroot}/%{_sysconfdir}/rpmlint/
55
56
57 %files
58 %manifest %{name}.manifest
59 %defattr(-,root,root,0755)
60 %license COPYING 
61 %{_prefix}/bin/*
62 %{_prefix}/share/rpmlint
63 %config(noreplace) /etc/rpmlint/config
64 %config(noreplace) /etc/rpmlint/licenses.config
65 %config %{_sysconfdir}/rpmlint/rpmgroups.config
66 %config %{_sysconfdir}/rpmlint/pie.config
67 %dir /etc/rpmlint
68 %doc /usr/share/man/man1/rpmlint.1.gz
69