You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

127 lines
4.4 KiB

##
## prince.spec -- OpenPKG RPM Package Specification
## Copyright (c) 2000-2020 OpenPKG Project <http://openpkg.org/>
##
## Permission to use, copy, modify, and distribute this software for
## any purpose with or without fee is hereby granted, provided that
## the above copyright notice and this permission notice appear in all
## copies.
##
## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
## SUCH DAMAGE.
##
# package version
%define V_openpkg 13.1
%define V_freebsd 13.1
%define V_linux 13.1
%define V_macos 13.1
# package information
Name: prince
Summary: Professional XML to PDF Renderer
URL: http://www.princexml.com/
Vendor: YesLogic Pty. Ltd.
Packager: OpenPKG Project
Distribution: OpenPKG Community
Class: EVAL
Group: Typesetting
License: Commercial
Version: %{V_openpkg}
Release: 20191226
# list of sources
Source0: http://www.princexml.com/download/prince-%{V_freebsd}-freebsd12.0-amd64.tar.gz
Source1: http://www.princexml.com/download/prince-%{V_linux}-debian9-amd64.tar.gz
Source2: http://www.princexml.com/download/prince-%{V_macos}-macos.tar.gz
Source3: prince.sh
Source4: prince.txt
# build information
BuildPreReq: OpenPKG, openpkg >= 20160101
PreReq: OpenPKG, openpkg >= 20160101, fonts-free
%description
Prince is a commercial program that converts XML and HTML into PDF
documents. Prince can read many XML formats, including XHTML and
SVG. Prince formats documents according to style sheets written in
CSS.
%track
prog prince = {
version = %{V_linux}
url = http://www.princexml.com/download/
regex = prince-(__VER__)-linux-generic
}
%prep
%setup -q -T -c
%build
# unpack platform-specific distribution
case "%{l_platform -t}" in
*-freebsd* ) source="%{SOURCE0}" ;;
*-linux* ) source="%{SOURCE1}" ;;
*-darwin* ) source="%{SOURCE2}" ;;
* ) echo "Sorry, platform %{l_platform -t} not supported" 1>&2; exit 1 ;;
esac
%{l_gzip} -d -c $source | %{l_tar} xf -
%install
# create installation hierarchy
%{l_shtool} mkdir -f -p -m 755 \
$RPM_BUILD_ROOT%{l_prefix}/bin \
$RPM_BUILD_ROOT%{l_prefix}/etc/prince \
$RPM_BUILD_ROOT%{l_prefix}/libexec/prince \
$RPM_BUILD_ROOT%{l_prefix}/lib/prince
# install command line wrapper
%{l_shtool} install -c -m 755 %{l_value -s -a} \
%{SOURCE prince.sh} $RPM_BUILD_ROOT%{l_prefix}/bin/prince
# install program
%{l_shtool} install -c -m 755 \
prince-*/lib/prince/bin/prince \
$RPM_BUILD_ROOT%{l_prefix}/libexec/prince/
rm -rf prince-*/lib/prince/bin
# install license file
%{l_shtool} install -c -m 644 \
prince-*/lib/prince/license/license.dat \
$RPM_BUILD_ROOT%{l_prefix}/etc/prince/
ln -s \
../../etc/prince \
$RPM_BUILD_ROOT%{l_prefix}/lib/prince/license
rm -rf prince-*/lib/prince/license
# install data
cp -rp prince-*/lib/prince/* \
$RPM_BUILD_ROOT%{l_prefix}/lib/prince/
# extend fonts.css for finding standard fonts
for name in `grep "^<file" %{SOURCE prince.txt} | sed -e 's;^.*name=";;' -e 's;".*$;;'`; do
(echo ""; cat %{SOURCE prince.txt}; echo "") |\
sed -e "1,/^<file name=\"$name\">/d" -e "/<\/file>/,\$d" >$name
%{l_shtool} install -c -m 644 %{l_value -s -a} \
$name $RPM_BUILD_ROOT%{l_prefix}/lib/prince/style/$name
done
# determine installation files
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
%{l_files_std} \
'%config %{l_prefix}/etc/prince/*'
%files -f files
%clean