#!/bin/bash# Script that can install, remove and update packages from source, with one single command# Version: 0.1BETA# License: GPLv2smver=0.1BETApkgname=$2prefix=/usr/bin# Functions - startfunction install { cd /var/sourcemake wget http://code-geek.baah.dk/sourcemake/packages/stable/$pkgname-*.tar.gz tar xvfz $pkgname-*.tar.gz cd /$pkgname-* ./configure --prefix=$prefix make || return 1 make install echo "If there dont come any errors, so is the application installed! :)"}function remove { cd /var/sourcemake/$pkgname-* make clean cd .. rm -R /$pkgname-* echo "If there dont come any errors, so is the application removed! :)"}function update { cd /var/sourcemake/$pkgname-* make clean cd .. wget http://code-geek.baah.dk/sourcemake/packages/stable/$pkgname-*.tar.gz tar xvfz $pkgname-*.tar.gz cd /$pkgname-* ./configure --prefix=$prefix make || return 1 make install echo "If there dont come any errors is the application now replaced with the newest version on this server! :)"}function about { echo "About Sourcemake:" echo "" echo "Name: Sourcemake" echo "Version: $smver" echo "Started by: Kris <kris@scoutzone.dk>" echo "License: GPLv2" echo ""}function help { echo "Sourcemake help:" echo "" echo "Install: sourcemake install <package-name>" echo "Remove: sourcemake remove <package-name>" echo "Update: sourcemake update <package-name>" echo "" echo "About: sourcemake about" echo "Help: sourcemake help" echo ""}# Functions - end# Install, remove, update, about and help - startif [ "$1" == "install" ] && [ "$pkgname" != "" ]; then installelif [ "$1" == "remove" ] && [ "$pkgname" != "" ]; then removeelif [ "$1" == "update" ] && [ "$pkgname" != "" ]; then updateelif [ "$1" == "about" ]; then aboutelif [ "$1" == "help" ]; then helpelse helpfi# Install, remove, update, about and help - end# End of script