LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File acroread.spec of Package acroread (Project devel:openSUSE:Factory)

# spec file for package acroread
# 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/

Name:           acroread
BuildRequires:  ed
BuildRequires:  openldap2-client
BuildRequires:  update-desktop-files
BuildRequires:  xorg-x11-devel
%if %suse_version < 1030
BuildRequires:  libicu
%if %suse_version > 1020
BuildRequires:  fdupes
BuildRequires:  libcurl4
Url:            http://www.adobe.com/products/acrobat/readermain.html
Provides:       linux-ar
%if %suse_version < 1030
Requires:       libcrypto.so.0.9.7
Requires:       libcurl.so.3
Requires:       libgcc_s.so.1
Requires:       libicudata.so.34
Requires:       libicui18n.so.34
Requires:       libicuuc.so.34
Requires:       libssl.so.0.9.7
Requires:       libstdc++.so.6
%elseif %suse_version >= 1030
Requires:       libcrypto.so.0.9.8
Requires:       libcurl.so.4
Requires:       libgcc_s.so.1
Requires:       libssl.so.0.9.8
Requires:       libstdc++.so.6
%if %suse_version >= 1220
Requires:       xdpyinfo
Requires:       ISO8859-1.so
Requires:       UTF-16.so
Recommends:     acroread-browser-plugin
Summary:        Adobe Reader for PDF Files
License:        SUSE-NonFree
Group:          Productivity/Publishing/PDF
Source10:       acroread.desktop
Source20:       acroread.png
Source30:       suse-do-not-grab-server.tar.bz2
Source40:       acroread.patch
Source50:       acroread-rpmlintrc
Patch0:         install.patch
# this Version is reported when calling "acroread -version"
Version:        9.5.5
Release:        0
Source0:        ftp://ftp.adobe.com/pub/adobe/reader/unix/9.x/%{version}/enu/AdbeRdr%{version}-1_i486linux_enu.tar.bz2
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires:       coreutils
Requires:       openldap2-client
NoSource:       0
ExclusiveArch:  %ix86

Acroread is a well known PDF viewer.

Adobe Reader is often the only program able to process complicated PDF
files, such as PDF forms. However, there are many bugs where we cannot
do anything about because it is proprietary binary-only software.

Please consider whether it is possible to use free PDF readers like
okular, evince, xpdf, ghostview, ... instead.

    Adobe Systems Incorporated

%package browser-plugin
Summary:        Browser plugin of Adobe Reader
Group:          Productivity/Publishing/PDF
Requires:       acroread = %{version}

%description browser-plugin
Adobe Reader browser plugin to view PDF files in the webbrowser

%define my_provides /tmp/my-provides
%define my_requires /tmp/my-requires
%define INSTALL_DIR /usr/lib
%define _use_internal_dependency_generator 0

# unpack the Source into a suitable directory
# there is the top-level directory "AdobeReader" in the source archive
%setup -n AdobeReader
# apply Patch0 to skip the "OutputLicense" dialog in the INSTALL script
# retrieve the gif for desktop
tar -xvf COMMON.TAR Adobe/Reader9/Resource/Icons/128x128/AdobeReader9.png
tar -xvf COMMON.TAR Adobe/Reader9/Resource/Shell/acroread.1.gz

# there is nothing to build as this package is a binary-only package
# but we build a preload library to work around bug #375551:
tar xf %{S:30}
make -C suse-do-not-grab-server

# skip the automated stripping because this damages some functionality
# for example a stripped AcroForm.api can no longer fill in forms
# see bug 28717 for details
export NO_BRP_STRIP_DEBUG="true"
# stuff to be done before the installation
# do the installation
# stuff to be done after the installation
rm -rf %{buildroot}%INSTALL_DIR/Adobe/Reader9/bin/UNINSTALL
# set the correct install_dir in the "acroread" start script
# to be safe to note changes in new versions do a test before
grep -q '^install_dir=' %{buildroot}%INSTALL_DIR/Adobe/Reader9/bin/acroread || exit 1
sed -i -e 's:^install_dir=.*$:install_dir="/usr/lib/Adobe/Reader9/Reader":' %{buildroot}%INSTALL_DIR/Adobe/Reader9/bin/acroread
# Apply workaround for http://bugzilla.novell.com/show_bug.cgi?id=85416 & 147966 & 275088:
pushd %{buildroot}%INSTALL_DIR/Adobe/Reader9/bin
    patch -p0 -i %{S:40}
# symlink the executable to a directory which is in the PATH
mkdir -p %{buildroot}/usr/bin
pushd %{buildroot}/usr/bin
   ln -sf ../../%INSTALL_DIR/Adobe/Reader9/bin/acroread acroread
# add a link for the browser plugin so that it can be found automatically
mkdir -p %{buildroot}/usr/lib/browser-plugins
ln -sf %INSTALL_DIR/Adobe/Reader9/Browser/intellinux/nppdf.so %{buildroot}/usr/lib/browser-plugins/nppdf.so
# Add links to openldap2 libraries needed to avoid bug: 261555
%if %suse_version > 1030
(cd %{buildroot}%INSTALL_DIR/Adobe/Reader9/Reader/intellinux/lib && ln -sf ../../../../../../../usr/lib/libldap-2.4.so.? libldap.so)
(cd %{buildroot}%INSTALL_DIR/Adobe/Reader9/Reader/intellinux/lib && ln -sf ../../../../../../../usr/lib/liblber-2.4.so.? liblber.so)
(cd %{buildroot}%INSTALL_DIR/Adobe/Reader9/Reader/intellinux/lib && ln -sf ../../../../../../../usr/lib/libldap-2.3.so.? libldap.so)
(cd %{buildroot}%INSTALL_DIR/Adobe/Reader9/Reader/intellinux/lib && ln -sf ../../../../../../../usr/lib/liblber-2.3.so.? liblber.so)
for i in Adobe/Reader9/Reader/GlobalPrefs/.config \
    sed -i -e 's:%{buildroot}::' %{buildroot}%INSTALL_DIR/$i
