--- zaptel-1.2.0-rc2.orig/Makefile 2005-11-17 10:53:02.000000000 -0900 +++ zaptel-1.2.0-rc2/Makefile 2005-11-17 12:05:28.000000000 -0900 @@ -77,13 +77,15 @@ endif endif -ifeq (${BUILDVER},linux24) -#We only support DEVFS in linux 2.4 kernels, since its considered obsolete post 2.4 -DYNFS:=$(shell ps ax | grep -v grep | grep -q devfsd && echo "yes") -endif -ifeq (${BUILDVER},linux26) -#Tests for newer linux-2.6 udev support -DYNFS:=$(shell ps ax | grep -v grep | grep udevd && echo "yes") +ifndef IGNOREDYNFS + ifeq (${BUILDVER},linux24) + #We only support DEVFS in linux 2.4 kernels, since its considered obsolete post 2.4 + DYNFS:=$(shell ps ax | grep -v grep | grep -q devfsd && echo "yes") + endif + ifeq (${BUILDVER},linux26) + #Tests for newer linux-2.6 udev support + DYNFS:=$(shell ps ax | grep -v grep | grep udevd && echo "yes") + endif endif CHKCONFIG:=$(shell sh -c 'type -p chkconfig' 2> /dev/null) @@ -116,11 +118,11 @@ #PRIMARY=wcfxo PWD:=$(shell pwd) -all: $(BUILDVER) $(LIBTONEZONE_SO) +all: prereq $(BINS) $(BUILDVER) $(LIBTONEZONE_SO) linux24: $(MODULESO) $(BINS) -linux26: prereq $(BINS) +linux26: @echo $(KSRC) @if [ -z "$(KSRC)" -o ! -d "$(KSRC)" ]; then echo "You do not appear to have the sources for the $(KVERS) kernel installed."; exit 1 ; fi $(MAKE) -C $(KSRC) SUBDIRS=$(PWD) modules @@ -270,7 +272,7 @@ ztdiag: ztdiag.o $(CC) -o $@ $^ -devices: +install-devices: ifndef DYNFS mkdir -p $(INSTALL_PREFIX)/dev/zap rm -f $(INSTALL_PREFIX)/dev/zap/ctl @@ -296,7 +298,9 @@ @echo "**** If you are running udev, read README.udev" endif -install: all devices +install: all install-bins install-tonezone install-devel install-tonezone-devel install-devices install-modules + +install-bins: install-man install -D -m 755 ztcfg $(INSTALL_PREFIX)/sbin/ztcfg if [ -f sethdlc-new ]; then \ install -D -m 755 sethdlc-new $(INSTALL_PREFIX)/sbin/sethdlc; \ @@ -304,6 +308,10 @@ install -D -m 755 sethdlc $(INSTALL_PREFIX)/sbin/sethdlc ; \ fi if [ -f zttool ]; then install -D -m 755 zttool $(INSTALL_PREFIX)/sbin/zttool; fi + +install-modules: install-modules-noupdate install-modules-update + +install-modules-noupdate: if [ -f zaptel.ko ]; then \ for x in $(MODULESKO); do \ rm -f $(INSTALL_PREFIX)/lib/modules/$(KVERS)/extra/$$x ; \ @@ -322,16 +330,6 @@ fi; \ rm -f $(INSTALL_PREFIX)/lib/modules/$(KVERS)/misc/wcfxs.o; \ fi - install -D -m 755 $(LIBTONEZONE_SO) $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER).$(LIBTONEZONE_SO_MINOR_VER) - [ `id -u` = 0 ] && /sbin/ldconfig || : - rm -f $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE_SO) - ln -sf $(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER) $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE_SO) - if [ -x /usr/sbin/sestatus ] && (/usr/sbin/sestatus | grep "SELinux status:" | grep -q "enabled") ; then restorecon -v $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE_SO); fi - install -D -m 644 zaptel.h $(INSTALL_PREFIX)/usr/include/linux/zaptel.h - install -D -m 644 torisa.h $(INSTALL_PREFIX)/usr/include/linux/torisa.h - install -D -m 644 tonezone.h $(INSTALL_PREFIX)/usr/include/tonezone.h - install -m 644 doc/ztcfg.8 $(INSTALL_PREFIX)/usr/share/man/man8 - install -m 644 doc/zttool.8 $(INSTALL_PREFIX)/usr/share/man/man8 if [ -n "$(MODCONF)" ]; then \ if [ -f $(MODCONF) ]; then mv -f $(MODCONF) $(MODCONF).bak ; fi; \ cat $(MODCONF).bak | grep -v "alias char-major-250" | \ @@ -363,12 +361,32 @@ echo "alias wct2xxp wct4xxp" >> $(MODCONF); \ fi; \ fi + +install-modules-update: if [ -d /etc/modutils ]; then \ /sbin/update-modules ; \ fi [ `id -u` = 0 ] && /sbin/depmod -a $(KVERS) || : [ -f $(CONFIG_FILE) ] || install -D -m 644 zaptel.conf.sample $(CONFIG_FILE) +install-tonezone: + install -D -m 755 $(LIBTONEZONE_SO) $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER).$(LIBTONEZONE_SO_MINOR_VER) + [ `id -u` = 0 ] && /sbin/ldconfig || : + rm -f $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE_SO) + ln -sf $(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER) $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE_SO) + if [ -x /usr/sbin/sestatus ] && (/usr/sbin/sestatus | grep "SELinux status:" | grep -q "enabled") ; then restorecon -v $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE_SO); fi + +install-tonezone-devel: + install -D -m 644 tonezone.h $(INSTALL_PREFIX)/usr/include/tonezone.h + +install-devel: + install -D -m 644 zaptel.h $(INSTALL_PREFIX)/usr/include/linux/zaptel.h + install -D -m 644 torisa.h $(INSTALL_PREFIX)/usr/include/linux/torisa.h + +install-man: + install -m 644 doc/ztcfg.8 $(INSTALL_PREFIX)/usr/share/man/man8 + install -m 644 doc/zttool.8 $(INSTALL_PREFIX)/usr/share/man/man8 + install-udev: install -m 444 udev/zaptel.rules $(INSTALL_PREFIX)/etc/udev/rules.d install -m 444 udev/zaptel.permissions $(INSTALL_PREFIX)/etc/udev/permissions.d