On Fri, Jun 21, 2002, Michael Schloh wrote:

> [...]
>     Backed out some misinformed changes, and made gcc-dependent thread library
>     inclusion consistent across platforms.
> [...]
>        cd src
>   -    CC="%{l_cc}"
>   +    CC="%{l_cc}" CFLAGS="%{l_cflags -O}"
>   +    CFLAGS="%{l_cflags -O}"
>   +    case "%{l_target}" in
>   +        *-freebsd* )
>   +            if ( %{l_cc} --version | grep -i -e "gcc" ); then
>   +                CFLAGS="$CFLAGS -pthread"
>   +            fi
>   +            ;;
>   +        *-solaris* )
>   +            if ( %{l_cc} --version | grep -i -e "gcc" ); then
>   +                CFLAGS="$CFLAGS -pthreads"
>   +            fi
>   +            ;;
>   +    esac
>        case "%{l_target}" in
>            *-freebsd* )
>                OS=freebsd

Sorry Michael, but I've to complain loudly again.
The whole package is still broken:

1. As I already said, using -pthread[s] is useless unless the
   application uses any Pthread functions. PGP 2.x doesn't:

   | openpkg-dev$ find /tmp/rse/openpkg/pgp-2.6.3i -type f -print |\
   |              xargs grep -i pthread
   | openpkg-dev$ _

   So I do not understand what the fuzz is about in your fiddling
   with this here.

2. Even if it would be correct to use the above Pthread fiddling, you
   still do not depend on "gcc" and hence %{l_cc} still could be the
   Workshop compiler on a Solaris box.

3. If you look inside src/makefile of PGP 2.x you will recognize that
   all this is fully broken, because only a few platforms respect $(CC).
   Most (like Solaris) force it to something like CC=gcc, etc.

4. In your latest version above you now have the init of CFLAGS twice.

5. Your OS=sun4gcc should be OS=sun4sunos5gcc, because sun4gcc is
   for the good old braindead SunOS 4 (although this still might work on
   SunOS 5).

6. In general the whole direct $OS determination is predestined to fail
   because it restricts you to a _very_ limited set of platforms.
   Something like a small decision hierarchy approach is needed here.

7. PGP complains under run-time:

   | openpkg-dev$ /cw/bin/pgp -kg
   | Pretty Good Privacy(tm) 2.6.3ia - Public-key encryption for the masses.
   | (c) 1990-96 Philip Zimmermann, Phil's Pretty Good Software. 1996-03-04
   | International version - not for use in the USA. Does not use RSAREF.
   | Current time: 2002/06/21 19:49 GMT
   |
   | Error: PGP User's Guide not found.
   | PGP looked for it in the following directories:

   The pgpdoc[12].txt files are missing.

8. The binary and man-page you install conflicts with the files in our "pgp"
   package. A "pgp2" package should install <prefix>/bin/pgp2, of course.

9. The package "Distribution" is "OpenPKG [REL]" instead of "OpenPKG [EXP]".

I felt free to fix this now for us (see appended and already comitted
patch). But please review my changes to make sure you understood my
solutions to the above points.
                                       Ralf S. Engelschall
                                       [EMAIL PROTECTED]
                                       www.engelschall.com
Index: pgp2.spec
===================================================================
RCS file: /e/openpkg/cvs/openpkg-src/pgp2/pgp2.spec,v
retrieving revision 1.5
diff -u -d -u -d -r1.5 pgp2.spec
--- pgp2.spec   21 Jun 2002 17:48:22 -0000      1.5
+++ pgp2.spec   21 Jun 2002 19:59:01 -0000
@@ -33,7 +33,7 @@
 URL:          http://www.pgpi.org/
 Vendor:       Philip Zimmerman
 Packager:     The OpenPKG Project
-Distribution: OpenPKG [REL]
+Distribution: OpenPKG [EXP]
 Group:        Cryptography
 License:      GPL
 Version:      %{V_long}
