]> git.pld-linux.org Git - packages/cppcheck.git/blob - cppcheck.spec
- package cppcheck(1) manual
[packages/cppcheck.git] / cppcheck.spec
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:  sed >= 4.0
24 BuildRequires:  tinyxml-devel
25 %if %{with gui}
26 BuildRequires:  QtGui-devel >= 4
27 BuildRequires:  QtHelp-devel >= 4
28 BuildRequires:  qt4-linguist >= 4
29 BuildRequires:  qt4-qmake >= 4
30 %endif
31 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33 %description
34 cppcheck is an analysis tool for C/C++ code. Unlike C/C++ compilers
35 and many other analysis tools, it doesn't detect syntax errors.
36 cppcheck only detects the types of bugs that the compilers normally
37 fail to detect. The goal is no false positives.
38
39 %description -l pl.UTF-8
40 cppcheck to narzędzie do analizy kodu w C/C++. W przeciwieństwie do
41 kompilatorów i innych narzędzi do analizy, nie wykrywa błędów
42 składni. Wykrywa tylko te rodzaje błędów, których zwykle nie wykrywają
43 kompilatory. Celem jest brak fałszywych alarmów.
44
45 %package gui
46 Summary:        Qt4-based GUI for cppcheck
47 Summary(pl.UTF-8):      Oparty na Qt4 graficzny interfejs użytkownika do cppcheck
48 Group:          X11/Applications
49 Requires:       %{name} = %{version}-%{release}
50
51 %description gui
52 Qt4-based GUI for cppcheck.
53
54 %description gui -l pl.UTF-8
55 Oparty na Qt4 graficzny interfejs użytkownika do cppcheck.
56
57 %prep
58 %setup -q
59 %patch0 -p1
60
61 %{__sed} -i -e 's,-I[^ ]*/externals,,g' lib/lib.pri
62
63 %build
64 %{__make} all man \
65         CXX="%{__cxx}" \
66         CXXFLAGS="%{rpmcxxflags} -DNDEBUG -DHAVE_RULES -DTIXML_USE_STL -Wall" \
67         INCLUDE_FOR_CLI="-Ilib" \
68         INCLUDE_FOR_TEST="-Ilib -Icli" \
69         LDFLAGS="%{rpmldflags} -lpcre" \
70         TINYXML="%{_libdir}/libtinyxml.so" \
71         DB2MAN=%{_datadir}/sgml/docbook/xsl-stylesheets/manpages/docbook.xsl
72
73 %if %{with gui}
74 cd gui
75 qmake-qt4 \
76         QMAKE_CXX="%{__cxx}" \
77         QMAKE_CXXFLAGS_RELEASE="%{rpmcxxflags}" \
78         QMAKE_LFLAGS_RELEASE="%{rpmldflags}"
79 %{__make}
80 lrelease-qt4 cppcheck_*.ts
81 # compiled version not used yet (code refers to manual.html at sf.net)
82 #cd help
83 #%{_libdir}/qt4/bin/qcollectiongenerator online-help.qhcp -o online-help.qhc
84 %endif
85
86 %install
87 rm -rf $RPM_BUILD_ROOT
88
89 %{__make} install \
90         DESTDIR=$RPM_BUILD_ROOT \
91         TINYXML="%{_libdir}/libtinyxml.so" 
92
93 install -Dp cppcheck.1 $RPM_BUILD_ROOT%{_mandir}/man1/cppcheck.1
94
95 %if %{with gui}
96 install -d $RPM_BUILD_ROOT{%{_bindir},%{_datadir}/cppcheck-gui}
97 install gui/cppcheck-gui $RPM_BUILD_ROOT%{_bindir}
98 install -p gui/cppcheck_*.qm $RPM_BUILD_ROOT%{_datadir}/cppcheck-gui
99 %{__make} -C gui install \
100         DESTDIR=$RPM_BUILD_ROOT
101 %endif
102
103 %clean
104 rm -rf $RPM_BUILD_ROOT
105
106 %files
107 %defattr(644,root,root,755)
108 %doc AUTHORS Changelog readme.txt
109 %attr(755,root,root) %{_bindir}/cppcheck
110 %{_mandir}/man1/cppcheck.1*
111
112 %if %{with gui}
113 %files gui
114 %defattr(644,root,root,755)
115 %doc readme_gui.txt
116 %attr(755,root,root) %{_bindir}/cppcheck-gui
117 %dir %{_datadir}/cppcheck-gui
118 %lang(de) %{_datadir}/cppcheck-gui/cppcheck_de.qm
119 %{_datadir}/cppcheck-gui/cppcheck_en.qm
120 %lang(es) %{_datadir}/cppcheck-gui/cppcheck_es.qm
121 %lang(fi) %{_datadir}/cppcheck-gui/cppcheck_fi.qm
122 %lang(fr) %{_datadir}/cppcheck-gui/cppcheck_fr.qm
123 %lang(ja) %{_datadir}/cppcheck-gui/cppcheck_ja.qm
124 %lang(nl) %{_datadir}/cppcheck-gui/cppcheck_nl.qm
125 %lang(pl) %{_datadir}/cppcheck-gui/cppcheck_pl.qm
126 %lang(ru) %{_datadir}/cppcheck-gui/cppcheck_ru.qm
127 %lang(sr) %{_datadir}/cppcheck-gui/cppcheck_sr.qm
128 %lang(sv) %{_datadir}/cppcheck-gui/cppcheck_sv.qm
129 %endif
This page took 0.536415 seconds and 4 git commands to generate.