X-Git-Url: http://git.kaliko.me/?p=mpd-goodies.git;a=blobdiff_plain;f=Makefile;fp=Makefile;h=6bf3dfc2be6bde85a404ce70a6d3e211aea14d7e;hp=0000000000000000000000000000000000000000;hb=8c680f357953b22043895a3b49f9e58981504669;hpb=6729b0a3c9607c8ee6a8dd352ec601ad22cacaf2 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..6bf3dfc --- /dev/null +++ b/Makefile @@ -0,0 +1,52 @@ +SHELL = /bin/sh +PREFIX = /usr +#DESTDIR = /tmp/mpd-goodies +LIBDIR = $(DESTDIR)$(PREFIX)/lib +BIN = $(DESTDIR)$(PREFIX)/bin +ETC = $(DESTDIR)$(PREFIX)/etc +DATADIR = $(DESTDIR)$(PREFIX)/share +LOCALEDIR = $(DATADIR)/locale +MANDIR = $(DATADIR)/man +PKGNAME = mpd-goodies + +all: man bin +#clean: +# rm -f mpd-goodies.1.gz + +mpd-goodies.1.gz: + cat data/mpd-goodies.1 | gzip > mpd-goodies.1.gz + +bash_completion: + install -d $(ETC)/bash_completion.d + install -m644 data/mpd-goodies.sh $(ETC)/bash_completion.d/ + mv $(ETC)/bash_completion.d/mpd-goodies.sh $(ETC)/bash_completion.d/$(PKGNAME) + +man: mpd-goodies.1.gz + +install: + install -d $(BIN) $(DATADIR)/$(PKGNAME) #$(MANDIR)/man1 + + #install -m644 mpd-goodies.1.gz $(MANDIR)/man1 + + # listing all sub folder to install (prevent a remaining .svn directory to be install) + for sourcedir in `find src/ -name .svn -prune -o -type d -print | sed 's:src/::g'` ; do \ + install -d $(DATADIR)/$(PKGNAME)/$$sourcedir; \ + for sourcefile in `find src/$$sourcedir -maxdepth 1 -name *pyc -o -name .svn -prune -o -print` ; do \ + install -m644 $$sourcefile $(DATADIR)/$(PKGNAME)/$$sourcedir; \ + done \ + done + # listing all command in ./src + for command in `find src/ -maxdepth 1 -name .svn -prune -o -type f -print` ; do \ + install -m 755 $$command $(DATADIR)/$(PKGNAME)/ ;\ + done + for command in `find $(DATADIR)/$(PKGNAME)/ -maxdepth 1 -name .svn -prune -o -type f -print` ; do \ + ln -sf $$command $(BIN) ;\ + done + +uninstall: + for command in `find $(DATADIR)/$(PKGNAME)/ -maxdepth 1 -name .svn -prune -o -type f -print` ; do \ + rm -rf $(BIN)/$$(basename $$command) ;\ + done + rm -f $(MANDIR)/man1/mpd-goodies.1.gz + rm -f $(ETC)/bash_completion.d/$(PKGNAME) + rm -rf $(DATADIR)/$(PKGNAME)