Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 174681
Collapse All | Expand All

(-)zaptel-1.4.1/Makefile (-15 / +22 lines)
Lines 40-52 Link Here
40
  BUILDVER:=linux26
40
  BUILDVER:=linux26
41
endif
41
endif
42
42
43
# This is not related to the version that we build. Rather, to the 
44
# version that we runs. If we build for 2.4 using 2.4 headers on a 2.6
45
# system with udev mounted on /dev , no point in installing files to /dev
46
# because they'll be wiped at next reboot. XXX: should this be a use-flag? Perhaps: noudev?
47
DYNFS:=$(shell ps ax | grep -v grep | grep -qw 'devfsd\|udevd' && echo "yes")
48
49
# Check for udev rules directories
50
ifneq (,$(wildcard $(ROOT_PREFIX)/etc/udev/rules.d))
51
  UDEVRULES=yes
52
endif
53
43
# Set HOTPLUG_FIRMWARE=no to override automatic building with hotplug support
54
# Set HOTPLUG_FIRMWARE=no to override automatic building with hotplug support
44
# if it is enabled in the kernel.
55
# if it is enabled in the kernel.
45
ifeq ($(BUILDVER),linux26)
56
ifeq ($(BUILDVER),linux26)
46
  ifneq (,$(wildcard $(INSTALL_PREFIX)/etc/udev/rules.d))
47
    DYNFS=yes
48
    UDEVRULES=yes
49
  endif
50
  HOTPLUG_FIRMWARE:=$(shell if grep CONFIG_FW_LOADER $(KINCLUDES)/linux/autoconf.h | grep -q undef; then echo "no"; else echo "yes"; fi)
57
  HOTPLUG_FIRMWARE:=$(shell if grep CONFIG_FW_LOADER $(KINCLUDES)/linux/autoconf.h | grep -q undef; then echo "no"; else echo "yes"; fi)
51
else
58
else
52
  # Hotplug firmware loading is not supported on any other version then 2.6
59
  # Hotplug firmware loading is not supported on any other version then 2.6
Lines 136-142 Link Here
136
  ALL_MODULES+=$(patsubst %,xpp/%.ko,xpp_usb xpd_fxo xpd_fxs xpp)
143
  ALL_MODULES+=$(patsubst %,xpp/%.ko,xpp_usb xpd_fxo xpd_fxs xpp)
137
endif
144
endif
138
145
139
CFLAGS+=-I. -O4 -g -Wall -DBUILDING_TONEZONE #-DTONEZONE_DRIVER
146
CFLAGS+=-I. -Iinclude -g -Wall -DBUILDING_TONEZONE #-DTONEZONE_DRIVER
140
ifneq (,$(findstring ppc,$(UNAME_M)))
147
ifneq (,$(findstring ppc,$(UNAME_M)))
141
CFLAGS_PPC:=-fsigned-char
148
CFLAGS_PPC:=-fsigned-char
142
endif
149
endif
Lines 386-392 Link Here
386
$(UTILSO): %.o: %.c
393
$(UTILSO): %.o: %.c
387
	$(CC) $(CFLAGS) -o $@ -c $<
394
	$(CC) $(CFLAGS) -o $@ -c $<
388
395
389
install: all devices install-modules install-libs install-include install-xpp
396
install: devices install-modules install-libs install-include install-xpp
390
ifeq ($(HOTPLUG_FIRMWARE),yes)
397
ifeq ($(HOTPLUG_FIRMWARE),yes)
391
	$(MAKE) -C firmware hotplug-install
398
	$(MAKE) -C firmware hotplug-install
392
endif
399
endif
Lines 401-420 Link Here
401
	if [ -f zttool ]; then \
408
	if [ -f zttool ]; then \
402
		$(INSTALL) -D -m 755 zttool $(INSTALL_PREFIX)/sbin/zttool; \
409
		$(INSTALL) -D -m 755 zttool $(INSTALL_PREFIX)/sbin/zttool; \
