netpbm/netpbm.spec

Tue, 29 Mar 2011 20:04:34 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 29 Mar 2011 20:04:34 +0200
changeset 334
4a34d7a82eab
parent 54
f012bbb2a542
permissions
-rw-r--r--

Rework package yet again, correcting and introducing new buildconf logic:
Conditionally disable bootstrap stage comparison correctly, correct
english grammar, better find system as(1) and ld(1), indotruce detailed
optimization option messages, more completely guess cpu types, allow
profiled bootstrapping without a preinstalled GCC because many other
compilers have long since implemented 64-bit arithmetic, instruct make
to build sequentially (not in sparallel) when building a profiled
bootstrap as GCC online documents recommend, and generally improve
comment blocks.

The single most important correction in this changeset relates to the
GCC changed optimization policy since at least GCC 4.5, in which -march
is always passed and not always correctly guessed. In the case of this
package, allowing GCC to guess the architecture leads to wild build
errors at various subcomponents (zlib, libgcc, libiberty...) and
bootstrap stages. It seems quite platform specific, and the safest
approach to correcting this seems to be explicitly always specifying the
-march argument when bootstrapping GCC. Because the best choice 'native'
is not available when bootstrapping using a foreign (non GCC) compiler,
a guess is made according to rpmmacros l_platform in that case.

It is questionable as to whether these recent optimization changes
on the part of GCC or this package are compatible with each other,
or if either are complete or correct at all. At least applying these
corrections allows this package to build again in most cases test.

