Name:                jasypt
Version:             1.9.3
Release:             1
Summary:             Java Simplified Encryption
License:             ASL 2.0
Url:                 http://www.jasypt.org/
Source0:             https://github.com/jasypt/jasypt/archive/jasypt-1.9.3.tar.gz
Patch0:              %{name}-1.9.0-use-system-commons-codec.patch
Patch1:              %{name}-1.9.0-StandardStringDigester.patch
Patch2:              %{name}-1.9.0-StandardPBEStringEncryptor.patch
BuildRequires:       maven-local mvn(com.ibm.icu:icu4j) mvn(commons-codec:commons-codec)
BuildRequires:       mvn(commons-lang:commons-lang) mvn(commons-logging:commons-logging)
BuildRequires:       mvn(junit:junit) mvn(javax.servlet:javax.servlet-api)
BuildRequires:       mvn(org.bouncycastle:bcprov-jdk16)
BuildArch:           noarch
%description
Java library which enables encryption
in java apps with minimum effort.

%package javadoc
Summary:             Javadoc for %{name}
%description javadoc
This package contains javadoc for %{name}.

%prep
%setup -q -n %{name}-%{name}-%{version}
rm -rf jasypt-* README.md LICENSE
mv ./jasypt/* ./
%patch0 -p1
%patch1 -p0
%patch2 -p0
%pom_remove_plugin :maven-gpg-plugin
%pom_remove_plugin :maven-site-plugin
%pom_remove_plugin :maven-source-plugin
%pom_remove_plugin :maven-assembly-plugin
%pom_xpath_remove "pom:plugin[pom:artifactId='maven-javadoc-plugin']/pom:executions"
%pom_xpath_remove "pom:plugin[pom:artifactId='maven-resources-plugin']/pom:configuration"
%pom_xpath_inject "pom:plugin[pom:artifactId='maven-resources-plugin']" "
<configuration>
  <encoding>UTF-8</encoding>
</configuration>"
%pom_xpath_remove "pom:plugin[pom:artifactId='maven-compiler-plugin']/pom:configuration"
%pom_xpath_inject "pom:plugin[pom:artifactId='maven-compiler-plugin']" "
<configuration>
  <source>1.6</source>
  <target>1.6</target>
  <encoding>UTF-8</encoding>
</configuration>"
%pom_change_dep bouncycastle:bcprov-jdk12 org.bouncycastle:bcprov-jdk16:1.46:test
%pom_add_dep commons-logging:commons-logging::test
%pom_change_dep javax.servlet: :javax.servlet-api:3.1.0
%mvn_file :%{name} %{name}

%build
%mvn_build -f

%install
%mvn_install

%files -f .mfiles
%doc ChangeLog.txt README.txt RELEASING.txt USAGE.txt
%license LICENSE.txt NOTICE.txt

%files javadoc -f .mfiles-javadoc
%license LICENSE.txt NOTICE.txt

%changelog
* Tue Aug 11 2020 chengzihan <chengzihan2@huawei.com> - 1.9.3-1
- Package init
