Subject: pkg/28809: security/openssl installation problem on IRIX 5
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <georg.schwarz@freenet.de>
List: pkgsrc-bugs
Date: 12/29/2004 22:12:00
>Number:         28809
>Category:       pkg
>Synopsis:       security/openssl installation problem on IRIX 5
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 29 22:12:00 +0000 2004
>Originator:     Georg Schwarz
>Release:        current pkgsrc
>Organization:
>Environment:
IRIX lorenz 5.3 08031225 IP20 mips
>Description:
When installing openssl-0.9.7e on IRIX 5.3 there are some shell issues with the installation. At certain points it fails:

making install in fips/sha1...
gmake[2]: Entering directory `/usr/people/schwarz/pkgsrc/security/openssl/work/o
penssl-0.9.7e/fips/sha1'
/bin/sh: Syntax error at line 1: `;' unexpected
gmake[2]: *** [install] Error 2
gmake[2]: Leaving directory `/usr/people/schwarz/pkgsrc/security/openssl/work/op
enssl-0.9.7e/fips/sha1'
making install in fips/rand...
gmake[2]: Entering directory `/usr/people/schwarz/pkgsrc/security/openssl/work/o
penssl-0.9.7e/fips/rand'
gmake[2]: Leaving directory `/usr/people/schwarz/pkgsrc/security/openssl/work/op
enssl-0.9.7e/fips/rand'
making install in fips/des...
gmake[2]: Entering directory `/usr/people/schwarz/pkgsrc/security/openssl/work/o
penssl-0.9.7e/fips/des'
/bin/sh: Syntax error at line 1: `;' unexpected
gmake[2]: *** [install] Error 2
gmake[2]: Leaving directory `/usr/people/schwarz/pkgsrc/security/openssl/work/op
enssl-0.9.7e/fips/des'
making install in fips/aes...
gmake[2]: Entering directory `/usr/people/schwarz/pkgsrc/security/openssl/work/o
penssl-0.9.7e/fips/aes'
/bin/sh: Syntax error at line 1: `;' unexpected
gmake[2]: *** [install] Error 2
gmake[2]: Leaving directory `/usr/people/schwarz/pkgsrc/security/openssl/work/op
enssl-0.9.7e/fips/aes'
making install in fips/dsa...
gmake[2]: Entering directory `/usr/people/schwarz/pkgsrc/security/openssl/work/o
penssl-0.9.7e/fips/dsa'
/bin/sh: Syntax error at line 1: `;' unexpected
gmake[2]: *** [install] Error 2
gmake[2]: Leaving directory `/usr/people/schwarz/pkgsrc/security/openssl/work/op
enssl-0.9.7e/fips/dsa'
making install in fips/rsa...
gmake[2]: Entering directory `/usr/people/schwarz/pkgsrc/security/openssl/work/o
penssl-0.9.7e/fips/rsa'
/bin/sh: Syntax error at line 1: `;' unexpected
gmake[2]: *** [install] Error 2
gmake[2]: Leaving directory `/usr/people/schwarz/pkgsrc/security/openssl/work/op
enssl-0.9.7e/fips/rsa'
making install in fips/dh...
gmake[2]: Entering directory `/usr/people/schwarz/pkgsrc/security/openssl/work/o
penssl-0.9.7e/fips/dh'
/bin/sh: Syntax error at line 1: `;' unexpected
gmake[2]: *** [install] Error 2
gmake[2]: Leaving directory `/usr/people/schwarz/pkgsrc/security/openssl/work/op
enssl-0.9.7e/fips/dh'
gmake[1]: *** [install] Error 2
gmake[1]: Leaving directory `/usr/people/schwarz/pkgsrc/security/openssl/work/op
enssl-0.9.7e/fips'

This seems to result in openssl_fips_fingerprint not being installed:

Cannot access /usr/local/pkg/bin/openssl_fips_fingerprint: No such file or directory

Unfortunately I am not familiar enough with Makefiles, so I was unable to figure out the precise reason. It seems to be that the shell does not like some of the syntax used in some of the Makefiles.
When I use SHELL= to have GNU bash as the shell the problem does not appear. With SHELL=/bin/ksh it still does. 

As a probably unrelated problem, certain libs do not seem to be built:

Cannot access /usr/local/pkg/lib/libcrypto.so.300: No such file or directory
Cannot access /usr/local/pkg/lib/libcrypto.so.300.1: No such file or directory
Cannot access /usr/local/pkg/lib/libssl.so.300: No such file or directory
Cannot access /usr/local/pkg/lib/libssl.so.300.1: No such file or directory

maybe this is normal on IRIX 5, in which case one would have to differentiate in PLIST between IRIX 5 and IRIX 6.

>How-To-Repeat:

>Fix:
For the first issue I was able to work around using bash:

--- Makefile.orig       2004-12-26 02:27:25.000000000 +0100
+++ Makefile    2004-12-26 02:25:31.000000000 +0100
@@ -51,6 +51,10 @@
 CONFIGURE_SCRIPT=      ./Configure
 CONFIGURE_ARGS+=       irix64-mips4-cc
 .  endif
+.  if !empty(OS_VERSION:M5*)
+BUILD_DEPENDS+=         bash-[2-]*:../../shells/bash
+MAKEFLAGS+=             SHELL=${LOCALBASE}/bin/bash
+.  endif
 .endif
 
 CONFIGURE_ARGS+=       ${CFLAGS} ${LDFLAGS}

I'm not sure if that is the correct way of doing it. Moreover, I do not like very much the dependency it induces. (BTW, would .if ${OS_VERSION} < 6.0 be better syntax?)