%define DATE 20020415
%define sourcedir stable/%{version}/distribution/tar/generic/source
%define is_release 1
%define beta %{nil}
Version: 2.0a54
%define rel 1%{?_dist_release}
%if "%{beta}" != ""
%define VER %{version}%{beta}
%else
%define VER %{version}
%endif

Name: kdoc
Summary: KDOC -- C++ and IDL Source Documentation System
%if %{is_release}
Source: ftp://ftp.kde.org/pub/kde/%{sourcedir}/kdoc-%{VER}.tar.bz2
%else
Source: ftp://ftp.kde.org/pub/kde/%{sourcedir}/kdoc-%{DATE}.tar.bz2
%endif
Release: %{rel}
Epoch: 1
Group: Development/Tools
License: GPL

BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: perl >= 5.6.1 autoconf automake15
BuildRequires: qt-devel
Requires: perl >= 5.6.1
BuildArch: noarch

%description
Documentation tools for the K Desktop Environment.
KDOC creates cross-referenced documentation for C++ and CORBA IDL libraries
directly from the source. Documentation can be embedded in special doc
comments in the source.

%prep
%if %{is_release}
%setup -q -n %{name}-%{VER}
%else
%setup -q -n %{name}
%endif

# Workaround for legacy auto* tools
[ -x /usr/bin/autoconf-2.5? ] && ln -s /usr/bin/autoconf-2.5? autoconf
[ -x /usr/bin/autoheader-2.5? ] && ln -s /usr/bin/autoheader-2.5? autoheader
[ -x /usr/bin/aclocal-1.5 ] && ln -s /usr/bin/aclocal-1.5 aclocal
[ -x /usr/bin/automake-1.5 ] && ln -s /usr/bin/automake-1.5 automake
export PATH=`pwd`:$PATH
# End workaround

make -f Makefile.cvs

%build
export KDEDIR=/usr
. /etc/profile.d/qt.sh
if [ -x /usr/bin/getconf ]; then
  CPUS=`getconf _NPROCESSORS_ONLN`
fi
if test "x$CPUS" = "x" -o "x$CPUS" = "x0"; then
  CPUS=1
fi
CXXFLAGS="$RPM_OPT_FLAGS -I%{_includedir}/kde" %configure 
make -j $CPUS CXXFLAGS="$RPM_OPT_FLAGS -DNO_DEBUG -DNDEBUG"

%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR="$RPM_BUILD_ROOT" install

rm -rf docs
cp -a $RPM_BUILD_ROOT/usr/share/doc/kdoc docs
rm -rf $RPM_BUILD_ROOT%{_docdir}

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%doc COPYING docs/*
%{_bindir}/*
%dir %{_datadir}/kdoc
%{_datadir}/kdoc/*
%{_mandir}/*/*

%changelog
* Sun May 10 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.0a54-1
- applied new versioning policy
- added BuildRequires: qt-devel

* Sun Oct 22 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.0a54-0vl2
- changed Group to Development/Tools

* Mon May 20 2002 AKIYAMA Kazuhito <akiyama@karen.servepics.com> 2.0a54-0vl1
- Update to 2.0a54
- Epoch: 1
- change Summary and description

* Sat Mar 16 2002 AKIYAMA Kazuhito <akiyama@karen.servepics.com> 2.2.2-0vl1
- Update to 2.2.2

* Sun Oct 14 2001 AKIYAMA Kazuhito <akiyama@karen.servepics.com> 2.2.1-1vl1
- Update to 2.2.1
- Delete Epoch
- Add BuildPrereq and Requires
- Build for VineSeed

* Mon Aug  6 2001 Bernhard Rosenkraenzer <bero@redhat.com> 2.2-1
- 2.2 final

* Wed Jun 27 2001 Bernhard Rosenkraenzer <bero@redhat.com>
- 2.2 beta 1

* Wed Feb 21 2001 Bernhard Rosenkraenzer <bero@redhat.com>
- 2.1-respin

* Tue Feb 20 2001 Bernhard Rosenkraenzer <bero@redhat.com>
- 2.1

* Sun Feb 18 2001 Bernhard Rosenkraenzer <bero@redhat.com>
- Update

* Tue Nov 28 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- 2.0.1

* Wed Nov  1 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- Update to current CVS, this should finally be able to generate the kdelibs
  docs

* Fri Oct 27 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- Update to KDE_2_0_BRANCH, now that the ".0 release" bugs are fixed.
- Fix build on 6.x systems

* Mon Oct 23 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- 2.0 final

* Wed Oct  4 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- 2.0rc2
- clean up spec file

* Tue Jul 18 2000 Trond Eivind Glomsrxd <teg@redhat.com>
- drop icon (glint is obsolete)
- "License" replaces "Copyright"
- use %%docdir
- different releasenumber scheme, the old one can't be used 
  for tools and makes fixing specfiles hard

* Thu Jul 13 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- SMPify
- Don't hardcode QTDIR

* Tue Jul 11 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- new snapshot

* Tue Jun 27 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- Fix build if %%{_mandir} = /usr/man

* Sun Jun 20 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- new snapshot
- FHSify

* Mon Apr  3 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- fix compatibility with perl 5.6.0

* Sat Mar 18 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- new snapshot
- remove renaming to kdoc2 etc, move to /usr

* Wed Mar 15 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- New snapshot
- Make gzipped man pages optional

* Tue Feb  1 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- handle compressed man pages
- new snapshot

* Wed Jan 12 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- fix up the makekde2doc script (add missing semicolon)

* Thu Jan  6 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- new snapshot
- get ready for powertools 6.2
- make it a noarch package; it's just perl scripts

* Thu Dec 16 1999 Bernhard Rosenkraenzer <bero@redhat.de>
- initial RPM
