diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 12dc635cd..b7def7e96 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -45,6 +45,7 @@ Adam Dobrawy / @ad-m Daniele Tricoli / @eriol Harry Percival / @hjwp Cullen Rhodes / @c-rhodes +Burhan Khalid / @burhan * Possesses commit rights diff --git a/{{cookiecutter.repo_name}}/install_fedora_dependencies.sh b/{{cookiecutter.repo_name}}/install_fedora_dependencies.sh new file mode 100644 index 000000000..e7231826d --- /dev/null +++ b/{{cookiecutter.repo_name}}/install_fedora_dependencies.sh @@ -0,0 +1,83 @@ +#!/bin/bash + +OS_REQUIREMENTS_FILENAME="requirements.yum" + +# Handle call with wrong command +function wrong_command() +{ + echo "${0##*/} - unknown command: '${1}'" + usage_message +} + +# Print help / script usage +function usage_message() +{ + echo "usage: ./${0##*/} " + echo "available commands are:" + echo -e "\tlist\t\tPrint a list of all packages defined on ${OS_REQUIREMENTS_FILENAME} file" + echo -e "\thelp\t\tPrint this help" + echo -e "\n\tCommands that require superuser permission:" + echo -e "\tinstall\t\tInstall packages defined on ${OS_REQUIREMENTS_FILENAME} file. Note: This\n\t\t\t does not upgrade the packages already installed for new\n\t\t\t versions, even if new version is available in the repository." + echo -e "\tupgrade\t\tSame that install, but upgrate the already installed packages,\n\t\t\t if new version is available." + +} + +# Read the requirements.apt file, and remove comments and blank lines +function list_packages(){ + cat ${OS_REQUIREMENTS_FILENAME} | grep -v "#" | grep -v "^$"; +} + +function install() +{ + list_packages | xargs yum -y install; +} + +function upgrade() +{ + list_packages | xargs yum -y install; +} + + +function install_or_upgrade() +{ + P=${1} + PARAN=${P:-"install"} + + if [[ $EUID -ne 0 ]]; then + echo -e "\nYou must run this with root privilege" 2>&1 + echo -e "Please do:\n" 2>&1 + echo "sudo ./${0##*/} $PARAN" 2>&1 + echo -e "\n" 2>&1 + + exit 1 + else + + yum -y update + + # Install the basic compilation dependencies and other required libraries of this project + if [ "$PARAN" == "install" ]; then + install; + else + upgrade; + fi + + # cleaning downloaded packages from yum cache + yum clean all + + exit 0 + fi + + +} + + +# Handle command argument +case "$1" in + install) install_or_upgrade;; + upgrade) install_or_upgrade "upgrade";; + list) list_packages;; + help) usage_message;; + *) wrong_command $1;; +esac + + diff --git a/{{cookiecutter.repo_name}}/install_os_dependencies.sh b/{{cookiecutter.repo_name}}/install_ubuntu_dependencies.sh similarity index 100% rename from {{cookiecutter.repo_name}}/install_os_dependencies.sh rename to {{cookiecutter.repo_name}}/install_ubuntu_dependencies.sh diff --git a/{{cookiecutter.repo_name}}/requirements.yum b/{{cookiecutter.repo_name}}/requirements.yum new file mode 100644 index 000000000..7a041266a --- /dev/null +++ b/{{cookiecutter.repo_name}}/requirements.yum @@ -0,0 +1,24 @@ +sic build dependencies on Fedora/RedHat +make +automake +gcc +gcc-c++mv +gettext +python-devel + +# Package dependencies +zlib-devel +libpqxx +libtiff + +# In fedora, only includes libjpeg6 +# see https://fedoraproject.org/wiki/Features/libjpeg-turbo-jpeg8-ABI +libjpeg-turbo +freetype +lcms-devel +libwebp-devel + +libmemcached +openssl-devel +graphviz-devel +