403
	fi
410
	fi
411
	install -d $(INSTALL_PREFIX)/usr/share/man/man8
404
	$(INSTALL) -m 644 doc/ztcfg.8 $(INSTALL_PREFIX)/usr/share/man/man8
412
	$(INSTALL) -m 644 doc/ztcfg.8 $(INSTALL_PREFIX)/usr/share/man/man8
405
	$(INSTALL) -m 644 doc/zttool.8 $(INSTALL_PREFIX)/usr/share/man/man8
413
	$(INSTALL) -m 644 doc/zttool.8 $(INSTALL_PREFIX)/usr/share/man/man8
406
	[ `id -u` = 0 ] && /sbin/depmod -a $(KVERS) || :
414
	[ -z "$(INSTALL_PREFIX)" -a `id -u` = 0 ] && /sbin/depmod -a $(KVERS) || :
407
	[ -f $(CONFIG_FILE) ] || $(INSTALL) -D -m 644 zaptel.conf.sample $(CONFIG_FILE)
415
	[ -f $(CONFIG_FILE) ] || $(INSTALL) -D -m 644 zaptel.conf.sample $(CONFIG_FILE)
408
	build_tools/genmodconf $(BUILDVER) "$(ROOT_PREFIX)" "$(filter-out zaptel ztdummy xpp zttranscode ztdynamic,$(BUILD_MODULES)) $(MODULE_ALIASES)"
416
	install -d -m 755 $(INSTALL_PREFIX)/etc/modules.d
409
	@if [ -d /etc/modutils ]; then \
417
	build_tools/genmodconf $(BUILDVER) "$(INSTALL_PREFIX)" "$(filter-out zaptel ztdummy xpp zttranscode ztdynamic,$(BUILD_MODULES)) $(MODULE_ALIASES)"
410
		/sbin/update-modules ; \
411
	fi
412
418
413
install-libs: $(LTZ_SO) $(LTZ_A)
419
install-libs: $(LTZ_SO) $(LTZ_A)
414
	$(INSTALL) -D -m 755 $(LTZ_A) $(LIB_DIR)/$(LTZ_A)
420
	$(INSTALL) -D -m 755 $(LTZ_A) $(LIB_DIR)/$(LTZ_A)
415
	$(INSTALL) -D -m 755 $(LTZ_SO) $(LIB_DIR)/$(LTZ_SO).$(LTZ_SO_MAJOR_VER).$(LTZ_SO_MINOR_VER)
421
	$(INSTALL) -D -m 755 $(LTZ_SO) $(LIB_DIR)/$(LTZ_SO).$(LTZ_SO_MAJOR_VER).$(LTZ_SO_MINOR_VER)
416
	if [ -z "$(INSTALL_PREFIX)" -a `id -u` = 0 ]; then \
422
	if [ `id -u` = 0 ]; then \
417
		/sbin/ldconfig || : ;\
423
		/sbin/ldconfig -n "$(INSTALL_PREFIX)"/usr/lib || : ;\
418
	fi
424
	fi
419
	rm -f $(LIB_DIR)$(LTZ_SO)
425
	rm -f $(LIB_DIR)$(LTZ_SO)
420
	$(LN) -sf $(LTZ_SO).$(LTZ_SO_MAJOR_VER).$(LTZ_SO_MINOR_VER) \
426
	$(LN) -sf $(LTZ_SO).$(LTZ_SO_MAJOR_VER).$(LTZ_SO_MINOR_VER) \
Lines 425-431 Link Here
425
431
426
install-xpp:
432
install-xpp:
427
ifeq (yes,$(BUILD_XPP))
433
ifeq (yes,$(BUILD_XPP))
428
	@$(MAKE) -C xpp/utils install
434
	@$(MAKE) DESTDIR="$(INSTALL_PREFIX)" -C xpp/utils install
