]>
Commit | Line | Data |
---|---|---|
563fc4ec | 1 | # |
2 | # TODO: | |
f50e30c4 | 3 | # - IMPORTANT rename: http://www.asterisk.org/zaptel-to-dahdi |
563fc4ec | 4 | # |
563fc4ec | 5 | # Conditional build: |
6 | %bcond_without dist_kernel # without distribution kernel | |
7 | %bcond_with oslec # with Open Source Line Echo Canceller | |
563fc4ec | 8 | %bcond_without xpp # without Astribank |
9 | %bcond_with verbose | |
10 | ||
11 | %ifarch sparc | |
12 | %undefine with_smp | |
13 | %endif | |
14 | %ifarch alpha | |
15 | %undefine with_xpp | |
16 | %endif | |
17 | ||
8a1cfcba | 18 | %define rel 4 |
563fc4ec | 19 | %define pname dahdi-linux |
20 | %define FIRMWARE_URL http://downloads.digium.com/pub/telephony/firmware/releases | |
21 | Summary: DAHDI telephony device support | |
22 | Summary(pl.UTF-8): Obsługa urządzeń telefonicznych DAHDI | |
23 | Name: %{pname}%{_alt_kernel} | |
0aa6d864 | 24 | Version: 2.2.0.1 |
b800683f | 25 | Release: %{rel} |
563fc4ec | 26 | License: GPL |
27 | Group: Base/Kernel | |
b603dc42 | 28 | Source0: http://downloads.digium.com/pub/telephony/dahdi-linux/dahdi-linux-%{version}.tar.gz |
0aa6d864 | 29 | # Source0-md5: 824919c1ee040a3c1999b4f70dd17c4a |
563fc4ec | 30 | Source3: %{FIRMWARE_URL}/dahdi-fw-oct6114-064-1.05.01.tar.gz |
31 | # Source3-md5: 88db9b7a07d8392736171b1b3e6bcc66 | |
32 | Source4: %{FIRMWARE_URL}/dahdi-fw-oct6114-128-1.05.01.tar.gz | |
33 | # Source4-md5: c1f1a18d3e20d283f42c71e580a64b5a | |
34 | Source5: %{FIRMWARE_URL}/dahdi-fw-vpmadt032-1.07.tar.gz | |
35 | # Source5-md5: e1c7231d6225ac999cb18f4e858f66b6 | |
36 | Source6: %{FIRMWARE_URL}/dahdi-fw-tc400m-MR6.12.tar.gz | |
37 | # Source6-md5: 2ea860bb8a9d8ede2858b9557b74ee3c | |
38 | URL: http://www.asterisk.org/ | |
39 | %if %{with kernel} && %{with dist_kernel} | |
40 | BuildRequires: kernel%{_alt_kernel}-module-build | |
41 | BuildRequires: module-init-tools | |
42 | %endif | |
43 | BuildRequires: newt-devel | |
44 | BuildRequires: perl-base | |
45 | BuildRequires: perl-tools-pod | |
46 | BuildRequires: rpmbuild(macros) >= 1.379 | |
563fc4ec | 47 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
48 | ||
49 | # Rules: | |
50 | # - modules_X: single modules, just name module with no suffix | |
51 | # - modules_X: subdir modules are just directory name with slash like dirname/ | |
52 | # - keep X and X_in in sync | |
53 | # - X is used for actual building (entries separated with space), X_in for pld macros (entries separated with comma) | |
54 | ||
21a65756 | 55 | %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 |
56 | %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 | |
57 | %define modules_2 voicebuss wct4xxp/ wcte12xp/ %{?with_xpp:xpp/} | |
b800683f | 58 | %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 | 59 | %ifnarch alpha |
60 | %define modules_nalpha wctc4xxp/ wctdm24xxp/ dahdi_transcode.o wcb4xxp/ | |
61 | %define modules_nalpha_in wctc4xxp/wctc4xxp,wctdm24xxp/wctdm24xxp,dahdi_transcode,wcb4xxp/wcb4xxp | |
62 | ||
63 | %endif | |
b800683f | 64 | %define modules %{modules_1} %{modules_2}%{?modules_nalpha: %{modules_nalpha}} |
65 | %define modules_in %{modules_1_in},%{modules_2_in}%{?modules_nalpha:,%{modules_nalpha_in}} | |
563fc4ec | 66 | |
67 | %description | |
68 | DAHDI telephony device driver. | |
69 | ||
70 | %description -l pl.UTF-8 | |
71 | Sterownik do urządzeń telefonicznych DAHDI. | |
72 | ||
73 | %package devel | |
74 | Summary: Header files for dahdi interface | |
75 | Group: Development/Libraries | |
76 | # if base package contains shared library for which these headers are | |
77 | #Requires: %{name} = %{version}-%{release} | |
78 | # if -libs package contains shared library for which these headers are | |
79 | #Requires: %{name}-libs = %{version}-%{release} | |
80 | ||
81 | %description devel | |
82 | Header files for dahdi interface. | |
83 | ||
84 | %package -n kernel%{_alt_kernel}-%{pname} | |
85 | Summary: DAHDI Linux kernel driver | |
86 | Summary(pl.UTF-8): Sterownik DAHDI dla jądra Linuksa | |
87 | Release: %{rel}@%{_kernel_ver_str} | |
88 | Group: Base/Kernel | |
89 | Requires(post,postun): /sbin/depmod | |
90 | %if %{with dist_kernel} | |
91 | %requires_releq_kernel | |
92 | Requires(postun): %releq_kernel | |
93 | %{?with_oslec:Requires: kernel-misc-oslec = 20070608-0.1@%{_kernel_ver_str}} | |
94 | %endif | |
95 | ||
96 | %description -n kernel%{_alt_kernel}-%{pname} | |
97 | DAHDI telephony Linux kernel driver. | |
98 | ||
99 | %description -n kernel%{_alt_kernel}-%{pname} -l pl.UTF-8 | |
100 | Sterownik dla jądra Linuksa do urządzeń telefonicznych DAHDI. | |
101 | ||
102 | %prep | |
103 | %setup -q -n %{pname}-%{version} | |
104 | ||
105 | for a in %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6}; do | |
106 | ln -s $a drivers/dahdi/firmware | |
107 | tar -C drivers/dahdi/firmware -xzf $a | |
108 | done | |
109 | ||
110 | cat > download-logger <<'EOF' | |
111 | #!/bin/sh | |
112 | # keep log of files make wanted to download in firmware/ dir | |
113 | echo "$@" >> download.log | |
114 | EOF | |
115 | chmod a+rx download-logger | |
116 | ||
117 | %build | |
118 | %{__make} include/dahdi/version.h | |
119 | ||
120 | %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 | |
121 | ||
122 | check_modules() { | |
123 | err=0 | |
124 | for a in drivers/dahdi/{*/,}*.ko; do | |
125 | [[ $a = *-dist.ko ]] && continue | |
126 | [[ $a = *-up.ko ]] && continue | |
127 | [[ $a = *-smp.ko ]] && continue | |
128 | echo >&2 "unpackaged module: ${a%.ko}" | |
129 | err=1 | |
130 | done | |
131 | ||
132 | [ $err = 0 ] || exit 1 | |
133 | } | |
134 | check_modules | |
135 | ||
136 | %install | |
137 | rm -rf $RPM_BUILD_ROOT | |
138 | mkdir $RPM_BUILD_ROOT%{_includedir}/dahdi -p | |
139 | cd drivers/dahdi | |
140 | %install_kernel_modules -m %{modules_in} -d misc | |
141 | cd ../.. | |
142 | ||
143 | install include/dahdi/*.h $RPM_BUILD_ROOT%{_includedir}/dahdi/ | |
144 | ||
145 | %clean | |
146 | rm -rf $RPM_BUILD_ROOT | |
147 | ||
148 | %post -n kernel%{_alt_kernel}-%{pname} | |
149 | %depmod %{_kernel_ver} | |
150 | ||
151 | %postun -n kernel%{_alt_kernel}-%{pname} | |
152 | %depmod %{_kernel_ver} | |
153 | ||
154 | %files devel | |
b603dc42 | 155 | %defattr(644,root,root,755) |
563fc4ec | 156 | %{_includedir}/dahdi |
157 | ||
158 | %files -n kernel%{_alt_kernel}-%{pname} | |
159 | %defattr(644,root,root,755) | |
160 | /lib/modules/%{_kernel_ver}/misc/*.ko* |