diff options
-rw-r--r-- | Makefile | 57 | ||||
-rw-r--r-- | install | 64 |
2 files changed, 57 insertions, 64 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..3f55cba --- /dev/null +++ b/Makefile @@ -0,0 +1,57 @@ +INTO = $(HOME) +INSTALL = abcde.conf \ + bash_logout \ + bashrc \ + conkerorrc \ + conkyrc \ + crawlrc \ + gitconfig \ + gitignore \ + gtkrc \ + inputrc \ + muttrc \ + nethackrc \ + procmailrc \ + screenrc \ + tmux.conf \ + vimrc \ + Xdefaults \ + xinitrc \ + xmobarrc \ + bash \ + bin \ + irssi \ + fortune \ + module-setup \ + ncmpc \ + newsbeuter \ + procmail \ + re.pl \ + services \ + terminfo \ + urxvt \ + vim \ + xmonad +INSTALLED = $(patsubst %,$(INTO)/.%,$(INSTALL)) + +ECHO = @echo +LN = @ln -sf +MKDIR = @mkdir -p +RM = @rm -f + +build : + +install : $(INSTALLED) + $(MKDIR) $(INTO)/.ssh + $(LN) $(PWD)/authorized_keys $(INTO)/.ssh/ + $(ECHO) Installed into $(HOME) + +clean : + $(ECHO) Cleaning from $(HOME) + $(RM) $(INSTALLED) $(INTO)/.ssh/authorized_keys + +$(INTO)/.% : % + @[ ! -f $@ ] || readlink -q $@ || mv -f $@ $@.bak + $(LN) $(PWD)/$< $@ + +.PHONY: build install clean diff --git a/install b/install deleted file mode 100644 index 59e9d11..0000000 --- a/install +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/bash - -confdir=$(dirname $0) -files="abcde.conf - bash_logout - bashrc - conkerorrc - conkyrc - crawlrc - gitconfig - gitignore - gtkrc - inputrc - muttrc - nethackrc - procmailrc - screenrc - tmux.conf - vimrc - Xdefaults - xinitrc - xmobarrc - bash - bin - irssi - fortune - module-setup - ncmpc - newsbeuter - procmail - re.pl - services - terminfo - urxvt - vim - xmonad" - -function install() { - if [[ -e "$2" && ! -h "$2" ]]; then - mv "$2" "$2.bak" - fi - if [[ -d "$2" && -h "$2" ]]; then - rm -f "$2" - fi - target="$confdir/$1" - tmp=$(dirname $2) - if [[ "$tmp" != '.' ]]; then - for i in ${tmp//\// }; do - target="../$target" - done - fi - mkdir -p $(dirname $2) - ln -sf "$target" "$2" -} - -for file in $files; do - install "${file}" ".${file}" -done -install authorized_keys .ssh/authorized_keys - -cd .bin -find -type f -exec chmod a+x '{}' \; -ln -sf ssh scp -ln -sf ssh sftp |