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_with oslec # with Open Source Line Echo Canceller
16 %bcond_without xpp # without Astribank
17 %bcond_without userspace # don't build userspace packages
20 %if "%{_alt_kernel}" != "%{nil}"
21 %undefine with_userspace
32 %define pname dahdi-linux
33 %define FIRMWARE_URL http://downloads.digium.com/pub/telephony/firmware/releases
34 Summary: DAHDI telephony device support
35 Summary(pl.UTF-8): Obsługa urządzeń telefonicznych DAHDI
36 Name: %{pname}%{_alt_kernel}
41 Source0: http://downloads.digium.com/pub/telephony/dahdi-linux/dahdi-linux-%{version}.tar.gz
42 # Source0-md5: 1f932729ad28f2f028afcf2cc5ccf7ba
43 Source3: %{FIRMWARE_URL}/dahdi-fw-oct6114-064-1.05.01.tar.gz
44 # Source3-md5: 88db9b7a07d8392736171b1b3e6bcc66
45 Source4: %{FIRMWARE_URL}/dahdi-fw-oct6114-128-1.05.01.tar.gz
46 # Source4-md5: c1f1a18d3e20d283f42c71e580a64b5a
47 Source5: %{FIRMWARE_URL}/dahdi-fw-vpmadt032-1.07.tar.gz
48 # Source5-md5: e1c7231d6225ac999cb18f4e858f66b6
49 Source6: %{FIRMWARE_URL}/dahdi-fw-tc400m-MR6.12.tar.gz
50 # Source6-md5: 2ea860bb8a9d8ede2858b9557b74ee3c
51 Patch0: %{name}-gentoo.patch
52 URL: http://www.asterisk.org/
53 %if %{with kernel} && %{with dist_kernel}
54 BuildRequires: kernel%{_alt_kernel}-module-build
55 BuildRequires: module-init-tools
57 BuildRequires: newt-devel
58 BuildRequires: perl-base
59 BuildRequires: perl-tools-pod
60 BuildRequires: rpmbuild(macros) >= 1.379
61 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
64 # - modules_X: single modules, just name module with no suffix
65 # - modules_X: subdir modules are just directory name with slash like dirname/
66 # - keep X and X_in in sync
67 # - X is used for actual building (entries separated with space), X_in for pld macros (entries separated with comma)
69 %define modules_1 dahdi.o dahdi_dynamic.o dahdi_dynamic_eth.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
70 %define modules_1_in dahdi,dahdi_dynamic,dahdi_dynamic_eth,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
71 %define modules_2 voicebuss wct4xxp/ wcte12xp/ %{?with_xpp:xpp/}
72 %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}
74 %define modules_nalpha wctc4xxp/ wctdm24xxp/ dahdi_transcode.o wcb4xxp/
75 %define modules_nalpha_in wctc4xxp/wctc4xxp,wctdm24xxp/wctdm24xxp,dahdi_transcode,wcb4xxp/wcb4xxp
78 %define modules %{modules_1} %{modules_2}%{?modules_nalpha: %{modules_nalpha}}
79 %define modules_in %{modules_1_in},%{modules_2_in}%{?modules_nalpha:,%{modules_nalpha_in}}
82 DAHDI telephony device driver.
84 %description -l pl.UTF-8
85 Sterownik do urządzeń telefonicznych DAHDI.
88 Summary: Header files for dahdi interface
89 Group: Development/Libraries
90 # if base package contains shared library for which these headers are
91 #Requires: %{name} = %{version}-%{release}
92 # if -libs package contains shared library for which these headers are
93 #Requires: %{name}-libs = %{version}-%{release}
96 Header files for dahdi interface.
99 Summary: udev rules for DAHDI kernel modules
100 Summary(pl.UTF-8): Reguły udev dla modułów jądra Linuksa dla DAHDI
103 Requires: dahdi-tools >= 2.2.0
107 udev rules for DAHDI kernel modules.
109 %description udev -l pl.UTF-8
110 Reguły udev dla modułów jądra Linuksa dla DAHDI.
112 %package -n kernel%{_alt_kernel}-%{pname}
113 Summary: DAHDI Linux kernel driver
114 Summary(pl.UTF-8): Sterownik DAHDI dla jądra Linuksa
115 Release: %{rel}@%{_kernel_ver_str}
117 Requires(post,postun): /sbin/depmod
118 %if %{with dist_kernel}
119 %requires_releq_kernel
120 Requires(postun): %releq_kernel
121 %{?with_oslec:Requires: kernel-misc-oslec = 20070608-0.1@%{_kernel_ver_str}}
124 %description -n kernel%{_alt_kernel}-%{pname}
125 DAHDI telephony Linux kernel driver.
127 %description -n kernel%{_alt_kernel}-%{pname} -l pl.UTF-8
128 Sterownik dla jądra Linuksa do urządzeń telefonicznych DAHDI.
131 %setup -q -n %{pname}-%{version}
134 for a in %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6}; do
135 ln -s $a drivers/dahdi/firmware
136 tar -C drivers/dahdi/firmware -xzf $a
139 cat > download-logger <<'EOF'
141 # keep log of files make wanted to download in firmware/ dir
142 echo "$@" >> download.log
144 chmod a+rx download-logger
147 %{__make} include/dahdi/version.h
149 %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
153 for a in drivers/dahdi/{*/,}*.ko; do
154 [[ $a = *-dist.ko ]] && continue
155 [[ $a = *-up.ko ]] && continue
156 [[ $a = *-smp.ko ]] && continue
157 echo >&2 "unpackaged module: ${a%.ko}"
161 [ $err = 0 ] || exit 1
166 rm -rf $RPM_BUILD_ROOT
167 mkdir $RPM_BUILD_ROOT%{_includedir}/dahdi -p
169 %install_kernel_modules -m %{modules_in} -d misc
172 %if %{with userspace}
173 install -d $RPM_BUILD_ROOT/etc/udev/rules.d
176 DESTDIR=$RPM_BUILD_ROOT \
182 rm -rf $RPM_BUILD_ROOT
184 %post -n kernel%{_alt_kernel}-%{pname}
185 %depmod %{_kernel_ver}
187 %postun -n kernel%{_alt_kernel}-%{pname}
188 %depmod %{_kernel_ver}
190 %if %{with userspace}
192 %defattr(644,root,root,755)
196 %defattr(644,root,root,755)
197 %config(noreplace) %verify(not md5 mtime size) /etc/udev/rules.d/dahdi.rules
198 %config(noreplace) %verify(not md5 mtime size) /etc/udev/rules.d/xpp.rules
201 %files -n kernel%{_alt_kernel}-%{pname}
202 %defattr(644,root,root,755)
203 /lib/modules/%{_kernel_ver}/misc/*.ko*