Bug 15123 - www/apache13-modssl has PREFIX problems finding OpenSSL
Summary: www/apache13-modssl has PREFIX problems finding OpenSSL
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 1999-11-27 21:30 UTC by matt
Modified: 2001-12-21 18:40 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description matt 1999-11-27 21:30:02 UTC
www/apache13-modssl has a problem finding OpenSSL which appears to
be PREFIX-related, but may also happen even if /usr/local is used
as the PREFIX.  When the module is being configured it searches
for OpenSSL include files.  It cannot find them because
${PREFIX}/include/openssl is not in its search path.

I suspect, but cannot confirm, that this would fail even if PREFIX
was not set  because OpenSSL would then install its includes into
/usr/local/include/openssl, and the closest match to that in the
script's list is /usr/local/include/ssl.

In addition, this failure does not return an error code, which
would enable the ports system to detect that the configure had
failed.  Rather, it marks .configure_done and happily moves right
along to the build phase, which of course does return an error
code.

Fix: 

The port (or maybe source tarball?) needs to fix
work/mod_ssl-2.4.9-1.3.9/pkg.sslmod/libssl.module at line 343 to
include a reference to ${PREFIX}/include/openssl in its include
search.  Of course this would probably be done with sed before
configure is called.  However this port is somewhat complex and I
think the maintainer might have a better idea than I would how to
actually go about doing this.
How-To-Repeat: 
# cd /usr/ports/www/apache13-modssl
# make PREFIX=/foo/bar install
Comment 1 dirk freebsd_committer freebsd_triage 1999-12-01 16:05:22 UTC
Responsible Changed
From-To: freebsd-ports->rse

Over to port maintainer. 

Comment 2 matt 1999-12-02 13:59:37 UTC
Update:

I was able to make the port build by manually changing libssl.module as
found in the work/apache_1.3.9/src/modules/ssl directory before the
configure phase.  I had previously and incorrectly identified the
solution as adding $PREFIX/include/openssl.  I was not paying enough
attention to the script.  The correct solution to that particular
problem would be to either add $PREFIX/include or change occurrences of
/usr/local on that line to $PREFIX.

In addition, there are a few other places that $PREFIX needs to be added
or substituted in a similar manner:

1.  Line 351; to make the error message correctly reflect the list of
directories that was searched in case of a problem.

2.  Line 263; to allow for a more reasonable fallback for SSL_BASE (just
for correctness' sake; I did not actually have problems with this
portion of the script), /usr/local should be changed to the value of
$PREFIX.

3.  Lines 369 and 452; to permit searching for libraries in $PREFIX/lib,
/usr/local should be changed here.

4.  Lines 378 and 463; to make the error message correctly reflect the
list of directories that were searched in case of a problem.

Again, I regret that I don't presently have time to figure out how to
make a clean solution to this port, but I might this weekend if the
maintainer hasn't done it just yet.  In any event, with these changes
made manually prior to the configure phase, the port builds and installs
cleanly and seems to operate well.
Comment 3 matt 1999-12-11 03:03:42 UTC
Attached is a shar archive containing (a) a patch to Makefile and
(b) a new patch-af to put in the patches directory.  Works great
for me.