429
endif
435
endif
430
436
431
install-include:
437
install-include:
Lines 463-469 Link Here
463
else # DYNFS
469
else # DYNFS
464
  ifdef UDEVRULES
470
  ifdef UDEVRULES
465
	install -d $(INSTALL_PREFIX)/etc/udev/rules.d
471
	install -d $(INSTALL_PREFIX)/etc/udev/rules.d
466
	build_tools/genudevrules > $(INSTALL_PREFIX)/etc/udev/rules.d/zaptel.rules
472
	build_tools/genudevrules > zaptel.rules
473
	install -D -m 644 zaptel.rules $(INSTALL_PREFIX)/etc/udev/rules.d/10-zaptel.rules
467
  else # !UDEVRULES
474
  else # !UDEVRULES
468
	@echo "**** Dynamic filesystem detected -- not creating device nodes"
475
	@echo "**** Dynamic filesystem detected -- not creating device nodes"
469
  endif
476
  endif
(-)zaptel-1.4.1/build_tools/genmodconf (-14 lines)
Lines 79-98 Link Here
79
79
80
echo Building ${target}...
80
echo Building ${target}...
81
81
82
if [ "${1}" = "linux24" ]; then
83
    for mod in ${3}; do
84
	if ! grep -q "post-install ${mod} " ${target}; then
85
	    echo "post-install ${mod} /sbin/ztcfg" >> ${target}
86
	fi
87
    done
88
elif [ "${1}" = "linux26" ]; then
89
    for mod in ${3}; do
90
	if ! grep -q "install ${mod} " ${target}; then
91
	    echo "install ${mod} /sbin/modprobe --ignore-install ${mod} ${cmdopts} && /sbin/ztcfg" >> ${target}
92
	fi
93
    done
94
fi
95
96
if [ -z "${combined}" ]; then
82
if [ -z "${combined}" ]; then
97
    echo "***"
83
    echo "***"
98
    echo "*** WARNING:"
84
    echo "*** WARNING:"
(-)zaptel-1.4.1/build_tools/genudevrules (-6 / +6 lines)
Lines 22-31 Link Here
22
22
23
cat <<EOF
23
cat <<EOF
24
# zaptel devices with ownership/permissions for running as non-root
24
# zaptel devices with ownership/permissions for running as non-root
25
KERNEL${match}"zapctl", NAME="zap/ctl", OWNER="asterisk", GROUP="asterisk", MODE="0660"
25
KERNEL${match}"zapctl", NAME="zap/ctl", OWNER="root", GROUP="dialout", MODE="0660"
26
KERNEL${match}"zaptranscode", NAME="zap/transcode", OWNER="asterisk", GROUP="asterisk", MODE="0660"
26
KERNEL${match}"zaptranscode", NAME="zap/transcode", OWNER="root", GROUP="dialout", MODE="0660"
27
KERNEL${match}"zaptimer", NAME="zap/timer", OWNER="asterisk", GROUP="asterisk", MODE="0660"
27
KERNEL${match}"zaptimer", NAME="zap/timer", OWNER="root", GROUP="dialout", MODE="0660"
28
KERNEL${match}"zapchannel", NAME="zap/channel", OWNER="asterisk", GROUP="asterisk", MODE="0660"
28
KERNEL${match}"zapchannel", NAME="zap/channel", OWNER="root", GROUP="dialout", MODE="0660"
29
KERNEL${match}"zappseudo", NAME="zap/pseudo", OWNER="asterisk", GROUP="asterisk", MODE="0660"
29
KERNEL${match}"zappseudo", NAME="zap/pseudo", OWNER="root", GROUP="dialout", MODE="0660"
30
KERNEL${match}"zap[0-9]*", NAME="zap/%n", OWNER="asterisk", GROUP="asterisk", MODE="0660"
30
KERNEL${match}"zap[0-9]*", NAME="zap/%n", OWNER="root", GROUP="dialout", MODE="0660"
31
EOF
31
EOF

Return to bug 174681