]>
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 | ||
cf935eb0 | 31 | %define rel 14 |
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 | |
cf935eb0 | 51 | Patch0: %{pname}-gentoo.patch |
563fc4ec | 52 | URL: http://www.asterisk.org/ |
f877d867 | 53 | %if %{with dist_kernel} |
563fc4ec | 54 | BuildRequires: kernel%{_alt_kernel}-module-build |
563fc4ec | 55 | %endif |
563fc4ec | 56 | BuildRequires: perl-base |
563fc4ec | 57 | BuildRequires: rpmbuild(macros) >= 1.379 |
563fc4ec | 58 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
59 | ||
60 | # Rules: | |
61 | # - modules_X: single modules, just name module with no suffix | |
62 | # - modules_X: subdir modules are just directory name with slash like dirname/ | |
63 | # - keep X and X_in in sync | |
64 | # - X is used for actual building (entries separated with space), X_in for pld macros (entries separated with comma) | |
65 | ||
f877d867 | 66 | %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 |
21a65756 | 67 | %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 |
68 | %define modules_2 voicebuss wct4xxp/ wcte12xp/ %{?with_xpp:xpp/} | |
b800683f | 69 | %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 | 70 | %ifnarch alpha |
71 | %define modules_nalpha wctc4xxp/ wctdm24xxp/ dahdi_transcode.o wcb4xxp/ | |
72 | %define modules_nalpha_in wctc4xxp/wctc4xxp,wctdm24xxp/wctdm24xxp,dahdi_transcode,wcb4xxp/wcb4xxp | |
73 | ||
74 | %endif | |
b800683f | 75 | %define modules %{modules_1} %{modules_2}%{?modules_nalpha: %{modules_nalpha}} |
76 | %define modules_in %{modules_1_in},%{modules_2_in}%{?modules_nalpha:,%{modules_nalpha_in}} | |
563fc4ec | 77 | |
78 | %description | |
79 | DAHDI telephony device driver. | |
80 | ||
81 | %description -l pl.UTF-8 | |
82 | Sterownik do urządzeń telefonicznych DAHDI. | |
83 | ||
84 | %package devel | |
85 | Summary: Header files for dahdi interface | |
86 | Group: Development/Libraries | |
87 | # if base package contains shared library for which these headers are | |
88 | #Requires: %{name} = %{version}-%{release} | |
89 | # if -libs package contains shared library for which these headers are | |
90 | #Requires: %{name}-libs = %{version}-%{release} | |
91 | ||
92 | %description devel | |
93 | Header files for dahdi interface. | |
94 | ||
b448351d | 95 | %package udev |
96 | Summary: udev rules for DAHDI kernel modules | |
97 | Summary(pl.UTF-8): Reguły udev dla modułów jądra Linuksa dla DAHDI | |
98 | Release: %{rel} | |
99 | Group: Base/Kernel | |
6e3c0f33 | 100 | Requires: dahdi-tools >= 2.2.0 |
b448351d | 101 | Requires: udev-core |
102 | ||
103 | %description udev | |
104 | udev rules for DAHDI kernel modules. | |
105 | ||
106 | %description udev -l pl.UTF-8 | |
107 | Reguły udev dla modułów jądra Linuksa dla DAHDI. | |
108 | ||
563fc4ec | 109 | %package -n kernel%{_alt_kernel}-%{pname} |
110 | Summary: DAHDI Linux kernel driver | |
111 | Summary(pl.UTF-8): Sterownik DAHDI dla jądra Linuksa | |
112 | Release: %{rel}@%{_kernel_ver_str} | |
113 | Group: Base/Kernel | |
114 | Requires(post,postun): /sbin/depmod | |
115 | %if %{with dist_kernel} | |
116 | %requires_releq_kernel | |
117 | Requires(postun): %releq_kernel | |
118 | %{?with_oslec:Requires: kernel-misc-oslec = 20070608-0.1@%{_kernel_ver_str}} | |
119 | %endif | |
120 | ||
121 | %description -n kernel%{_alt_kernel}-%{pname} | |
122 | DAHDI telephony Linux kernel driver. | |
123 | ||
124 | %description -n kernel%{_alt_kernel}-%{pname} -l pl.UTF-8 | |
125 | Sterownik dla jądra Linuksa do urządzeń telefonicznych DAHDI. | |
126 | ||
127 | %prep | |
128 | %setup -q -n %{pname}-%{version} | |
c278c563 | 129 | %patch0 -p1 |
563fc4ec | 130 | |
131 | for a in %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6}; do | |
132 | ln -s $a drivers/dahdi/firmware | |
133 | tar -C drivers/dahdi/firmware -xzf $a | |
134 | done | |
135 | ||
136 | cat > download-logger <<'EOF' | |
137 | #!/bin/sh | |
138 | # keep log of files make wanted to download in firmware/ dir | |
139 | echo "$@" >> download.log | |
140 | EOF | |
141 | chmod a+rx download-logger | |
142 | ||
143 | %build | |
144 | %{__make} include/dahdi/version.h | |
145 | ||
f877d867 | 146 | %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 |
563fc4ec | 147 | |
148 | check_modules() { | |
149 | err=0 | |
150 | for a in drivers/dahdi/{*/,}*.ko; do | |
151 | [[ $a = *-dist.ko ]] && continue | |
152 | [[ $a = *-up.ko ]] && continue | |
153 | [[ $a = *-smp.ko ]] && continue | |
154 | echo >&2 "unpackaged module: ${a%.ko}" | |
155 | err=1 | |
156 | done | |
157 | ||
158 | [ $err = 0 ] || exit 1 | |
159 | } | |
160 | check_modules | |
161 | ||
162 | %install | |
163 | rm -rf $RPM_BUILD_ROOT | |
164 | mkdir $RPM_BUILD_ROOT%{_includedir}/dahdi -p | |
165 | cd drivers/dahdi | |
166 | %install_kernel_modules -m %{modules_in} -d misc | |
167 | cd ../.. | |
168 | ||
56c839b0 | 169 | %if %{with userspace} |
b448351d | 170 | install -d $RPM_BUILD_ROOT/etc/udev/rules.d |
171 | ||
172 | %{make} \ | |
173 | DESTDIR=$RPM_BUILD_ROOT \ | |
174 | install-devices \ | |
175 | install-include | |
56c839b0 | 176 | %endif |
563fc4ec | 177 | |
178 | %clean | |
179 | rm -rf $RPM_BUILD_ROOT | |
180 | ||
181 | %post -n kernel%{_alt_kernel}-%{pname} | |
182 | %depmod %{_kernel_ver} | |
183 | ||
184 | %postun -n kernel%{_alt_kernel}-%{pname} | |
185 | %depmod %{_kernel_ver} | |
186 | ||
56c839b0 | 187 | %if %{with userspace} |
563fc4ec | 188 | %files devel |
b603dc42 | 189 | %defattr(644,root,root,755) |
563fc4ec | 190 | %{_includedir}/dahdi |
191 | ||
b448351d | 192 | %files udev |
193 | %defattr(644,root,root,755) | |
194 | %config(noreplace) %verify(not md5 mtime size) /etc/udev/rules.d/dahdi.rules | |
195 | %config(noreplace) %verify(not md5 mtime size) /etc/udev/rules.d/xpp.rules | |
56c839b0 | 196 | %endif |
b448351d | 197 | |
563fc4ec | 198 | %files -n kernel%{_alt_kernel}-%{pname} |
199 | %defattr(644,root,root,755) | |
200 | /lib/modules/%{_kernel_ver}/misc/*.ko* |