A new user interface for you! Read more...

File qjson.spec of Package qjson

Name:           qjson
Version:        0.7.1
Release:        4%{?dist}
Summary:        A qt-based library that maps JSON data to QVariant objects

Group:          Development/Languages
License:        GPLv2+
URL:            http://sourceforge.net/projects/qjson/
Source0:        http://downloads.sourceforge.net/project/qjson/qjson/0.7.1/qjson-0.7.1.tar.bz2
BuildRoot:  %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRoot:  %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRequires: redhat-rpm-config redhat-release

BuildRequires:  gcc-c++
BuildRequires:  qt4-devel
BuildRequires:  cmake >= 2.6
BuildRequires:  doxygen

%description
JSON is a lightweight data-interchange format. It can represents integer, real
number, string, an ordered sequence of value, and a collection of
name/value pairs.QJson is a qt-based library that maps JSON data to
QVariant objects.

%package devel
Summary:  Development files for qjson
Group:    Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: qt-devel >= 4.0
Requires: pkgconfig
Requires: cmake

%description devel
The %{name}-devel package contains the libraries and header files required for
developing applications that use %{name}.

%prep
%setup -qn qjson

%build
mkdir -p %{_target_platform}
pushd %{_target_platform}
%{cmake} -DQJSON_BUILD_TESTS=1  -DCMAKE_MODULES_INSTALL_DIR=%{_datadir}/cmake/Modules/  ..
cd %{_builddir}/%{buildsubdir}/doc
doxygen
popd

sed -i -e 's/-fno-exceptions -fno-check-new -fno-common//' \
-e 's/-fno-threadsafe-statics -fvisibility=hidden -fvisibility-inlines-hidden//' \
-e 's/-ansi//' %{_target_platform}/src/CMakeFiles/qjson.dir/flags.make

make %{?_smp_mflags} -C %{_target_platform}

%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot} -C %{_target_platform}

%check
LD_PRELOAD=%{_target_platform}/%{_lib}/libqjson.so \
           %{_target_platform}/tests/testparser
LD_PRELOAD=%{_target_platform}/%{_lib}/libqjson.so \
           %{_target_platform}/tests/testserializer

%clean
rm -rf %{buildroot}

%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%doc COPYING
%{_libdir}/*.so.*

%files devel
%defattr(-,root,root,-)
%doc doc/html
%{_includedir}/qjson/
%{_libdir}/pkgconfig/*.pc
%{_datadir}/cmake/Modules/FindQJSON.cmake
%{_libdir}/*.so

%changelog