%global appname clion %global desc A cross-platform IDE for C and C++ %global dir %{appname}-%{VERSION} # 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 %define __brp_check_rpaths %{nil} # do not automatically detect and export provides and dependencies on bundled libraries and executables %global __provides_exclude_from %{_javadir}/%{name}/bin/.*|%{_javadir}/%{name}/lib/.*|%{_javadir}/%{name}/plugins/.* %global __requires_exclude_from %{_javadir}/%{name}/bin/.*|%{_javadir}/%{name}/lib/.*|%{_javadir}/%{name}/plugins/.* Name: %{appname} Version: 2024.2.3 Release: 1%?dist Summary: %{desc} License: Proprietary URL: https://jetbrains.com/%{name} Source0: https://download.jetbrains.com/cpp/CLion-%{version}.tar.gz Source1: https://download.jetbrains.com/cpp/CLion-%{version}-aarch64.tar.gz Source2: %{name}.desktop BuildRequires: python3-rpm-macros BuildRequires: python3 BuildRequires: javapackages-filesystem BuildRequires: /usr/bin/desktop-file-validate BuildRequires: /usr/bin/rsvg-convert Requires: java-jbr Suggests: %{name}-cmake%{?_isa} = %{version}-%{release} Suggests: %{name}-gdb%{?_isa} = %{version}-%{release} Suggests: %{name}-lldb%{?_isa} = %{version}-%{release} Suggests: %{name}-clang%{?_isa} = %{version}-%{release} %description %{desc} %package cmake Summary: CMake and ninja bundled by CLion %description cmake CMake and ninja bundled by CLion %package gdb Summary: gdb bundled by CLion %description gdb gdb bundled by CLion %package lldb Summary: lldb bundled by CLion %description lldb lldb bundled by CLion %package clang Summary: clang bundled by CLion %description clang clang bundled by CLion %prep mkdir %{dir} if [[ $(arch) == "x86_64" ]] then tar -xvf %{SOURCE0} -C %{dir} --strip-components=1 else tar -xvf %{SOURCE1} -C %{dir} --strip-components=1 fi %py3_shebang_fix %{dir} %install mkdir -p %{buildroot}%{_javadir}/%{name} cp -ar %{dir}/{bin,lib,plugins,modules,build.txt,product-info.json} %{buildroot}%{_javadir}/%{name}/ mkdir -p %{buildroot}%{_datadir}/{pixmaps,icons/hicolor/scalable/apps} cp %{dir}/bin/%{appname}.png %{buildroot}%{_datadir}/pixmaps/ cp %{dir}/bin/%{appname}.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/ for size in 16 22 24 32 48 64 128 256; do dest=%{buildroot}%{_datadir}/icons/hicolor/${size}x${size}/apps install -d ${dest} rsvg-convert -w ${size} -h ${size} %{dir}/bin/%{appname}.svg -o ${dest}/%{name}.png chmod 0644 ${dest}/%{name}.png touch -r %{dir}/bin/%{appname}.svg ${dest}/%{name}.png done mkdir -p %{buildroot}%{_bindir} cat > %{buildroot}%{_bindir}/%{name} << EOF #!/bin/sh export $(echo "%{name}_jdk" | tr '[:lower:]' '[:upper:]')=%{_jvmdir}/jdk-jbr exec %{_javadir}/%{name}/bin/%{name} "\$@" EOF chmod +x %{buildroot}%{_bindir}/%{name} mkdir -p %{buildroot}%{_datadir}/applications cp %{SOURCE2} %{buildroot}%{_datadir}/applications/ %check desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop %files %license %{dir}/license/* %{_javadir}/%{name}/{lib,plugins,modules,build.txt,product-info.json} # run "find . -maxdepth 1 ! -name lldb ! -name gdb ! -name clang ! -name cmake ! -name ninja -printf %%P," to generate %{_javadir}/%{name}/bin/{clion,clion.svg,rtos,helpers,restarter,clion64.vmoptions,brokenPlugins.db,clion.png,inspect.sh,repair,fsnotifier,remote-dev-server.sh,ltedit.sh,clion.sh,format.sh,idea.properties,jetbrains_client64.vmoptions,jetbrains_client.sh,remote-dev-server,libdbm.so} %{_bindir}/%{name} %{_datadir}/applications/%{name}.desktop %{_datadir}/pixmaps/%{name}.png %{_datadir}/icons/hicolor/*/apps/%{name}.* %files cmake %{_javadir}/%{name}/bin/cmake %{_javadir}/%{name}/bin/ninja %files gdb %{_javadir}/%{name}/bin/gdb %files lldb %{_javadir}/%{name}/bin/lldb %files clang %{_javadir}/%{name}/bin/clang %changelog %autochangelog