# make the Adobe Reader available in the SUSE menues
%suse_update_desktop_file -i %name Office Viewer
echo "InitialPreference=7" >> %{buildroot}/usr/share/applications/%name.desktop
# install preload library to work around bug #375551:
install -m 755 suse-do-not-grab-server/suse-do-not-grab-server.so \
# remove duplicated system libraries and massage provides and requires lists:
# When a compatible version of a library which comes with the acroread
# binary tarball is already available in the system, it should be deleted.
# See bnc#353251.
# Libraries which come with the acroread tarball where no compatible
# version is available in the system cannot be deleted but they
# should neither be provided nor required by acroread.
# Providing them might cause problems for other packages which
# might require these libraries and requiring them is not necessary
# because they are already within the acroread package).
%if %suse_version < 1030
rm -f %{buildroot}%INSTALL_DIR/Adobe/Reader9/Reader/intellinux/lib/lib{crypto,ssl,curl,gcc_s,stdc++,icudata,icui18n,icuuc}.so*
# bnc#373590:
(cd %{buildroot}%INSTALL_DIR/Adobe/Reader9/Reader/intellinux/lib && ln -sf ../../../../../../../usr/lib/libicudata.so.34 libicudata.so)
(cd %{buildroot}%INSTALL_DIR/Adobe/Reader9/Reader/intellinux/lib && ln -sf ../../../../../../../usr/lib/libicui18n.so.34 libicui18n.so)
(cd %{buildroot}%INSTALL_DIR/Adobe/Reader9/Reader/intellinux/lib && ln -sf ../../../../../../../usr/lib/libicuuc.so.34 libicuuc.so)
cat << EOF > %{my_provides}
%{__find_provides} | grep -vE "liblber|libldap" ; exit 0
chmod 755 %{my_provides}
%define __find_provides %{my_provides}
cat << EOF > %{my_requires}
%{__find_requires} | grep -vE "liblber|libldap" ; exit 0
chmod 755 %{my_requires}
%define __find_requires %{my_requires}
%elseif %suse_version >= 1030
rm -f %{buildroot}%INSTALL_DIR/Adobe/Reader9/Reader/intellinux/lib/lib{crypto,ssl,gcc_s,stdc++}.so*
# apparently libcurl.so.4 and libcurl.so.3 are *not* compatible, see bnc#382777.
# # libcurl.so.4 and libcurl.so.3 are supposedly compatible, see bnc#353251 comment #29:
# (cd %{buildroot}%INSTALL_DIR/Adobe/Reader9/Reader/intellinux/lib && ln -sf ../../../../../../../usr/lib/libcurl.so.4 libcurl.so)
# (cd %{buildroot}%INSTALL_DIR/Adobe/Reader9/Reader/intellinux/lib && ln -sf ../../../../../../../usr/lib/libcurl.so.4 libcurl.so.3)
cat << EOF > %{my_provides}
%{__find_provides} | grep -vE "libicudata|libicui18n|libicuuc|liblber|libldap|libcurl.so.3" ; exit 0
chmod 755 %{my_provides}
%define __find_provides %{my_provides}
cat << EOF > %{my_requires}
%{__find_requires} | grep -vE "libicudata|libicui18n|libicuuc|liblber|libldap|libcurl.so.3" ; exit 0
chmod 755 %{my_requires}
%define __find_requires %{my_requires}
# install the acroread icon for desktop
install -d %{buildroot}/usr/share/pixmaps
install -m644 Adobe/Reader9/Resource/Icons/128x128/AdobeReader9.png %{buildroot}/usr/share/pixmaps/acroread.png
# install the manunal, bnc#631267, bili@novell.com
install -d %{buildroot}/usr/share/man/man1
install -m644 Adobe/Reader9/Resource/Shell/acroread.1.gz %{buildroot}/usr/share/man/man1/
# libsccore.so and libextendscript.so have RPATH=. which is not good.
# But we cannot change this in a binary only package, we can only
# disable the check:
export NO_BRP_CHECK_RPATH=true
%if %suse_version > 1020
%fdupes %{buildroot}%INSTALL_DIR

/usr/bin/touch -c %_libdir/browser-plugins/libdragonegg.so

/usr/bin/touch -c %_libdir/browser-plugins/libdragonegg.so

rm -f %{my_provides}
rm -f %{my_requires}

%doc ReadMe.htm
%dir %INSTALL_DIR/Adobe/
%dir %INSTALL_DIR/Adobe/Reader9
%dir %INSTALL_DIR/Adobe/Reader9/Reader/
%dir %INSTALL_DIR/Adobe/Reader9/bin/
%dir %INSTALL_DIR/Adobe/Reader9/Resource/
%dir %INSTALL_DIR/Adobe/Reader9/Resource/CMap/
%dir %INSTALL_DIR/Adobe/Reader9/Resource/Font/
%dir %INSTALL_DIR/Adobe/Reader9/Resource/Icons/
%dir %INSTALL_DIR/Adobe/Reader9/Resource/Linguistics/
%dir %INSTALL_DIR/Adobe/Reader9/Resource/Support/
%dir %INSTALL_DIR/Adobe/Reader9/Resource/TypeSupport/
%dir %INSTALL_DIR/Adobe/Reader9/Resource/TypeSupport/Unicode
%dir %INSTALL_DIR/Adobe/Reader9/Resource/Shell

%files browser-plugin
%dir %INSTALL_DIR/Adobe/Reader9/Browser/