%bcond_with groovy
%global base_name jci
%global short_name commons-%{base_name}
%global namedreltag %{nil}
%global namedversion %{version}%{?namedreltag}
Name: apache-commons-jci
Version: 1.1
Release: 9%{?dist}
Summary: Commons Java Compiler Interface
License: ASL 2.0
URL: http://commons.apache.org/jci/
Source0: http://www.apache.org/dist/commons/%{base_name}/source/%{short_name}-%{namedversion}-src.tar.gz
Patch0: %{name}-1.1-janino27.patch
BuildRequires: maven-local
BuildRequires: mvn(asm:asm)
BuildRequires: mvn(commons-io:commons-io)
BuildRequires: mvn(commons-logging:commons-logging)
BuildRequires: mvn(junit:junit)
BuildRequires: mvn(org.apache.commons:commons-lang3)
BuildRequires: mvn(org.apache.commons:commons-parent:pom:)
BuildRequires: mvn(org.apache.maven.plugins:maven-antrun-plugin)
%if %{with groovy}
BuildRequires: mvn(org.codehaus.groovy:groovy)
%endif
BuildRequires: mvn(org.codehaus.janino:janino)
BuildRequires: mvn(org.eclipse.jdt.core.compiler:ecj)
BuildRequires: mvn(rhino:js)
Requires: %{name}-core = %{version}-%{release}
BuildArch: noarch
#* jsr199 Commons JCI compiler implementation for JDK 1.6 and up.
%description
JCI is a java compiler interface featuring a compiling class loader.
The current implementation supports compilation via the following
compilers:
* eclipse
* groovy
* janino
* rhino
%package core
Summary: Commons Java Compiler Interface - core
%description core
Commons JCI core interfaces and implementations.
%package fam
Summary: Commons Java Compiler Interface - FAM
%description fam
Commons JCI FileAlterationMonitor (FAM) to
monitor local file systems and get notified
about changes.
%package javadoc
Summary: Javadoc for %{name}
%description javadoc
This package contains javadoc for %{name}.
# compilers
%package eclipse
Summary: Commons Java Compiler Interface - eclipse
%description eclipse
Commons JCI compiler implementation for the eclipse compiler.
%if %{with groovy}
%package groovy
Summary: Commons Java Compiler Interface - groovy
%description groovy
Commons JCI compiler implementation for the groovy compiler.
%endif
%package janino
Summary: Commons Java Compiler Interface - janino
%description janino
Commons JCI compiler implementation for the janino compiler.
%package rhino
Summary: Commons Java Compiler Interface - rhino
%description rhino
Commons JCI compiler implementation for rhino JavaScript.
%prep
%setup -q -n %{short_name}-%{namedversion}-src
find . -name "*.class" -delete
find . -name "*.jar" -delete
%patch0 -p1
%if %{without groovy}
# disable groovy support
%pom_disable_module compilers/groovy
%endif
# require old version of jdependency
%pom_disable_module examples
%pom_xpath_remove "pom:build/pom:extensions"
%pom_xpath_set "pom:properties/pom:maven.compiler.source" 1.6
%pom_xpath_set "pom:properties/pom:maven.compiler.target" 1.6
%pom_remove_plugin :cobertura-maven-plugin
%pom_remove_plugin :maven-assembly-plugin
%pom_remove_plugin :maven-site-plugin
%if %{with groovy}
%pom_xpath_set "pom:dependencyManagement/pom:dependencies/pom:dependency[pom:groupId = 'org.codehaus.groovy']/pom:artifactId" groovy
%pom_xpath_set "pom:dependencyManagement/pom:dependencies/pom:dependency[pom:groupId = 'org.codehaus.groovy']/pom:version" 1.8.9
%pom_xpath_set "pom:dependencies/pom:dependency[pom:groupId = 'org.codehaus.groovy']/pom:artifactId" groovy compilers/groovy
%pom_xpath_inject "pom:dependencies/pom:dependency[pom:groupId = 'org.codehaus.groovy']" "1.8.9" compilers/groovy
%endif
# Fix installation directory
%mvn_file :%{short_name}-core %{short_name}/%{short_name}-core
%mvn_file :%{short_name}-fam %{short_name}/%{short_name}-fam
%mvn_file :%{short_name}-eclipse %{short_name}/%{short_name}-eclipse
%if %{with groovy}
%mvn_file :%{short_name}-groovy %{short_name}/%{short_name}-groovy
%endif
%mvn_file :%{short_name}-janino %{short_name}/%{short_name}-janino
%mvn_file :%{short_name}-rhino %{short_name}/%{short_name}-rhino
%build
# random tests failures
%mvn_build -s -- -Dmaven.test.failure.ignore=true
%install
%mvn_install
%files -f .mfiles-%{short_name}
%dir %{_javadir}/%{short_name}
%doc README.txt TODO.txt
%license LICENSE.txt NOTICE.txt
%files core -f .mfiles-%{short_name}-core
%files fam -f .mfiles-%{short_name}-fam
%files javadoc -f .mfiles-javadoc
%license LICENSE.txt NOTICE.txt
%files eclipse -f .mfiles-%{short_name}-eclipse
%if %{with groovy}
%files groovy -f .mfiles-%{short_name}-groovy
%endif
%files janino -f .mfiles-%{short_name}-janino
%files rhino -f .mfiles-%{short_name}-rhino
%changelog
* Tue Jul 23 2019 Fabio Valentini - 1.1-9
- Disable groovy support by default.
- Regenerate BuildRequires.
* Thu Jan 31 2019 Fedora Release Engineering - 1.1-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Thu Jul 12 2018 Fedora Release Engineering - 1.1-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Wed Feb 07 2018 Fedora Release Engineering - 1.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Wed Jul 26 2017 Fedora Release Engineering - 1.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Fri Feb 10 2017 Fedora Release Engineering - 1.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Wed Feb 03 2016 Fedora Release Engineering - 1.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Wed Jun 17 2015 Fedora Release Engineering - 1.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Mon Feb 09 2015 gil cattaneo 1.1-1
- Update to 1.1
* Thu Jan 29 2015 gil cattaneo 1.0-14
- introduce license macro
* Sat Jun 07 2014 Fedora Release Engineering - 1.0-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Fri Mar 28 2014 Michael Simacek - 1.0-12
- Use Requires: java-headless rebuild (#1067528)
* Thu Nov 14 2013 gil cattaneo 1.0-11
- use objectweb-asm3
* Sat Aug 03 2013 Fedora Release Engineering - 1.0-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Sat Jun 29 2013 gil cattaneo 1.0-9
- switch to XMvn, minor changes to adapt to current guideline
* Wed Jun 12 2013 Orion Poplawski - 1.0-8
- Make main package own jar directory
* Wed Feb 13 2013 Fedora Release Engineering - 1.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
* Wed Feb 06 2013 Java SIG - 1.0-6
- Update for https://fedoraproject.org/wiki/Fedora_19_Maven_Rebuild
- Replace maven BuildRequires with maven-local
* Wed Dec 12 2012 gil cattaneo 1.0-5
- fix build for new ecj
* Thu Jul 19 2012 gil cattaneo 1.0-4
- Add depmap file, force ecj use
* Wed Jul 18 2012 Fedora Release Engineering - 1.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Fri Jun 15 2012 gil cattaneo 1.0-2
- javadocs are installed in %%{_javadocdir}/%%{name}
- correct spelling errors
- fix requires
* Fri Apr 06 2012 gil cattaneo 1.0-1
- initial rpm