]> git.pld-linux.org Git - packages/dahdi-linux.git/blame - dahdi-linux.spec
- rebuild for kernel.spec:auto/th/kernel-3.4.8-1 /home/users/baggins/devel/PLD/rpm...
[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
4c3e49b7 35%define rel 28
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}
8e2ce037 41Version: 2.6.0
b800683f 42Release: %{rel}
563fc4ec 43License: GPL
44Group: Base/Kernel
64471470 45Source0: http://downloads.asterisk.org/pub/telephony/dahdi-linux/releases/dahdi-linux-%{version}.tar.gz
8e2ce037 46# Source0-md5: ea35ad29dafe5490028ff642c35ef9a2
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
8be0f738 57Patch0: %{pname}-build.patch
e4bd3df2 58# http://oss.axsentis.de/people/stkn/openzap/dahdi-2.4.0-linux-2.6.37.patch
8be0f738 59Patch1: dahdi-2.4.0-linux-2.6.37.patch
ab31d4d8 60Patch2: dahdi-linux-kernel-3.4.patch
563fc4ec 61URL: http://www.asterisk.org/
f877d867 62%if %{with dist_kernel}
563fc4ec 63BuildRequires: kernel%{_alt_kernel}-module-build
563fc4ec 64%endif
563fc4ec 65BuildRequires: perl-base
563fc4ec 66BuildRequires: rpmbuild(macros) >= 1.379
563fc4ec 67BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
68
69# Rules:
70# - modules_X: single modules, just name module with no suffix
71# - modules_X: subdir modules are just directory name with slash like dirname/
72# - keep X and X_in in sync
73# - X is used for actual building (entries separated with space), X_in for pld macros (entries separated with comma)
74
8be0f738 75%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
76%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 77%define modules_2 voicebus/ wct4xxp/ wcte12xp/ %{?with_xpp:xpp/}
141723f4 78%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 79%ifnarch alpha
80%define modules_nalpha wctc4xxp/ wctdm24xxp/ dahdi_transcode.o wcb4xxp/
81%define modules_nalpha_in wctc4xxp/wctc4xxp,wctdm24xxp/wctdm24xxp,dahdi_transcode,wcb4xxp/wcb4xxp
563fc4ec 82%endif
b800683f 83%define modules %{modules_1} %{modules_2}%{?modules_nalpha: %{modules_nalpha}}
84%define modules_in %{modules_1_in},%{modules_2_in}%{?modules_nalpha:,%{modules_nalpha_in}}
563fc4ec 85
86%description
87DAHDI telephony device driver.
88
89%description -l pl.UTF-8
90Sterownik do urządzeń telefonicznych DAHDI.
91
92%package devel
93Summary: Header files for dahdi interface
94Group: Development/Libraries
95# if base package contains shared library for which these headers are
96#Requires: %{name} = %{version}-%{release}
97# if -libs package contains shared library for which these headers are
98#Requires: %{name}-libs = %{version}-%{release}
99
100%description devel
101Header files for dahdi interface.
102
b448351d 103%package udev
104Summary: udev rules for DAHDI kernel modules
105Summary(pl.UTF-8): Reguły udev dla modułów jądra Linuksa dla DAHDI
106Release: %{rel}
107Group: Base/Kernel
6e3c0f33 108Requires: dahdi-tools >= 2.2.0
b448351d 109Requires: udev-core
110
111%description udev
112udev rules for DAHDI kernel modules.
113
114%description udev -l pl.UTF-8
115Reguły udev dla modułów jądra Linuksa dla DAHDI.
116
563fc4ec 117%package -n kernel%{_alt_kernel}-%{pname}
118Summary: DAHDI Linux kernel driver
119Summary(pl.UTF-8): Sterownik DAHDI dla jądra Linuksa
120Release: %{rel}@%{_kernel_ver_str}
121Group: Base/Kernel
122Requires(post,postun): /sbin/depmod
123%if %{with dist_kernel}
124%requires_releq_kernel
125Requires(postun): %releq_kernel
126%{?with_oslec:Requires: kernel-misc-oslec = 20070608-0.1@%{_kernel_ver_str}}
127%endif
128
129%description -n kernel%{_alt_kernel}-%{pname}
130DAHDI telephony Linux kernel driver.
131
132%description -n kernel%{_alt_kernel}-%{pname} -l pl.UTF-8
133Sterownik dla jądra Linuksa do urządzeń telefonicznych DAHDI.
134
135%prep
136%setup -q -n %{pname}-%{version}
c278c563 137%patch0 -p1
8be0f738 138#%patch1 -p1
ab31d4d8 139%patch2 -p1
563fc4ec 140
d2a401d3 141for a in %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} %{SOURCE7}; do
563fc4ec 142 ln -s $a drivers/dahdi/firmware
143 tar -C drivers/dahdi/firmware -xzf $a
144done
145
146cat > download-logger <<'EOF'
147#!/bin/sh
148# keep log of files make wanted to download in firmware/ dir
149echo "$@" >> download.log
150EOF
151chmod a+rx download-logger
152
153%build
154%{__make} include/dahdi/version.h
155
f3ae6389 156%if %{with kernel}
f877d867 157%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 158
9f74732a
ER
159# check that all built .ko is handled by build_kernel_modules
160# (renamed to either -dist, -up, or -smp suffix)
161# if some missing, check the 'modules*' macros above
563fc4ec 162check_modules() {
163 err=0
164 for a in drivers/dahdi/{*/,}*.ko; do
165 [[ $a = *-dist.ko ]] && continue
166 [[ $a = *-up.ko ]] && continue
167 [[ $a = *-smp.ko ]] && continue
168 echo >&2 "unpackaged module: ${a%.ko}"
169 err=1
170 done
171
172 [ $err = 0 ] || exit 1
173}
60ab0550 174#check_modules
f3ae6389 175%endif
563fc4ec 176
177%install
178rm -rf $RPM_BUILD_ROOT
179mkdir $RPM_BUILD_ROOT%{_includedir}/dahdi -p
f3ae6389 180%if %{with kernel}
563fc4ec 181cd drivers/dahdi
182%install_kernel_modules -m %{modules_in} -d misc
183cd ../..
f3ae6389 184%endif
563fc4ec 185
56c839b0 186%if %{with userspace}
b448351d 187install -d $RPM_BUILD_ROOT/etc/udev/rules.d
188
189%{make} \
190 DESTDIR=$RPM_BUILD_ROOT \
191 install-devices \
192 install-include
56c839b0 193%endif
563fc4ec 194
195%clean
196rm -rf $RPM_BUILD_ROOT
197
198%post -n kernel%{_alt_kernel}-%{pname}
199%depmod %{_kernel_ver}
200
201%postun -n kernel%{_alt_kernel}-%{pname}
202%depmod %{_kernel_ver}
203
56c839b0 204%if %{with userspace}
563fc4ec 205%files devel
b603dc42 206%defattr(644,root,root,755)
563fc4ec 207%{_includedir}/dahdi
208
b448351d 209%files udev
210%defattr(644,root,root,755)
211%config(noreplace) %verify(not md5 mtime size) /etc/udev/rules.d/dahdi.rules
212%config(noreplace) %verify(not md5 mtime size) /etc/udev/rules.d/xpp.rules
56c839b0 213%endif
b448351d 214
f3ae6389 215%if %{with kernel}
563fc4ec 216%files -n kernel%{_alt_kernel}-%{pname}
217%defattr(644,root,root,755)
218/lib/modules/%{_kernel_ver}/misc/*.ko*
f3ae6389 219%endif
This page took 0.056163 seconds and 4 git commands to generate.