mutt-wizard

fork of Luke Smiths mutt-wizard
git clone git://git.jakekoroman.com/mutt-wizard
Log | Files | Refs | README | LICENSE

Makefile (2179B)


      1 .POSIX:
      2 
      3 OS = $(shell uname -s)
      4 ifndef PREFIX
      5   PREFIX = /usr/local
      6 endif
      7 ifndef MANPREFIX
      8   MANPREFIX = $(PREFIX)/share/man
      9 endif
     10 
     11 install:
     12 	mkdir -p $(DESTDIR)$(PREFIX)/bin
     13 	mkdir -p $(DESTDIR)$(PREFIX)/lib/mutt-wizard
     14 	cp -f bin/mw bin/mailsync $(DESTDIR)$(PREFIX)/bin/
     15 	cp -f lib/openfile $(DESTDIR)$(PREFIX)/lib/mutt-wizard
     16 	chmod 755 $(DESTDIR)$(PREFIX)/bin/mw $(DESTDIR)$(PREFIX)/bin/mailsync $(DESTDIR)$(PREFIX)/lib/mutt-wizard/openfile
     17 	mkdir -p $(DESTDIR)$(PREFIX)/share/mutt-wizard
     18 	chmod 755 $(DESTDIR)$(PREFIX)/share/mutt-wizard
     19 	for shared in share/*; do \
     20 		cp -f $$shared $(DESTDIR)$(PREFIX)/share/mutt-wizard; \
     21 		chmod 644 $(DESTDIR)$(PREFIX)/share/mutt-wizard/$$(basename $(notdir $$shared)); \
     22 	done
     23 	mkdir -p $(DESTDIR)$(MANPREFIX)/man1
     24 	cp -f mw.1 $(DESTDIR)$(MANPREFIX)/man1/mw.1
     25 	cp -f mailsync.1 $(DESTDIR)$(MANPREFIX)/man1/mailsync.1
     26 	chmod 644 $(DESTDIR)$(MANPREFIX)/man1/mw.1 $(DESTDIR)$(MANPREFIX)/man1/mailsync.1
     27 	if [ "$(PREFIX)" ]; then \
     28 		sed -iba 's:/usr/local:$(PREFIX):' $(DESTDIR)$(PREFIX)/share/mutt-wizard/mutt-wizard.muttrc; \
     29 		rm -f $(DESTDIR)$(PREFIX)/share/mutt-wizard/mutt-wizard.muttrcba; \
     30 		sed -iba 's:/usr/local:$(PREFIX):' $(DESTDIR)$(PREFIX)/bin/mw; \
     31 		rm -f $(DESTDIR)$(PREFIX)/bin/mwba; \
     32 		sed -iba 's:/usr/local:$(PREFIX):' $(DESTDIR)$(MANPREFIX)/man1/mw.1; \
     33 		rm -f $(DESTDIR)$(MANPREFIX)/man1/mw.1ba; \
     34 		sed -iba 's:/usr/local:$(PREFIX):' $(DESTDIR)$(PREFIX)/share/mutt-wizard/mailcap; \
     35 		rm -f $(DESTDIR)$(PREFIX)/share/mutt-wizard/mailcapba; \
     36 	fi
     37 	mkdir -p $(DESTDIR)$(PREFIX)/share/zsh/site-functions/
     38 	chmod 755 $(DESTDIR)$(PREFIX)/share/zsh/site-functions/
     39 	cp -f completion/_mutt-wizard.zsh $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_mutt-wizard.zsh
     40 	chmod 644 $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_mutt-wizard.zsh
     41 
     42 uninstall:
     43 	rm -f $(DESTDIR)$(PREFIX)/bin/mw $(DESTDIR)$(PREFIX)/bin/mailsync $(DESTDIR)$(PREFIX)/lib/mutt-wizard/openfile
     44 	rm -rf $(DESTDIR)$(PREFIX)/share/mutt-wizard  $(DESTDIR)$(PREFIX)/lib/mutt-wizard
     45 	rm -f $(DESTDIR)$(MANPREFIX)/man1/mw.1  $(DESTDIR)$(MANPREFIX)/man1/mailsync.1
     46 	rm -f $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_mutt-wizard.zsh
     47 
     48 .PHONY: install uninstall