<!---
 Licensed to the Apache Software Foundation (ASF) under one or more
 contributor license agreements.  See the NOTICE file distributed with
 this work for additional information regarding copyright ownership.
 The ASF licenses this file to You under the Apache License, Version 2.0
 (the "License"); you may not use this file except in compliance with
 the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
-->
Build instructions for Apache Commons Crypto

----------------------------------------------------------------------------------
Requirements:

* Unix System (Linux or Mac), or Windows with MinGW
* JDK 8 or above (environment variable JAVA_HOME must be set)
* Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy
  Files (if running unit tests)
* export JAVA_HOME
* Maven 3.3.9 or above
* Make
* OpenSSL devel 1.1.1 (OpenSSL library header files are required)
* GCC
* G++

Profile win64 on Ubuntu 64-bit:
apt-get install mingw-w64

apt install x86_64-w64-mingw32-gcc

Profile win32 on Ubuntu 64-bit:
apt install gcc-mingw-w64-i686

Profile linux32 on Ubuntu 64-bit:
dpkg --add-architecture i386
apt-get update
apt-get install libssl-dev:i386
sudo apt-get install g++-multilib

----------------------------------------------------------------------------------
Install JCE Unlimited Strength Jurisdiction Policy Files:

Download the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files from Oracle:

For JDK 1.8: http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html

Install JCE Unlimited Strength Jurisdiction Policy Files to JDK:

Copy downloaded local_policy.jar and US_export_policy.jar to <java-home>/jre/lib/security/

----------------------------------------------------------------------------------
Verify OpenSSL version:

Check OpenSSL version:

  $ openssl version

If it is not 1.1.1, upgrade OpenSSL version to 1.1.1:

Upgrade OpenSSL in Linux:

You can follow your OS distribution instructions to upgrade OpenSSL to a proper version.

Upgrade OpenSSL in Mac:

  $ brew install openssl111
  $ brew link openssl --force

Get OpenSSL headers: sudo apt -y install libssl-dev

Cross compile to 32-bit from Linux 64-bit: sudo apt-get install gcc-multilib

----------------------------------------------------------------------------------
Maven build goals:

* Clean                       : mvn clean
* Compile                     : mvn compile
* Run tests                   : mvn test
* Run Release Audit Check     : mvn apache-rat:check
* Run API Compatibility Check : mvn japicmp:cmp
* Build the site              : mvn site
* Build Javadocs              : mvn javadoc:javadoc -Ddoclint=all
* Run benchmarks              : mvn clean test -Pbenchmark
* Run test; no JNI build      : mvn clean test -Dmaven.antrun.skip
* Create JAR                  : mvn package
* Run SpotBugs Check          : mvn compile spotbugs:check
* Run Checkstyle Check        : mvn compile checkstyle:check
* Install JAR in M2 cache     : mvn install
* Deploy JAR to Maven repo    : mvn deploy
* Change version              : mvn versions:set -DnewVersion=NEWVERSION

----------------------------------------------------------------------------------
Importing projects to eclipse

File menu: Choose Import..., select "Existing Maven Project".

----------------------------------------------------------------------------------
Building distributions:

Please read http://commons.apache.org/releases/index.html

