%define debug 0
%define final 0
%define make_cvs 1

%define arts 1

%define qt_version 3.3.5
%define kde_version 3.5.0

%define disable_gcc_check_and_hidden_visibility 1

Version: 3.5.0
Release: 1asp
Summary: WEB Development package for the K Desktop Environment.
Name: kdewebdev
Url: http://quanta.sourceforge.net/
Epoch: 6
Group: Applications/Editors
License: GPL
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
Prefix: %{_prefix}

Source: ftp://ftp.kde.org/pub/kde/stable/%{version}/src/%{name}-%{version}.tar.bz2
Source1: http://download.sourceforge.net/quanta/css.tar.bz2
Source2: http://download.sourceforge.net/quanta/html.tar.bz2
Source3: http://download.sourceforge.net/quanta/php_manual_en_20030401.tar.bz2
Source4: http://download.sourceforge.net/quanta/javascript.tar.bz2

Patch0: javascript.patch
Prereq: /sbin/ldconfig
Requires: kdelibs >= 6:%{kde_version}

BuildPrereq: qt-devel >= %{qt_version}
BuildPrereq: kdesdk-devel >= %{kde_version}
BuildPrereq: perl

Obsoletes: WebMaker
Obsoletes: quanta

%description
The kdewebdev package contains Quanta Plus and other applications, which are useful
for web development. They are runtime dependencies of Quanta Plus, and it is
highly recommended that you install them.

%package devel
Group: Development/Libraries
Summary: Header files and documentation for compiling kdewebdev applications.
Requires: kdelibs-devel >= 1:%{qt_version}
Requires: %{name} = %{epoch}:%{version}-%{release}
Obsoletes: quanta-devel

%description devel
This package includes the header files you will need to compile
applications for kdewebdev.


%prep
%setup -q -a 1 -a 2 -a 3 -a 4
%patch0 -p0 -b .javascript

%build
QTDIR="" && . /etc/profile.d/qt.sh

%if %{disable_gcc_check_and_hidden_visibility}
  # disable gcc check
  perl -pi -e "s|KDE_CHECK_FOR_BAD_COMPILER$|dnl KDE_CHECK_FOR_BAD_COMPILER|" admin/acinclude.m4.in
  # disable hidden visibility
  perl -pi -e "s|KDE_ENABLE_HIDDEN_VISIBILITY$|dnl KDE_ENABLE_HIDDEN_VISIBILITY|" configure.in.in
%endif

%if %{make_cvs}
  make -f admin/Makefile.common cvs
%endif

export CFLAGS="$RPM_OPT_FLAGS"
export CXXFLAGS="$RPM_OPT_FLAGS"

%configure \
   --disable-rpath \
%if %{arts} == 0
   --without-arts \
%endif
%if %{final}
   --enable-final \
%endif
   --with-qt-libraries=$QTDIR/lib

make %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT

make DESTDIR=$RPM_BUILD_ROOT install

# install docs
for i in css html javascript ; do
   pushd $i
   ./install.sh <<EOF
$RPM_BUILD_ROOT%{_datadir}/apps/quanta/doc
EOF
   popd
   rm -rf $i
done

cp -R php php.docrc $RPM_BUILD_ROOT%{_datadir}/apps/quanta/doc

# fix dangling symlinks
pushd $RPM_BUILD_ROOT%{_docdir}/HTML/en
for i in *; do
   if [ -d $i -a -L $i/common ]; then
      rm -f $i/common
      ln -s ../common $i
   fi
