| 1 | #define svn_url F:/rd/ports/ghostscript/trunk
|
|---|
| 2 | %define svn_url http://svn.netlabs.org/repos/ports/ghostscript/trunk
|
|---|
| 3 | %define svn_rev 941
|
|---|
| 4 |
|
|---|
| 5 | %define _with_freetype 1
|
|---|
| 6 | %define gs_ver 9.10
|
|---|
| 7 | %define gs_dot_ver 9.10
|
|---|
| 8 | %{expand: %%define build_with_freetype %{?_with_freetype:1}%{!?_with_freetype:0}}
|
|---|
| 9 |
|
|---|
| 10 | Summary: A PostScript interpreter and renderer
|
|---|
| 11 | Name: ghostscript
|
|---|
| 12 | Version: %{gs_ver}
|
|---|
| 13 |
|
|---|
| 14 | Release: 3%{?dist}
|
|---|
| 15 |
|
|---|
| 16 | # Included CMap data is Redistributable, no modification permitted,
|
|---|
| 17 | # see http://bugzilla.redhat.com/487510
|
|---|
| 18 | License: GPLv3+ and Redistributable, no modification permitted
|
|---|
| 19 | URL: http://www.ghostscript.com/
|
|---|
| 20 | Group: Applications/Publishing
|
|---|
| 21 |
|
|---|
| 22 | Source: %{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip
|
|---|
| 23 |
|
|---|
| 24 | Requires: urw-fonts >= 1.1, ghostscript-fonts
|
|---|
| 25 | Requires: poppler-data
|
|---|
| 26 | BuildRequires: xz
|
|---|
| 27 | BuildRequires: libjpeg-devel
|
|---|
| 28 | BuildRequires: zlib-devel, libpng-devel, unzip
|
|---|
| 29 | BuildRequires: glib2-devel
|
|---|
| 30 | # Omni requires libxml
|
|---|
| 31 | BuildRequires: libxml2-devel
|
|---|
| 32 | BuildRequires: libtiff-devel
|
|---|
| 33 | #BuildRequires: cups-devel >= 1.1.13
|
|---|
| 34 | BuildRequires: libtool
|
|---|
| 35 | #BuildRequires: jasper-devel, gnutls-devel
|
|---|
| 36 | #BuildRequires: dbus-devel
|
|---|
| 37 | BuildRequires: poppler-data
|
|---|
| 38 | #BuildRequires: lcms2-devel
|
|---|
| 39 | #BuildRequires: openjpeg-devel
|
|---|
| 40 | %{?_with_freetype:BuildRequires: freetype-devel}
|
|---|
| 41 | BuildRoot: %{_tmppath}/%{name}-%{gs_ver}-root
|
|---|
| 42 |
|
|---|
| 43 | # See bug #83516.
|
|---|
| 44 | Conflicts: ttfonts-ja < 1.2-23
|
|---|
| 45 | Conflicts: ttfonts-ko < 1.0.11-27
|
|---|
| 46 | Conflicts: ttfonts-zh_CN < 2.12-2
|
|---|
| 47 | Conflicts: ttfonts-zh_TW < 2.11-20
|
|---|
| 48 |
|
|---|
| 49 | %description
|
|---|
| 50 | Ghostscript is a set of software that provides a PostScript
|
|---|
| 51 | interpreter, a set of C procedures (the Ghostscript library, which
|
|---|
| 52 | implements the graphics capabilities in the PostScript language) and
|
|---|
| 53 | an interpreter for Portable Document Format (PDF) files. Ghostscript
|
|---|
| 54 | translates PostScript code into many common, bitmapped formats, like
|
|---|
| 55 | those understood by your printer or screen. Ghostscript is normally
|
|---|
| 56 | used to display PostScript files and to print PostScript files to
|
|---|
| 57 | non-PostScript printers.
|
|---|
| 58 |
|
|---|
| 59 | If you need to display PostScript files or print them to
|
|---|
| 60 | non-PostScript printers, you should install ghostscript. If you
|
|---|
| 61 | install ghostscript, you also need to install the ghostscript-fonts
|
|---|
| 62 | package.
|
|---|
| 63 |
|
|---|
| 64 | %package devel
|
|---|
| 65 | Summary: Files for developing applications that use ghostscript
|
|---|
| 66 | Requires: %{name} = %{version}-%{release}
|
|---|
| 67 | Group: Development/Libraries
|
|---|
| 68 |
|
|---|
| 69 | %description devel
|
|---|
| 70 | The header files for developing applications that use ghostscript.
|
|---|
| 71 |
|
|---|
| 72 | %package doc
|
|---|
| 73 | Summary: Documentation for ghostscript
|
|---|
| 74 | Requires: %{name} = %{version}-%{release}
|
|---|
| 75 | Group: Documentation
|
|---|
| 76 | BuildArch: noarch
|
|---|
| 77 |
|
|---|
| 78 | %description doc
|
|---|
| 79 | The documentation files that come with ghostscript.
|
|---|
| 80 |
|
|---|
| 81 | %package gtk
|
|---|
| 82 | Summary: A GTK-enabled PostScript interpreter and renderer
|
|---|
| 83 | Requires: %{name} = %{version}-%{release}
|
|---|
| 84 | Group: Applications/Publishing
|
|---|
| 85 |
|
|---|
| 86 | %description gtk
|
|---|
| 87 | A GTK-enabled version of Ghostscript, called 'gsx'.
|
|---|
| 88 |
|
|---|
| 89 | %package cups
|
|---|
| 90 | Summary: CUPS filter for interpreting PostScript and PDF
|
|---|
| 91 | Requires: %{name} = %{version}-%{release}
|
|---|
| 92 | Requires: cups
|
|---|
| 93 | Group: System Environment/Daemons
|
|---|
| 94 |
|
|---|
| 95 | %description cups
|
|---|
| 96 | CUPS filter and conversion rules for interpreting PostScript and PDF.
|
|---|
| 97 |
|
|---|
| 98 | %package debug
|
|---|
| 99 | Summary: HLL debug data for exception handling support.
|
|---|
| 100 |
|
|---|
| 101 | %description debug
|
|---|
| 102 | HLL debug data for exception handling support.
|
|---|
| 103 |
|
|---|
| 104 | %prep
|
|---|
| 105 | %if %{?svn_rev:%(sh -c 'if test -f "%{_sourcedir}/%{name}-%{version}-r%{svn_rev}.zip" ; then echo 1 ; else echo 0 ; fi')}%{!?svn_rev):0}
|
|---|
| 106 | %setup -q
|
|---|
| 107 | %else
|
|---|
| 108 | %setup -n "%{name}-%{version}" -Tc
|
|---|
| 109 | svn export %{?svn_rev:-r %{svn_rev}} %{svn_url} . --force
|
|---|
| 110 | rm -f "%{_sourcedir}/%{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip"
|
|---|
| 111 | (cd .. && zip -SrX9 "%{_sourcedir}/%{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip" "%{name}-%{version}")
|
|---|
| 112 | %endif
|
|---|
| 113 |
|
|---|
| 114 | #rm -rf expat freetype icclib jasper jpeg lcms2 libpng openjpeg zlib cups/libs
|
|---|
| 115 | rm -rf expat freetype jpeg libpng zlib cups/libs
|
|---|
| 116 |
|
|---|
| 117 |
|
|---|
| 118 |
|
|---|
| 119 | # Convert manual pages to UTF-8
|
|---|
| 120 | #from8859_1() {
|
|---|
| 121 | # iconv -f iso-8859-1 -t utf-8 < "$1" > "${1}_"
|
|---|
| 122 | # mv "${1}_" "$1"
|
|---|
| 123 | #}
|
|---|
| 124 | #for i in man/de/*.1; do
|
|---|
| 125 | # if [ "$(file --brief --mime-encoding "$i")" = iso-8859-1 ]; then
|
|---|
| 126 | # from8859_1 "$i"
|
|---|
| 127 | # fi
|
|---|
| 128 | #done
|
|---|
| 129 |
|
|---|
| 130 | # Convert ps files to UTF-8
|
|---|
| 131 | #for i in examples/cjk/gsc*.ps; do from8859_1 "$i"; done
|
|---|
| 132 |
|
|---|
| 133 | %build
|
|---|
| 134 | # Compile without strict aliasing opts due to these files:
|
|---|
| 135 | # gdevescv.c gdevl4v.c gdevopvp.c gdevbbox.c gdevdbit.c gdevddrw.c
|
|---|
| 136 | # gdevp14.c gdevpdfd.c gdevpdfi.c gdevpdfo.c gdevpdft.c gdevpdfv.c
|
|---|
| 137 | # gdevpdte.c gdevpdtt.c gdevps.c gdevpx.c gscoord.c gscparam.c gscrd.c
|
|---|
| 138 | # gsdps1.c gsimage.c gspath1.c gsptype1.c gsptype2.c gstype2.c
|
|---|
| 139 | # gstype42.c gxccache.c gxchar.c gxclimag.c gxclpath.c gxfcopy.c
|
|---|
| 140 | # gximag3x.c gximage3.c gxipixel.c gxshade1.c gxstroke.c gxtype1.c
|
|---|
| 141 | # ibnum.c iscanbin.c zchar1.c zchar.c zcharx.c zfapi.c zfont32.c
|
|---|
| 142 | # zfunc0.c zfunc3.c zfunc4.c zpcolor.c zshade.c
|
|---|
| 143 | EXTRACFLAGS="-fno-strict-aliasing"
|
|---|
| 144 |
|
|---|
| 145 | FONTPATH=
|
|---|
| 146 | for path in \
|
|---|
| 147 | /@system_drive/psfonts \
|
|---|
| 148 | /@system_drive/os2/psfonts \
|
|---|
| 149 | %{_datadir}/fonts/default/%{name} \
|
|---|
| 150 | %{_datadir}/fonts/default/Type1 \
|
|---|
| 151 | %{_datadir}/fonts/default/amspsfnt/pfb \
|
|---|
| 152 | %{_datadir}/fonts/default/cmpsfont/pfb \
|
|---|
| 153 | %{_datadir}/fonts \
|
|---|
| 154 | %{_datadir}/%{name}/conf.d \
|
|---|
| 155 | %{_sysconfdir}/%{name} \
|
|---|
| 156 | %{_sysconfdir}/%{name}/%{gs_dot_ver} \
|
|---|
| 157 | %{_datadir}/poppler/cMap/*
|
|---|
| 158 | do
|
|---|
| 159 | FONTPATH="$FONTPATH${FONTPATH:+;}$path"
|
|---|
| 160 | done
|
|---|
| 161 |
|
|---|
| 162 | #autoconf --force
|
|---|
| 163 | # --with-ijs --enable-dynamic
|
|---|
| 164 | export CONFIG_SITE="/@unixroot/usr/share/config.legacy";
|
|---|
| 165 | export CONFIG_SHELL="/@unixroot/usr/bin/sh.exe";
|
|---|
| 166 | %configure --with-fontpath="$FONTPATH" \
|
|---|
| 167 | --with-drivers=ALL --disable-compile-inits \
|
|---|
| 168 | CFLAGS="$CFLAGS $EXTRACFLAGS"
|
|---|
| 169 |
|
|---|
| 170 | # Build IJS
|
|---|
| 171 | #cd ijs
|
|---|
| 172 | #./autogen.sh
|
|---|
| 173 | #configure --enable-shared --disable-static
|
|---|
| 174 | #make
|
|---|
| 175 | #cd ..
|
|---|
| 176 |
|
|---|
| 177 | %if %{build_with_freetype}
|
|---|
| 178 | FT_CFLAGS=$(pkg-config --cflags freetype2)
|
|---|
| 179 | make so RPM_OPT_FLAGS="$RPM_OPT_FLAGS $EXTRACFLAGS" prefix=%{_prefix} \
|
|---|
| 180 | FT_BRIDGE=1 FT_CFLAGS="$FT_CFLAGS" FT_LIB=freetype
|
|---|
| 181 | %else
|
|---|
| 182 | make so RPM_OPT_FLAGS="$RPM_OPT_FLAGS $EXTRACFLAGS" prefix=%{_prefix}
|
|---|
| 183 | %endif
|
|---|
| 184 | #make cups
|
|---|
| 185 |
|
|---|
| 186 | %install
|
|---|
| 187 | rm -rf $RPM_BUILD_ROOT
|
|---|
| 188 | mkdir -p $RPM_BUILD_ROOT
|
|---|
| 189 | mkdir -p $RPM_BUILD_ROOT/%{_mandir}
|
|---|
| 190 | mkdir -p $RPM_BUILD_ROOT/%{_bindir}
|
|---|
| 191 | mkdir -p $RPM_BUILD_ROOT/%{_datadir}
|
|---|
| 192 | mkdir -p $RPM_BUILD_ROOT/%{_docdir}
|
|---|
| 193 | mkdir -p $RPM_BUILD_ROOT/%{_libdir}
|
|---|
| 194 | mkdir -p $RPM_BUILD_ROOT/%{_includedir}/ijs
|
|---|
| 195 |
|
|---|
| 196 | make soinstall \
|
|---|
| 197 | %{?_with_freetype:FT_BRIDGE=1} \
|
|---|
| 198 | prefix=$RPM_BUILD_ROOT%{_prefix} \
|
|---|
| 199 | mandir=$RPM_BUILD_ROOT%{_mandir} \
|
|---|
| 200 | datadir=$RPM_BUILD_ROOT%{_datadir} \
|
|---|
| 201 | gsincludedir=$RPM_BUILD_ROOT%{_includedir}/ghostscript/ \
|
|---|
| 202 | bindir=$RPM_BUILD_ROOT%{_bindir} \
|
|---|
| 203 | libdir=$RPM_BUILD_ROOT%{_libdir} \
|
|---|
| 204 | docdir=$RPM_BUILD_ROOT%{_docdir}/%{name}-%{gs_dot_ver} \
|
|---|
| 205 | gsdir=$RPM_BUILD_ROOT%{_datadir}/%{name} \
|
|---|
| 206 | gsdatadir=$RPM_BUILD_ROOT%{_datadir}/%{name}/%{gs_dot_ver} \
|
|---|
| 207 | gssharedir=$RPM_BUILD_ROOT%{_libdir}/%{name}/%{gs_dot_ver} \
|
|---|
| 208 | CUPSSERVERROOT=$RPM_BUILD_ROOT`cups-config --serverroot` \
|
|---|
| 209 | CUPSSERVERBIN=$RPM_BUILD_ROOT`cups-config --serverbin` \
|
|---|
| 210 | CUPSDATA=$RPM_BUILD_ROOT`cups-config --datadir`
|
|---|
| 211 |
|
|---|
| 212 | mv -f $RPM_BUILD_ROOT%{_bindir}/gsc.exe $RPM_BUILD_ROOT%{_bindir}/gsos2.exe
|
|---|
| 213 | # add symlink for scripts
|
|---|
| 214 | ln -s %{_bindir}/gsos2.exe %{buildroot}%{_bindir}/gs.exe
|
|---|
| 215 | rm -f $RPM_BUILD_ROOT%{_libdir}/gsdll2.%{gs_dot_ver}.dll
|
|---|
| 216 |
|
|---|
| 217 | #cd ijs
|
|---|
| 218 | #makeinstall
|
|---|
| 219 | #cd ..
|
|---|
| 220 |
|
|---|
| 221 | echo ".so man1/gs.1" > $RPM_BUILD_ROOT/%{_mandir}/man1/ghostscript.1
|
|---|
| 222 | ln -sf gs $RPM_BUILD_ROOT%{_bindir}/ghostscript
|
|---|
| 223 |
|
|---|
| 224 | # Rename an original cidfmap to cidfmap.GS
|
|---|
| 225 | #mv $RPM_BUILD_ROOT%{_datadir}/%{name}/%{gs_dot_ver}/Resource/Init/cidfmap $RPM_BUILD_ROOT%{_datadir}/%{name}/%{gs_dot_ver}/Resource/Init/cidfmap.GS
|
|---|
| 226 | # Install our own cidfmap to allow the separated
|
|---|
| 227 | # cidfmap which the font packages own.
|
|---|
| 228 | #install -m0644 %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/%{name}/%{gs_dot_ver}/Resource/Init/CIDFnmap
|
|---|
| 229 | #install -m0644 %{SOURCE4} $RPM_BUILD_ROOT%{_datadir}/%{name}/%{gs_dot_ver}/Resource/Init/cidfmap
|
|---|
| 230 |
|
|---|
| 231 | # Documentation
|
|---|
| 232 | install -m0644 doc/COPYING $RPM_BUILD_ROOT%{_docdir}/%{name}-%{gs_dot_ver}
|
|---|
| 233 |
|
|---|
| 234 | # Don't ship libtool la files.
|
|---|
| 235 | rm -f $RPM_BUILD_ROOT%{_libdir}/libijs.la
|
|---|
| 236 |
|
|---|
| 237 | # Don't ship ijs example client or server
|
|---|
| 238 | rm -f $RPM_BUILD_ROOT%{_bindir}/ijs_{client,server}_example
|
|---|
| 239 |
|
|---|
| 240 | # Don't ship URW fonts; we already have them.
|
|---|
| 241 | #rm -rf $RPM_BUILD_ROOT%{_datadir}/ghostscript/%{gs_dot_ver}/Resource/Font
|
|---|
| 242 |
|
|---|
| 243 | mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/ghostscript/%{gs_dot_ver}
|
|---|
| 244 | touch $RPM_BUILD_ROOT%{_sysconfdir}/ghostscript/%{gs_dot_ver}/Fontmap.local
|
|---|
| 245 | touch $RPM_BUILD_ROOT%{_sysconfdir}/ghostscript/%{gs_dot_ver}/cidfmap.local
|
|---|
| 246 | touch $RPM_BUILD_ROOT%{_sysconfdir}/ghostscript/%{gs_dot_ver}/CIDFnmap.local
|
|---|
| 247 |
|
|---|
| 248 | # The man/de/man1 symlinks are broken (bug #66238).
|
|---|
| 249 | find $RPM_BUILD_ROOT%{_mandir}/de/man1 -type l | xargs rm -f
|
|---|
| 250 |
|
|---|
| 251 | # Don't ship fixmswrd.pl as it pulls in perl (bug #463948).
|
|---|
| 252 | rm -f $RPM_BUILD_ROOT%{_bindir}/fixmswrd.pl
|
|---|
| 253 |
|
|---|
| 254 | # Don't ship CMaps (instead poppler-data paths are in search path).
|
|---|
| 255 | rm -f $RPM_BUILD_ROOT%{_datadir}/ghostscript/%{gs_dot_ver}/Resource/CMap/*
|
|---|
| 256 |
|
|---|
| 257 | MAIN_PWD=`pwd`
|
|---|
| 258 | (cd $RPM_BUILD_ROOT; find .%{_datadir}/ghostscript/%{gs_dot_ver}/Resource -type f | \
|
|---|
| 259 | sed -e 's/\.//;' | grep -v Fontmap | grep -v gs_init.ps > $MAIN_PWD/rpm.sharelist
|
|---|
| 260 | find .%{_bindir}/ | sed -e 's/\.//;' | \
|
|---|
| 261 | grep -v '/$\|/hpijs$\|/gsx$\|/ijs-config$' \
|
|---|
| 262 | >> $MAIN_PWD/rpm.sharelist)
|
|---|
| 263 |
|
|---|
| 264 |
|
|---|
| 265 | %clean
|
|---|
| 266 | rm -rf $RPM_BUILD_ROOT
|
|---|
| 267 |
|
|---|
| 268 | #%post -p /sbin/ldconfig
|
|---|
| 269 |
|
|---|
| 270 | #%postun -p /sbin/ldconfig
|
|---|
| 271 |
|
|---|
| 272 | %files -f rpm.sharelist
|
|---|
| 273 | %defattr(-,root,root)
|
|---|
| 274 | %dir %{_sysconfdir}/ghostscript
|
|---|
| 275 | %dir %{_sysconfdir}/ghostscript/%{gs_dot_ver}
|
|---|
| 276 | %dir %{_datadir}/ghostscript/%{gs_dot_ver}
|
|---|
| 277 | %dir %{_datadir}/ghostscript/%{gs_dot_ver}/Resource
|
|---|
| 278 | %dir %{_datadir}/ghostscript/%{gs_dot_ver}/Resource/Init
|
|---|
| 279 | %config %{_datadir}/ghostscript/%{gs_dot_ver}/Resource/Init/gs_init.ps
|
|---|
| 280 | %config %{_datadir}/ghostscript/%{gs_dot_ver}/Resource/Init/Fontmap*
|
|---|
| 281 | %dir %{_datadir}/ghostscript/%{gs_dot_ver}/Resource/CMap
|
|---|
| 282 | %dir %{_datadir}/ghostscript/%{gs_dot_ver}/Resource/ColorSpace
|
|---|
| 283 | %dir %{_datadir}/ghostscript/%{gs_dot_ver}/Resource/Decoding
|
|---|
| 284 | %dir %{_datadir}/ghostscript/%{gs_dot_ver}/Resource/Encoding
|
|---|
| 285 | %dir %{_datadir}/ghostscript/%{gs_dot_ver}/Resource/SubstCID
|
|---|
| 286 | %{_datadir}/ghostscript/%{gs_dot_ver}/lib
|
|---|
| 287 | %{_datadir}/ghostscript/%{gs_dot_ver}/iccprofiles
|
|---|
| 288 | %{_mandir}/man*/*
|
|---|
| 289 | %lang(de) %{_mandir}/de/man*/*
|
|---|
| 290 | %{_libdir}/gsdll2.dll
|
|---|
| 291 | #%{_libdir}/libijs-*.so*
|
|---|
| 292 | #%dir %{_libdir}/%{name}
|
|---|
| 293 | #%{_libdir}/%{name}/%{gs_dot_ver}
|
|---|
| 294 | %config(noreplace) %{_sysconfdir}/ghostscript/%{gs_dot_ver}/*
|
|---|
| 295 |
|
|---|
| 296 | %files doc
|
|---|
| 297 | %defattr(-,root,root)
|
|---|
| 298 | %doc %{_datadir}/ghostscript/%{gs_dot_ver}/examples
|
|---|
| 299 | %doc %{_docdir}/%{name}-%{gs_dot_ver}
|
|---|
| 300 |
|
|---|
| 301 | %files gtk
|
|---|
| 302 | %defattr(-,root,root)
|
|---|
| 303 | %{_bindir}/gsx.exe
|
|---|
| 304 |
|
|---|
| 305 | %files cups
|
|---|
| 306 | %defattr(-,root,root)
|
|---|
| 307 | #%{_datadir}/cups/model/pxl*
|
|---|
| 308 | #%{_datadir}/cups/mime/*.convs
|
|---|
| 309 | #%{_cups_serverbin}/filter/*
|
|---|
| 310 |
|
|---|
| 311 | %files devel
|
|---|
| 312 | %defattr(-,root,root)
|
|---|
| 313 | %dir %{_includedir}/ghostscript
|
|---|
| 314 | %{_includedir}/ghostscript/*.h
|
|---|
| 315 | #%dir %{_includedir}/ijs
|
|---|
| 316 | #%{_includedir}/ijs/*
|
|---|
| 317 | #%{_bindir}/ijs-config
|
|---|
| 318 | #%{_libdir}/pkgconfig/ijs.pc
|
|---|
| 319 | #%{_libdir}/libijs.so
|
|---|
| 320 | %{_libdir}/gs.a
|
|---|
| 321 | %{_libdir}/gs.lib
|
|---|
| 322 |
|
|---|
| 323 | %files debug
|
|---|
| 324 | %defattr(-,root,root)
|
|---|
| 325 | %{_bindir}/*.dbg
|
|---|
| 326 | %{_libdir}/*.dbg
|
|---|
| 327 |
|
|---|
| 328 | %changelog
|
|---|
| 329 | * Tue Dec 16 2014 yd
|
|---|
| 330 | - r937, r941, fix FONTPATH handling, add PSFONTS dir.
|
|---|
| 331 |
|
|---|
| 332 | * Fri Dec 12 2014 yd
|
|---|
| 333 | - initial unixroot build.
|
|---|