pgp2/pgp2.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 95
c15febc142b1
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@95 1 ##
michael@95 2 ## pgp2.spec -- OpenPKG RPM Specification
michael@95 3 ## Copyright (c) 2000-2005 The OpenPKG Project <http://www.openpkg.org/>
michael@95 4 ## Copyright (c) 2000-2005 Ralf S. Engelschall <rse@engelschall.com>
michael@95 5 ## Copyright (c) 2000-2005 Cable & Wireless <http://www.cw.com/>
michael@95 6 ##
michael@95 7 ## Permission to use, copy, modify, and distribute this software for
michael@95 8 ## any purpose with or without fee is hereby granted, provided that
michael@95 9 ## the above copyright notice and this permission notice appear in all
michael@95 10 ## copies.
michael@95 11 ##
michael@95 12 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
michael@95 13 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@95 14 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@95 15 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@95 16 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@95 17 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@95 18 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@95 19 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@95 20 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@95 21 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@95 22 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@95 23 ## SUCH DAMAGE.
michael@95 24 ##
michael@95 25
michael@95 26 # package version
michael@95 27 %define V_short 2.x
michael@95 28 %define V_long 2.6.3i
michael@95 29 %define V_strip 263
michael@95 30
michael@95 31 # package information
michael@95 32 Name: pgp2
michael@95 33 Summary: Pretty Good Privacy
michael@95 34 URL: http://www.pgpi.org/
michael@95 35 Vendor: Philip Zimmerman
michael@95 36 Packager: The OpenPKG Project
michael@95 37 Distribution: OpenPKG [PLUS]
michael@95 38 Group: Cryptography
michael@95 39 License: GPL
michael@95 40 Version: %{V_long}
michael@96 41 Release: 20090106
michael@95 42
michael@95 43 # list of sources
michael@95 44 Source0: ftp://ftp.pgpi.org/pub/pgp/%{V_short}/src/pgp%{V_strip}is.tar.gz
michael@95 45 Source1: language.idx
michael@95 46 Patch0: pgp2.patch
michael@95 47
michael@95 48 # build information
michael@95 49 Prefix: %{l_prefix}
michael@95 50 BuildRoot: %{l_buildroot}
michael@95 51 BuildPreReq: OpenPKG, openpkg >= 20030909, gcc
michael@95 52 PreReq: OpenPKG, openpkg >= 20030909
michael@95 53 AutoReq: no
michael@95 54 AutoReqProv: no
michael@95 55
michael@95 56 %description
michael@95 57 PGP (Pretty Good Privacy) is a public key encryption program originally
michael@95 58 written by Phil Zimmermann in 1991. This is version %{V_long}, considered
michael@95 59 a classic PGP by some and outdated by others. However, this version of PGP
michael@95 60 is absent of questionable security features implemented in more current
michael@95 61 releases. Because of this, some paranoid PGP users prefer this classic
michael@95 62 version. An article http://senderek.de/security/key-experiments.html
michael@95 63 explains the questionable security features of newer versions of PGP, and
michael@95 64 the reasons that PGP %{V_long} might be the most secure version to date.
michael@95 65
michael@95 66 This version includes '4k' patch code from Rich WALES. It will not display
michael@95 67 warnings regarding RSA patent rights, and allows key generation and
michael@95 68 processing of up to 4096 bits in length. For more information, please see
michael@95 69 http://www.richw.org/pgp/263i-4k-patch.
michael@95 70
michael@95 71 %prep
michael@95 72 # extract distribution
michael@95 73 %setup -c -n pgp-%{V_long}
michael@95 74 %{l_tar} -xf pgp%{V_strip}ii.tar
michael@95 75 %patch -p0
michael@95 76
michael@95 77 # patch distribution
michael@95 78 %{l_shtool} subst \
michael@96 79 -e 's;\/usr\/local\/lib\/pgp;%{l_prefix}\/etc\/pgp;' \
michael@95 80 src/fileio.h
michael@95 81
michael@95 82 %build
michael@95 83 # build program
michael@95 84 cd src
michael@95 85 CC="%{l_cc}"
michael@95 86 CFLAGS="%{l_cflags -O} -fno-strength-reduce"
michael@95 87 CFLAGS="$CFLAGS -DUNIX -DPORTABLE"
michael@95 88 case "%{l_platform -t}" in
michael@95 89 sparc* ) CFLAGS="$CFLAGS -DHIGHFIRST" ;;
michael@95 90 i?86* ) CFLAGS="$CFLAGS -DIDEA32" ;;
michael@95 91 esac
michael@95 92 case "%{l_platform -t}" in
michael@95 93 *-freebsd* ) CFLAGS="$CFLAGS -DMAX_NAMELEN=255" ;;
michael@95 94 *-linux* ) CFLAGS="$CFLAGS -DLINUX" ;;
michael@95 95 *-sunos* ) CFLAGS="$CFLAGS -DSOLARIS" ;;
michael@95 96 esac
michael@95 97 %{l_make} %{l_mflags} \
michael@95 98 CC="$CC" CFLAGS="$CFLAGS" pgp
michael@95 99
michael@95 100 %install
michael@95 101 rm -rf $RPM_BUILD_ROOT
michael@95 102 %{l_shtool} mkdir -f -p -m 755 \
michael@95 103 $RPM_BUILD_ROOT%{l_prefix}/bin \
michael@95 104 $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
michael@96 105 $RPM_BUILD_ROOT%{l_prefix}/etc/pgp
michael@95 106
michael@95 107 # install program and manpage files
michael@95 108 %{l_shtool} install -c -s -m 755 \
michael@96 109 src/pgp $RPM_BUILD_ROOT%{l_prefix}/bin/pgp
michael@95 110 %{l_shtool} install -c -m 644 \
michael@96 111 doc/pgp.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/pgp.1
michael@95 112
michael@95 113 # install configuration, language, and help files
michael@95 114 %{l_shtool} install -c -m 644 \
michael@95 115 config.txt *.hlp doc/pgpdoc[12].txt \
michael@95 116 language.txt %{SOURCE language.idx} \
michael@96 117 $RPM_BUILD_ROOT%{l_prefix}/etc/pgp/
michael@95 118
michael@95 119 # determine installation files and mark configs
michael@95 120 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
michael@95 121 %{l_files_std} \
michael@96 122 '%config %{l_prefix}/etc/pgp/config.txt'
michael@95 123
michael@95 124 %files -f files
michael@95 125
michael@95 126 %clean
michael@95 127 rm -rf $RPM_BUILD_ROOT
michael@95 128

mercurial