Blame SOURCES/openssl-1.0.2i-enginesdir.patch

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