#in noarch? why... %global debug_package %{nil} #javadoc is empty. Keep building it now with hope for bright future %global with_javadoc 1 Name: fernflower Version: 183.5153.8 Release: 7%{?dist} Summary: JIdea's java decompiler License: ASL 2.0 URL: https://github.com/JetBrains/intellij-community/tree/master/plugins/java-decompiler/engine #Source0: https://github.com/JetBrains/intellij-community/archive/idea/%%{version}.tar.gz # this source is 280MB big, so only the decompiler is repacked via create-sources.sh and has 350kB # generated by source2; `create-sources.sh 183.5153.8` Source0: %{name}-%{version}.tar.gz # launcher Source1: %{name} Source2: create-sources.sh Patch0: remove_main.patch BuildArch: noarch BuildRequires: javapackages-tools BuildRequires: java-devel %if %{with_javadoc} BuildRequires: zip %endif Requires: java-headless Requires: javapackages-tools Provides: %{name}-decompiler %description JIdea's decompiler is the first actually working analytical decompiler for Java and probably for a high-level programming language in general. Naturally it is still under development, please send your bug reports and improvement suggestions to the issue tracker. %if %{with_javadoc} %package javadoc Summary: %{name} API documentation Requires: javapackages-filesystem BuildArch: noarch Provides: %{name}-decompiler-javadoc %description javadoc The %{name} 100% empty API documentation. %endif %prep %setup # removing test classes and jars, tests are not run in rpm build anyway (but can be run out of it) # maybe to pack them as demos? find | grep "\\.class$" find | grep "\\.jar$" rm -rvf test rm -rvf testData rm -vf gradle/wrapper/gradle-wrapper.jar find | grep "\\.class$" && exit 1 find | grep "\\.jar$" && exit 1 #removing main method from entry point jar %patch0 %build mkdir build javac -d build `find src -type f` cd build jar -cf ../%{name}.jar org cd .. mkdir build/libs mv %{name}.jar build/libs/ %if %{with_javadoc} # this is sad. Javadoc is really 100% empty mkdir fernflower-javadoc cd fernflower-javadoc javadoc `find ../src -type f` cd .. zip -r %{name}.zip fernflower-javadoc %endif %install mkdir -p $RPM_BUILD_ROOT/%{_bindir}/ cp %{SOURCE1} $RPM_BUILD_ROOT/%{_bindir}/ # cusotm launcher for main method in main jar mkdir -p $RPM_BUILD_ROOT/%{_javadir}/ cp build/libs/%{name}.jar $RPM_BUILD_ROOT/%{_javadir} %if %{with_javadoc} mkdir -p $RPM_BUILD_ROOT/%{_javadocdir}/%{name} cp %{name}.zip $RPM_BUILD_ROOT/%{_javadocdir}/ %endif %files %license LICENSE.txt %doc README.md %{_javadir}/%{name}.jar %attr(755, root, root) %{_bindir}/%{name} %if %{with_javadoc} %files javadoc %license LICENSE.txt %doc README.md %{_javadocdir}/%{name}.zip %endif %changelog * Fri Jul 10 2020 Jiri Vanek - 183.5153.8-7 - Rebuilt for JDK-11, see https://fedoraproject.org/wiki/Changes/Java11 * Tue Feb 18 2020 Jiri Vanek - 183.5153.8-6 - moved to gradle-less build * Tue Jan 28 2020 Fedora Release Engineering - 183.5153.8-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild * Thu Jul 25 2019 Fedora Release Engineering - 183.5153.8-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild * Thu Jan 31 2019 Fedora Release Engineering - 183.5153.8-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild * Fri Jan 18 2019 Jiri Vanek - 183.5153.8-2 - added virtual provides of fernflower-decompiler and fernflower-decompiler-javadoc * Wed Jan 09 2019 Jiri Vanek - 183.5153.8-1 - initial package