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