Blame SOURCES/openssl-1.0.2i-enginesdir.patch

cfec1a
diff --git a/Configure b/Configure
cfec1a
index c39f71a..7f3d905 100755
cfec1a
--- a/Configure
cfec1a
+++ b/Configure
cfec1a
@@ -727,6 +727,7 @@ my $idx_multilib = $idx++;
a5ef24
 my $prefix="";
a5ef24
 my $libdir="";
a5ef24
 my $openssldir="";
a5ef24
+my $enginesdir="";
a5ef24
 my $exe_ext="";
a5ef24
 my $install_prefix= "$ENV{'INSTALL_PREFIX'}";
a5ef24
 my $cross_compile_prefix="";
cfec1a
@@ -956,6 +957,10 @@ PROCESS_ARGS:
a5ef24
 				{
a5ef24
 				$openssldir=$1;
a5ef24
 				}
a5ef24
+			elsif (/^--enginesdir=(.*)$/)
a5ef24
+				{
a5ef24
+				$enginesdir=$1;
a5ef24
+				}
a5ef24
 			elsif (/^--install.prefix=(.*)$/)
a5ef24
 				{
a5ef24
 				$install_prefix=$1;
cfec1a
@@ -1207,7 +1212,7 @@ chop $prefix if $prefix =~ /.\/$/;
a5ef24
 
a5ef24
 $openssldir=$prefix . "/ssl" if $openssldir eq "";
a5ef24
 $openssldir=$prefix . "/" . $openssldir if $openssldir !~ /(^\/|^[a-zA-Z]:[\\\/])/;
a5ef24
-
a5ef24
+$enginesdir="$prefix/lib/engines" if $enginesdir eq "";
a5ef24
 
a5ef24
 print "IsMK1MF=$IsMK1MF\n";
a5ef24
 
cfec1a
@@ -1709,6 +1714,7 @@ while (<IN>)
cfec1a
 	s/^INSTALLTOP=.*$/INSTALLTOP=$prefix/;
cfec1a
 	s/^MULTILIB=.*$/MULTILIB=$multilib/;
cfec1a
 	s/^OPENSSLDIR=.*$/OPENSSLDIR=$openssldir/;
cfec1a
+	s/^ENGINESDIR=.*$/ENGINESDIR=$enginesdir/;
cfec1a
 	s/^LIBDIR=.*$/LIBDIR=$libdir/;
cfec1a
 	s/^INSTALL_PREFIX=.*$/INSTALL_PREFIX=$install_prefix/;
cfec1a
 	s/^PLATFORM=.*$/PLATFORM=$target/;
cfec1a
@@ -1915,7 +1921,7 @@ while (<IN>)
a5ef24
 		}
a5ef24
 	elsif	(/^#define\s+ENGINESDIR/)
a5ef24
 		{
a5ef24
-		my $foo = "$prefix/$libdir/engines";
a5ef24
+		my $foo = "$enginesdir";
a5ef24
 		$foo =~ s/\\/\\\\/g;
a5ef24
 		print OUT "#define ENGINESDIR \"$foo\"\n";
a5ef24
 		}
cfec1a
diff --git a/Makefile.org b/Makefile.org
cfec1a
index 2377f50..fe8d54c 100644
cfec1a
--- a/Makefile.org
cfec1a
+++ b/Makefile.org
cfec1a
@@ -28,6 +28,7 @@ INSTALLTOP=/usr/local/ssl
cfec1a
 
cfec1a
 # Do not edit this manually. Use Configure --openssldir=DIR do change this!
cfec1a
 OPENSSLDIR=/usr/local/ssl
cfec1a
+ENGINESDIR=$${libdir}/engines
cfec1a
 
cfec1a
 # NO_IDEA - Define to build without the IDEA algorithm
cfec1a
 # NO_RC4  - Define to build without the RC4 algorithm
cfec1a
@@ -368,7 +369,7 @@ libcrypto.pc: Makefile
cfec1a
 	    echo 'exec_prefix=$${prefix}'; \
cfec1a
 	    echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
cfec1a
 	    echo 'includedir=$${prefix}/include'; \
cfec1a
-	    echo 'enginesdir=$${libdir}/engines'; \
cfec1a
+	    echo 'enginesdir=$(ENGINESDIR)'; \
cfec1a
 	    echo ''; \
cfec1a
 	    echo 'Name: OpenSSL-libcrypto'; \
cfec1a
 	    echo 'Description: OpenSSL cryptography library'; \
cfec1a
diff --git a/engines/Makefile b/engines/Makefile
cfec1a
index 2058ff4..a2c407b 100644
cfec1a
--- a/engines/Makefile
cfec1a
+++ b/engines/Makefile
a5ef24
@@ -124,7 +124,7 @@ install:
cfec1a
 				esac; \
cfec1a
 				cp $$pfx$$l$$sfx $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx.new; \
a5ef24
 			  fi; \
a5ef24
-			  chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx.new; \
a5ef24
+			  chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx.new; \
a5ef24
 			  mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx ); \
a5ef24
 		done; \
a5ef24
 	fi