File pdfsam.spec of Package pdfsam

# spec file for package pdfsam
# Copyright (c) 2010 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

Name:           pdfsam
Version:        2.2.4
Release:        0
Summary:        PDF split and merge
License:        AGPL-3.0
Group:          Productivity/Graphics/Other
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:	    noarch
BuildRequires:  ant
BuildRequires:  unzip

#%if 0%{?suse_version} > 1100
BuildRequires:  java-devel >= 1.7.0
#BuildRequires:  java-1.7.0-openjdk-devel 
BuildConflicts:	java-9-openjdk-devel >= 1.9.0

A Java based PDF merge and split tool

%setup -c %{name}-%{version}
for FILE in *.zip; do
   unzip -o $FILE

ANTOPTIONS="-Dlibs.dir=$PWD/libraries-2/ \
            -Dpdfsam.release.jar.dir=$PWD/libraries-2/ \
            -Dworkspace.dir=$PWD \
  {version} \

for DIR in \
	emp4j			\
	jcmdline		\
	pdfsam-maine	\
	pdfsam-split		\
	pdfsam-merge		\

###pdfsam-console-br1	\
cd $DIR/ant
ant $ANTOPTIONS -Dbuild.dir="$PWD/.."
find ../$DIR/dist/ -name "*.jar" -exec cp {} $PWD/libraries-2 \;
cd -


# TODO: What to do with install icepdfcreator, jpodrenderercreator?
install -d -m 755 $RPM_BUILD_ROOT%{_bindir}

cat << EOF > $RPM_BUILD_ROOT%{_bindir}/pdfsam
cd %{_datadir}/%{name}
java -jar %{_datadir}/%{name}/pdfsam.jar

chmod 755 $RPM_BUILD_ROOT%{_bindir}/pdfsam
install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/%{name}/lib
install -m 644 libraries-2/*.jar $RPM_BUILD_ROOT%{_datadir}/%{name}/lib
install -m 644 libraries-ICEpdf/*.jar $RPM_BUILD_ROOT%{_datadir}/%{name}/lib
install -m 644 libraries-jPodRenderer/*.jar $RPM_BUILD_ROOT%{_datadir}/%{name}/lib

mv $RPM_BUILD_ROOT%{_datadir}/%{name}/lib/pdfsam-%{version}.jar $RPM_BUILD_ROOT%{_datadir}/%{name}/
ln -s pdfsam-%{version}.jar $RPM_BUILD_ROOT%{_datadir}/%{name}/pdfsam.jar

rm template-basic-2/*.exe
cp -r template-basic-2/* $RPM_BUILD_ROOT%{_datadir}/%{name}
for PLUGIN in mix merge split vcomposer rotate vpagereorder; do
  mv $RPM_BUILD_ROOT%{_datadir}/%{name}/lib/pdfsam-$PLUGIN-*.jar $RPM_BUILD_ROOT%{_datadir}/%{name}/plugins/$PLUGIN

rm -rf "$RPM_BUILD_ROOT"


openSUSE Build Service is sponsored by