File wt.spec of Package wt

#
# spec file for package wt (Version 3.1.0)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild


Name:           wt
Url:            http://www.webtoolkit.eu/wt/
License:        GPLv2
Group:          Development/Libraries/C and C++
AutoReqProv:    on
Version:        3.1.2
Release:        1
Summary:        Web Toolkit
Source0:        %{name}-%{version}.tar.bz2
Patch1:         cmake_config.patch
Requires:       FastCGI openssl Xerces-c
Requires:       mxml >= 2.3
BuildRequires:  gcc-c++
BuildRequires:  FastCGI-devel Xerces-c-devel openssl-devel
BuildRequires:  boost-devel >= 1.34.1
BuildRequires:  mxml-devel >= 2.3
BuildRequires:  cmake doxygen gd-devel libqt4-devel pkgconfig
BuildRequires:  fdupes
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Wt is a C++ library and application server for developping and
deploying web applications. The widget-centric API is inspired by
existing C++ GUI APIs.	It offers complete abstraction of any
web-specific implementation details.  Most imporantly, the entire
application is written in only one compiled language (C++), from which
the library generates the necessary HTML, Javascript, CGI, and AJAX
code.



Authors:
--------
    Koen Deforche (koen.deforche@gmail.com)
    Abdiel Janulgue (xynopsis@yahoo.com)
    Wim Dumon (wim.dumon@gmail.com)

%package        devel
License:        GPLv2
Summary:        Web Toolkit
Group:          Development/Libraries/C and C++
Requires:       FastCGI-devel openssl-devel Xerces-c-devel
Requires:       boost-devel >= 1.34.1
Requires:       mxml-devel >= 2.3
Requires:       %{name} = %{version}

%description devel
Wt is a C++ library and application server for developping and
deploying web applications. The widget-centric API is inspired by
existing C++ GUI APIs.	It offers complete abstraction of any
web-specific implementation details.  Most imporantly, the entire
application is written in only one compiled language (C++), from which
the library generates the necessary HTML, Javascript, CGI, and AJAX
code.



Authors:
--------
    Koen Deforche (koen.deforche@gmail.com)
    Abdiel Janulgue (xynopsis@yahoo.com)
    Wim Dumon (wim.dumon@gmail.com)

%prep
%setup -q
%patch1

%build
%define WTSRVDIR /srv/wt
# path to runtime session data
%define WTRUNDIR %{WTSRVDIR}/run 
# webserve user and group
%define WTRUNUSER wwwrun 
%define WTRUNGROUP www 
mkdir wt-build
cd wt-build
CFLAGS=$RPM_OPT_FLAGS CXXFLAGS="$RPM_OPT_FLAGS" \
cmake .. \
    -DCMAKE_INSTALL_PREFIX="/usr" \
    -DLIB_INSTALL_DIR=%{_lib} \
    -DCONNECTOR_HTTP=ON \
    -DCONNECTOR_FCGI=ON \
    -DEXAMPLES_CONNECTOR="" \
    -DWEBGROUP="%{WTRUNGROUP}" -DWEBUSER="%{WTRUNUSER}" \
    -DRUNDIR="%{WTRUNDIR}"
make %{?jobs:-j%jobs}

%install
cd wt-build
make DESTDIR="%{buildroot}" install
# hack for broken cmake configs on archs with /lib64
%ifarch ppc64 s390x x86_64
mv %{buildroot}/usr/lib/* %{buildroot}/usr/%{_lib} || true
rm -Rf %{buildroot}/usr/lib
%endif
# end hack
mkdir -p %{buildroot}%{_docdir}/%{name}
mkdir -p %{buildroot}%{WTSRVDIR}
mkdir -p %{buildroot}%{WTRUNDIR}
sed "s /usr/wt/run %{WTRUNDIR} " < ../wt_config.xml > ../wt_config.xml.example
mkdir %{buildroot}%{_docdir}/%{name}-devel/
cp -rv ../doc/* %{buildroot}%{_docdir}/%{name}-devel/
mv -v %{buildroot}%{_datadir}/Wt %{buildroot}%{_datadir}/wt

# We mustn't package .orig files
find %{buildroot}%{_includedir}/Wt -name '*.orig' -delete

%fdupes %{buildroot}%{_docdir}
%fdupes %{buildroot}%{_datadir}

%clean
# ODKOMENTOVAT !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# rm -rf "%{buildroot}"

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root)
%{_libdir}/*.so.%{version}
%doc AUTHORS BUGS Changelog INSTALL LICENSE
%doc wt_config.xml.example
%dir %{WTSRVDIR}
%dir /etc/wt
%{_datadir}/wt
%config /etc/wt/wt_config.xml
%attr(-,%{WTRUNUSER},%{WTRUNGROUP}) %{WTRUNDIR}

%files devel
%defattr(-,root,root)
%{_includedir}/Wt
%exclude %{_libdir}/*.so.%{version}
%{_libdir}/*.so.*
%{_libdir}/*.so
%doc %{_docdir}/%{name}-devel
%{_datadir}/cmake/Modules/*

%changelog
openSUSE Build Service is sponsored by