]> git.pld-linux.org Git - packages/dahdi-linux.git/blob - dahdi-linux.spec
923c5a3ff370e7478045bb6c8eaa4997c40fd6b9
[packages/dahdi-linux.git] / dahdi-linux.spec
1 #
2 # TODO:
3 # - IMPORTANT rename: http://www.asterisk.org/zaptel-to-dahdi
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
12 #
13 # Conditional build:
14 %bcond_without  dist_kernel     # without distribution kernel
15 %bcond_without  kernel          # don't build kernel modules
16 %bcond_with     oslec           # with Open Source Line Echo Canceller
17 %bcond_without  xpp             # without Astribank
18 %bcond_without  userspace       # don't build userspace packages
19 %bcond_with     verbose
20
21 %if "%{_alt_kernel}" != "%{nil}"
22 %undefine       with_userspace
23 %endif
24
25 %ifarch sparc
26 %undefine       with_smp
27 %endif
28 %ifarch alpha
29 %undefine       with_xpp
30 %endif
31 %if %{without kernel}
32 %undefine       with_dist_kernel
33 %endif
34
35 %define         rel     4
36 %define         pname   dahdi-linux
37 %define         FIRMWARE_URL http://downloads.digium.com/pub/telephony/firmware/releases
38 Summary:        DAHDI telephony device support
39 Summary(pl.UTF-8):      Obsługa urządzeń telefonicznych DAHDI
40 Name:           %{pname}%{_alt_kernel}
41 Version:        2.7.0
42 Release:        %{rel}
43 License:        GPL v2
44 Group:          Base/Kernel
45 Source0:        http://downloads.asterisk.org/pub/telephony/dahdi-linux/releases/dahdi-linux-%{version}.tar.gz
46 # Source0-md5:  ac0d7ed711130e8038b304c5e2f96334
47 Source3:        %{FIRMWARE_URL}/dahdi-fw-oct6114-064-1.05.01.tar.gz
48 # Source3-md5:  88db9b7a07d8392736171b1b3e6bcc66
49 Source4:        %{FIRMWARE_URL}/dahdi-fw-oct6114-128-1.05.01.tar.gz
50 # Source4-md5:  c1f1a18d3e20d283f42c71e580a64b5a
51 Source5:        %{FIRMWARE_URL}/dahdi-fw-vpmadt032-1.07.tar.gz
52 # Source5-md5:  e1c7231d6225ac999cb18f4e858f66b6
53 Source6:        %{FIRMWARE_URL}/dahdi-fw-tc400m-MR6.12.tar.gz
54 # Source6-md5:  2ea860bb8a9d8ede2858b9557b74ee3c
55 Source7:        %{FIRMWARE_URL}/dahdi-fw-hx8-2.06.tar.gz
56 # Source7-md5:  a7f3886942bb3e9fed349a41b3390c9f
57 Patch0:         %{pname}-build.patch
58 # http://oss.axsentis.de/people/stkn/openzap/dahdi-2.4.0-linux-2.6.37.patch
59 URL:            http://www.asterisk.org/
60 %if %{with dist_kernel}
61 BuildRequires:  kernel%{_alt_kernel}-module-build
62 %endif
63 BuildRequires:  perl-base
64 BuildRequires:  rpmbuild(macros) >= 1.379
65 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
66
67 # Rules:
68 # - modules_X: single modules, just name module with no suffix
69 # - modules_X: subdir modules are just directory name with slash like dirname/
70 # - keep X and X_in in sync
71 # - X is used for actual building (entries separated with space), X_in for pld macros (entries separated with comma)
72
73 %define modules_1       dahdi.o dahdi_dynamic.o dahdi_dynamic_eth.o dahdi_dynamic_ethmf.o dahdi_dynamic_loc.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
74 %define modules_1_in    dahdi,dahdi_dynamic,dahdi_dynamic_eth,dahdi_dynamic_ethmf,dahdi_dynamic_loc,dahdi_echocan_jpah,dahdi_echocan_kb1,dahdi_echocan_mg2,dahdi_echocan_sec,dahdi_echocan_sec2,pciradio,tor2,wcfxo,wct1xxp,wctdm,wcte11xp
75 %define modules_2       voicebus/ wct4xxp/ wcte12xp/ %{?with_xpp:xpp/}
76 %define modules_2_in    voicebus/dahdi_voicebus,wct4xxp/wct4xxp,wcte12xp/wcte12xp,%{?with_xpp:xpp/xpd_bri,xpp/xpd_echo,xpp/xpd_fxo,xpp/xpd_fxs,xpp/xpd_pri,xpp/xpp,xpp/xpp_usb}
77 %ifnarch alpha
78 %define modules_nalpha  wctc4xxp/ wctdm24xxp/ dahdi_transcode.o wcb4xxp/
79 %define modules_nalpha_in       wctc4xxp/wctc4xxp,wctdm24xxp/wctdm24xxp,dahdi_transcode,wcb4xxp/wcb4xxp
80 %endif
81 %define modules         %{modules_1} %{modules_2}%{?modules_nalpha: %{modules_nalpha}}
82 %define modules_in      %{modules_1_in},%{modules_2_in}%{?modules_nalpha:,%{modules_nalpha_in}}
83
84 %description
85 DAHDI telephony device driver.
86
87 %description -l pl.UTF-8
88 Sterownik do urządzeń telefonicznych DAHDI.
89
90 %package devel
91 Summary:        Header files for dahdi interface
92 Summary(pl.UTF-8):      Pliki nagłówkowe interfejsu dahdi
93 Group:          Development/Libraries
94
95 %description devel
96 Header files for dahdi interface.
97
98 %description devel -l pl.UTF-8
99 Pliki nagłówkowe interfejsu dahdi.
100
101 %package udev
102 Summary:        udev rules for DAHDI kernel modules
103 Summary(pl.UTF-8):      Reguły udev dla modułów jądra Linuksa dla DAHDI
104 Release:        %{rel}
105 Group:          Base/Kernel
106 Requires:       dahdi-tools >= 2.2.0
107 Requires:       udev-core
108
109 %description udev
110 udev rules for DAHDI kernel modules.
111
112 %description udev -l pl.UTF-8
113 Reguły udev dla modułów jądra Linuksa dla DAHDI.
114
115 %package -n kernel%{_alt_kernel}-%{pname}
116 Summary:        DAHDI Linux kernel driver
117 Summary(pl.UTF-8):      Sterownik DAHDI dla jądra Linuksa
118 Release:        %{rel}@%{_kernel_ver_str}
119 Group:          Base/Kernel
120 Requires(post,postun):  /sbin/depmod
121 %if %{with dist_kernel}
122 %requires_releq_kernel
123 Requires(postun):       %releq_kernel
124 %{?with_oslec:Requires: kernel-misc-oslec = 20070608-0.1@%{_kernel_ver_str}}
125 %endif
126
127 %description -n kernel%{_alt_kernel}-%{pname}
128 DAHDI telephony Linux kernel driver.
129
130 %description -n kernel%{_alt_kernel}-%{pname} -l pl.UTF-8
131 Sterownik dla jądra Linuksa do urządzeń telefonicznych DAHDI.
132
133 %prep
134 %setup -q -n %{pname}-%{version}
135 %patch0 -p1
136
137 for a in %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} %{SOURCE7}; do
138         ln -s $a drivers/dahdi/firmware
139         tar -C drivers/dahdi/firmware -xzf $a
140 done
141
142 cat > download-logger <<'EOF'
143 #!/bin/sh
144 # keep log of files make wanted to download in firmware/ dir
145 echo "$@" >> download.log
146 EOF
147 chmod a+rx download-logger
148
149 %build
150 %{__make} include/dahdi/version.h
151
152 %if %{with kernel}
153 # hack: build library first (using explicit "lib" target), then modules without cleaning (-c)
154 %build_kernel_modules lib SUBDIRS=$PWD/drivers/dahdi DAHDI_BUILD_ALL=m HOTPLUG_FIRMWARE=yes DAHDI_MODULES_EXTRA=" " -m %{modules_in} KSRC=$PWD/o -C drivers/dahdi/oct612x DAHDI_INCLUDE=$PWD/../../include
155
156 %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 -c
157 %endif
158
159 %install
160 rm -rf $RPM_BUILD_ROOT
161 mkdir $RPM_BUILD_ROOT%{_includedir}/dahdi -p
162 %if %{with kernel}
163 cd drivers/dahdi
164 %install_kernel_modules -m %{modules_in} -d misc
165 cd ../..
166 %endif
167
168 %if %{with userspace}
169 install -d $RPM_BUILD_ROOT/etc/udev/rules.d
170
171 %{__make} install-devices install-include \
172         DESTDIR=$RPM_BUILD_ROOT
173 %endif
174
175 %clean
176 rm -rf $RPM_BUILD_ROOT
177
178 %post -n kernel%{_alt_kernel}-%{pname}
179 %depmod %{_kernel_ver}
180
181 %postun -n kernel%{_alt_kernel}-%{pname}
182 %depmod %{_kernel_ver}
183
184 %if %{with userspace}
185 %files devel
186 %defattr(644,root,root,755)
187 %{_includedir}/dahdi
188
189 %files udev
190 %defattr(644,root,root,755)
191 %config(noreplace) %verify(not md5 mtime size) /etc/udev/rules.d/dahdi.rules
192 %config(noreplace) %verify(not md5 mtime size) /etc/udev/rules.d/xpp.rules
193 %endif
194
195 %if %{with kernel}
196 %files -n kernel%{_alt_kernel}-%{pname}
197 %defattr(644,root,root,755)
198 /lib/modules/%{_kernel_ver}/misc/dahdi*.ko*
199 /lib/modules/%{_kernel_ver}/misc/pciradio.ko*
200 /lib/modules/%{_kernel_ver}/misc/tor2.ko*
201 /lib/modules/%{_kernel_ver}/misc/wcb4xxp.ko*
202 /lib/modules/%{_kernel_ver}/misc/wcfxo.ko*
203 /lib/modules/%{_kernel_ver}/misc/wct1xxp.ko*
204 /lib/modules/%{_kernel_ver}/misc/wct4xxp.ko*
205 /lib/modules/%{_kernel_ver}/misc/wctc4xxp.ko*
206 /lib/modules/%{_kernel_ver}/misc/wctdm.ko*
207 /lib/modules/%{_kernel_ver}/misc/wctdm24xxp.ko*
208 /lib/modules/%{_kernel_ver}/misc/wcte11xp.ko*
209 /lib/modules/%{_kernel_ver}/misc/wcte12xp.ko*
210 %if %{with xpp}
211 /lib/modules/%{_kernel_ver}/misc/xpd_*.ko*
212 /lib/modules/%{_kernel_ver}/misc/xpp.ko*
213 /lib/modules/%{_kernel_ver}/misc/xpp_usb.ko*
214 %endif
215 %endif
This page took 0.091467 seconds and 2 git commands to generate.