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