File libpgf.spec of Package libpgf

#
# spec file for package libpgf
#
# 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 so_ver 6

Name:           libpgf
Version:        6.12.24
Release:        0
Summary:        Progressive Graphics File Library
License:        LGPL-2.1+
Group:          Productivity/Graphics/Other
Url:            http://www.libpgf.org/
Source0:        http://downloads.sourceforge.net/%{name}/%{name}-%{version}-src.tar.gz
# PATCH-FIX-UPSTREAM automake-1.13.patch sf#3608908 asterios.dramis@gmail.com -- Fix build with automake 1.13
Patch0:         automake-1.13.patch
BuildRequires:  doxygen
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  graphviz
BuildRequires:  libtool
BuildRequires:  pkg-config
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
libpgf is a library for working with PGF (Progresive Graphics File) images.

%package devel
Summary:        Development files for the libpgf library
Group:          Development/Libraries/C and C++
Requires:       libpgf%{so_ver} = %{version}

%description devel
This package contains header files and libraries needed for developing programs
using the libpgf library.

%package -n libpgf%{so_ver}
Summary:        Progressive Graphics File Library
Group:          System/Libraries

%description -n libpgf%{so_ver}
libpgf is a library for working with PGF (Progresive Graphics File) images.

%prep
%setup -q -n %{name}
%patch0

# Add "libpgf-" prefix to all man pages to prevent conflicts with other packages
sed -i 's/\/man\/man3\/\$\$f/\/man\/man3\/libpgf-\$\$f/' doc/Makefile.am

# Fix permissions (fix rpmlint errors "spurious-executable-perm" and "executable-docs")
chmod 644 COPYING README

# Fix rpmlint warning "wrong-file-end-of-line-encoding"
sed -i 's/\r$//' README

# Remove build time references so build-compare can do its work
sed -i "s/HTML_TIMESTAMP         = YES/HTML_TIMESTAMP         = NO/g" doc/Doxyfile.in

%build
sh autogen.sh
%configure --disable-static
make %{?_smp_mflags}

%install
make DESTDIR=%{buildroot} DOC_DIR=%{buildroot}%{_docdir}/%{name}-devel/ install

# Install additional documentation
install -pm 0644 COPYING README %{buildroot}%{_docdir}/%{name}-devel/

# Remove libtool config files
rm -f %{buildroot}%{_libdir}/*.la

# Remove unneeded man pages
rm -f %{buildroot}%{_mandir}/man3/libpgf-*rpmbuild*

%fdupes -s %{buildroot}

%post -n libpgf%{so_ver} -p /sbin/ldconfig

%postun -n libpgf%{so_ver} -p /sbin/ldconfig

%files devel
%defattr(-,root,root,-)
%doc %{_docdir}/%{name}-devel/
%{_includedir}/libpgf/
%{_libdir}/pkgconfig/libpgf.pc
%{_libdir}/libpgf.so
%{_mandir}/man3/libpgf-*.3%{ext_man}

%files -n libpgf%{so_ver}
%defattr(-,root,root,-)
%{_libdir}/libpgf.so.%{so_ver}*

%changelog
openSUSE Build Service is sponsored by