├── .gitignore ├── gitkraken.png ├── screenshot1.png ├── screenshot2.png ├── gitkraken-wide.png ├── README.md ├── gitkraken.desktop ├── gitkraken.spec ├── LICENSE ├── basic-checks.sh ├── terminal-colors.sh ├── create-package.sh └── common-functions.sh /.gitignore: -------------------------------------------------------------------------------- 1 | work/ 2 | RPMs/ 3 | -------------------------------------------------------------------------------- /gitkraken.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPM-Outpost/gitkraken/HEAD/gitkraken.png -------------------------------------------------------------------------------- /screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPM-Outpost/gitkraken/HEAD/screenshot1.png -------------------------------------------------------------------------------- /screenshot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPM-Outpost/gitkraken/HEAD/screenshot2.png -------------------------------------------------------------------------------- /gitkraken-wide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RPM-Outpost/gitkraken/HEAD/gitkraken-wide.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Official rpm available 2 | 3 | **Axosoft now offers official RPM packages** on the [gitkraken website](https://www.gitkraken.com). 4 | They are guaranteed to be up to date and should be used instead of this script. 5 | 6 | -------------------------------------------------------------------------------- /gitkraken.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Version=1.0 3 | Type=Application 4 | Name=GitKraken 5 | Icon=/opt/gitkraken/@icon 6 | Exec=/opt/gitkraken/@exe 7 | Comment=Unleash your repo 8 | Categories=Development;RevisionControl; 9 | Terminal=false 10 | StartupWMClass=GitKraken 11 | -------------------------------------------------------------------------------- /gitkraken.spec: -------------------------------------------------------------------------------- 1 | %define install_dir /opt/gitkraken 2 | %define apps_dir /usr/share/applications 3 | %define _build_id_links none 4 | 5 | Name: gitkraken 6 | Version: %{pkg_version} 7 | Release: 1%{?dist} 8 | Summary: Modern GUI for git 9 | 10 | Group: Applications/Internet 11 | License: Proprietary 12 | URL: https://gitkraken.com/ 13 | BuildArch: x86_64 14 | Requires: %{pkg_req} 15 | 16 | %description 17 | Unleash your repo! 18 | 19 | %prep 20 | 21 | %build 22 | 23 | %install 24 | mkdir -p "%{buildroot}%{install_dir}" 25 | mkdir -p "%{buildroot}%{apps_dir}" 26 | mv "%{downloaded_dir}"/* "%{buildroot}%{install_dir}" 27 | cp "%{desktop_file}" "%{buildroot}%{apps_dir}" 28 | chmod +x "%{buildroot}%{install_dir}"/*.so 29 | chmod +x "%{buildroot}%{install_dir}/%{exec_name}" 30 | 31 | %files 32 | %{install_dir} 33 | %{apps_dir}/* 34 | 35 | #%post 36 | #ln -s -f /usr/lib64/libcurl.so.4 /opt/gitkraken/libcurl-gnutls.so.4 37 | 38 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 RPM Outpost 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /basic-checks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: TheElectronWill 3 | # Made for https://github.com/RPM-Outpost 4 | # This script requires terminal-colors.sh and common-functions.sh 5 | 6 | # It's a bad idea to run rpmbuild as root! 7 | if [ "$(id -u)" = "0" ]; then 8 | disp "$red_bg------------------------ WARNING ------------------------\n\ 9 | This script should NOT be executed with root privileges!\n\ 10 | Building rpm packages as root is dangerous and may harm the system!\n\ 11 | Actually, badly written RPM spec files may execute dangerous command in the system directories.\n\ 12 | So it is REALLY safer not to run this script as root.\n\ 13 | If you still want to continue, type \"do it!\" within 5 seconds (type anything else to exit)." 14 | disp "------------------------ WARNING ------------------------$reset$bold" 15 | read -t 5 -p '> Do you really want to do it (not recommended)? ' answer 16 | if [ "$answer" != "do it!" ]; then 17 | exit 18 | fi 19 | style $reset 20 | fi 21 | 22 | # Checks that the rpmbuild package is installed. 23 | if ! type 'rpmbuild' > /dev/null; then 24 | echo 'You need the rpm development tools to create rpm packages.' 25 | style $bold 26 | read -n 1 -p '> Install the required package (rpm-build) now? [y/N]: ' answer 27 | echo 28 | style $reset 29 | case "$answer" in 30 | y|Y) 31 | sudo_install_prompt 'Enter your password to install rpm-build: ' rpm-build 32 | ;; 33 | *) 34 | echo "The package won't be installed. Exiting now." 35 | exit 36 | esac 37 | else 38 | disp "${green}rpmbuild detected.$reset" 39 | fi 40 | -------------------------------------------------------------------------------- /terminal-colors.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: TheElectronWill 3 | # Script to use terminal colors easily, made for https://github.com/RPM-Outpost 4 | 5 | # Colors IDs 6 | id_black=0 7 | id_red=1 8 | id_green=2 9 | id_yellow=3 10 | id_blue=4 11 | id_purple=5 12 | id_cyan=6 13 | id_white=7 14 | 15 | disp() { # echo -e 16 | echo -e $@ 17 | } 18 | style() { # echo -e -n 19 | echo -e -n $@ 20 | } 21 | code() { # Escape code 22 | echo "\033[$1m" 23 | } 24 | fgr() { # Regular foreground color 25 | let id=30+$1 26 | if [ $# -eq 2 ]; then 27 | data="$2;$id" 28 | echo "$(code $data)" 29 | else 30 | echo "$(code $id)" 31 | fi 32 | } 33 | bgr() { # Regular background color 34 | let id=40+$1 35 | echo "$(code $id)" 36 | } 37 | fgh() { # High-intensity foreground color 38 | let id=90+$1 39 | echo "$(code $id)" 40 | } 41 | bgh() { # High-intensity background color 42 | let id=100+$1 43 | echo "$(code $id)" 44 | } 45 | 46 | # Foreground colors Bold colors Underlined colors 47 | black=$(fgr $id_black); bblack=$(fgr $id_black 1); ublack=$(fgr $id_black 4); 48 | red=$(fgr $id_red); bred=$(fgr $id_red 1); ured=$(fgr $id_red 4); 49 | green=$(fgr $id_green); bgreen=$(fgr $id_green 1); ugreen=$(fgr $id_green 4); 50 | yellow=$(fgr $id_yellow); byellow=$(fgr $id_yellow 1); uyellow=$(fgr $id_yellow 4); 51 | blue=$(fgr $id_blue); bblue=$(fgr $id_blue 1); ublue=$(fgr $id_blue 4); 52 | purple=$(fgr $id_purple); bpurple=$(fgr $id_purple 1); upurple=$(fgr $id_purple 4); 53 | cyan=$(fgr $id_cyan); bcyan=$(fgr $id_cyan 1); ucyan=$(fgr $id_cyan 4); 54 | white=$(fgr $id_white); bwhite=$(fgr $id_white 1); uwhite=$(fgr $id_white 4); 55 | 56 | # Background colors 57 | black_bg=$(bgr $id_black) 58 | red_bg=$(bgr $id_red) 59 | green_bg=$(bgr $id_green) 60 | yellow_bg=$(bgr $id_yellow) 61 | blue_bg=$(bgr $id_blue) 62 | purple_bg=$(bgr $id_purple) 63 | cyan_bg=$(bgr $id_cyan) 64 | white_bg=$(bgr $id_white) 65 | 66 | # Effects 67 | bold=$(code 1) 68 | underline=$(code 4) 69 | invert=$(code 7) 70 | cross=$(code 9) 71 | 72 | # Resets 73 | reset=$(code 0) # resets all 74 | reset_fg=$(code 39) # resets foreground color 75 | reset_bg=$(code 49) # resets background color 76 | reset_font=$(code '22;24') # resets font to regular, ie removes bold and underline 77 | 78 | -------------------------------------------------------------------------------- /create-package.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: TheElectronWill 3 | # This script downloads the latest version of gitkraken for linux, and creates a package with rpmbuild. 4 | 5 | source terminal-colors.sh # Adds color variables 6 | source common-functions.sh # Adds utilities functions 7 | source basic-checks.sh # Checks that rpmbuild is available and that the script isn't started as root 8 | 9 | rpm_dir="$PWD/RPMs" 10 | work_dir="$PWD/work" 11 | 12 | arch='x86_64' 13 | pkg_version="$1" 14 | archive_name='gitkraken-linux.tar.gz' 15 | download_url='https://release.gitkraken.com/linux/gitkraken-amd64.tar.gz' 16 | 17 | desktop_model="$PWD/gitkraken.desktop" 18 | icon_name="gitkraken.png" 19 | icon_file="$PWD/$icon_name" 20 | spec_file="$PWD/gitkraken.spec" 21 | 22 | desktop_file="$work_dir/gitkraken.desktop" 23 | archive_file="$work_dir/$archive_name" 24 | 25 | downloaded_dir="$work_dir/gitkraken" 26 | exec_name='gitkraken' 27 | exec_file="$downloaded_dir/$exec_name" 28 | 29 | # Settings according to the distribution 30 | if [[ $distrib == "redhat" ]]; then 31 | pkg_req='glibc, git, libcurl' 32 | elif [[ $distrib == "mageia" || $distrib == "suse" ]]; then 33 | pkg_req='glibc, git, libcurl4' 34 | else 35 | disp "${red}Sorry, your distribution isn't supported (yet).$reset" 36 | exit 37 | fi 38 | 39 | # Checks that the version is given as a parameter. 40 | if [ $# -ne 1 ]; then 41 | disp "${red}Wrong number of parameters!$reset" 42 | echo 'Usage: create-package.sh gitkraken_version' 43 | echo ' - gitkraken_version: for instance 2.1 or 3.0.0' 44 | exit 45 | fi 46 | 47 | # Downloads the gitkraken zip archive. 48 | download_gitkraken() { 49 | echo 'Downloading the latest gitkraken for linux...' 50 | wget $wget_progress "$download_url" -O "$archive_file" 51 | } 52 | 53 | manage_dir "$work_dir" 'work' 54 | manage_dir "$rpm_dir" 'RPMs' 55 | cd "$work_dir" 56 | 57 | # Downloads gitkraken if needed. 58 | if [ -e "$archive_name" ]; then 59 | echo "Found the archive \"$archive_name\"." 60 | ask_yesno 'Use this archive instead of downloading a new one?' 61 | case "$answer" in 62 | y|Y) 63 | echo 'Existing archive selected.' 64 | ;; 65 | *) 66 | rm "$archive_name" 67 | echo 'Existing archive removed.' 68 | download_gitkraken 69 | esac 70 | else 71 | download_gitkraken 72 | fi 73 | 74 | # Extracts the archive: 75 | echo 76 | if [ ! -d "$downloaded_dir" ]; then 77 | mkdir "$downloaded_dir" 78 | fi 79 | extract "$archive_name" "$downloaded_dir" "--strip 1" # --strip 1 gets rid of the top archive's directory 80 | 81 | 82 | echo 'Creating the .desktop file...' 83 | cp "$icon_file" "$downloaded_dir" 84 | cp "$desktop_model" "$desktop_file" 85 | sed "s/@version/$pkg_version/; s/@icon/$icon_name/; s/@exe/$exec_name/" "$desktop_model" > "$desktop_file" 86 | 87 | 88 | disp "${yellow}Creating the RPM package (this may take a while)..." 89 | rpmbuild -bb --quiet "$spec_file" --define "_topdir $work_dir" --define "_rpmdir $rpm_dir"\ 90 | --define "arch $arch" --define "downloaded_dir $downloaded_dir" --define "desktop_file $desktop_file"\ 91 | --define "pkg_version $pkg_version" --define "pkg_req $pkg_req" --define "exec_name $exec_name" 92 | 93 | disp "${bgreen}Done!${reset_font}" 94 | disp "The RPM package is located in the \"RPMs/$arch\" folder." 95 | disp '----------------' 96 | 97 | ask_remove_dir "$work_dir" 98 | ask_installpkg 99 | -------------------------------------------------------------------------------- /common-functions.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: TheElectronWill 3 | # Various functions used by the scripts of https://github.com/RPM-Outpost 4 | # This script requires terminal-colors.sh 5 | 6 | # Initializes $installer and $distrib 7 | if hash dnf 2>/dev/null; then 8 | # Fedora, CentOS with dnf installed 9 | installer="dnf install --allowerasing" 10 | distrib="redhat" 11 | elif hash yum 2>/dev/null; then 12 | # CentOS 13 | installer="yum install" 14 | distrib="redhat" 15 | elif hash zypper 2>/dev/null; then 16 | # OpenSUSE 17 | installer="zypper install" 18 | distrib="suse" 19 | elif hash urpmi 2>/dev/null; then 20 | # Mageia 21 | installer="urpmi" 22 | distrib="mageia" 23 | else 24 | # Unknown 25 | installer="exit" 26 | distrib="unknown" 27 | fi 28 | 29 | # Initializes $wget_progress: detects if the option --show-progress is available 30 | wget --help | grep -q '\--show-progress' && wget_progress="-q --show-progress" || wget_progress="" 31 | 32 | # ask_yesno question 33 | ## Asks a yes/no question and stores the result in the 'answer' variable 34 | ask_yesno() { 35 | style $reset$bold 36 | read -n 1 -p "> $1 [y/N]: " answer 37 | echo 38 | style $reset 39 | } 40 | 41 | # ask_remove_dir directory 42 | ## Asks the user if they want to remove the specified directory, and removes it if they want to. 43 | ask_remove_dir() { 44 | ask_yesno "Remove the directory \"$1\"?" 45 | case "$answer" in 46 | y|Y) 47 | rm -r "$1" 48 | echo "Directory removed." 49 | ;; 50 | *) 51 | echo "Directory not removed." 52 | esac 53 | echo 54 | } 55 | 56 | # manage_dir directory directory_short_name 57 | ## If the specified directory exists, asks the user if they want to remove it. 58 | ## If it doesn't exist, creates it. 59 | manage_dir() { 60 | if [ -d "$1" ]; then 61 | echo "The $2 directory already exist and may contain outdated data." 62 | ask_remove_dir "$1" 63 | fi 64 | mkdir -p "$1" 65 | } 66 | 67 | # ask_installpkg [all] 68 | ## Asks the user if they want to install the newly created package. 69 | ask_installpkg() { 70 | if [[ $1 == "all" || $2 == "all" ]]; then 71 | pl='es' 72 | else 73 | pl='e' 74 | fi 75 | ask_yesno "Install the packag$pl now?" 76 | case "$answer" in 77 | y|Y) 78 | cd "$rpm_dir/$arch" 79 | if [[ $1 == "all" ]]; then 80 | rpm_filename=$(find -type f -name '*.rpm' -printf '%P\n') 81 | else 82 | rpm_filename=$(find -maxdepth 1 -type f -name '*.rpm' -printf '%P\n' -quit) 83 | fi 84 | sudo_install $rpm_filename 85 | ;; 86 | *) 87 | echo "Packag$pl not installed." 88 | esac 89 | } 90 | 91 | # sudo_install pkg [options] 92 | sudo_install() { 93 | sudo $installer "$@" 94 | } 95 | 96 | # sudo_install_prompt prompt pkg [options] 97 | sudo_install_prompt() { 98 | if [[ $# -eq 2 ]]; then 99 | sudo -p "$1" $installer "$2" 100 | else 101 | sudo -p "$1" $installer "$2" $3 102 | fi 103 | } 104 | 105 | # extract archive_file destination [option1 [option2]] 106 | extract() { 107 | echo "Extracting \"$1\"..." 108 | if [[ "$1" == *.tar.gz ]]; then 109 | command="tar -xzf \"$1\" -C \"$2\"" 110 | elif [[ "$1" == *.tar.xz ]];then 111 | command="tar -xJf \"$1\" -C \"$2\"" 112 | elif [[ "$1" == *.tar.bz2 ]];then 113 | command="tar -xjf \"$1\" -C \"$2\"" 114 | elif [[ "$1" == *.tar ]];then 115 | command="tar -xf \"$1\" -C \"$2\"" 116 | elif [[ "$1" == *.zip ]]; then 117 | command="unzip -q \"$1\" -d \"$2\"" 118 | else 119 | disp "${red}Unsupported archive type for $1" 120 | return 10 121 | fi 122 | if [ $# -eq 3 ]; then 123 | eval $command $3 # Custom options 124 | elif [ $# -eq 4 ]; then 125 | eval $command $3 $4 # Custom options 126 | else 127 | eval $command 128 | fi 129 | } 130 | --------------------------------------------------------------------------------