]>
Commit | Line | Data |
---|---|---|
563fc4ec | 1 | # |
2 | # TODO: | |
f50e30c4 | 3 | # - IMPORTANT rename: http://www.asterisk.org/zaptel-to-dahdi |
563fc4ec | 4 | # |
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 | |
11 | # | |
12 | # Conditional build: | |
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 | |
17 | %bcond_with verbose | |
18 | ||
19 | %ifarch sparc | |
20 | %undefine with_smp | |
21 | %endif | |
22 | %ifarch alpha | |
23 | %undefine with_xpp | |
24 | %endif | |
25 | ||
0aa6d864 | 26 | %define rel 0.1 |
563fc4ec | 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} | |
0aa6d864 | 32 | Version: 2.2.0.1 |
563fc4ec | 33 | Release: %{rel}%{?with_bristuff:.bristuff} |
34 | License: GPL | |
35 | Group: Base/Kernel | |
b603dc42 | 36 | Source0: http://downloads.digium.com/pub/telephony/dahdi-linux/dahdi-linux-%{version}.tar.gz |
0aa6d864 | 37 | # Source0-md5: 824919c1ee040a3c1999b4f70dd17c4a |
563fc4ec | 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 | |
50 | %endif | |
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) | |
57 | ||
58 | # Rules: | |
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) | |
63 | ||
21a65756 | 64 | %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 |
65 | %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 | |
66 | %define modules_2 voicebuss wct4xxp/ wcte12xp/ %{?with_xpp:xpp/} | |
67 | %define modules_2_in voicebus/dahdi_voicebus,wct4xxp/wct4xxp,wcte12xp/wcte12xp,%{?with_xpp:%{?with_bristuff:xpp/xpd_bri,}xpp/xpd_fxo,xpp/xpd_fxs,xpp/xpd_pri,xpp/xpp,xpp/xpp_usb} | |
563fc4ec | 68 | %ifnarch alpha |
69 | %define modules_nalpha wctc4xxp/ wctdm24xxp/ dahdi_transcode.o wcb4xxp/ | |
70 | %define modules_nalpha_in wctc4xxp/wctc4xxp,wctdm24xxp/wctdm24xxp,dahdi_transcode,wcb4xxp/wcb4xxp | |
71 | ||
72 | %endif | |
73 | %if %{with bristuff} | |
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 | |
76 | %endif | |
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}} | |
79 | ||
80 | %description | |
81 | DAHDI telephony device driver. | |
82 | ||
83 | %description -l pl.UTF-8 | |
84 | Sterownik do urządzeń telefonicznych DAHDI. | |
85 | ||
86 | %package devel | |
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} | |
93 | ||
94 | %description devel | |
95 | Header files for dahdi interface. | |
96 | ||
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} | |
101 | Group: Base/Kernel | |
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}} | |
107 | %endif | |
108 | ||
109 | %description -n kernel%{_alt_kernel}-%{pname} | |
110 | DAHDI telephony Linux kernel driver. | |
111 | ||
112 | %description -n kernel%{_alt_kernel}-%{pname} -l pl.UTF-8 | |
113 | Sterownik dla jądra Linuksa do urządzeń telefonicznych DAHDI. | |
114 | ||
115 | %prep | |
116 | %setup -q -n %{pname}-%{version} | |
117 | ||
118 | for a in %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6}; do | |
119 | ln -s $a drivers/dahdi/firmware | |
120 | tar -C drivers/dahdi/firmware -xzf $a | |
121 | done | |
122 | ||
123 | cat > download-logger <<'EOF' | |
124 | #!/bin/sh | |
125 | # keep log of files make wanted to download in firmware/ dir | |
126 | echo "$@" >> download.log | |
127 | EOF | |
128 | chmod a+rx download-logger | |
129 | ||
130 | %build | |
131 | %{__make} include/dahdi/version.h | |
132 | ||
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 | |
134 | ||
135 | check_modules() { | |
136 | err=0 | |
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}" | |
142 | err=1 | |
143 | done | |
144 | ||
145 | [ $err = 0 ] || exit 1 | |
146 | } | |
147 | check_modules | |
148 | ||
149 | %install | |
150 | rm -rf $RPM_BUILD_ROOT | |
151 | mkdir $RPM_BUILD_ROOT%{_includedir}/dahdi -p | |
152 | cd drivers/dahdi | |
153 | %install_kernel_modules -m %{modules_in} -d misc | |
154 | cd ../.. | |
155 | ||
156 | install include/dahdi/*.h $RPM_BUILD_ROOT%{_includedir}/dahdi/ | |
157 | ||
158 | %clean | |
159 | rm -rf $RPM_BUILD_ROOT | |
160 | ||
161 | %post -n kernel%{_alt_kernel}-%{pname} | |
162 | %depmod %{_kernel_ver} | |
163 | ||
164 | %postun -n kernel%{_alt_kernel}-%{pname} | |
165 | %depmod %{_kernel_ver} | |
166 | ||
167 | %files devel | |
b603dc42 | 168 | %defattr(644,root,root,755) |
563fc4ec | 169 | %{_includedir}/dahdi |
170 | ||
171 | %files -n kernel%{_alt_kernel}-%{pname} | |
172 | %defattr(644,root,root,755) | |
173 | /lib/modules/%{_kernel_ver}/misc/*.ko* |