3 # - IMPORTANT rename: http://www.asterisk.org/zaptel-to-dahdi
6 # unpackaged module: drivers/dahdi/xpp/xpd_bri
7 # unpackaged module: drivers/dahdi/xpp/xpd_fxo
8 # unpackaged module: drivers/dahdi/xpp/xpd_fxs
9 # unpackaged module: drivers/dahdi/xpp/xpd_pri
10 # unpackaged module: drivers/dahdi/xpp/xpp
11 # unpackaged module: drivers/dahdi/xpp/xpp_usb
14 %bcond_without dist_kernel # without distribution kernel
15 %bcond_without kernel # don't build kernel modules
16 %bcond_with oslec # with Open Source Line Echo Canceller
17 %bcond_without xpp # without Astribank
18 %bcond_without userspace # don't build userspace packages
21 %if "%{_alt_kernel}" != "%{nil}"
22 %undefine with_userspace
32 %undefine with_dist_kernel
36 %define pname dahdi-linux
37 %define FIRMWARE_URL http://downloads.digium.com/pub/telephony/firmware/releases
38 Summary: DAHDI telephony device support
39 Summary(pl.UTF-8): Obsługa urządzeń telefonicznych DAHDI
40 Name: %{pname}%{_alt_kernel}
45 Source0: http://downloads.digium.com/pub/telephony/dahdi-linux/dahdi-linux-%{version}.tar.gz
46 # Source0-md5: ac454f91d7e1267655ecd698832da414
47 Source3: %{FIRMWARE_URL}/dahdi-fw-oct6114-064-1.05.01.tar.gz
48 # Source3-md5: 88db9b7a07d8392736171b1b3e6bcc66
49 Source4: %{FIRMWARE_URL}/dahdi-fw-oct6114-128-1.05.01.tar.gz
50 # Source4-md5: c1f1a18d3e20d283f42c71e580a64b5a
51 Source5: %{FIRMWARE_URL}/dahdi-fw-vpmadt032-1.07.tar.gz
52 # Source5-md5: e1c7231d6225ac999cb18f4e858f66b6
53 Source6: %{FIRMWARE_URL}/dahdi-fw-tc400m-MR6.12.tar.gz
54 # Source6-md5: 2ea860bb8a9d8ede2858b9557b74ee3c
55 Source7: %{FIRMWARE_URL}/dahdi-fw-hx8-2.06.tar.gz
56 # Source7-md5: a7f3886942bb3e9fed349a41b3390c9f
57 Patch0: %{pname}-dummy.patch
58 URL: http://www.asterisk.org/
59 %if %{with dist_kernel}
60 BuildRequires: kernel%{_alt_kernel}-module-build
62 BuildRequires: perl-base
63 BuildRequires: rpmbuild(macros) >= 1.379
64 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
67 # - modules_X: single modules, just name module with no suffix
68 # - modules_X: subdir modules are just directory name with slash like dirname/
69 # - keep X and X_in in sync
70 # - X is used for actual building (entries separated with space), X_in for pld macros (entries separated with comma)
72 %define modules_1 dahdi.o dahdi_dynamic.o dahdi_dynamic_eth.o dahdi_dynamic_ethmf.o dahdi_dynamic_loc.o dahdi_dummy.o dahdi_echocan_jpah.o dahdi_echocan_kb1.o dahdi_echocan_mg2.o dahdi_echocan_sec.o dahdi_echocan_sec2.o pciradio.o tor2.o wcfxo.o wct1xxp.o wctdm.o wcte11xp.o
73 %define modules_1_in dahdi,dahdi_dynamic,dahdi_dynamic_eth,dahdi_dynamic_ethmf,dahdi_dynamic_loc,dahdi_dummy,dahdi_echocan_jpah,dahdi_echocan_kb1,dahdi_echocan_mg2,dahdi_echocan_sec,dahdi_echocan_sec2,pciradio,tor2,wcfxo,wct1xxp,wctdm,wcte11xp
74 %define modules_2 voicebus/ wct4xxp/ wcte12xp/ %{?with_xpp:xpp/}
75 %define modules_2_in voicebus/dahdi_voicebus,wct4xxp/wct4xxp,wcte12xp/wcte12xp,%{?with_xpp:xpp/xpd_bri,xpp/xpd_fxo,xpp/xpd_fxs,xpp/xpd_pri,xpp/xpp,xpp/xpp_usb}
77 %define modules_nalpha wctc4xxp/ wctdm24xxp/ dahdi_transcode.o wcb4xxp/
78 %define modules_nalpha_in wctc4xxp/wctc4xxp,wctdm24xxp/wctdm24xxp,dahdi_transcode,wcb4xxp/wcb4xxp
80 %define modules %{modules_1} %{modules_2}%{?modules_nalpha: %{modules_nalpha}}
81 %define modules_in %{modules_1_in},%{modules_2_in}%{?modules_nalpha:,%{modules_nalpha_in}}
84 DAHDI telephony device driver.
86 %description -l pl.UTF-8
87 Sterownik do urządzeń telefonicznych DAHDI.
90 Summary: Header files for dahdi interface
91 Group: Development/Libraries
92 # if base package contains shared library for which these headers are
93 #Requires: %{name} = %{version}-%{release}
94 # if -libs package contains shared library for which these headers are
95 #Requires: %{name}-libs = %{version}-%{release}
98 Header files for dahdi interface.
101 Summary: udev rules for DAHDI kernel modules
102 Summary(pl.UTF-8): Reguły udev dla modułów jądra Linuksa dla DAHDI
105 Requires: dahdi-tools >= 2.2.0
109 udev rules for DAHDI kernel modules.
111 %description udev -l pl.UTF-8
112 Reguły udev dla modułów jądra Linuksa dla DAHDI.
114 %package -n kernel%{_alt_kernel}-%{pname}
115 Summary: DAHDI Linux kernel driver
116 Summary(pl.UTF-8): Sterownik DAHDI dla jądra Linuksa
117 Release: %{rel}@%{_kernel_ver_str}
119 Requires(post,postun): /sbin/depmod
120 %if %{with dist_kernel}
121 %requires_releq_kernel
122 Requires(postun): %releq_kernel
123 %{?with_oslec:Requires: kernel-misc-oslec = 20070608-0.1@%{_kernel_ver_str}}
126 %description -n kernel%{_alt_kernel}-%{pname}
127 DAHDI telephony Linux kernel driver.
129 %description -n kernel%{_alt_kernel}-%{pname} -l pl.UTF-8
130 Sterownik dla jądra Linuksa do urządzeń telefonicznych DAHDI.
133 %setup -q -n %{pname}-%{version}
136 for a in %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} %{SOURCE7}; do
137 ln -s $a drivers/dahdi/firmware
138 tar -C drivers/dahdi/firmware -xzf $a
141 cat > download-logger <<'EOF'
143 # keep log of files make wanted to download in firmware/ dir
144 echo "$@" >> download.log
146 chmod a+rx download-logger
149 %{__make} include/dahdi/version.h
152 %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
156 for a in drivers/dahdi/{*/,}*.ko; do
157 [[ $a = *-dist.ko ]] && continue
158 [[ $a = *-up.ko ]] && continue
159 [[ $a = *-smp.ko ]] && continue
160 echo >&2 "unpackaged module: ${a%.ko}"
164 [ $err = 0 ] || exit 1
170 rm -rf $RPM_BUILD_ROOT
171 mkdir $RPM_BUILD_ROOT%{_includedir}/dahdi -p
174 %install_kernel_modules -m %{modules_in} -d misc
178 %if %{with userspace}
179 install -d $RPM_BUILD_ROOT/etc/udev/rules.d
182 DESTDIR=$RPM_BUILD_ROOT \
188 rm -rf $RPM_BUILD_ROOT
190 %post -n kernel%{_alt_kernel}-%{pname}
191 %depmod %{_kernel_ver}
193 %postun -n kernel%{_alt_kernel}-%{pname}
194 %depmod %{_kernel_ver}
196 %if %{with userspace}
198 %defattr(644,root,root,755)
202 %defattr(644,root,root,755)
203 %config(noreplace) %verify(not md5 mtime size) /etc/udev/rules.d/dahdi.rules
204 %config(noreplace) %verify(not md5 mtime size) /etc/udev/rules.d/xpp.rules
208 %files -n kernel%{_alt_kernel}-%{pname}
209 %defattr(644,root,root,755)
210 /lib/modules/%{_kernel_ver}/misc/*.ko*