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