]> git.pld-linux.org Git - packages/rpmlint.git/blob - rpmlint.spec
960818a669155424939655cf302f75127913a39a
[packages/rpmlint.git] / rpmlint.spec
1 #
2 # Conditional build:
3 %bcond_without  tests           # build without tests
4
5 Summary:        Tool for checking common errors in RPM packages
6 Summary(pl.UTF-8):      Narzędzie do sprawdzania pakietów RPM pod kątem częstych błędów
7 Name:           rpmlint
8 Version:        1.7
9 Release:        2
10 License:        GPL v2
11 Group:          Development/Building
12 Source0:        http://downloads.sourceforge.net/rpmlint/%{name}-%{version}.tar.xz
13 # Source0-md5:  0b78c2fa4a98c6f660003a679ad6ea90
14 Source1:        %{name}.config
15 Source3:        %{name}-etc.config
16 Patch0:         %{name}-groups.patch
17 Patch1:         pythonpath.patch
18 Patch2:         %{name}-licenses.patch
19 Patch3:         postshell.patch
20 Patch4:         rpm5.patch
21 Patch5:         bash-completion.patch
22 Patch6:         revert-9f71923e.patch
23 URL:            http://sourceforge.net/projects/rpmlint/
24 BuildRequires:  python >= 1:2.6
25 BuildRequires:  python-modules
26 %{?with_tests:BuildRequires:    python-rpm >= 5.4.10-12}
27 BuildRequires:  rpm-pythonprov
28 BuildRequires:  rpmbuild(macros) >= 1.673
29 # tests require rpmlint in installed packages database
30 %{?with_tests:BuildRequires:    rpmlint}
31 BuildRequires:  tar >= 1:1.22
32 BuildRequires:  xz
33 Requires:       /bin/bash
34 Requires:       /lib/cpp
35 Requires:       binutils
36 Requires:       bzip2
37 Requires:       cpio
38 Requires:       desktop-file-utils
39 Requires:       file
40 Requires:       findutils
41 Requires:       grep
42 Requires:       gzip
43 Requires:       python >= 1.5.2
44 Requires:       python-magic
45 Requires:       python-pyenchant
46 Requires:       python-rpm >= 5.4.10-12
47 Requires:       xz
48 BuildArch:      noarch
49 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
50
51 %description
52 Rpmlint is a tool to check common errors on rpm packages. Binary and
53 source packages can be checked.
54
55 %description -l pl.UTF-8
56 rpmlint to narzędzie do sprawdzania pakietów RPM pod kątem często
57 występujących błędów. Można sprawdzać pakiety źródłowe i binarne.
58
59 %package -n bash-completion-%{name}
60 Summary:        bash-completion for rpmlint
61 Summary(pl.UTF-8):      Bashowe uzupełnianie parametrów dla polecenia rpmlint
62 Group:          Applications/Shells
63 Requires:       %{name} = %{version}-%{release}
64 Requires:       bash-completion >= 2.0
65
66 %description -n bash-completion-%{name}
67 bash-completion for rpmlint.
68
69 %description -n bash-completion-%{name} -l pl.UTF-8
70 Bashowe uzupełnianie parametrów dla polecenia rpmlint.
71
72 %prep
73 %setup -q
74 %patch0 -p1
75 %patch1 -p1
76 %patch2 -p1
77 %patch3 -p1
78 %patch4 -p1
79 %patch5 -p1
80 %patch6 -p1
81
82 cp -p config config.example
83 cp -p %{SOURCE3} config
84
85 mv %{name} %{name}.py
86 %{__sed} -i -e 's,python ./rpmlint,./rpmlint.py,' test.sh
87
88 cat <<'EOF' > %{name}
89 #!/bin/sh
90 exec python -tt -u -O %{py_sitescriptdir}/%{name}/rpmlint.pyc "$@"
91 EOF
92 touch __init__.py
93
94 %build
95 # Create GROUPS for -groups.patch
96 rpmnv=$(rpm -q rpm --qf '%{N}-%{V}')
97 gzip -dc "%{_docdir}/$rpmnv/groups.gz" | awk '/^[A-Z].*/ { print }' > GROUPS
98 test -s GROUPS
99
100 %{__make} \
101         bash_compdir=%{bash_compdir} \
102         COMPILE_PYC=1
103
104 %if %{with tests}
105 %{__make} check
106 %endif
107
108 %install
109 rm -rf $RPM_BUILD_ROOT
110 %{__make} install \
111         bash_compdir=%{bash_compdir} \
112         ETCDIR=%{_sysconfdir} \
113         MANDIR=%{_mandir} \
114         LIBDIR=%{py_sitescriptdir}/%{name} \
115         BINDIR=%{_bindir} \
116         DESTDIR=$RPM_BUILD_ROOT
117
118 install -p %{name} $RPM_BUILD_ROOT%{_bindir}/%{name}
119 install -d $RPM_BUILD_ROOT%{_datadir}/%{name}
120 cp -p GROUPS $RPM_BUILD_ROOT%{_datadir}/%{name}
121 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/%{name}/config
122
123 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
124 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
125 %py_postclean
126
127 %clean
128 rm -rf $RPM_BUILD_ROOT
129
130 %files
131 %defattr(644,root,root,755)
132 %doc ChangeLog README* config.example
133 %dir %{_sysconfdir}/rpmlint
134 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rpmlint/config
135 %attr(755,root,root) %{_bindir}/rpmdiff
136 %attr(755,root,root) %{_bindir}/rpmlint
137 %{_mandir}/man1/rpmdiff.1*
138 %{_mandir}/man1/rpmlint.1*
139 %dir %{_datadir}/%{name}
140 %{_datadir}/%{name}/GROUPS
141 %{_datadir}/%{name}/config
142 %dir %{py_sitescriptdir}/%{name}
143 %{py_sitescriptdir}/%{name}/*.py[co]
144
145 %files -n bash-completion-%{name}
146 %defattr(644,root,root,755)
147 %{bash_compdir}/rpmlint
148 %{bash_compdir}/rpmdiff
This page took 0.053361 seconds and 2 git commands to generate.