File podofo.spec of Package podofo

#
# spec file for package podofo
#
# Copyright (c) 2013 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/
#


%define libver 0_9_2

Name:           podofo
Version:        0.9.2
Release:        0
Summary:        Tools to work with PDF files
License:        GPL-2.0+
Group:          Productivity/Publishing/PDF
Url:            http://podofo.sourceforge.net/
Source0:        http://downloads.sourceforge.net/podofo/%{name}-%{version}.tar.gz
# PATCH-FIX-UPSTREAM podofo-0.9.2-soname.patch http://sourceforge.net/apps/mantisbt/podofo/view.php?id=54 asterios.dramis@gmail.com -- Update the soname of the library
Patch0:         podofo-0.9.2-soname.patch
BuildRequires:  cmake >= 2.5
BuildRequires:  doxygen
BuildRequires:  fdupes
BuildRequires:  fontconfig-devel
BuildRequires:  freetype2-devel
BuildRequires:  gcc-c++
BuildRequires:  libcppunit-devel
BuildRequires:  libidn-devel
BuildRequires:  libjpeg-devel
BuildRequires:  libpng-devel
BuildRequires:  libtiff-devel
%if 0%{?suse_version} > 1210
BuildRequires:  lua51-devel
%else
BuildRequires:  lua-devel
%endif
BuildRequires:  openssl-devel
BuildRequires:  zlib-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Command line tools for working with PDF files.

%package -n libpodofo%{libver}

Summary:        PDF parsing and creation library
License:        LGPL-2.1+
Group:          System/Libraries

%description -n libpodofo%{libver}
A cross platform PDF parsing and creation library.

%package -n libpodofo-devel
Summary:        Development files for podofo
License:        LGPL-2.1+
Group:          Development/Libraries/Other
Requires:       libpodofo%{libver} = %{version}

%description -n libpodofo-devel
This package contains development files for podofo library.

%prep
%setup -q
%patch0 -p1

# Remove build time references so build-compare can do its work
echo "HTML_TIMESTAMP = NO" >> Doxyfile

%build
export CFLAGS="%{optflags} -fno-strict-aliasing"
export CXXFLAGS="$CFLAGS"

mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} -DPODOFO_BUILD_STATIC=FALSE -DPODOFO_USE_VISIBILITY=1 \
%if "%{_lib}" == "lib64"
-DWANT_LIB64=1 \
%endif
../
make %{?_smp_mflags} VERBOSE=1
cd ..

# Build devel docs
doxygen

%install
pushd build
%makeinstall
popd

# Install devel docs (do it manually to fix also rpmlint warning "files-duplicate" with %%fdupes)
mkdir -p %{buildroot}%{_docdir}/libpodofo-devel
install -pm 0644 AUTHORS COPYING.LIB ChangeLog FAQ.html README.html TODO %{buildroot}%{_docdir}/libpodofo-devel/
cp -a doc/html/ %{buildroot}%{_docdir}/libpodofo-devel/

%fdupes -s %{buildroot}

%post -n libpodofo%{libver} -p /sbin/ldconfig

%postun -n libpodofo%{libver} -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%doc AUTHORS COPYING README.html
%{_bindir}/*
%doc %{_mandir}/man1/podofo*.1%{ext_man}

%files -n libpodofo%{libver}
%defattr(-,root,root,-)
%{_libdir}/libpodofo.so.%{version}

%files -n libpodofo-devel
%defattr(-,root,root,-)
%doc %{_docdir}/libpodofo-devel/
%{_includedir}/podofo/
%{_libdir}/libpodofo.so

%changelog
openSUSE Build Service is sponsored by