# setting some global constants %global appname pycharm # 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} # 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 __provides_exclude_from %{_javadir}/%{name}/jbr/.*|%{_javadir}/%{name}/lib/.*|%{_javadir}/%{name}/plugins/.* %global __requires_exclude_from %{_javadir}/%{name}/jbr/.*|%{_javadir}/%{name}/lib/.*|%{_javadir}/%{name}/plugins/.* Name: %{appname}-community Version: 2025.3.3 Release: 1%{?dist} Summary: Intelligent Python IDE License: Apache-2.0 URL: https://www.jetbrains.com/%{appname}/ Source0: https://download.jetbrains.com/python/%{appname}-%{version}.tar.gz Source101: %{name}.xml Source102: %{name}.desktop Source103: %{name}.metainfo.xml BuildRequires: desktop-file-utils BuildRequires: libappstream-glib BuildRequires: librsvg2-tools BuildRequires: python3-devel Requires: hicolor-icon-theme %if 0%{?rhel} && 0%{?rhel} <= 7 BuildRequires: javapackages-tools Requires: javapackages-tools %else BuildRequires: javapackages-filesystem Requires: javapackages-filesystem %endif ExclusiveArch: x86_64 aarch64 ppc64le Obsoletes: %{name}-jre < %{?epoch:%{epoch}:}%{version}-%{release} %description The intelligent Python IDE with unique code assistance and analysis, for productive Python development on all levels %package doc Summary: Documentation for intelligent Python IDE BuildArch: noarch Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} %description doc This package contains documentation for the Intelligent Python IDE. %prep %autosetup -n %{appname}-%{version} # Removing trialware plugins... # rm -rf plugins/{cwm-plugin,cwm-plugin-projector,marketplace,space} # Patching shebangs... %if 0%{?fedora} %py3_shebang_fix bin %else find bin -type f -name "*.py" -exec sed -e 's@/usr/bin/env python.*@%{__python3}@g' -i "{}" \; %endif %install # 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 # Creating additional PNG icons on the fly... 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} bin/%{appname}.svg -o ${dest}/%{name}.png chmod 0644 ${dest}/%{name}.png touch -r bin/%{appname}.svg ${dest}/%{name}.png done # Installing metainfo... install -d %{buildroot}%{_metainfodir} install -m 0644 -p %{SOURCE103} %{buildroot}%{_metainfodir}/%{name}.metainfo.xml # Installing launcher... install -d %{buildroot}%{_bindir} ln -s %{_javadir}/%{name}/bin/%{appname} %{buildroot}%{_bindir}/%{name} # Installing desktop file... install -d %{buildroot}%{_datadir}/applications install -m 0644 -p %{SOURCE102} %{buildroot}%{_datadir}/applications/%{name}.desktop # Installing mime package... install -d %{buildroot}%{_datadir}/mime/packages install -m 0644 -p %{SOURCE101} %{buildroot}%{_datadir}/mime/packages/%{name}.xml # Patch Python shebangs tail -n +2 %{buildroot}%{_datadir}/java/pycharm-community/plugins/python-ce/helpers/pycodestyle-2.10.0.py sed -i '1 i #!/usr/bin/env python3' %{buildroot}%{_datadir}/java/pycharm-community/plugins/python-ce/helpers/pycodestyle-2.10.0.py tail -n +2 %{buildroot}%{_datadir}/java/pycharm-community/plugins/python-ce/helpers/pycodestyle.py sed -i '1 i #!/usr/bin/env python3' %{buildroot}%{_datadir}/java/pycharm-community/plugins/python-ce/helpers/pycodestyle.py %check appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/%{name}.metainfo.xml desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop %files %license license/* %{_javadir}/%{name} %{_bindir}/%{name} %{_datadir}/applications/%{name}.desktop %{_datadir}/pixmaps/%{name}.png %{_datadir}/mime/packages/%{name}.xml %{_datadir}/icons/hicolor/*/apps/%{name}.* %{_metainfodir}/%{name}.metainfo.xml %files doc %doc help/ %doc Install-Linux-tar.txt %changelog %autochangelog