Blob Blame History Raw
Name:           krazy2
Version:        2.8
Release:        5.20090111svn909634%{?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 909634 svn://anonsvn.kde.org/home/kde/trunk/quality/krazy2 krazy2-2.8
#  tar -c krazy2-2.8 | bzip2 --best -c > krazy2-2.8.tar.bz2
Source0:        krazy2-%{version}.tar.bz2
# TODO: Remove if/when 4.2 hits F9 and F10
%if 0%{?fedora} > 10
Source1:        krazy-licensecheck
Patch0:         checkutil-libsuffix.patch
%endif
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  groff
BuildRequires:  perl(ExtUtils::MakeMaker)
BuildRequires:  perl(HTML::Parser)
BuildRequires:  perl(Tie::IxHash)
BuildRequires:  perl(XML::LibXML)
BuildRequires:  qt4-devel
# FIXME: Needs KDevPlatform4
# 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
%if 0%{?fedora} > 10
%patch0
%endif


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


%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=%{buildroot} PREFIX=%{_prefix} install
chmod 0755 %{buildroot}%{_bindir}/krazy2{,all,ebn}
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}%{_mandir} install
popd
%if 0%{fedora} > 10
install -m 644 %{SOURCE1} %{buildroot}%{_bindir}/krazy-licensecheck
%endif
# FIXME: Needs KDevelop4
# pushd cppchecks
# make DESTDIR=%{buildroot} PREFIX=%{_prefix} install
# popd
find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} ';'
find $RPM_BUILD_ROOT -type f -name perllocal.pod -exec rm -f {} ';'
find $RPM_BUILD_ROOT -depth -type d -exec rmdir {} 2>/dev/null ';'
# chmod -R ug+w %{buildroot}%{_bindir}
# chmod -R ug+w %{buildroot}%{_libdir}


%check


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
%doc COPYING README
%{_mandir}/man1/krazy2.1.gz
%{_mandir}/man1/krazy2all.1.gz
%{_mandir}/man1/krazy2ebn.1.gz
%{_mandir}/man5/krazyrc.5.gz
%if 0%{fedora} > 10
%{_bindir}/krazy-licensecheck
%endif
%{_bindir}/krazy2
%{_bindir}/krazy2all
%{_bindir}/krazy2ebn
%{_libdir}/krazy2
%{_datadir}/dtd
%{perl_vendorlib}/Krazy


%changelog
* 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