File pdfedit.spec of Package pdfedit

#
# spec file for package pdfedit
#
# Copyright (c) 2007-2008 Nikolay Derkach
# Copyright (c) 2009 Buschmann <buschmann23@opensuse.org>
#
# 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.
#

%define git 5efb58265d0b

Name:           pdfedit
Version:        0.4.5
Release:        0
License:        GPL-2.0
URL:            http://pdfedit.cz
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  qt3-devel
BuildRequires:  qt3-devel-tools
BuildRequires:  update-desktop-files
BuildRequires:  boost-devel
BuildRequires:  fdupes unzip autoconf
BuildRequires:  docbook_4
BuildRequires:  docbook-xsl-stylesheets
BuildRequires:  libxslt-devel
BuildRequires:  t1lib-devel
%if 0%{?suse_version} > 1210
BuildRequires:  libXpm-devel
%endif
%if 0%{?suse_version} > 1220
BuildRequires:  libpaper-devel
%endif
#BuildRequires:  openmotif-devel
Source0:        pdfedit-0.4.5.tar.bz2
# PATCH-FIX-FEDORA http://pkgs.fedoraproject.org/cgit/pdfedit.git/tree/pdfedit-fixbuild.patch
Patch1:         pdfedit-fixbuild.patch
Patch2:         pdfedit-fixbuild2.patch
Group:          Productivity/Publishing/PDF
Summary:        Complete PDF Editin Solution

%description
Free editor for PDF documents. Complete editing of PDF documents is possible with PDFedit.
You can change raw pdf objects (for advanced users) or use many gui functions.
Functionality can be easily extended using a scripting language (ECMAScript).

%package devel
License:        GPL-2.0
Group:          Development/Libraries/C and C++
Summary:        Include Files and Libraries Mandatory for Development
Requires:       %{name} = %{version}-%{release}

%description devel
Free editor for PDF documents. Complete editing of PDF documents is possible with PDFedit.
You can change raw pdf objects (for advanced users) or use many gui functions.
Functionality can be easily extended using a scripting language (ECMAScript).

%prep
%setup -q
%patch1 -p0 -b .fixbuild
%patch2 -p0
# fix paths to be relative to rpm build root

sed -i 's/\(.path\s\+= \)/\1$(QMAKE_DESTDIR)\//' src/gui/pdfedit.pro

%build
%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
export EXTRA_UTILS_CFLAGS=$RPM_OPT_FLAGS
export EXTRA_KERNEL_CFLAGS=$RPM_OPT_FLAGS
export EXTRA_TESTS_CFLAGS=$RPM_OPT_FLAGS
export EXTRA_UTILS_CXXFLAGS=$RPM_OPT_FLAGS
export EXTRA_KERNEL_CXXFLAGS=$RPM_OPT_FLAGS
export EXTRA_TEST_CXXFLAGS=$RPM_OPT_FLAGS
export EXTRA_GUI_CXXFLAGS=$RPM_OPT_FLAGS
export QTDIR=/usr/lib/qt3
export PATH=$QTDIR/bin:$PATH
export QMAKESPEC=$QTDIR/mkspecs/linux-g++ 

autoconf
autoupdate

echo '%{version}' > .scmversion

sed -i 's/-posix//g' ./configure

%configure \
    --enable-release \
    --enable-stack-protector \
    --disable-debug-info \
    --enable-pdfedit-core-dev \
    --enable-user-manual

sed -i 's/-posix//g' ./Makefile
make %{?jobs:-j%jobs}

%install
make install INSTALL_ROOT=$RPM_BUILD_ROOT

#icons
install -d \
  $RPM_BUILD_ROOT/%{_datadir}/icons/hicolor/{16x16,32x32,48x48,64x64}/apps
install -p -m 0644 src/gui/icon/pdfedit_icon_16.png \
  $RPM_BUILD_ROOT/%{_datadir}/icons/hicolor/16x16/apps/pdfedit.png
install -p -m 0644 src/gui/icon/pdfedit_icon_32.png \
  $RPM_BUILD_ROOT/%{_datadir}/icons/hicolor/32x32/apps/pdfedit.png
install -p -m 0644 src/gui/icon/pdfedit_icon_48.png \
  $RPM_BUILD_ROOT/%{_datadir}/icons/hicolor/48x48/apps/pdfedit.png
install -p -m 0644 src/gui/icon/pdfedit_icon_64.png \
  $RPM_BUILD_ROOT/%{_datadir}/icons/hicolor/64x64/apps/pdfedit.png

%fdupes $RPM_BUILD_ROOT/%_datadir

%suse_update_desktop_file -c %{name} "PDF editor" "Edit .pdf files" %{name} "%{name}" Office WordProcessor

%__chmod +x %{buildroot}%{_bindir}/pdfedit-core-dev-config
#%__chmod -x %{buildroot}%{_includedir}/%{name}-%{version}/os/win.h

%files
%defattr(-,root,root,-)
%{_bindir}/%{name}
%{_mandir}/man1/%{name}*
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/*.qs
%{_datadir}/%{name}/mode.conf
%{_datadir}/%{name}/operator.hint
%{_datadir}/%{name}/pdfeditrc
%{_datadir}/%{name}/icon
%{_datadir}/%{name}/scripts
%dir %{_datadir}/%{name}/lang
%lang(cs) %{_datadir}/%{name}/lang/%{name}_cs.qm
%lang(de) %{_datadir}/%{name}/lang/%{name}_de.qm
%lang(es) %{_datadir}/%{name}/lang/%{name}_es.qm
%lang(fr) %{_datadir}/%{name}/lang/%{name}_fr.qm
%lang(ru) %{_datadir}/%{name}/lang/%{name}_ru.qm
%lang(sk) %{_datadir}/%{name}/lang/%{name}_sk.qm
%lang(zh_TW) %{_datadir}/%{name}/lang/%{name}_zh_TW.qm
%dir %{_datadir}/%{name}/help
%doc %lang(cs) %{_datadir}/%{name}/help/cs
%{_datadir}/%{name}/help/images
%doc %lang(en) %{_datadir}/%{name}/help/index.html
%doc %lang(en) %{_datadir}/%{name}/help/keyboard.html
%doc %lang(en) %{_datadir}/%{name}/help/pdfedit.html
%doc %lang(en) %{_datadir}/%{name}/help/qsa-inputdialog.html
%doc %lang(en) %{_datadir}/%{name}/help/qsa-util.html
%doc %lang(en) %{_datadir}/%{name}/help/scripting.html
%{_datadir}/applications/*desktop
%{_datadir}/icons/hicolor
%doc %{_datadir}/doc/%{name}

%files devel
%defattr(-,root,root,-)
%{_bindir}/pdfedit-core-dev-config
%{_includedir}/%{name}-%{version}
%{_libdir}/%{name}-%{version}

%changelog
openSUSE Build Service is sponsored by