@@ -45,7 +45,7 @@
 #   build information
 Prefix:       %{l_prefix}
 BuildRoot:    %{l_buildroot}
-BuildPreReq:  OpenPKG, openpkg >= 20020206, tar
+BuildPreReq:  OpenPKG, openpkg >= 20020206, tar, gcc
 PreReq:       OpenPKG, openpkg >= 20020206
 AutoReq:      no
 AutoReqProv:  no
@@ -61,46 +61,33 @@
     the reasons that PGP %{V_long} might be the most secure version to date.

 %prep
+    #   extract distribution
     %setup -c -n pgp-%{V_long}
     %{l_prefix}/bin/tar -xf pgp%{V_strip}ii.tar
+
+    #   patch distribution
     chmod u+w src/fileio.h
-    %{l_shtool} subst -e 's;\/usr\/local\/lib\/pgp;%{l_prefix}\/etc\/pgp2;' 
src/fileio.h
+    %{l_shtool} subst \
+        -e 's;\/usr\/local\/lib\/pgp;%{l_prefix}\/etc\/pgp2;' \
+        src/fileio.h

 %build
+    #   build program
     cd src
-    CC="%{l_cc}" CFLAGS="%{l_cflags -O}"
-    CFLAGS="%{l_cflags -O}"
+    CC="%{l_cc}"
+    CFLAGS="%{l_cflags -O} -fno-strength-reduce"
+    CFLAGS="$CFLAGS -DUNIX -DPORTABLE"
     case "%{l_target}" in
-        *-freebsd* )
-            if ( %{l_cc} --version | egrep -i -e "gcc" ); then
-                CFLAGS="$CFLAGS -pthread"
-            fi
-            ;;
-        *-solaris* )
-            if ( %{l_cc} --version | egrep -i -e "gcc" ); then
-                CFLAGS="$CFLAGS -pthreads"
-            fi
-            ;;
+        sparc*     ) CFLAGS="$CFLAGS -DHIGHFIRST" ;;
+        *[3456x]86*) CFLAGS="$CFLAGS -DIDEA32"    ;;
     esac
     case "%{l_target}" in
-        *-freebsd* )
-            OS=freebsd
-            ;;
-        *-linux* )
-            OS=linux
-            ;;
-        *ix86-solaris* )
-            OS=solx86gcc
-            ;;
-        *-solaris* )
-            OS=sun4gcc
-            ;;
-        *)
-            echo "Unsupported platform" 1>&2
-            exit 1
-            ;;
+        *-freebsd* ) CFLAGS="$CFLAGS -DMAX_NAMELEN=255" ;;
+        *-linux*   ) CFLAGS="$CFLAGS -DLINUX"           ;;
+        *-solaris* ) CFLAGS="$CFLAGS -DSOLARIS"         ;;
     esac
-    %{l_make} %{l_mflags} $OS
+    %{l_make} %{l_mflags} \
+        CC="$CC" CFLAGS="$CFLAGS" pgp

 %install
     rm -rf $RPM_BUILD_ROOT
@@ -111,13 +98,14 @@

     #   install program and manpage files
     %{l_shtool} install -c -s -m 755 \
-        src/pgp $RPM_BUILD_ROOT%{l_prefix}/bin/
+        src/pgp $RPM_BUILD_ROOT%{l_prefix}/bin/pgp2
     %{l_shtool} install -c -m 644 \
-        doc/pgp.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/
+        doc/pgp.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/pgp2.1

     #   install configuration, language, and help files
     %{l_shtool} install -c -m 644 \
-        config.txt language.txt *.hlp $RPM_BUILD_ROOT%{l_prefix}/etc/pgp2/
+        config.txt language.txt *.hlp doc/pgpdoc[12].txt \
+        $RPM_BUILD_ROOT%{l_prefix}/etc/pgp2/

     #   determine installation files and mark configs
     %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
Developer Communication List                   [EMAIL PROTECTED]

Reply via email to