]> git.pld-linux.org Git - packages/dahdi-linux.git/blame_incremental - dahdi-linux.spec
Release 2 (by relup.sh)
[packages/dahdi-linux.git] / dahdi-linux.spec
... / ...
CommitLineData
1#
2# TODO:
3# - IMPORTANT rename: http://www.asterisk.org/zaptel-to-dahdi
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
12#
13# Conditional build:
14%bcond_without kernel # don't build kernel modules
15%bcond_with oslec # with Open Source Line Echo Canceller
16%bcond_without xpp # without Astribank
17%bcond_without userspace # don't build userspace packages
18%bcond_with verbose
19
20%ifarch alpha
21%undefine with_xpp
22%endif
23
24# The goal here is to have main, userspace, package built once with
25# simple release number, and only rebuild kernel packages with kernel
26# version as part of release number, without the need to bump release
27# with every kernel change.
28%if 0%{?_pld_builder:1} && %{with kernel} && %{with userspace}
29%{error:kernel and userspace cannot be built at the same time on PLD builders}
30exit 1
31%endif
32
33%if %{without userspace}
34# nothing to be placed to debuginfo package
35%define _enable_debug_packages 0
36%endif
37
38%define rel 3
39%define pname dahdi-linux
40%define FIRMWARE_URL http://downloads.digium.com/pub/telephony/firmware/releases
41Summary: DAHDI telephony device support
42Summary(pl.UTF-8): Obsługa urządzeń telefonicznych DAHDI
43Name: %{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel}
44Version: 2.11.1
45Release: %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}}
46License: GPL v2
47Group: Base/Kernel
48Source0: http://downloads.asterisk.org/pub/telephony/dahdi-linux/releases/dahdi-linux-%{version}.tar.gz
49# Source0-md5: af96917e15eebc36519948133ec7e36b
50Source3: %{FIRMWARE_URL}/dahdi-fw-oct6114-064-1.05.01.tar.gz
51# Source3-md5: 88db9b7a07d8392736171b1b3e6bcc66
52Source4: %{FIRMWARE_URL}/dahdi-fw-oct6114-128-1.05.01.tar.gz
53# Source4-md5: c1f1a18d3e20d283f42c71e580a64b5a
54Source5: %{FIRMWARE_URL}/dahdi-fw-vpmadt032-1.07.tar.gz
55# Source5-md5: e1c7231d6225ac999cb18f4e858f66b6
56Source6: %{FIRMWARE_URL}/dahdi-fw-tc400m-MR6.12.tar.gz
57# Source6-md5: 2ea860bb8a9d8ede2858b9557b74ee3c
58Source7: %{FIRMWARE_URL}/dahdi-fw-hx8-2.06.tar.gz
59# Source7-md5: a7f3886942bb3e9fed349a41b3390c9f
60Patch0: kernel-4.11.patch
61Patch1: kernel-4.13.patch
62Patch2: 0001-xpp-move-command_timer-functions-to-xbus-core.patch
63Patch3: 0002-fix-building-with-4.15-init_timer-setup_timer.patch
64URL: http://www.asterisk.org/
65%{?with_kernel:%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}}
66BuildRequires: perl-base
67BuildRequires: rpmbuild(macros) >= 1.701
68BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
69
70# Rules:
71# - modules_X: single modules, just name module with no suffix
72# - modules_X: subdir modules are just directory name with slash like dirname/
73# - keep X and X_in in sync
74# - X is used for actual building (entries separated with space), X_in for pld macros (entries separated with comma)
75
76%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
77%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
78%define modules_2 voicebus/ wct4xxp/ wcte12xp/ %{?with_xpp:xpp/}
79%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}
80%ifnarch alpha
81%define modules_nalpha wctc4xxp/ wctdm24xxp/ dahdi_transcode.o wcb4xxp/
82%define modules_nalpha_in wctc4xxp/wctc4xxp,wctdm24xxp/wctdm24xxp,dahdi_transcode,wcb4xxp/wcb4xxp
83%endif
84%define modules %{modules_1} %{modules_2}%{?modules_nalpha: %{modules_nalpha}}
85%define modules_in %{modules_1_in},%{modules_2_in}%{?modules_nalpha:,%{modules_nalpha_in}}
86
87%description
88DAHDI telephony device driver.
89
90%description -l pl.UTF-8
91Sterownik do urządzeń telefonicznych DAHDI.
92
93%package devel
94Summary: Header files for dahdi interface
95Summary(pl.UTF-8): Pliki nagłówkowe interfejsu dahdi
96Group: Development/Libraries
97
98%description devel
99Header files for dahdi interface.
100
101%description devel -l pl.UTF-8
102Pliki nagłówkowe interfejsu dahdi.
103
104%define kernel_pkg()\
105%package -n kernel%{_alt_kernel}-%{pname}\
106Summary: DAHDI Linux kernel driver\
107Summary(pl.UTF-8): Sterownik DAHDI dla jądra Linuksa\
108Release: %{rel}@%{_kernel_ver_str}\
109Group: Base/Kernel\
110Requires(post,postun): /sbin/depmod\
111%requires_releq_kernel\
112Requires(postun): %releq_kernel\
113%{?with_oslec:Requires: kernel-misc-oslec = 20070608-0.1@%{_kernel_ver_str}}\
114\
115%description -n kernel%{_alt_kernel}-%{pname}\
116DAHDI telephony Linux kernel driver.\
117\
118%description -n kernel%{_alt_kernel}-%{pname} -l pl.UTF-8\
119Sterownik dla jądra Linuksa do urządzeń telefonicznych DAHDI.\
120\
121%if %{with kernel}\
122%files -n kernel%{_alt_kernel}-%{pname}\
123%defattr(644,root,root,755)\
124/lib/modules/%{_kernel_ver}/misc/dahdi*.ko*\
125/lib/modules/%{_kernel_ver}/misc/pciradio.ko*\
126/lib/modules/%{_kernel_ver}/misc/tor2.ko*\
127/lib/modules/%{_kernel_ver}/misc/wcb4xxp.ko*\
128/lib/modules/%{_kernel_ver}/misc/wcfxo.ko*\
129/lib/modules/%{_kernel_ver}/misc/wct1xxp.ko*\
130/lib/modules/%{_kernel_ver}/misc/wct4xxp.ko*\
131/lib/modules/%{_kernel_ver}/misc/wctc4xxp.ko*\
132/lib/modules/%{_kernel_ver}/misc/wctdm.ko*\
133/lib/modules/%{_kernel_ver}/misc/wctdm24xxp.ko*\
134/lib/modules/%{_kernel_ver}/misc/wcte11xp.ko*\
135/lib/modules/%{_kernel_ver}/misc/wcte12xp.ko*\
136%if %{with xpp}\
137/lib/modules/%{_kernel_ver}/misc/xpd_*.ko*\
138/lib/modules/%{_kernel_ver}/misc/xpp.ko*\
139/lib/modules/%{_kernel_ver}/misc/xpp_usb.ko*\
140%endif\
141%endif\
142\
143%post -n kernel%{_alt_kernel}-%{pname}\
144%depmod %{_kernel_ver}\
145\
146%postun -n kernel%{_alt_kernel}-%{pname}\
147%depmod %{_kernel_ver}\
148%{nil}
149
150%define build_kernel_pkg()\
151%if %{with kernel}\
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\
153cd drivers/dahdi\
154%install_kernel_modules -D ../../installed -m %{modules_in} -d misc\
155cd ../..\
156%endif\
157%{nil}
158
159%{?with_kernel:%{expand:%create_kernel_packages}}
160
161%prep
162%setup -q -n %{pname}-%{version}
163%patch0 -p1
164%patch1 -p1
165%patch2 -p1
166%patch3 -p1
167
168for a in %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} %{SOURCE7}; do
169 ln -s $a drivers/dahdi/firmware
170 tar -C drivers/dahdi/firmware -xzf $a
171done
172
173cat > download-logger <<'EOF'
174#!/bin/sh
175# keep log of files make wanted to download in firmware/ dir
176echo "$@" >> download.log
177EOF
178chmod a+rx download-logger
179
180%build
181%{__make} include/dahdi/version.h
182
183%{?with_kernel:%{expand:%build_kernel_packages}}
184
185%install
186rm -rf $RPM_BUILD_ROOT
187install -d $RPM_BUILD_ROOT%{_includedir}/dahdi
188
189%if %{with userspace}
190%{__make} install-include \
191 DESTDIR=$RPM_BUILD_ROOT
192%endif
193
194%if %{with kernel}
195cp -a installed/* $RPM_BUILD_ROOT
196%endif
197
198%clean
199rm -rf $RPM_BUILD_ROOT
200
201%if %{with userspace}
202%files devel
203%defattr(644,root,root,755)
204%{_includedir}/dahdi
205%endif
This page took 0.055634 seconds and 4 git commands to generate.