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