From 033bb23774bab623d92d6afa664c736b7901990b Mon Sep 17 00:00:00 2001 From: Muhammad Herdiansyah Date: Mon, 10 Jul 2017 18:32:45 +0700 Subject: [PATCH] Misc: Add back Makefile and remove install script --- Makefile | 28 ++++++++++++++++++++++++++++ install.sh | 37 ------------------------------------- 2 files changed, 28 insertions(+), 37 deletions(-) create mode 100644 Makefile delete mode 100755 install.sh diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..2d6885e4 --- /dev/null +++ b/Makefile @@ -0,0 +1,28 @@ +PREFIX = /usr +SYSCONFDIR = /etc + +all: + @echo Run \'make install\' to install Neofetch. + +install: + @echo 'Making directories...' + @mkdir -p $(DESTDIR)$(PREFIX)/bin + @mkdir -p $(DESTDIR)$(PREFIX)/share/neofetch/ascii/distro + @mkdir -p $(DESTDIR)$(PREFIX)/share/man/man1 + @mkdir -p $(DESTDIR)$(SYSCONFDIR)/neofetch + + @echo 'Installing binaries...' + @sed "s|ASCIIDIR|$(PREFIX)/share/neofetch/ascii/distro|g;s|CONFDIR|$(SYSCONFDIR)/neofetch|g" < neofetch > $(DESTDIR)$(PREFIX)/bin/neofetch + @chmod 755 $(DESTDIR)$(PREFIX)/bin/neofetch + + @echo 'Installing ASCII files, man page and config file...' + @cp -p ascii/distro/* $(DESTDIR)$(PREFIX)/share/neofetch/ascii/distro + @cp -p neofetch.1 $(DESTDIR)$(PREFIX)/share/man/man1 + @cp -p config/config.conf $(DESTDIR)$(SYSCONFDIR)/neofetch/config.conf + +uninstall: + @echo 'Removing files...' + @rm -rf $(DESTDIR)$(PREFIX)/bin/neofetch + @rm -rf $(DESTDIR)$(PREFIX)/share/man/man1/neofetch.1* + @rm -rf $(DESTDIR)$(PREFIX)/share/neofetch + @rm -rf $(DESTDIR)$(SYSCONFDIR)/neofetch diff --git a/install.sh b/install.sh deleted file mode 100755 index 7f8fded5..00000000 --- a/install.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -while [ "$1" ]; do - case "$1" in - "--destdir") DESTDIR="$2" ;; - "--bindir") BINDIR="$2" ;; - "--confdir") CONFDIR="$2" ;; - "--prefix") PREFIX="$2" ;; - "--asciidir") ASCIIDIR="$2" ;; - "--mandir") MANDIR="$2" ;; - esac - shift -done - -if [ -z "$PREFIX" ]; then - [ -z "$BINDIR" ] && BINDIR="/usr/bin" - [ -z "$ASCIIDIR" ] && ASCIIDIR="/usr/share/neofetch/ascii/distro" - [ -z "$MANDIR" ] && MANDIR="/usr/share/man/man1" -else - [ -z "$BINDIR" ] && BINDIR="/bin" - [ -z "$ASCIIDIR" ] && ASCIIDIR="/share/neofetch/ascii/distro" - [ -z "$MANDIR" ] && MANDIR="/share/man/man1" -fi -[ -z "$CONFDIR" ] && CONFDIR="/etc/neofetch" - -mkdir -p "${DESTDIR}""${PREFIX}""${BINDIR}" -mkdir -p "${DESTDIR}""${PREFIX}""${CONFDIR}" -mkdir -p "${DESTDIR}""${PREFIX}""${ASCIIDIR}" -mkdir -p "${DESTDIR}""${PREFIX}""${MANDIR}" - -sed -i -e "s|CONFDIR|${PREFIX}${CONFDIR}|g" neofetch -sed -i -e "s|ASCIIDIR|${PREFIX}${ASCIIDIR}|g" neofetch - -cp -p neofetch "${DESTDIR}""${PREFIX}""${BINDIR}" -cp -p config/config.conf "${DESTDIR}""${PREFIX}""${CONFDIR}" -cp -p ascii/distro/* "${DESTDIR}""${PREFIX}""${ASCIIDIR}" -cp -p neofetch.1 "${DESTDIR}""${PREFIX}""${MANDIR}"