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.
185 lines
6.6 KiB
185 lines
6.6 KiB
## |
|
## ghostscript.spec -- OpenPKG RPM Package Specification |
|
## Copyright (c) 2000-2009 OpenPKG Foundation e.V. <http://openpkg.net/> |
|
## |
|
## 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 versions |
|
%define V_real 8.70 |
|
%define V_comp 870 |
|
%define V_font_std 8.11 |
|
%define V_font_other 6.0 |
|
%define V_jpeg 6b |
|
%define V_png 1.4.0 |
|
%define V_zlib 1.2.3 |
|
|
|
# package information |
|
Name: ghostscript |
|
Summary: Ghostscript, Postscript and PDF Rendering Engine |
|
URL: http://www.ghostscript.com/ |
|
Vendor: Aladdin Enterprises |
|
Packager: OpenPKG Foundation e.V. |
|
Distribution: OpenPKG Community |
|
Class: BASE |
|
Group: Postscript |
|
License: GPL |
|
Version: %{V_real} |
|
Release: 20100105 |
|
|
|
# package options |
|
%option with_x11 yes |
|
%option with_a4 yes |
|
|
|
# list of sources |
|
Source0: http://switch.dl.sourceforge.net/ghostscript/ghostscript-%{V_real}.tar.bz2 |
|
Source1: ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v%{V_jpeg}.tar.gz |
|
Source2: http://switch.dl.sourceforge.net/sourceforge/libpng/libpng-%{V_png}.tar.gz |
|
Source3: http://www.zlib.net/zlib-%{V_zlib}.tar.gz |
|
Source4: http://switch.dl.sourceforge.net/ghostscript/ghostscript-fonts-std-%{V_font_std}.tar.gz |
|
Source5: http://switch.dl.sourceforge.net/ghostscript/ghostscript-fonts-other-%{V_font_other}.tar.gz |
|
Patch0: ghostscript.patch |
|
|
|
# build information |
|
Prefix: %{l_prefix} |
|
BuildRoot: %{l_buildroot} |
|
BuildPreReq: OpenPKG, openpkg >= 20040212, gcc, make |
|
PreReq: OpenPKG, openpkg >= 20040212 |
|
%if "%{with_x11}" == "yes" |
|
BuildPreReq: X11 |
|
PreReq: X11 |
|
%endif |
|
AutoReq: no |
|
AutoReqProv: no |
|
|
|
%description |
|
Ghostscript is an interpreter for the PostScript language, with the |
|
ability to convert PostScript language files to many raster formats, |
|
view them on displays, and print them on printers that don't have |
|
PostScript language capability built in. It also works with Portable |
|
Document Format files (PDF), providing the same set of functionality |
|
as with PostScript. |
|
|
|
%track |
|
prog ghostscript = { |
|
version = %{version} |
|
url = http://sourceforge.net/projects/ghostscript/files/ |
|
regex = ghostscript-(__VER__)\.tar\.bz2 |
|
} |
|
prog ghostscript:jpegsrc = { |
|
version = v%{V_jpeg} |
|
url = ftp://ftp.uu.net/graphics/jpeg/ |
|
regex = jpegsrc.(__VER__)\.tar\.gz |
|
} |
|
prog ghostscript:png = { |
|
version = %{V_png} |
|
url = http://sourceforge.net/projects/libpng/files/ |
|
regex = libpng-(\d+\.\d+\.\d+)\.tar\.gz |
|
} |
|
prog ghostscript:zlib = { |
|
version = %{V_zlib} |
|
url = http://www.zlib.net/ |
|
regex = zlib-(__VER__)\.tar\.gz |
|
} |
|
|
|
%prep |
|
%setup -q -c |
|
%setup -q -T -D -a 1 |
|
%setup -q -T -D -a 2 |
|
%setup -q -T -D -a 3 |
|
%setup -q -T -D -a 4 |
|
%setup -q -T -D -a 5 |
|
mv jpeg-%{V_jpeg} ghostscript-%{version}/jpeg |
|
mv libpng-%{V_png} ghostscript-%{version}/libpng |
|
mv zlib-%{V_zlib} ghostscript-%{version}/zlib |
|
%patch -p0 -d ghostscript-%{version} |
|
|
|
%build |
|
mtcflags="" |
|
mtldflags="" |
|
case "%{l_platform -t}" in |
|
*-freebsd* ) mtcflags=""; mtldflags="-lc_r" ;; |
|
*-linux* ) mtcflags=""; mtldflags="-lpthread" ;; |
|
*-sunos* ) mtcflags=""; mtldflags="-lpthread" ;; |
|
esac |
|
cd ghostscript-%{version} |
|
%if "%{with_x11}" == "yes" |
|
x11_inc="-I`%{l_rc} --query x11_incdir`" |
|
x11_lib="-L`%{l_rc} --query x11_libdir`" |
|
x11_ext="" |
|
[ -f `%{l_rc} --query x11_libdir`/libSM.a ] && x11_ext="$x11_ext -lSM" |
|
[ -f `%{l_rc} --query x11_libdir`/libICE.a ] && x11_ext="$x11_ext -lICE" |
|
%else |
|
x11_inc="" |
|
x11_lib="" |
|
x11_ext="" |
|
%endif |
|
%if "%{with_a4}" == "yes" |
|
mtcflags="$mtcflags -DA4" |
|
%endif |
|
%{l_shtool} subst \ |
|
-e "s;^STDLIBS=-lpthread -lm;STDLIBS=$mtldflags -lm;" \ |
|
-e "s;^EXTRALIBS=.*$;EXTRALIBS=$x11_lib $x11_ext;" \ |
|
-e "s;^prefix = /usr/local;prefix = %{l_prefix};" \ |
|
-e "s;CC=gcc;CC=%{l_cc};" \ |
|
-e "s;GCFLAGS=.*\\(-fno.*\\)\$;GCFLAGS=\$1;" \ |
|
-e "s;XCFLAGS=.*\$;XCFLAGS=$mtcflags;" \ |
|
-e "s;XINCLUDE=.*\$;XINCLUDE=$x11_inc;" \ |
|
-e "s;XLIBDIRS=.*\$;XLIBDIRS=$x11_lib;" \ |
|
base/unix-gcc.mak |
|
%if "%{with_x11}" != "yes" |
|
%{l_shtool} subst \ |
|
-e 's;DEVICE_DEVS=.*$;DEVICE_DEVS=;' \ |
|
base/unix-gcc.mak |
|
%endif |
|
%{l_make} %{l_mflags} -f base/unix-gcc.mak |
|
|
|
%install |
|
rm -rf $RPM_BUILD_ROOT |
|
( cd ghostscript-%{version} |
|
%{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix} |
|
%{l_make} %{l_mflags} -f base/unix-gcc.mak install DEVICE_DEVS="" \ |
|
prefix=$RPM_BUILD_ROOT%{l_prefix} |
|
) || exit $? |
|
%{l_shtool} mkdir -f -p -m 755 \ |
|
$RPM_BUILD_ROOT%{l_prefix}/share/ghostscript/fonts |
|
%{l_shtool} install -c fonts/* \ |
|
$RPM_BUILD_ROOT%{l_prefix}/share/ghostscript/fonts/ |
|
rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/ghostscript/%{V_real}/doc |
|
rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/de |
|
for prg in eps2eps gsbj gsdj gslj gsdj500 ps2pdf12 ps2pdf13; do |
|
rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/$prg |
|
rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/$prg.1 |
|
done |
|
mv $RPM_BUILD_ROOT%{l_prefix}/bin/ps2pdf14 \ |
|
$RPM_BUILD_ROOT%{l_prefix}/bin/ps2pdf |
|
for prg in fixmswrd.pl lprsetup.sh pj-gs.sh pv.sh sysvlp.sh unix-lpr.sh; do |
|
rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/$prg |
|
done |
|
for man in ansi2knr.1; do |
|
rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/$man |
|
done |
|
strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true |
|
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} |
|
|
|
%files -f files |
|
|
|
%clean |
|
rm -rf $RPM_BUILD_ROOT |
|
|
|
|