# setting some global constants %global appname idea %global build_ver 241.18034.62 %global idea_name ideaIC # disable debuginfo subpackage %global debug_package %{nil} # Disable build-id symlinks to avoid conflicts %global _build_id_links none # don't strip bundled binaries because pycharm checks length (!!!) of binary fsnotif # and if you strip debug stuff from it, it will complain %global __strip /bin/true # dont repack jars %global __jar_repack %{nil} # disable rpath checks %global __brp_check_rpaths %{nil} # there are some python 2 and python 3 scripts so there is no way out to bytecompile them ^_^ %global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g') # do not automatically detect and export provides and dependencies on bundled libraries and executables %global _exclude_from %{_javadir}/%{name}/bin/.*|%{_javadir}/%{name}/lib/.*|%{_javadir}/%{name}/plugins/.*|%{_javadir}/%{name}/jbr/.* %global __provides_exclude_from %{_exclude_from} %global __requires_exclude_from %{_exclude_from} Name: intellij-idea-community Version: 2024.1.4 Release: 2%{?dist} Summary: Capable and Ergonomic Java IDE - Community Edition License: Apache-2.0 URL: https://www.jetbrains.com/%{appname}/ Source0: %{name}.desktop BuildRequires: desktop-file-utils BuildRequires: python3-devel BuildRequires: javapackages-filesystem BuildRequires: wget BuildRequires: tar BuildRequires: git BuildRequires: java-17-openjdk-devel BuildRequires: p7zip Requires: hicolor-icon-theme Requires: javapackages-filesystem Recommends: %{name}-jbr %description IntelliJ IDEA Community is a free and open-source edition of IntelliJ IDEA, the commercial Java IDE by JetBrains. IntelliJ IDEA Community provides all the tools you need for Java, Groovy, Kotlin, Scala, and Android. %package jbr Summary: JetBrains Runtime Requires: %{name} %global __provides_exclude_from %{_exclude_from} %global __requires_exclude_from %{_exclude_from} %description jbr JetBrains Runtime - a patched Java Runtime Environment (JRE). %prep git clone https://github.com/JetBrains/intellij-community -b idea/%{build_ver} --depth 1 cd intellij-community git clone git://git.jetbrains.org/idea/android.git android -b idea/%{build_ver} --depth 1 %build # Building cd intellij-community ./installers.cmd cd .. artifact_version=$(echo "%{build_ver}" | sed -E 's|idea/||; s|.[0-9]+$||') idea_target_dir="./intellij-community/out/idea-ce/artifacts" %ifarch x86_64 target_file_name="%{idea_name}-${artifact_version}.*.tar.gz" %else target_file_name="%{idea_name}-${artifact_version}.*-aarch64.tar.gz" %endif target_file_pattern="${idea_target_dir}/${target_file_name}" target_file=$(ls ${target_file_pattern} 2>/dev/null | head -n 1) mkdir -p "unpacked" tar xf "${target_file}" -C "unpacked" mkdir -p "target" mv "unpacked"/*/* target cd target # Patching shebangs... %if 0%{?fedora} %py3_shebang_fix . %else find . -type f -name "*.py" -exec sed -e 's@/usr/bin/env python.*@%{__python3}@g' -i "{}" \; %endif # Deleting unnecessary files... size_before=$(du -s . | awk '{print $1}') # First it removes directories, because it sometimes throws an error find . -type d -iname '*darwin*' -exec rm -rv {} + find . -iname '*darwin*' -exec rm -rv {} + find . -type d -iname '*macos*' -exec rm -rv {} + find . -iname '*macos*' -exec rm -rv {} + find . -type d -iname '*windows*' -exec rm -rv {} + find . -iname '*windows*' -exec rm -rv {} + %ifarch x86_64 find . -type d -name '*arm64*' -exec rm -rv {} + find . -name '*arm64*' -exec rm -rv {} + find . -type d -name '*aarch64*' -exec rm -rv {} + find . -name '*aarch64*' -exec rm -rv {} + %else find . -type d -name '*amd64*' -exec rm -rv {} + find . -name '*amd64*' -exec rm -rv {} + find . -type d -name '*x86_64*' -exec rm -rv {} + find . -name '*x86_64*' -exec rm -rv {} + %endif size_after=$(du -s . | awk '{print $1}') size_diff=$(( size_before - size_after )) echo "Space freed: $size_diff bytes" %install cd target # Installing application... install -d %{buildroot}%{_javadir}/%{name} cp -arf ./{bin,jbr,lib,plugins,build.txt,product-info.json} %{buildroot}%{_javadir}/%{name}/ # Installing icons... install -d %{buildroot}%{_datadir}/pixmaps install -m 0644 -p bin/%{appname}.png %{buildroot}%{_datadir}/pixmaps/%{name}.png install -d %{buildroot}%{_datadir}/icons/hicolor/scalable/apps install -m 0644 -p bin/%{appname}.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg # Installing launcher... install -d %{buildroot}%{_bindir} ln -s %{_javadir}/%{name}/bin/%{appname}.sh %{buildroot}%{_bindir}/%{name} # Installing desktop file... install -d %{buildroot}%{_datadir}/applications install -m 0644 -p %{SOURCE0} %{buildroot}%{_datadir}/applications/%{name}.desktop %check desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop %files %license target/license/* %{_javadir}/%{name}/{bin,lib,plugins,build.txt,product-info.json} %{_bindir}/%{name} %{_datadir}/applications/%{name}.desktop %{_datadir}/pixmaps/%{name}.png %{_datadir}/icons/hicolor/scalable/apps/%{name}.svg %files jbr %{_javadir}/%{name}/jbr %changelog * Fri Jun 21 2024 M3DZIK - 2024.1.4-1 - Update to 2024.1.4 (241.18034.62) * Mon Jun 10 2024 M3DZIK - 2024.1.3-1 - Update to 2024.1.3 (241.17890.1) * Thu May 23 2024 M3DZIK - 2024.1.2-1 - Update to 2024.1.2 (241.17011.79) * Tue Apr 30 2024 M3DZIK - 2024.1.1-1 - Update to 2024.1.1 (241.15989.150) * Thu Apr 04 2024 M3DZIK - 2024.1-1 - Update to 2024.1 (241.14494.240) * Thu Mar 21 2024 M3DZIK - 2023.3.6-1 - Update to 2023.3.6 (233.15026.9) * Wed Mar 13 2024 M3DZIK - 2023.3.5-1 - Update to 2023.3.5 (233.14808.21) * Wed Feb 14 2024 M3DZIK - 2023.3.4-1 - Update to 2023.3.4 (233.14475.28) * Fri Jan 26 2024 M3DZIK - 2023.3.3-1 - Update to 2023.3.3 (233.14015.106) * Thu Dec 21 2023 M3DZIK - 2023.3.2-1 - Update to 2023.3.2 (233.13135.103) * Wed Dec 13 2023 M3DZIK - 2023.3.1-1 - Update to 2023.3.1 (233.11799.300) * Thu Dec 07 2023 M3DZIK - 2023.3-1 - Update to 2023.3 (233.11799.241) * Fri Nov 10 2023 M3DZIK - 2023.2.5-1 - Update to 2023.2.5 (232.10227.8) * Thu Oct 26 2023 M3DZIK - 2023.2.4 - Update to 2023.2.4 (232.10203.10) * Thu Oct 12 2023 M3DZIK - 2023.2.3 - Update to 2023.2.3 (232.10072.27) * Thu Sep 14 2023 M3DZIK - 2023.2.2 - Update to 2023.2.2 (232.9921.47) * Thu Aug 31 2023 M3DZIK - 2023.2.1 - Initial release