diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 80 |
1 files changed, 57 insertions, 23 deletions
@@ -179,9 +179,40 @@ INSTALL_PREFIX=$(DESTDIR) CONFIG_FILE=$(INSTALL_PREFIX)/etc/zaptel.conf CFLAGS+=-DZAPTEL_CONFIG=\"$(CONFIG_FILE)\" -CHKCONFIG:=$(shell sh -c 'type -p chkconfig' 2> /dev/null) -ifndef CHKCONFIG -CHKCONFIG:=: +# sample makefile "trace print" +#tracedummy=$(shell echo ====== GOT HERE ===== >&2; echo >&2) + +CHKCONFIG := $(wildcard /sbin/chkconfig) +UPDATE_RCD := $(wildcard /usr/sbin/update-rc.d) +ifneq (,$(DESTDIR)) + ifneq (,$(CHKCONFIG)) + ADD_INITD := $(CHKCONFIG) --add zaptel + else + ifndef (,$(UPDATE_RCD)) + ADD_INITD := $(UPDATE_RCD) zaptel defaults 15 30 + endif + endif +endif + +INITRD_DIR := $(firstword $(wildcard /etc/rc.d/init.d /etc/init.d)) +ifneq (,$(INITRD_DIR)) + INIT_TARGET := $(DESTDIR)$(INITRD_DIR)/zaptel + COPY_INITD := install -D zaptel.init $(INIT_TARGET) +endif + +NETSCR_DIR := $(firstword $(wildcard /etc/sysconfig/network-scripts )) +ifneq (,$(NET_SCR_DIR)) + NETSCR_TARGET := $(DESTDIR)$(NETSCR_DIR)/ifup-hdlc + COPY_NETSCR := install -D ifup-hdlc $(NETSCR_TARGET) +endif + +RCCONF_DIR := $(firstword $(wildcard /etc/default /etc/sysconfig)) +ifneq (,$(RCCONF_DIR)) + RCCONF_TARGET := $(DESTDIR)$(RCCONF_DIR)/zaptel + # Let's not step over an existing config file: + ifeq (,$(wildcard $(RCCONF_TARGET))) + COPY_RCCONF := install -D -m 644 zaptel.sysconfig $(RCCONF_TARGET) + endif endif ifneq ($(wildcard .version),) @@ -506,26 +537,29 @@ else endif config: - if [ -d $(INSTALL_PREFIX)/etc/rc.d/init.d ]; then \ - $(INSTALL) -D -m 755 zaptel.init $(INSTALL_PREFIX)/etc/rc.d/init.d/zaptel; \ - if [ -z "$(INSTALL_PREFIX)" ]; then \ - $(CHKCONFIG) --add zaptel; \ - fi; \ - elif [ -d $(INSTALL_PREFIX)/etc/init.d ]; then \ - $(INSTALL) -D -m 755 zaptel.init $(INSTALL_PREFIX)/etc/init.d/zaptel; \ - if [ -z "$(INSTALL_PREFIX)" ]; then \ - $(CHKCONFIG) --add zaptel; \ - fi; \ - fi - if [ -d $(INSTALL_PREFIX)/etc/default ] && [ ! -f $(INSTALL_PREFIX)/etc/default/zaptel ]; then \ - $(INSTALL) -D -m 644 zaptel.sysconfig $(INSTALL_PREFIX)/etc/default/zaptel; \ - fi - if [ -d $(INSTALL_PREFIX)/etc/sysconfig ] && [ ! -f $(INSTALL_PREFIX)/etc/sysconfig/zaptel ]; then \ - $(INSTALL) -D -m 644 zaptel.sysconfig $(INSTALL_PREFIX)/etc/sysconfig/zaptel; \ - fi - if [ -d $(INSTALL_PREFIX)/etc/sysconfig/network-scripts ]; then \ - $(INSTALL) -D -m 755 ifup-hdlc $(INSTALL_PREFIX)/etc/sysconfig/network-scripts/ifup-hdlc; \ - fi +ifneq (,$(COPY_INITD)) + $(COPY_INITD) +endif +ifneq (,$(COPY_RCCONF)) + $(COPY_RCCONF) +endif +ifneq (,$(COPY_NETSCR)) + $(COPY_NETSCR) +endif +ifneq (,$(ADD_INITD)) + $(ADD_INITD) +endif + @echo "Zaptel has been configured." + @echo "" +ifneq (,$(COPY_RCCONF)) + @echo "If you have any zaptel hardware it is now recommended to " + @echo "edit $(RCCONF_TARGET) and set there an optimal value for " + @echo "the variable MODULES ." + @echo "" +endif + @echo "I think that the zaptel hardware you have on your system is:" + @xpp/utils/zaptel_hardware || true + update: @if [ -d .svn ]; then \ |