1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
#
# Makefile for docx2txt
#
BINDIR ?= /usr/local/bin
CONFIGDIR ?= /etc
INSTALL = $(shell which install 2>/dev/null)
ifeq ($(INSTALL),)
$(error "Need 'install' to install docx2txt")
endif
PERL = $(shell which perl 2>/dev/null)
ifeq ($(PERL),)
$(warning "*** Make sure 'perl' is installed and is in your PATH, before running the installed script. ***")
endif
BINFILES = docx2txt.sh docx2txt.pl
CONFIGFILE = docx2txt.config
.PHONY: install installbin installconfig
install: installbin installconfig
installbin: $(BINFILES)
@echo "Installing script files [$(BINFILES)] in \"$(BINDIR)\" .."
@[ -d "$(BINDIR)" ] || mkdir -p "$(BINDIR)"
$(INSTALL) -m 755 $^ "$(BINDIR)"
ifneq ($(PERL),)
@echo "Setting systemConfigDir to [$(CONFIGDIR)] in \"$(BINDIR)/docx2txt.pl\" .."
$(PERL) -pi -e "s%\"/etc\";%\"$(CONFIGDIR)\";%" "$(BINDIR)/docx2txt.pl"\
&& rm -f "$(BINDIR)/docx2txt.pl.bak"
else
@echo "*** Set systemConfigDir to \"$(CONFIGDIR)\" in \"$(BINDIR)/docx2txt.pl\"."
endif
installconfig: $(CONFIGFILE)
@echo "Installing config file [$(CONFIGFILE)] in \"$(CONFIGDIR)\" .."
@[ -d "$(CONFIGDIR)" ] || mkdir -p "$(CONFIGDIR)"
$(INSTALL) -m 755 $^ "$(CONFIGDIR)"
|