Blame SOURCES/openssl-1.0.2i-enginesdir.patch

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