]> git.pld-linux.org Git - packages/dahdi-linux.git/blame - dahdi-linux.spec
- udev rules require /usr/share/dahdi/xpp_fxloader, R: dahdi-tools
[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
15%bcond_with oslec # with Open Source Line Echo Canceller
563fc4ec 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
b448351d 26%define rel 2
563fc4ec 27%define pname dahdi-linux
28%define FIRMWARE_URL http://downloads.digium.com/pub/telephony/firmware/releases
29Summary: DAHDI telephony device support
30Summary(pl.UTF-8): Obsługa urządzeń telefonicznych DAHDI
31Name: %{pname}%{_alt_kernel}
39ecdd6c 32Version: 2.2.0.2
b800683f 33Release: %{rel}
563fc4ec 34License: GPL
35Group: Base/Kernel
b603dc42 36Source0: http://downloads.digium.com/pub/telephony/dahdi-linux/dahdi-linux-%{version}.tar.gz
39ecdd6c 37# Source0-md5: 1f932729ad28f2f028afcf2cc5ccf7ba
563fc4ec 38Source3: %{FIRMWARE_URL}/dahdi-fw-oct6114-064-1.05.01.tar.gz
39# Source3-md5: 88db9b7a07d8392736171b1b3e6bcc66
40Source4: %{FIRMWARE_URL}/dahdi-fw-oct6114-128-1.05.01.tar.gz
41# Source4-md5: c1f1a18d3e20d283f42c71e580a64b5a
42Source5: %{FIRMWARE_URL}/dahdi-fw-vpmadt032-1.07.tar.gz
43# Source5-md5: e1c7231d6225ac999cb18f4e858f66b6
44Source6: %{FIRMWARE_URL}/dahdi-fw-tc400m-MR6.12.tar.gz
45# Source6-md5: 2ea860bb8a9d8ede2858b9557b74ee3c
c278c563 46Patch0: %{pname}-svn-fixes.patch
563fc4ec 47URL: http://www.asterisk.org/
48%if %{with kernel} && %{with dist_kernel}
49BuildRequires: kernel%{_alt_kernel}-module-build
50BuildRequires: module-init-tools
51%endif
52BuildRequires: newt-devel
53BuildRequires: perl-base
54BuildRequires: perl-tools-pod
55BuildRequires: rpmbuild(macros) >= 1.379
563fc4ec 56BuildRoot: %{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/}
b800683f 67%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 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
b800683f 73%define modules %{modules_1} %{modules_2}%{?modules_nalpha: %{modules_nalpha}}
74%define modules_in %{modules_1_in},%{modules_2_in}%{?modules_nalpha:,%{modules_nalpha_in}}
563fc4ec 75
76%description
77DAHDI telephony device driver.
78
79%description -l pl.UTF-8
80Sterownik do urządzeń telefonicznych DAHDI.
81
82%package devel
83Summary: Header files for dahdi interface
84Group: Development/Libraries
85# if base package contains shared library for which these headers are
86#Requires: %{name} = %{version}-%{release}
87# if -libs package contains shared library for which these headers are
88#Requires: %{name}-libs = %{version}-%{release}
89
90%description devel
91Header files for dahdi interface.
92
b448351d 93%package udev
94Summary: udev rules for DAHDI kernel modules
95Summary(pl.UTF-8): Reguły udev dla modułów jądra Linuksa dla DAHDI
96Release: %{rel}
97Group: Base/Kernel
6e3c0f33 98Requires: dahdi-tools >= 2.2.0
b448351d 99Requires: udev-core
100
101%description udev
102udev rules for DAHDI kernel modules.
103
104%description udev -l pl.UTF-8
105Reguły udev dla modułów jądra Linuksa dla DAHDI.
106
563fc4ec 107%package -n kernel%{_alt_kernel}-%{pname}
108Summary: DAHDI Linux kernel driver
109Summary(pl.UTF-8): Sterownik DAHDI dla jądra Linuksa
110Release: %{rel}@%{_kernel_ver_str}
111Group: Base/Kernel
112Requires(post,postun): /sbin/depmod
113%if %{with dist_kernel}
114%requires_releq_kernel
115Requires(postun): %releq_kernel
116%{?with_oslec:Requires: kernel-misc-oslec = 20070608-0.1@%{_kernel_ver_str}}
117%endif
118
119%description -n kernel%{_alt_kernel}-%{pname}
120DAHDI telephony Linux kernel driver.
121
122%description -n kernel%{_alt_kernel}-%{pname} -l pl.UTF-8
123Sterownik dla jądra Linuksa do urządzeń telefonicznych DAHDI.
124
125%prep
126%setup -q -n %{pname}-%{version}
c278c563 127%patch0 -p1
563fc4ec 128
129for a in %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6}; do
130 ln -s $a drivers/dahdi/firmware
131 tar -C drivers/dahdi/firmware -xzf $a
132done
133
134cat > download-logger <<'EOF'
135#!/bin/sh
136# keep log of files make wanted to download in firmware/ dir
137echo "$@" >> download.log
138EOF
139chmod a+rx download-logger
140
141%build
142%{__make} include/dahdi/version.h
143
144%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
145
146check_modules() {
147 err=0
148 for a in drivers/dahdi/{*/,}*.ko; do
149 [[ $a = *-dist.ko ]] && continue
150 [[ $a = *-up.ko ]] && continue
151 [[ $a = *-smp.ko ]] && continue
152 echo >&2 "unpackaged module: ${a%.ko}"
153 err=1
154 done
155
156 [ $err = 0 ] || exit 1
157}
158check_modules
159
160%install
161rm -rf $RPM_BUILD_ROOT
162mkdir $RPM_BUILD_ROOT%{_includedir}/dahdi -p
163cd drivers/dahdi
164%install_kernel_modules -m %{modules_in} -d misc
165cd ../..
166
b448351d 167install -d $RPM_BUILD_ROOT/etc/udev/rules.d
168
169%{make} \
170 DESTDIR=$RPM_BUILD_ROOT \
171 install-devices \
172 install-include
563fc4ec 173
174%clean
175rm -rf $RPM_BUILD_ROOT
176
177%post -n kernel%{_alt_kernel}-%{pname}
178%depmod %{_kernel_ver}
179
180%postun -n kernel%{_alt_kernel}-%{pname}
181%depmod %{_kernel_ver}
182
183%files devel
b603dc42 184%defattr(644,root,root,755)
563fc4ec 185%{_includedir}/dahdi
186
b448351d 187%files udev
188%defattr(644,root,root,755)
189%config(noreplace) %verify(not md5 mtime size) /etc/udev/rules.d/dahdi.rules
190%config(noreplace) %verify(not md5 mtime size) /etc/udev/rules.d/xpp.rules
191
563fc4ec 192%files -n kernel%{_alt_kernel}-%{pname}
193%defattr(644,root,root,755)
194/lib/modules/%{_kernel_ver}/misc/*.ko*
This page took 0.057556 seconds and 4 git commands to generate.