Blob Blame History Raw
Name:           krazy2
Version:        2.9
Release:        4.20090928svn%{?dist}
Summary:        Krazy is a tool for checking code against the KDE coding guidelines

Group:          Development/Libraries
License:        GPLv2+
URL:            http://techbase.kde.org/Development/Tutorials/Code_Checking
# The source for this package was pulled from upstream's vcs.  Use the
# following commands to generate the tarball:
#  svn export -r 1029034 svn://anonsvn.kde.org/home/kde/trunk/quality/krazy2 krazy2-2.8
#  tar -c krazy2-2.9 | bzip2 --best -c > krazy2-2.9.tar.bz2
Source0:        krazy2-%{version}.tar.bz2
Source1:        krazy-licensecheck
Patch0:         krazy2-prefix.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

# krazy-licensecheck moved from kdesdk to here in 4.2.0
Conflicts:      kdesdk < 4.2.0

BuildRequires:  groff
BuildRequires:  perl(ExtUtils::MakeMaker)
BuildRequires:  perl(HTML::Parser)
BuildRequires:  perl(Tie::IxHash)
BuildRequires:  perl(XML::LibXML)
BuildRequires:  qt4-devel
BuildRequires:  cmake
BuildRequires:  kdelibs4-devel
BuildRequires:  kdevplatform-devel
Requires:       perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
# Krazy2 uses desktop-file-validate, so this is an actual Requires
Requires:       desktop-file-utils

%description
Krazy scans KDE source code looking for issues that should be fixed
for reasons of policy, good coding practice, optimization, or any other
good reason.


%prep
%setup -q
%patch0


%build
%{__perl} Makefile.PL INSTALLDIRS=vendor
make
pushd src/passbyvalue
%{_qt4_qmake}
make %{?_smp_mflags}
popd
pushd cppchecks
%{cmake}
make VERBOSE=1 %{?_smp_mflags}
popd


%install
rm -rf %{buildroot}
make DESTDIR=%{buildroot} PREFIX=%{_prefix} install
chmod 0755 %{buildroot}%{_bindir}/krazy2{,all,xml}
pushd helpers
make DESTDIR=%{buildroot} PREFIX=%{_prefix} \
    %if "%{_lib}" == "lib64"
        LIBSUFFIX=64 \
    %endif
    install
popd
pushd plugins
make PREFIX=%{buildroot}%{_prefix} \
    %if "%{_lib}" == "lib64"
        LIBSUFFIX=64 \
    %endif
    install
popd
pushd extras
make DESTDIR=%{buildroot} PREFIX=%{_prefix} \
    %if "%{_lib}" == "lib64"
        LIBSUFFIX=64 \
    %endif
    install
popd
pushd src/passbyvalue
make INSTALL_ROOT=%{buildroot}%{_prefix} \
    %if "%{_lib}" == "lib64"
        LIBSUFFIX=64 \
    %endif
    install
popd
pushd share
mkdir -p %{buildroot}%{_datadir}/dtd
install -m 644 -p kpartgui.dtd %{buildroot}%{_datadir}/dtd/kpartgui.dtd
install -m 644 -p kcfg.dtd %{buildroot}%{_datadir}/dtd/kcfg.dtd
popd
pushd doc
make DESTDIR=%{buildroot} PREFIX=%{_prefix} install
popd
install -m 755 %{SOURCE1} %{buildroot}%{_bindir}/krazy-licensecheck
pushd cppchecks
make DESTDIR=%{buildroot} PREFIX=%{_prefix} install
popd
find %{buildroot} -type f -name .packlist -exec rm -f {} ';'
find %{buildroot} -type f -name perllocal.pod -exec rm -f {} ';'
find %{buildroot} -depth -type d -exec rmdir {} 2>/dev/null ';'


%clean
rm -rf %{buildroot}


%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig


%files
%defattr(-,root,root,-)
%doc COPYING README
%{_mandir}/man1/krazy2.1.gz
%{_mandir}/man1/krazy2all.1.gz
%{_mandir}/man1/krazy2xml.1.gz
%{_mandir}/man5/krazyrc.5.gz
%{_bindir}/krazy-licensecheck
%{_bindir}/krazy2
%{_bindir}/krazy2all
%{_bindir}/krazy2xml
%{_libdir}/libcpp_parser.so
%{_libdir}/libcppmodel.so
%{_libdir}/libpreprocessor.so
%{_libdir}/libcheckutil.so
%{_libdir}/libcheckutil.so.1
%{_libdir}/libcheckutil.so.1.0
%{_libdir}/krazy2/
%{_datadir}/dtd/
%{perl_vendorlib}/Krazy/


%changelog
* Tue Sep 29 2009 Ben Boeckel <MathStuf@gmail.com> 2.9-4.20090928svn
- Update snapshot
- krazy2ebn is gone
- Use kdevplatform by default now

* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.9-3.20090719svn
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Mon Jul 20 2009 Ben Boeckel <MathStuf@gmail.com> 2.9-2.20090719svn
- Fix %%changelog
- Fix CVS mistakes (update tarball)

* Mon Jul 20 2009 Ben Boeckel <MathStuf@gmail.com> 2.9-1.20090719svn
- Updated SVN
- Conditionalize patch
- Fix DESTDIR/PREFIX for doc
- Remove %%check section

* Mon Mar 16 2009 Ben Boeckel <MathStuf@gmail.com> 2.8-9.20090314svn
- Updated SVN

* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.8-8.20090127svn
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Thu Jan 29 2009 Ben Boeckel <MathStuf@gmail.com> 2.8-7.20090127svn
- Updated SVN

* Sat Jan 24 2009 Ben Boeckel <MathStuf@gmail.com> 2.8-6.20090113svn916151
- Added flag for building with kdevplatform
- Removed patches applied upstream

* Tue Jan 13 2009 Ben Boeckel <MathStuf@gmail.com> 2.8-5.20090111svn909634
- Typo with sources

* Tue Jan 13 2009 Ben Boeckel <MathStuf@gmail.com> 2.8-4.20090111svn909634
- Forgot to commit krazy-licensecheck

* Tue Jan 13 2009 Ben Boeckel <MathStuf@gmail.com> 2.8-3.20090111svn909634
- Missed the patch

* Tue Jan 13 2009 Ben Boeckel <MathStuf@gmail.com> 2.8-2.20090111svn909634
- Moved krazy-licensecheck from kdesdk to here

* Tue Jan 6 2009 Ben Boeckel <MathStuf@gmail.com> 2.8-1.20090105svn906738
- New plugins and extra checks
- Updated plugins

* Wed Oct 8 2008 Ben Boeckel <MathStuf@gmail.com> 2.6-6.20081008svn869261
- Updated SVN
- Patch applied upstream

* Tue Sep 23 2008 Ben Boeckel <MathStuf@gmail.com> 2.6-5.20080923svn862962
- Updated SVN

* Thu Sep 18 2008 Ben Boeckel <MathStuf@gmail.com> 2.6-4.20080918svn862357
- Updated SVN
- Spec file cleaned up

* Thu Sep 18 2008 Ben Boeckel <MathStuf@gmail.com> 2.6-3
- Fixed where the plugins get installed to

* Wed Sep 17 2008 Ben Boeckel <MathStuf@gmail.com> 2.6-2
- Fixed the rpmlint errors

* Wed Sep 17 2008 Ben Boeckel <MathStuf@gmail.com> 2.6-1
- Fixed the spec file up

* Wed May 21 2008 Ben Boeckel <MathStuf@gmail.com> 1.11-1
- Created