]>
Commit | Line | Data |
---|---|---|
df7f2cc2 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without gui # Qt4-based GUI | |
4 | # | |
5 | Summary: Tool for static C/C++ code analysis | |
6 | Summary(pl.UTF-8): Narzędzie do statycznej analizy kodu w C/C++ | |
7 | Name: cppcheck | |
8 | Version: 1.49 | |
9 | Release: 1 | |
10 | License: GPL v3+ | |
11 | Group: Development/Tools | |
12 | Source0: http://downloads.sourceforge.net/cppcheck/%{name}-%{version}.tar.bz2 | |
13 | # Source0-md5: 3af62285e268343fb9b8261364a1c1ef | |
14 | Patch0: %{name}-gui-paths.patch | |
15 | URL: http://cppcheck.sourceforge.net/ | |
16 | BuildRequires: cmake | |
17 | BuildRequires: docbook-style-xsl | |
18 | BuildRequires: docbook-dtd45-xml | |
19 | BuildRequires: libstdc++-devel | |
20 | BuildRequires: libxslt-progs | |
21 | BuildRequires: pcre-devel | |
22 | BuildRequires: rpmbuild(macros) >= 1.603 | |
23 | BuildRequires: tinyxml-devel | |
24 | %if %{with gui} | |
25 | BuildRequires: QtGui-devel >= 4 | |
26 | BuildRequires: QtHelp-devel >= 4 | |
27 | BuildRequires: qt4-linguist >= 4 | |
28 | BuildRequires: qt4-qmake >= 4 | |
29 | %endif | |
30 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
31 | ||
32 | %description | |
33 | cppcheck is an analysis tool for C/C++ code. Unlike C/C++ compilers | |
34 | and many other analysis tools, it doesn't detect syntax errors. | |
35 | cppcheck only detects the types of bugs that the compilers normally | |
36 | fail to detect. The goal is no false positives. | |
37 | ||
38 | %description -l pl.UTF-8 | |
39 | cppcheck to narzędzie do analizy kodu w C/C++. W przeciwieństwie do | |
40 | kompilatorów i innych narzędzi do analizy, nie wykrywa błędów | |
41 | składni. Wykrywa tylko te rodzaje błędów, których zwykle nie wykrywają | |
42 | kompilatory. Celem jest brak fałszywych alarmów. | |
43 | ||
44 | %package gui | |
45 | Summary: Qt4-based GUI for cppcheck | |
46 | Summary(pl.UTF-8): Oparty na Qt4 graficzny interfejs użytkownika do cppcheck | |
47 | Group: X11/Applications | |
48 | Requires: %{name} = %{version}-%{release} | |
49 | ||
50 | %description gui | |
51 | Qt4-based GUI for cppcheck. | |
52 | ||
53 | %description gui -l pl.UTF-8 | |
54 | Oparty na Qt4 graficzny interfejs użytkownika do cppcheck. | |
55 | ||
56 | %prep | |
57 | %setup -q | |
58 | %patch0 -p1 | |
59 | ||
60 | %build | |
61 | %{__make} all man \ | |
62 | CXX="%{__cxx}" \ | |
63 | CXXFLAGS="%{rpmcxxflags} -DNDEBUG -DHAVE_RULES -DTIXML_USE_STL -Wall" \ | |
64 | INCLUDE_FOR_CLI="-Ilib" \ | |
65 | INCLUDE_FOR_TEST="-Ilib -Icli" \ | |
66 | LDFLAGS="%{rpmldflags} -lpcre" \ | |
67 | TINYXML="%{_libdir}/libtinyxml.so" \ | |
68 | DB2MAN=%{_datadir}/sgml/docbook/xsl-stylesheets/manpages/docbook.xsl | |
69 | ||
70 | %if %{with gui} | |
71 | cd gui | |
72 | qmake-qt4 \ | |
73 | QMAKE_CXX="%{__cxx}" \ | |
74 | QMAKE_CXXFLAGS_RELEASE="%{rpmcxxflags}" \ | |
75 | QMAKE_LFLAGS_RELEASE="%{rpmldflags}" | |
76 | %{__make} | |
77 | lrelease-qt4 cppcheck_*.ts | |
78 | # compiled version not used yet (code refers to manual.html at sf.net) | |
79 | #cd help | |
80 | #%{_libdir}/qt4/bin/qcollectiongenerator online-help.qhcp -o online-help.qhc | |
81 | %endif | |
82 | ||
83 | %install | |
84 | rm -rf $RPM_BUILD_ROOT | |
85 | ||
86 | %{__make} install \ | |
87 | DESTDIR=$RPM_BUILD_ROOT | |
88 | ||
89 | %if %{with gui} | |
90 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_datadir}/cppcheck-gui} | |
91 | install gui/cppcheck-gui $RPM_BUILD_ROOT%{_bindir} | |
92 | install -p gui/cppcheck_*.qm $RPM_BUILD_ROOT%{_datadir}/cppcheck-gui | |
93 | %{__make} -C gui install \ | |
94 | DESTDIR=$RPM_BUILD_ROOT | |
95 | %endif | |
96 | ||
97 | %clean | |
98 | rm -rf $RPM_BUILD_ROOT | |
99 | ||
100 | %files | |
101 | %defattr(644,root,root,755) | |
102 | %doc AUTHORS Changelog readme.txt | |
103 | %attr(755,root,root) %{_bindir}/cppcheck | |
104 | ||
105 | %if %{with gui} | |
106 | %files gui | |
107 | %defattr(644,root,root,755) | |
108 | %doc readme_gui.txt | |
109 | %attr(755,root,root) %{_bindir}/cppcheck-gui | |
110 | %dir %{_datadir}/cppcheck-gui | |
111 | %lang(de) %{_datadir}/cppcheck-gui/cppcheck_de.qm | |
112 | %{_datadir}/cppcheck-gui/cppcheck_en.qm | |
113 | %lang(es) %{_datadir}/cppcheck-gui/cppcheck_es.qm | |
114 | %lang(fi) %{_datadir}/cppcheck-gui/cppcheck_fi.qm | |
115 | %lang(fr) %{_datadir}/cppcheck-gui/cppcheck_fr.qm | |
116 | %lang(ja) %{_datadir}/cppcheck-gui/cppcheck_ja.qm | |
117 | %lang(nl) %{_datadir}/cppcheck-gui/cppcheck_nl.qm | |
118 | %lang(pl) %{_datadir}/cppcheck-gui/cppcheck_pl.qm | |
119 | %lang(ru) %{_datadir}/cppcheck-gui/cppcheck_ru.qm | |
120 | %lang(sr) %{_datadir}/cppcheck-gui/cppcheck_sr.qm | |
121 | %lang(sv) %{_datadir}/cppcheck-gui/cppcheck_sv.qm | |
122 | %endif |