3 # - IMPORTANT rename: http://www.asterisk.org/zaptel-to-dahdi
5 # - kernel modules doesn't build
6 # - should more header files be installed?
7 # - Installed (but unpackaged) file(s) found:
8 # /etc/hotplug/usb/xpp_fxloader
9 # /etc/hotplug/usb/xpp_fxloader.usermap
10 # /etc/udev/rules.d/xpp.rules
13 %bcond_without dist_kernel # without distribution kernel
14 %bcond_with oslec # with Open Source Line Echo Canceller
15 %bcond_with bristuff # with bristuff support
16 %bcond_without xpp # without Astribank
27 %define pname dahdi-linux
28 %define FIRMWARE_URL http://downloads.digium.com/pub/telephony/firmware/releases
29 Summary: DAHDI telephony device support
30 Summary(pl.UTF-8): Obsługa urządzeń telefonicznych DAHDI
31 Name: %{pname}%{_alt_kernel}
33 Release: %{rel}%{?with_bristuff:.bristuff}
36 Source0: http://downloads.digium.com/pub/telephony/dahdi-linux/dahdi-linux-%{version}.tar.gz
37 # Source0-md5: ef2d34c394e8b600ad392560efc56920
38 Source3: %{FIRMWARE_URL}/dahdi-fw-oct6114-064-1.05.01.tar.gz
39 # Source3-md5: 88db9b7a07d8392736171b1b3e6bcc66
40 Source4: %{FIRMWARE_URL}/dahdi-fw-oct6114-128-1.05.01.tar.gz
41 # Source4-md5: c1f1a18d3e20d283f42c71e580a64b5a
42 Source5: %{FIRMWARE_URL}/dahdi-fw-vpmadt032-1.07.tar.gz
43 # Source5-md5: e1c7231d6225ac999cb18f4e858f66b6
44 Source6: %{FIRMWARE_URL}/dahdi-fw-tc400m-MR6.12.tar.gz
45 # Source6-md5: 2ea860bb8a9d8ede2858b9557b74ee3c
46 URL: http://www.asterisk.org/
47 %if %{with kernel} && %{with dist_kernel}
48 BuildRequires: kernel%{_alt_kernel}-module-build
49 BuildRequires: module-init-tools
51 BuildRequires: newt-devel
52 BuildRequires: perl-base
53 BuildRequires: perl-tools-pod
54 BuildRequires: rpmbuild(macros) >= 1.379
55 %{?with_bristuff:Provides: dahdi(bristuff)}
56 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
59 # - modules_X: single modules, just name module with no suffix
60 # - modules_X: subdir modules are just directory name with slash like dirname/
61 # - keep X and X_in in sync
62 # - X is used for actual building (entries separated with space), X_in for pld macros (entries separated with comma)
64 %define modules_1 dahdi.o dahdi_dynamic_eth.o dahdi_dynamic_loc.o pciradio.o tor2.o wcfxo.o wct1xxp.o wctdm.o wcte11xp.o dahdi_dummy.o dahdi_dynamic.o dahdi_echocan_jpah.o dahdi_echocan_kb1.o dahdi_echocan_mg2.o dahdi_echocan_sec.o dahdi_echocan_sec2.o
65 %define modules_1_in dahdi,dahdi_dynamic_eth,dahdi_dynamic_loc,pciradio,tor2,wcfxo,wct1xxp,wctdm,wcte11xp,dahdi_dummy,dahdi_dynamic,dahdi_echocan_jpah,dahdi_echocan_kb1,dahdi_echocan_mg2,dahdi_echocan_sec,dahdi_echocan_sec2
66 %define modules_2 wct4xxp/ wcte12xp/ %{?with_xpp:xpp/}
67 %define modules_2_in wct4xxp/wct4xxp,wcte12xp/wcte12xp%{?with_xpp:,xpp/{%{?with_bristuff:xpd_bri,}xpd_fxo,xpd_fxs,xpd_pri,xpp,xpp_usb}}
69 %define modules_nalpha wctc4xxp/ wctdm24xxp/ dahdi_transcode.o wcb4xxp/
70 %define modules_nalpha_in wctc4xxp/wctc4xxp,wctdm24xxp/wctdm24xxp,dahdi_transcode,wcb4xxp/wcb4xxp
74 %define modules_bristuff cwain/ qozap/ vzaphfc/ zaphfc/ ztgsm/ opvxa1200.o wcopenpci.o
75 %define modules_bristuff_in cwain/cwain,qozap/qozap,vzaphfc/vzaphfc,zaphfc/zaphfc,ztgsm/ztgsm,opvxa1200,wcopenpci
77 %define modules %{modules_1} %{modules_2}%{?modules_nalpha: %{modules_nalpha}}%{?modules_bristuff: %{modules_bristuff}}
78 %define modules_in %{modules_1_in},%{modules_2_in}%{?modules_nalpha:,%{modules_nalpha_in}}%{?modules_bristuff:,%{modules_bristuff_in}}
81 DAHDI telephony device driver.
83 %description -l pl.UTF-8
84 Sterownik do urządzeń telefonicznych DAHDI.
87 Summary: Header files for dahdi interface
88 Group: Development/Libraries
89 # if base package contains shared library for which these headers are
90 #Requires: %{name} = %{version}-%{release}
91 # if -libs package contains shared library for which these headers are
92 #Requires: %{name}-libs = %{version}-%{release}
95 Header files for dahdi interface.
97 %package -n kernel%{_alt_kernel}-%{pname}
98 Summary: DAHDI Linux kernel driver
99 Summary(pl.UTF-8): Sterownik DAHDI dla jądra Linuksa
100 Release: %{rel}@%{_kernel_ver_str}
102 Requires(post,postun): /sbin/depmod
103 %if %{with dist_kernel}
104 %requires_releq_kernel
105 Requires(postun): %releq_kernel
106 %{?with_oslec:Requires: kernel-misc-oslec = 20070608-0.1@%{_kernel_ver_str}}
109 %description -n kernel%{_alt_kernel}-%{pname}
110 DAHDI telephony Linux kernel driver.
112 %description -n kernel%{_alt_kernel}-%{pname} -l pl.UTF-8
113 Sterownik dla jądra Linuksa do urządzeń telefonicznych DAHDI.
116 %setup -q -n %{pname}-%{version}
118 for a in %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6}; do
119 ln -s $a drivers/dahdi/firmware
120 tar -C drivers/dahdi/firmware -xzf $a
123 cat > download-logger <<'EOF'
125 # keep log of files make wanted to download in firmware/ dir
126 echo "$@" >> download.log
128 chmod a+rx download-logger
131 %{__make} include/dahdi/version.h
133 %build_kernel_modules SUBDIRS=$PWD/drivers/dahdi DAHDI_BUILD_ALL=m HOTPLUG_FIRMWARE=yes DAHDI_MODULES_EXTRA=" " -m %{modules_in} KSRC=$PWD/o -C drivers/dahdi DAHDI_INCLUDE=$PWD/../../include
137 for a in drivers/dahdi/{*/,}*.ko; do
138 [[ $a = *-dist.ko ]] && continue
139 [[ $a = *-up.ko ]] && continue
140 [[ $a = *-smp.ko ]] && continue
141 echo >&2 "unpackaged module: ${a%.ko}"
145 [ $err = 0 ] || exit 1
150 rm -rf $RPM_BUILD_ROOT
151 mkdir $RPM_BUILD_ROOT%{_includedir}/dahdi -p
153 %install_kernel_modules -m %{modules_in} -d misc
156 install include/dahdi/*.h $RPM_BUILD_ROOT%{_includedir}/dahdi/
159 rm -rf $RPM_BUILD_ROOT
161 %post -n kernel%{_alt_kernel}-%{pname}
162 %depmod %{_kernel_ver}
164 %postun -n kernel%{_alt_kernel}-%{pname}
165 %depmod %{_kernel_ver}
168 %defattr(644,root,root,755)
171 %files -n kernel%{_alt_kernel}-%{pname}
172 %defattr(644,root,root,755)
173 /lib/modules/%{_kernel_ver}/misc/*.ko*