]> git.pld-linux.org Git - packages/dahdi-linux.git/blame - dahdi-linux.spec
- too much replace?
[packages/dahdi-linux.git] / dahdi-linux.spec
CommitLineData
563fc4ec 1#
2# TODO:
f50e30c4 3# - IMPORTANT rename: http://www.asterisk.org/zaptel-to-dahdi
563fc4ec 4#
5# - kernel modules doesn't build
6# - should more header files be installed?
7# - Installed (but unpackaged) file(s) found:
8# /etc/hotplug/usb/xpp_fxloader
9# /etc/hotplug/usb/xpp_fxloader.usermap
10# /etc/udev/rules.d/xpp.rules
11#
12# Conditional build:
13%bcond_without dist_kernel # without distribution kernel
14%bcond_with oslec # with Open Source Line Echo Canceller
15%bcond_with bristuff # with bristuff support
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
26%define rel 11
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}
32Version: 2.1.0.3
33Release: %{rel}%{?with_bristuff:.bristuff}
34License: GPL
35Group: Base/Kernel
36Source0: http://downloads.digium.com/pub/telephony/dahdi-linux/dahdi-linux-2.1.0.3.tar.gz
37# Source0-md5: 4e2a294073a1375b8b3d33bbf4f607fe
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
46URL: http://www.asterisk.org/
47%if %{with kernel} && %{with dist_kernel}
48BuildRequires: kernel%{_alt_kernel}-module-build
49BuildRequires: module-init-tools
50%endif
51BuildRequires: newt-devel
52BuildRequires: perl-base
53BuildRequires: perl-tools-pod
54BuildRequires: rpmbuild(macros) >= 1.379
55%{?with_bristuff:Provides: dahdi(bristuff)}
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
64%define modules_1 dahdi.o dahdi_dynamic_eth.o dahdi_dynamic_loc.o pciradio.o tor2.o wcfxo.o wct1xxp.o wctdm.o wcte11xp.o dahdi_dummy.o dahdi_dynamic.o dahdi_echocan_jpah.o dahdi_echocan_kb1.o dahdi_echocan_mg2.o dahdi_echocan_sec.o dahdi_echocan_sec2.o
65%define modules_1_in dahdi,dahdi_dynamic_eth,dahdi_dynamic_loc,pciradio,tor2,wcfxo,wct1xxp,wctdm,wcte11xp,dahdi_dummy,dahdi_dynamic,dahdi_echocan_jpah,dahdi_echocan_kb1,dahdi_echocan_mg2,dahdi_echocan_sec,dahdi_echocan_sec2
66%define modules_2 wct4xxp/ wcte12xp/ %{?with_xpp:xpp/}
67%define modules_2_in wct4xxp/wct4xxp,wcte12xp/wcte12xp%{?with_xpp:,xpp/{%{?with_bristuff:xpd_bri,}xpd_fxo,xpd_fxs,xpd_pri,xpp,xpp_usb}}
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
73%if %{with bristuff}
74%define modules_bristuff cwain/ qozap/ vzaphfc/ zaphfc/ ztgsm/ opvxa1200.o wcopenpci.o
75%define modules_bristuff_in cwain/cwain,qozap/qozap,vzaphfc/vzaphfc,zaphfc/zaphfc,ztgsm/ztgsm,opvxa1200,wcopenpci
76%endif
77%define modules %{modules_1} %{modules_2}%{?modules_nalpha: %{modules_nalpha}}%{?modules_bristuff: %{modules_bristuff}}
78%define modules_in %{modules_1_in},%{modules_2_in}%{?modules_nalpha:,%{modules_nalpha_in}}%{?modules_bristuff:,%{modules_bristuff_in}}
79
80%description
81DAHDI telephony device driver.
82
83%description -l pl.UTF-8
84Sterownik do urządzeń telefonicznych DAHDI.
85
86%package devel
87Summary: Header files for dahdi interface
88Group: Development/Libraries
89# if base package contains shared library for which these headers are
90#Requires: %{name} = %{version}-%{release}
91# if -libs package contains shared library for which these headers are
92#Requires: %{name}-libs = %{version}-%{release}
93
94%description devel
95Header files for dahdi interface.
96
97%package -n kernel%{_alt_kernel}-%{pname}
98Summary: DAHDI Linux kernel driver
99Summary(pl.UTF-8): Sterownik DAHDI dla jądra Linuksa
100Release: %{rel}@%{_kernel_ver_str}
101Group: Base/Kernel
102Requires(post,postun): /sbin/depmod
103%if %{with dist_kernel}
104%requires_releq_kernel
105Requires(postun): %releq_kernel
106%{?with_oslec:Requires: kernel-misc-oslec = 20070608-0.1@%{_kernel_ver_str}}
107%endif
108
109%description -n kernel%{_alt_kernel}-%{pname}
110DAHDI telephony Linux kernel driver.
111
112%description -n kernel%{_alt_kernel}-%{pname} -l pl.UTF-8
113Sterownik dla jądra Linuksa do urządzeń telefonicznych DAHDI.
114
115%prep
116%setup -q -n %{pname}-%{version}
117
118for a in %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6}; do
119 ln -s $a drivers/dahdi/firmware
120 tar -C drivers/dahdi/firmware -xzf $a
121done
122
123cat > download-logger <<'EOF'
124#!/bin/sh
125# keep log of files make wanted to download in firmware/ dir
126echo "$@" >> download.log
127EOF
128chmod a+rx download-logger
129
130%build
131%{__make} include/dahdi/version.h
132
133%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
134
135check_modules() {
136 err=0
137 for a in drivers/dahdi/{*/,}*.ko; do
138 [[ $a = *-dist.ko ]] && continue
139 [[ $a = *-up.ko ]] && continue
140 [[ $a = *-smp.ko ]] && continue
141 echo >&2 "unpackaged module: ${a%.ko}"
142 err=1
143 done
144
145 [ $err = 0 ] || exit 1
146}
147check_modules
148
149%install
150rm -rf $RPM_BUILD_ROOT
151mkdir $RPM_BUILD_ROOT%{_includedir}/dahdi -p
152cd drivers/dahdi
153%install_kernel_modules -m %{modules_in} -d misc
154cd ../..
155
156install include/dahdi/*.h $RPM_BUILD_ROOT%{_includedir}/dahdi/
157
158%clean
159rm -rf $RPM_BUILD_ROOT
160
161%post -n kernel%{_alt_kernel}-%{pname}
162%depmod %{_kernel_ver}
163
164%postun -n kernel%{_alt_kernel}-%{pname}
165%depmod %{_kernel_ver}
166
167%files devel
168%{_includedir}/dahdi
169
170%files -n kernel%{_alt_kernel}-%{pname}
171%defattr(644,root,root,755)
172/lib/modules/%{_kernel_ver}/misc/*.ko*
This page took 0.041445 seconds and 4 git commands to generate.