michael@54 1 ##
michael@54 2 ## netpbm.spec -- OpenPKG RPM Package Specification
michael@54 3 ## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/>
michael@54 4 ##
michael@54 5 ## Permission to use, copy, modify, and distribute this software for
michael@54 6 ## any purpose with or without fee is hereby granted, provided that
michael@54 7 ## the above copyright notice and this permission notice appear in all
michael@54 8 ## copies.
michael@54 9 ##
michael@54 10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
michael@54 11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@54 12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@54 13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@54 14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@54 15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@54 16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@54 17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@54 18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@54 19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@54 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@54 21 ## SUCH DAMAGE.
michael@54 22 ##
michael@54 23
michael@54 24 # package information
michael@54 25 Name: netpbm
michael@54 26 Summary: Graphic Image Conversion Tool
michael@54 27 URL: http://netpbm.sourceforge.net/
michael@54 28 Vendor: Bryan Henderson et al.
michael@54 29 Packager: OpenPKG Foundation e.V.
michael@54 30 Distribution: OpenPKG Community
michael@54 31 Class: BASE
michael@54 32 Group: Graphics
michael@54 33 License: MIT-style
michael@54 34 Version: 10.26.56
michael@55 35 Release: 20090106
michael@54 36
michael@54 37 # list of sources
michael@54 38 Source0: http://switch.dl.sourceforge.net/sourceforge/netpbm/netpbm-%{version}.tgz
michael@54 39 Patch0: netpbm.patch
michael@54 40
michael@54 41 # build information
michael@54 42 Prefix: %{l_prefix}
michael@54 43 BuildRoot: %{l_buildroot}
michael@54 44 BuildPreReq: OpenPKG, openpkg >= 20040130, perl, make, gcc, flex, m4
michael@54 45 PreReq: OpenPKG, openpkg >= 20040130, perl
michael@54 46 BuildPreReq: tiff, jasper, jpeg, png, zlib
michael@54 47 PreReq: tiff, jasper, jpeg, png, zlib
michael@54 48 AutoReq: no
michael@54 49 AutoReqProv: no
michael@54 50
michael@54 51 %description
michael@54 52 NetPBM is whole bunch of utilities for primitive manipulation of
michael@54 53 graphic images. Wide array of converters from one graphics format
michael@54 54 to another. E.g. from g3 fax format to jpeg. Many basic graphics
michael@54 55 editing tools such as magnifying and cropping.
michael@54 56
michael@54 57 %track
michael@54 58 prog netpbm = {
michael@54 59 version = %{version}
michael@54 60 url = http://prdownloads.sourceforge.net/netpbm/
michael@54 61 regex = netpbm-(\d+\.\d+\.\d+)\.tgz
michael@54 62 }
michael@54 63
michael@54 64 %prep
michael@54 65 %setup -q
michael@54 66 %patch -p0
michael@54 67
michael@54 68 %build
michael@54 69 ( cat Makefile.config.in
michael@54 70 echo ""
michael@54 71 echo "DEFAULT_TARGET = nonmerge"
michael@54 72 echo "NETPBMLIBTYPE=unixstatic"
michael@54 73 echo "NETPBMLIBSUFFIX=a"
michael@54 74 echo "STATICLIB_TOO=n"
michael@54 75 echo "CC = %{l_cc}"
michael@54 76 echo "CFLAGS = %{l_cflags -O}"
michael@54 77 echo "LDFLAGS = %{l_ldflags}"
michael@54 78 echo "TIFFHDR_DIR = %{l_prefix}/include/tiff"
michael@54 79 echo "TIFFLIB = libtiff.a"
michael@54 80 echo "TIFFLIB_LDFLAGS = -lz"
michael@54 81 echo "JASPERHDR_DIR = %{l_prefix}/include"
michael@54 82 echo "JASPERLIB = libjasper.a libjpeg.a"
michael@54 83 echo "JPEGHDR_DIR = %{l_prefix}/include"
michael@54 84 echo "JPEGLIB = libjpeg.a"
michael@54 85 echo "PNGHDR_DIR = %{l_prefix}/include"
michael@54 86 echo "PNGLIB = libpng.a"
michael@54 87 echo "ZHDR_DIR = %{l_prefix}/include"
michael@54 88 echo "ZLIB = libz.a"
michael@54 89 case "%{l_platform -t}" in
michael@54 90 *-sunos* ) echo "NETWORKLD = -lsocket -lnsl" ;;
michael@54 91 esac
michael@54 92 ) >Makefile.config
michael@54 93 %{l_make} %{l_mflags} -f GNUmakefile
michael@54 94
michael@54 95 %install
michael@54 96 rm -rf $RPM_BUILD_ROOT
michael@54 97 %{l_shtool} subst \
michael@54 98 -e 's;\[ -d $(PKGDIR) \];false;' \
michael@54 99 -e 's;mkdir;true;' \
michael@54 100 GNUmakefile
michael@54 101 %{l_shtool} mkdir -f -p -m 755 \
michael@54 102 $RPM_BUILD_ROOT%{l_prefix} \
michael@54 103 $RPM_BUILD_ROOT%{l_prefix}/share/netpbm \
michael@54 104 $RPM_BUILD_ROOT%{l_prefix}/include/netpbm
michael@54 105 %{l_make} %{l_mflags} -f GNUmakefile package pkgdir=$RPM_BUILD_ROOT%{l_prefix}
michael@54 106 %{l_shtool} subst \
michael@54 107 -e 's;/usr/bin/perl;%{l_prefix}/bin/perl;g' \
michael@54 108 $RPM_BUILD_ROOT%{l_prefix}/bin/manweb \
michael@54 109 $RPM_BUILD_ROOT%{l_prefix}/bin/pnmquant \
michael@54 110 $RPM_BUILD_ROOT%{l_prefix}/bin/ppmfade \
michael@54 111 $RPM_BUILD_ROOT%{l_prefix}/bin/ppmrainbow \
michael@54 112 $RPM_BUILD_ROOT%{l_prefix}/bin/ppmshadow
michael@54 113 strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
michael@54 114 rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/doc.url
michael@54 115 rm -f $RPM_BUILD_ROOT%{l_prefix}/pkginfo
michael@54 116 rm -f $RPM_BUILD_ROOT%{l_prefix}/README
michael@54 117 rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/web
michael@54 118 mv $RPM_BUILD_ROOT%{l_prefix}/include/*.h \
michael@54 119 $RPM_BUILD_ROOT%{l_prefix}/include/netpbm/
michael@54 120 mv $RPM_BUILD_ROOT%{l_prefix}/misc/* \
michael@54 121 $RPM_BUILD_ROOT%{l_prefix}/share/netpbm/
michael@54 122 rm -rf $RPM_BUILD_ROOT%{l_prefix}/misc
michael@54 123 mv $RPM_BUILD_ROOT%{l_prefix}/link \
michael@54 124 $RPM_BUILD_ROOT%{l_prefix}/lib
michael@54 125 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
michael@54 126
michael@54 127 %files -f files
michael@54 128
michael@54 129 %clean
michael@54 130 rm -rf $RPM_BUILD_ROOT
michael@54 131

mercurial