166 lines
8.5 KiB
RPMSpec
166 lines
8.5 KiB
RPMSpec
%global namedreltag -alpha-3
|
|
%global namedversion %{version}%{?namedreltag}
|
|
%global dotreltag %(echo %{namedreltag} | tr - .)
|
|
Name: jspc
|
|
Version: 2.0
|
|
Release: 1
|
|
Summary: Compile JSPs under Maven
|
|
License: ASL 2.0
|
|
Url: https://repo1.maven.org/maven2/org/codehaus/mojo/jspc
|
|
Source0: https://repo1.maven.org/maven2/org/codehaus/mojo/%{name}/jspc-compiler-api/%{namedversion}/jspc-compiler-api-%{namedversion}-sources.jar
|
|
Source1: https://repo1.maven.org/maven2/org/codehaus/mojo/%{name}/jspc-compiler-api/%{namedversion}/jspc-compiler-api-%{namedversion}.pom
|
|
Source2: https://repo1.maven.org/maven2/org/codehaus/mojo/%{name}/jspc-compilers/%{namedversion}/jspc-compilers-%{namedversion}-site.xml
|
|
Source3: https://repo1.maven.org/maven2/org/codehaus/mojo/%{name}/jspc-compilers/%{namedversion}/jspc-compilers-%{namedversion}.pom
|
|
Source4: https://repo1.maven.org/maven2/org/codehaus/mojo/%{name}/jspc-compiler-tomcat5/%{namedversion}/jspc-compiler-tomcat5-%{namedversion}-sources.jar
|
|
Source5: https://repo1.maven.org/maven2/org/codehaus/mojo/%{name}/jspc-compiler-tomcat5/%{namedversion}/jspc-compiler-tomcat5-%{namedversion}.pom
|
|
Source6: https://repo1.maven.org/maven2/org/codehaus/mojo/%{name}/jspc-compiler-tomcat6/%{namedversion}/jspc-compiler-tomcat6-%{namedversion}-sources.jar
|
|
Source7: https://repo1.maven.org/maven2/org/codehaus/mojo/%{name}/jspc-compiler-tomcat6/%{namedversion}/jspc-compiler-tomcat6-%{namedversion}.pom
|
|
Source8: https://repo1.maven.org/maven2/org/codehaus/mojo/%{name}/jspc-maven-plugin/%{namedversion}/jspc-maven-plugin-%{namedversion}-sources.jar
|
|
Source9: https://repo1.maven.org/maven2/org/codehaus/mojo/%{name}/jspc-maven-plugin/%{namedversion}/jspc-maven-plugin-%{namedversion}.pom
|
|
Source10: https://repo1.maven.org/maven2/org/codehaus/mojo/%{name}/%{name}/%{namedversion}/jspc-%{namedversion}.pom
|
|
Source11: https://www.apache.org/licenses/LICENSE-2.0.txt
|
|
Patch0: %{name}-ant-groovyc.patch
|
|
BuildRequires: java-devel maven-local
|
|
BuildRequires: apache-resource-bundles ant antlr3-tool fusesource-pom
|
|
BuildRequires: mvn(commons-lang:commons-lang) mvn(org.apache.maven.shared:file-management)
|
|
BuildRequires: plexus-containers-container-default mvn(org.apache.tomcat:tomcat-servlet-api)
|
|
BuildRequires: mvn(org.glassfish.web:javax.servlet.jsp)
|
|
BuildRequires: maven-antrun-plugin maven-enforcer-plugin maven-invoker-plugin
|
|
BuildRequires: maven-plugin-plugin maven-remote-resources-plugin maven-install-plugin
|
|
BuildRequires: mvn(org.codehaus.plexus:plexus-component-metadata)
|
|
BuildRequires: groovy18
|
|
Requires: groovy18
|
|
BuildArch: noarch
|
|
%description
|
|
The Codehaus is a collaborative environment for building open source
|
|
projects with a strong emphasis on modern languages, focused on
|
|
quality components that meet real world needs.
|
|
Provides support to precompile your JSPs and have them included into
|
|
your WAR file. Version 2 of the JSP compilation support includes a
|
|
pluggable JSP compiler implementation, which currently allows different
|
|
versions of the Tomcat Jasper compiler to be used as needed.
|
|
|
|
%package javadoc
|
|
Summary: Javadoc for %{name}
|
|
%description javadoc
|
|
This package contains javadoc for %{name}.
|
|
|
|
%prep
|
|
%setup -q -c -n %{name}
|
|
mkdir -p ./jspc-compiler-api/src/main/java/
|
|
mv ./org ./jspc-compiler-api/src/main/java/
|
|
mv ./META-INF ./jspc-compiler-api/
|
|
cp %{SOURCE1} ./jspc-compiler-api/pom.xml
|
|
|
|
mkdir -p ./jspc-compilers/
|
|
mkdir -p ./jspc-compilers/src/site/
|
|
cp %{SOURCE2} ./jspc-compilers/src/site/site.xml
|
|
cp %{SOURCE3} ./jspc-compilers/pom.xml
|
|
|
|
mkdir -p ./jspc-compilers/jspc-compiler-tomcat5/src/main/java/
|
|
cp %{SOURCE4} ./
|
|
unzip ./%{name}-compiler-tomcat5-%{namedversion}-sources.jar
|
|
mv ./org ./jspc-compilers/jspc-compiler-tomcat5/src/main/java/
|
|
mv ./META-INF ./jspc-compilers/jspc-compiler-tomcat5/
|
|
rm -f ./%{name}-compiler-tomcat5-%{namedversion}-sources.jar
|
|
cp %{SOURCE5} ./jspc-compilers/jspc-compiler-tomcat5/pom.xml
|
|
|
|
mkdir -p ./jspc-compilers/jspc-compiler-tomcat6/src/main/java/
|
|
cp %{SOURCE6} ./
|
|
unzip ./%{name}-compiler-tomcat6-%{namedversion}-sources.jar
|
|
mv ./org ./jspc-compilers/jspc-compiler-tomcat6/src/main/java/
|
|
mv ./META-INF ./jspc-compilers/jspc-compiler-tomcat6/
|
|
rm -f ./%{name}-compiler-tomcat6-%{namedversion}-sources.jar
|
|
cp %{SOURCE7} ./jspc-compilers/jspc-compiler-tomcat6/pom.xml
|
|
|
|
mkdir -p ./jspc-maven-plugin/src/main/groovy/
|
|
cp %{SOURCE8} ./
|
|
unzip ./%{name}-maven-plugin-%{namedversion}-sources.jar
|
|
mv ./org ./jspc-maven-plugin/src/main/groovy/
|
|
mv ./META-INF ./jspc-maven-plugin/
|
|
pushd jspc-maven-plugin/src/main/groovy/org/codehaus/mojo/jspc/
|
|
rename JspcMojoClassLoader.java JspcMojoClassLoader.java~ JspcMojoClassLoader.java
|
|
rm -f *.java
|
|
rename JspcMojoClassLoader.java~ JspcMojoClassLoader.java JspcMojoClassLoader.java~
|
|
popd
|
|
rm -f ./%{name}-maven-plugin-%{namedversion}-sources.jar
|
|
cp %{SOURCE9} ./jspc-maven-plugin/pom.xml
|
|
|
|
cp %{SOURCE10} ./pom.xml
|
|
cp %{SOURCE11} ./LICENSE.txt
|
|
%pom_remove_parent
|
|
for d in LICENSE ; do
|
|
iconv -f iso8859-1 -t utf-8 $d.txt > $d.txt.conv && mv -f $d.txt.conv $d.txt
|
|
sed -i 's/\r//' $d.txt
|
|
done
|
|
sed -i 's|import org.codehaus.groovy.maven.mojo.GroovyMojo|import org.apache.maven.plugin.AbstractMojo|' \
|
|
jspc-maven-plugin/src/main/groovy/org/codehaus/mojo/jspc/CompilationMojoSupport.groovy
|
|
sed -i 's|extends GroovyMojo|extends AbstractMojo|' \
|
|
jspc-maven-plugin/src/main/groovy/org/codehaus/mojo/jspc/CompilationMojoSupport.groovy
|
|
sed -i 's|<artifactId>plexus-maven-plugin</artifactId>|<artifactId>plexus-component-metadata</artifactId>|' pom.xml
|
|
%pom_disable_module jspc-compiler-tomcat5 jspc-compilers/pom.xml
|
|
%pom_remove_dep org.apache.tomcat:juli jspc-compilers/jspc-compiler-tomcat6/pom.xml
|
|
%pom_remove_dep org.apache.tomcat:servlet-api jspc-compilers/jspc-compiler-tomcat6/pom.xml
|
|
%pom_remove_dep org.apache.tomcat:jsp-api jspc-compilers/jspc-compiler-tomcat6/pom.xml
|
|
%pom_remove_dep org.apache.tomcat:el-api jspc-compilers/jspc-compiler-tomcat6/pom.xml
|
|
%pom_remove_dep org.apache.tomcat:jasper-jdt jspc-compilers/jspc-compiler-tomcat6/pom.xml
|
|
%pom_remove_dep org.apache.tomcat:annotations-api jspc-compilers/jspc-compiler-tomcat6/pom.xml
|
|
%pom_remove_dep org.apache.tomcat:jasper jspc-compilers/jspc-compiler-tomcat6/pom.xml
|
|
%pom_remove_dep org.apache.tomcat:jasper-el jspc-compilers/jspc-compiler-tomcat6/pom.xml
|
|
%pom_add_dep org.apache.tomcat:tomcat-servlet-api jspc-compilers/jspc-compiler-tomcat6/pom.xml
|
|
%pom_add_dep org.glassfish.web:javax.servlet.jsp jspc-compilers/jspc-compiler-tomcat6/pom.xml
|
|
%pom_remove_plugin org.codehaus.plexus:plexus-maven-plugin jspc-compilers/pom.xml
|
|
%pom_add_plugin org.codehaus.plexus:plexus-component-metadata jspc-compilers/pom.xml "
|
|
<configuration>
|
|
<descriptors>
|
|
<descriptor>target/classes/META-INF/plexus/components.xml</descriptor>
|
|
</descriptors>
|
|
</configuration>
|
|
<executions>
|
|
<execution>
|
|
<id>create-component-descriptor</id>
|
|
<phase>generate-resources</phase>
|
|
<goals>
|
|
<goal>generate-metadata</goal>
|
|
</goals>
|
|
</execution>
|
|
</executions>
|
|
"
|
|
%pom_remove_plugin org.apache.maven.plugins:maven-compiler-plugin pom.xml
|
|
%pom_add_plugin org.apache.maven.plugins:maven-compiler-plugin pom.xml "
|
|
<configuration>
|
|
<source>1.7</source>
|
|
<target>1.7</target>
|
|
</configuration>
|
|
"
|
|
%pom_remove_plugin org.apache.maven.plugins:maven-javadoc-plugin pom.xml
|
|
%pom_add_plugin org.apache.maven.plugins:maven-javadoc-plugin pom.xml "
|
|
<configuration>
|
|
<source>1.7</source>
|
|
</configuration>
|
|
"
|
|
%pom_xpath_remove "pom:build/pom:extensions"
|
|
%pom_remove_dep org.codehaus.groovy.maven:gmaven-mojo pom.xml
|
|
%pom_remove_plugin org.codehaus.groovy.maven:gmaven-plugin pom.xml
|
|
%pom_add_dep org.apache.ant:ant jspc-compilers/jspc-compiler-tomcat6/pom.xml
|
|
%patch0 -p2
|
|
sed -i '/Make directories if needed/a def ant = new AntBuilder()' jspc-maven-plugin/src/main/groovy/org/codehaus/mojo/jspc/CompilationMojoSupport.groovy
|
|
|
|
%build
|
|
%mvn_build
|
|
mkdir -p META-INF/maven/
|
|
|
|
%install
|
|
%mvn_install
|
|
|
|
%files -f .mfiles
|
|
%{_javadir}/%{name}
|
|
%doc LICENSE.txt
|
|
|
|
%files javadoc -f .mfiles-javadoc
|
|
%doc LICENSE.txt
|
|
|
|
%changelog
|
|
* Thu Sep 3 2020 Ge Wang <wangge20@huawei.com> - 2.0-1
|
|
- Package init
|