From: Amul Shah <Amul.Shah@fisglobal.com>
Forwarded: not-needed
Summary: Do not deploy the encryption libraries that require OpenSSL
Description: Build, but do not install the reference encryption plugins due to
  licensing conflicts between the AGPL and the OpenSSL license. Reference
  plugins are built simply to ensure that they could compile on the target
  system provided the correct libraries are installed. Upstream will pursue
  alternate encryption libraries, but there are no plans for this at the
  moment.
Last-Update: 2015-01-11

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -467,6 +467,8 @@
 add_dependencies(libgtmshr gen_export)
 add_dependencies(mumps libgtmshr)
 
+# FIXME: Temporarily disable building of encryption plugin libraries
+if (0) 
 # Iterate over the list of GPG related libraries
 foreach(gpglib gpg-error gpgme gcrypt config)
   # For each library, we need a new CMake variable, hence GPGLIB_${gpglib}
@@ -519,7 +521,7 @@
   )
 target_link_libraries(libgtmcrypt_openssl_AES256CFB ${GPG_LIBRARIES} ${TLS_LIBRARIES})
 add_dependencies(libgtmcrypt_openssl_AES256CFB gen_gtm_threadgbl_deftypes)
-install(TARGETS libgtmcrypt_openssl_AES256CFB DESTINATION ${GTM_INSTALL_DIR}/plugin)
+#install(TARGETS libgtmcrypt_openssl_AES256CFB DESTINATION ${GTM_INSTALL_DIR}/plugin)
 
 # Library=OPENSSL Algorithm=BLOWFISHCFB
 add_library(libgtmcrypt_openssl_BLOWFISHCFB MODULE ${libgtmcrypt_SOURCES})
@@ -530,7 +532,7 @@
   )
 target_link_libraries(libgtmcrypt_openssl_BLOWFISHCFB ${GPG_LIBRARIES} ${TLS_LIBRARIES})
 add_dependencies(libgtmcrypt_openssl_BLOWFISHCFB gen_gtm_threadgbl_deftypes)
-install(TARGETS libgtmcrypt_openssl_BLOWFISHCFB DESTINATION ${GTM_INSTALL_DIR}/plugin)
+#install(TARGETS libgtmcrypt_openssl_BLOWFISHCFB DESTINATION ${GTM_INSTALL_DIR}/plugin)
 
 add_library(libgtmtls MODULE ${libgtmtls_SOURCES})
 set_target_properties(libgtmtls PROPERTIES
@@ -540,7 +542,7 @@
   )
 target_link_libraries(libgtmtls ${TLS_LIBRARIES})
 add_dependencies(libgtmtls gen_gtm_threadgbl_deftypes)
-install(TARGETS libgtmtls DESTINATION ${GTM_INSTALL_DIR}/plugin)
+#install(TARGETS libgtmtls DESTINATION ${GTM_INSTALL_DIR}/plugin)
 
 add_executable(maskpass ${maskpass_SOURCES})
 target_link_libraries(maskpass ${GPG_LIBRARIES} ${TLS_LIBRARIES})
@@ -549,6 +551,7 @@
   RUNTIME_OUTPUT_DIRECTORY ${GTM_BINARY_DIR}/plugin/gtmcrypt
   )
 install(TARGETS maskpass DESTINATION ${GTM_INSTALL_DIR}/plugin/gtmcrypt)
+endif(0)
 
 # Always copy files into the plugin directory
 foreach(f
@@ -768,14 +771,14 @@
   STRING(REGEX REPLACE "\n" ";" locale_list "${locale_list}")
   foreach(lc ${locale_list})
     string(TOLOWER "${lc}" lc_lower)
-    if("x${lc_lower}" MATCHES "^xen_us\\.?utf-?8")
+    if("x${lc_lower}" MATCHES "^x[a-zA-Z_]+\\.?utf-?8")
       set(LC_ALL ${lc})
       message("-- Setting locale to ${LC_ALL}")
       break()
     endif()
   endforeach(lc)
   if("${LC_ALL}" STREQUAL "")
-    message("Locale undefined. Expect to see NONUTF8LOCALE during MUMPS routine compilation\n")
+    message("Locale undefined. Expect to see NONUTF8LOCALE during MUMPS routine compilation: ${locale_list}\n")
   endif()
 else()
   message(FATAL_ERROR "Unable to find 'locale'.  Set LOCALECFG in CMake cache.")
--- a/sr_unix/configure.gtc
+++ b/sr_unix/configure.gtc
@@ -544,6 +544,7 @@
 	chmod 0644 $gtmdist/$plugin_gtmcrypt/source.tar
 	chown ${owner}:${bingroup} $gtmdist/$plugin_gtmcrypt/source.tar
 	rm $plugin_gtmcrypt/README
+	(cd $gtmdist/$plugin_gtmcrypt && tar -xvf source.tar)
 fi
 
 # Install GDE, GTMHELP, and all the percent routines