Thanks!

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	Makefile.patch
#	patches/patch-af
#
echo x - Makefile.patch
sed 's/^X//' >Makefile.patch << 'END-of-Makefile.patch'
X--- Makefile.broken	Fri Dec 10 21:24:35 1999
X+++ Makefile	Fri Dec 10 21:35:28 1999
X@@ -111,6 +111,12 @@
X post-patch:
X 	@cd ${WRKSRC} \
X 	&& find . -type f -name "*.orig" -print | xargs ${RM} -f
X+	@${SED} 's#@@PREFIX@@#${PREFIX}#g' \
X+		< ${WRKSRC}/src/modules/ssl/libssl.module \
X+		> ${WRKSRC}/src/modules/ssl/libssl.module.NEW
X+	@${MV} \
X+		${WRKSRC}/src/modules/ssl/libssl.module.NEW \
X+		${WRKSRC}/src/modules/ssl/libssl.module
X 
X post-build:
X 	@cd ${WRKSRC} \
END-of-Makefile.patch
echo x - patches/patch-af
sed 's/^X//' >patches/patch-af << 'END-of-patches/patch-af'
X--- src/modules/ssl/libssl.module.broken	Fri Dec 10 21:18:47 1999
X+++ src/modules/ssl/libssl.module	Fri Dec 10 21:20:22 1999
X@@ -260,7 +260,7 @@
X     if [ ".$SSL_BASE" = . ]; then
X         SSL_BASE=`egrep '^SSL_BASE=' $file | tail -1 | awk -F= '{print $2}'`
X         if [ ".$SSL_BASE" = . ]; then
X-            SSL_BASE="/usr/local/ssl"
X+            SSL_BASE="@@PREFIX@@/ssl"
X         fi
X     fi
X     case $SSL_BASE in
X@@ -340,7 +340,7 @@
X     #
X     if [ ".$SSL_BASE" = .SYSTEM ]; then
X         SSL_INCDIR=""
X-        for p in . /usr/include /usr/include/ssl/ /usr/local/include /usr/local/include/ssl; do
X+        for p in . /usr/include /usr/include/ssl/ /usr/local/include /usr/local/include/ssl @@PREFIX@@/include; do
X             if [ -f "$p/openssl/ssl.h" ]; then
X                 SSL_INCDIR="$p"
X                 break
X@@ -348,7 +348,7 @@
X         done
X         if [ ".$SSL_INCDIR" = . ]; then
X             echo "Error: Cannot find SSL header files in any of the following dirs:" 1>&2
X-            echo "Error: . /usr/include /usr/include/ssl/ /usr/local/include /usr/local/include/ssl" 1>&2
X+            echo "Error: . /usr/include /usr/include/ssl/ /usr/local/include /usr/local/include/ssl @@PREFIX@@/include" 1>&2
X             exit 1
X         fi
X     else
X@@ -366,7 +366,7 @@
X     #
X     if [ ".$SSL_BASE" = .SYSTEM ]; then
X         SSL_LIBDIR=""
X-        for p in . /lib /usr/lib /usr/local/lib; do
X+        for p in . /lib /usr/lib /usr/local/lib @@PREFIX@@/lib; do
X             if [ -f "$p/libssl.a" -o -f "$p/libssl.so" ]; then
X                 SSL_LIBDIR="$p"
X                 my_real_ssl_libdir="$p"
X@@ -375,7 +375,7 @@
X         done
X         if [ ".$SSL_LIBDIR" = . ]; then
X             echo "Error: Cannot find SSL library files in any of the following dirs:" 1>&2
X-            echo "Error: . /lib /usr/lib /usr/local/lib" 1>&2
X+            echo "Error: . /lib /usr/lib /usr/local/lib @@PREFIX@@/lib" 1>&2
X             exit 1
X         fi
X     else
X@@ -449,7 +449,7 @@
X     if [ ".$RSA_BASE" != . ]; then
X         if [ ".$RSA_BASE" = .SYSTEM ]; then
X             my_found=no
X-            for p in . /lib /usr/lib /usr/local/lib; do
X+            for p in . /lib /usr/lib /usr/local/lib @@PREFIX@@/lib; do
X                 if [ -f "$p/librsaref.a" -o -f "$p/librsaref.so" ]; then
X                     SSL_LDFLAGS="$SSL_LDFLAGS -L$p"
X                     SSL_LIBS="$SSL_LIBS -lrsaref"
X@@ -460,7 +460,7 @@
X             done
X             if [ .$my_found = .no ]; then
X                 echo "Error: Cannot find RSAref library in any of the following dirs:" 1>&2
X-                echo "Error: . /lib /usr/lib /usr/local/lib" 1>&2
X+                echo "Error: . /lib /usr/lib /usr/local/lib @@PREFIX@@/lib" 1>&2
X                 exit 1
X             fi
X         else
END-of-patches/patch-af
exit
Comment 4 dirk freebsd_committer freebsd_triage 2001-11-05 12:59:20 UTC
Responsible Changed
From-To: rse->freebsd-ports

rse doesn't maintain apache13-modssl any longer.
Comment 5 Ying-Chieh Liao freebsd_committer freebsd_triage 2001-12-20 11:15:35 UTC
State Changed
From-To: open->closed

committed, thanks 
it takes a long time to fix this problem ...
Comment 6 ckd 2001-12-21 18:39:46 UTC
The committed patch no longer cleanly applies to Apache+mod_ssl; this is 
not surprising since it was submitted just over 2 years ago....

It also appears to be no longer necessary based on a quick glance.