]>
Commit | Line | Data |
---|---|---|
563fc4ec | 1 | # |
2 | # TODO: | |
f50e30c4 | 3 | # - IMPORTANT rename: http://www.asterisk.org/zaptel-to-dahdi |
cc9ccfe5 | 4 | # - Fix --without xpp: |
5 | # + check_modules | |
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 | |
563fc4ec | 12 | # |
563fc4ec | 13 | # Conditional build: |
14 | %bcond_without dist_kernel # without distribution kernel | |
15 | %bcond_with oslec # with Open Source Line Echo Canceller | |
563fc4ec | 16 | %bcond_without xpp # without Astribank |
56c839b0 | 17 | %bcond_without userspace # don't build userspace packages |
563fc4ec | 18 | %bcond_with verbose |
19 | ||
56c839b0 | 20 | %if "%{_alt_kernel}" != "%{nil}" |
21 | %undefine with_userspace | |
22 | %endif | |
23 | ||
563fc4ec | 24 | %ifarch sparc |
25 | %undefine with_smp | |
26 | %endif | |
27 | %ifarch alpha | |
28 | %undefine with_xpp | |
29 | %endif | |
30 | ||
14fc82b0 | 31 | %define rel 9 |
563fc4ec | 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} | |
39ecdd6c | 37 | Version: 2.2.0.2 |
b800683f | 38 | Release: %{rel} |
563fc4ec | 39 | License: GPL |
40 | Group: Base/Kernel | |
b603dc42 | 41 | Source0: http://downloads.digium.com/pub/telephony/dahdi-linux/dahdi-linux-%{version}.tar.gz |
39ecdd6c | 42 | # Source0-md5: 1f932729ad28f2f028afcf2cc5ccf7ba |
563fc4ec | 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 | |
c278c563 | 51 | Patch0: %{pname}-svn-fixes.patch |
563fc4ec | 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 | |
56 | %endif | |
57 | BuildRequires: newt-devel | |
58 | BuildRequires: perl-base | |
59 | BuildRequires: perl-tools-pod | |
60 | BuildRequires: rpmbuild(macros) >= 1.379 | |
563fc4ec | 61 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
62 | ||
63 | # Rules: | |
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) | |
68 | ||
21a65756 | 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/} | |
b800683f | 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} |
563fc4ec | 73 | %ifnarch alpha |
74 | %define modules_nalpha wctc4xxp/ wctdm24xxp/ dahdi_transcode.o wcb4xxp/ | |
75 | %define modules_nalpha_in wctc4xxp/wctc4xxp,wctdm24xxp/wctdm24xxp,dahdi_transcode,wcb4xxp/wcb4xxp | |
76 | ||
77 | %endif | |
b800683f | 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}} | |
563fc4ec | 80 | |
81 | %description | |
82 | DAHDI telephony device driver. | |
83 | ||
84 | %description -l pl.UTF-8 | |
85 | Sterownik do urządzeń telefonicznych DAHDI. | |
86 | ||
87 | %package devel | |
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} | |
94 | ||
95 | %description devel | |
96 | Header files for dahdi interface. | |
97 | ||
b448351d | 98 | %package udev |
99 | Summary: udev rules for DAHDI kernel modules | |
100 | Summary(pl.UTF-8): Reguły udev dla modułów jądra Linuksa dla DAHDI | |
101 | Release: %{rel} | |
102 | Group: Base/Kernel | |
6e3c0f33 | 103 | Requires: dahdi-tools >= 2.2.0 |
b448351d | 104 | Requires: udev-core |
105 | ||
106 | %description udev | |
107 | udev rules for DAHDI kernel modules. | |
108 | ||
109 | %description udev -l pl.UTF-8 | |
110 | Reguły udev dla modułów jądra Linuksa dla DAHDI. | |
111 | ||
563fc4ec | 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} | |
116 | Group: Base/Kernel | |
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}} | |
122 | %endif | |
123 | ||
124 | %description -n kernel%{_alt_kernel}-%{pname} | |
125 | DAHDI telephony Linux kernel driver. | |
126 | ||
127 | %description -n kernel%{_alt_kernel}-%{pname} -l pl.UTF-8 | |
128 | Sterownik dla jądra Linuksa do urządzeń telefonicznych DAHDI. | |
129 | ||
130 | %prep | |
131 | %setup -q -n %{pname}-%{version} | |
c278c563 | 132 | %patch0 -p1 |
563fc4ec | 133 | |
134 | for a in %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6}; do | |
135 | ln -s $a drivers/dahdi/firmware | |
136 | tar -C drivers/dahdi/firmware -xzf $a | |
137 | done | |
138 | ||
139 | cat > download-logger <<'EOF' | |
140 | #!/bin/sh | |
141 | # keep log of files make wanted to download in firmware/ dir | |
142 | echo "$@" >> download.log | |
143 | EOF | |
144 | chmod a+rx download-logger | |
145 | ||
146 | %build | |
147 | %{__make} include/dahdi/version.h | |
148 | ||
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 | |
150 | ||
151 | check_modules() { | |
152 | err=0 | |
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}" | |
158 | err=1 | |
159 | done | |
160 | ||
161 | [ $err = 0 ] || exit 1 | |
162 | } | |
163 | check_modules | |
164 | ||
165 | %install | |
166 | rm -rf $RPM_BUILD_ROOT | |
167 | mkdir $RPM_BUILD_ROOT%{_includedir}/dahdi -p | |
168 | cd drivers/dahdi | |
169 | %install_kernel_modules -m %{modules_in} -d misc | |
170 | cd ../.. | |
171 | ||
56c839b0 | 172 | %if %{with userspace} |
b448351d | 173 | install -d $RPM_BUILD_ROOT/etc/udev/rules.d |
174 | ||
175 | %{make} \ | |
176 | DESTDIR=$RPM_BUILD_ROOT \ | |
177 | install-devices \ | |
178 | install-include | |
56c839b0 | 179 | %endif |
563fc4ec | 180 | |
181 | %clean | |
182 | rm -rf $RPM_BUILD_ROOT | |
183 | ||
184 | %post -n kernel%{_alt_kernel}-%{pname} | |
185 | %depmod %{_kernel_ver} | |
186 | ||
187 | %postun -n kernel%{_alt_kernel}-%{pname} | |
188 | %depmod %{_kernel_ver} | |
189 | ||
56c839b0 | 190 | %if %{with userspace} |
563fc4ec | 191 | %files devel |
b603dc42 | 192 | %defattr(644,root,root,755) |
563fc4ec | 193 | %{_includedir}/dahdi |
194 | ||
b448351d | 195 | %files udev |
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 | |
56c839b0 | 199 | %endif |
b448351d | 200 | |
563fc4ec | 201 | %files -n kernel%{_alt_kernel}-%{pname} |
202 | %defattr(644,root,root,755) | |
203 | /lib/modules/%{_kernel_ver}/misc/*.ko* |