Last active
February 6, 2024 12:27
-
-
Save rasschaert/8508049 to your computer and use it in GitHub Desktop.
Creates an RPM package for PyCharm Community Edition
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "Creating directory structure" | |
mkdir -p ./tmproot/usr/local/bin | |
mkdir -p ./tmproot/usr/share/applications | |
mkdir -p ./tmproot/usr/share/icons/hicolor/128x128/apps | |
mkdir -p ./tmproot/usr/share/icons/gnome/128x128/apps | |
mkdir -p ./tmproot/opt/ | |
cd ./tmproot/opt | |
echo "Downloading tarball" | |
wget http://download.jetbrains.com/python/pycharm-community-3.0.2.tar.gz | |
echo "Extracting tarball" | |
tar xzf pycharm-community-3.0.2.tar.gz | |
rm pycharm-community-3.0.2.tar.gz | |
mv pycharm-community-3.0.2 pycharm-community | |
echo "Creating shortcut" | |
cd ../usr/local/bin/ | |
ln -s ../../../opt/pycharm-community/bin/pycharm.sh pycharm | |
echo "Creating launcher" | |
cd ../../../usr/share/applications/ | |
cat << EOF > pycharm-community.desktop | |
[Desktop Entry] | |
Name=PyCharm Community | |
GenericName=PyCharm Community | |
X-GNOME-FullName=PyCharm Community | |
Comment=Lightweight IDE for Python development | |
Exec=pycharm | |
Terminal=false | |
Type=Application | |
Icon=pycharm | |
MimeType=text/x-script.phyton; | |
StartupNotify=true | |
Categories=GTK;Development; | |
X-GNOME-Bugzilla-Bugzilla=GNOME | |
X-GNOME-Bugzilla-Product=PyCharm | |
X-GNOME-Bugzilla-Component=general | |
X-Desktop-File-Install-Version=3.0.2 | |
EOF | |
chmod 644 pycharm-community.desktop | |
echo "Placing icon" | |
cd ../../../ | |
cp ./opt/pycharm-community/bin/pycharm.png ./usr/share/icons/hicolor/128x128/apps/ | |
cp ./opt/pycharm-community/bin/pycharm.png ./usr/share/icons/gnome/128x128/apps/ | |
echo "Creating package" | |
cd .. | |
fpm -s dir -t rpm -n pycharm-community -v 3.0.2 -a noarch -C tmproot . | |
echo "Cleaning up" | |
rm -rf tmproot | |
echo 'Done!' |
you might also need rpm-build package, if you don't have it already
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
if you don't have fpm installed , it can be installed using gem -
make sure ruby-devel is installed
gem install fpm