done
popd

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%doc %{_docdir}/HTML/en/*
%{_bindir}/*
%{_libdir}/*.so.*
%{_libdir}/*.la
%{_libdir}/kde3/*
%{_datadir}/applications/kde/*
%{_datadir}/applnk/.hidden/*
%{_datadir}/apps/*
%{_datadir}/config.kcfg/*
%{_datadir}/icons/*/*/*/*
%{_datadir}/mimelnk/application/*
%{_datadir}/services/*
%{_datadir}/servicetypes/*

%files devel
%defattr(-,root,root)
%{_libdir}/*.so
%{_includedir}/*

%changelog
* Fri Dec  2 2005 Arkady L. Shane <shejn@msiu.ru> 6:3.5.0-1asp
- 3.5.0

* Tue Oct 25 2005 Than Ngo <than@redhat.com> 6:3.4.92-1
- update to 3.5 beta2

* Mon Oct 10 2005 Than Ngo <than@redhat.com> 6:3.4.91-1
- update to 3.5 beta 1

* Mon Sep 26 2005 Than Ngo <than@redhat.com> 6:3.4.2-3
- remove tidy since it's included in extras #169217

* Thu Sep 22 2005 Than Ngo <than@redhat.com> 6:3.4.2-2
- fix uic build problem

* Thu Aug 11 2005 Than Ngo <than@redhat.com> 6:3.4.2-1
- update to 3.4.2

* Wed Jun 29 2005 Than Ngo <than@redhat.com> 6:3.4.1-1
- 3.4.1
- fix gcc4 build problem

* Wed May 04 2005 Than Ngo <than@redhat.com> 6:3.4.0-3
- apply patch to fix CAN-2005-0754, Kommander untrusted code execution,
  thanks to KDE security team

* Tue Apr 19 2005 Than Ngo <than@redhat.com> 6:3.4.0-2
- add kdesdk in buildrequires #155054

* Sat Mar 19 2005 Than Ngo <than@redhat.com> 6:3.4.0-1
- 3.4.0

* Fri Mar 04 2005 Than Ngo <than@redhat.com> 6:3.4.0-0.rc1.2
- rebuilt against gcc-4.0.0-0.31

* Mon Feb 28 2005 Than Ngo <than@redhat.com> 6:3.4.0-0.rc1.1
- 3.4.0 rc1

* Mon Feb 21 2005 Than Ngo <than@redhat.com> 6:3.3.92-0.1
- 3.4 beta2

* Fri Dec 03 2004 Than Ngo <than@redhat.com> 6:3.3.2-0.1
- update to 3.3.2
- add missing tidy for HTML syntax checking #140970

* Mon Oct 18 2004 Than Ngo <than@redhat.com> 6:3.3.1-2
- rebuilt

* Wed Oct 13 2004 Than Ngo <than@redhat.com> 6:3.3.1-1
- update to 3.3.1

* Thu Sep 16 2004 Than Ngo <than@redhat.com> 3.3.0-1
- update to 3.3.0

* Sat Jun 19 2004 Than Ngo <than@redhat.com> 3.2.3-1 
- update to 3.2.3

* Sun Apr 11 2004 Than Ngo <than@redhat.com> 3.2.2-0.1
- 3.2.2 release

* Fri Mar 05 2004 Than Ngo <than@redhat.com> 6:3.2.1-1
- 3.2.1 release

* Tue Mar 02 2004 Elliot Lee <sopwith@redhat.com>
- rebuilt

* Tue Feb 17 2004 Than Ngo <than@redhat.com> 6:3.2.0-1.2
- fix typo bug, _smp_mflags instead smp_mflags

* Fri Feb 13 2004 Elliot Lee <sopwith@redhat.com>
- rebuilt

* Wed Feb 11 2004 Than Ngo <than@redhat.com> 6:3.2.0-0.1
- 3.2.0 release
- built against qt 3.3.0

* Thu Jan 22 2004 Than Ngo <than@redhat.com> 6:3.1.95-0.1
- 3.2 RC1

* Thu Dec 11 2003 Than Ngo <than@redhat.com> 6:3.1.94-0.3
- fix build problem with new gcc

* Thu Dec 04 2003 Than Ngo <than@redhat.com> 6:3.1.94-0.2
- remove quanta-3.1.93-xml2.patch, which is included in upstream

* Mon Dec 01 2003 Than Ngo <than@redhat.com> 6:3.1.94-0.1
- KDE 3.2 Beta2

* Thu Nov 27 2003 Than Ngo <than@redhat.com> 6:3.1.93-0.3
- get rid of rpath

* Tue Nov 25 2003 Than Ngo <than@redhat.com> 6:3.1.93-0.2
- add fix to build against new libxml2 >= 2.6

* Thu Nov 13 2003 Than Ngo <than@redhat.com> 6:3.1.93-0.1
- KDE 3.2 Beta 1
- cleanup
- add devel package

* Tue Sep 30 2003 Than Ngo <than@redhat.com> 6:3.1.4-1
- 3.1.4

* Tue Aug 12 2003 Than Ngo <than@redhat.com> 6:3.1.3-1
- 3.1.3
- update php docs (bug #99073)
- desktop issue (bug #87602)


* Wed Jun 25 2003 Than Ngo <than@redhat.com> 3.1.2-4
- rebuilt

* Wed Jun 04 2003 Elliot Lee <sopwith@redhat.com>
- rebuilt

* Tue May 20 2003 Than Ngo <than@redhat.com> 3.1.2-2
- 3.1.2

* Thu Mar 20 2003 Than Ngo <than@redhat.com> 3.1.1-1
- 3.1.1

* Fri Jan 31 2003 Than Ngo <than@redhat.com> 3.1-1
- 3.1 final

* Sat Nov 30 2002 Than Ngo <than@redhat.com> 3.1-0.2
- cleanup scpecfile
- desktop file issue
- add missing %post, %postun ldconfig
- remove po files, it's now in kde-i18n stuff

* Thu Nov 28 2002 Than Ngo <than@redhat.com> 3.1-0.1
- update to 3.1 rc4

* Fri Aug 23 2002 Phil Knirsch <pknirsch@redhat.com> 3.0-0.pr1.5
- Rebuilt with new qt.

* Mon Aug 12 2002 Tim Powers <timp@redhat.com> 3.0-0.pr1.4
- rebuilt with gcc-3.2

* Sun Aug  4 2002 han Ngo <than@redhat.com> 3.0-0.pr1.3
- 3.0-pr1 release
- fixed desktop file issue

* Tue Jul 23 2002 Tim Powers <timp@redhat.com> 3.0-0.pr1.2
- build using gcc-3.2-0.1

* Sun Jul 14 2002 Than Ngo <than@redhat.com> 3.0-0.pr1.1
- 3.0-pr1 fixed bug #68268
- use desktop-file-install

* Fri Jun 21 2002 Tim Powers <timp@redhat.com>
- automated rebuild

* Sun May 26 2002 Tim Powers <timp@redhat.com>
- automated rebuild

* Thu May 23 2002 Bernhard Rosenkraenzer <bero@redhat.com> 2.1-0.cvs20020523.1
- Update, fix build with current toolchain

* Tue Apr 16 2002 Than Ngo <than@redhat.com> 2.1-0.cvs20020404.2
- rebuild

* Thu Apr  4 2002 Bernhard Rosenkraenzer <bero@redhat.com> 2.1-0.cvs20020404.1
- Fix bug #62648

* Tue Mar 26 2002 Bernhard Rosenkraenzer <bero@redhat.com> 2.1-0.cvs20020326.1
- Update
- %%langify spec file
- Move desktop file to /etc/X11/applnk; quanta is generally useful

* Tue Jan 29 2002 Bernhard Rosenkraenzer <bero@redhat.com> 2.1-0.cvs20020129.1
- Update, fix build, KDE3ify

* Thu Aug 23 2001 Than Ngo <than@redhat.com> 2.0-0.cvs20010724.2
- fix quanta crashes on exit (Bug #51180)
- fix bad character (Bug #51509)

* Tue Jul 24 2001 Bernhard Rosenkraenzer <bero@redhat.com> 2.0-0.cvs20010724.1
- langify
- remove ia64 workarounds
- update

* Mon Jul 23 2001 Bernhard Rosenkraenzer <bero@redhat.com> 2.0-0.cvs20010723.1
- Update
- Make symlinks relative

* Thu Feb 22 2001 Than Ngo <than@redhat.com>
- update to 2.0pr1

* Wed Feb  7 2001 Bernhard Rosenkraenzer <bero@redhat.com>
- Update to get rid of libkdefakes.so.0 requirement

* Thu Jan  4 2001 Bernhard Rosenkraenzer <bero@redhat.com>
- Initial build, obsoletes WebMaker
