]> git.pld-linux.org Git - packages/dahdi-linux.git/blame - dahdi-linux.spec
- up to 3.0.0, doesn't build with kernel 5.0
[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:
f3ae6389 14%bcond_without kernel # don't build kernel modules
563fc4ec 15%bcond_with oslec # with Open Source Line Echo Canceller
563fc4ec 16%bcond_without xpp # without Astribank
56c839b0 17%bcond_without userspace # don't build userspace packages
563fc4ec 18%bcond_with verbose
19
563fc4ec 20%ifarch alpha
21%undefine with_xpp
22%endif
228a18e7 23
228a18e7
JR
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
228a18e7
JR
33%if %{without userspace}
34# nothing to be placed to debuginfo package
35%define _enable_debug_packages 0
36%endif
37
446f5676 38%define rel 0.1
563fc4ec 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
1a93d7c5 43Name: %{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel}
446f5676 44Version: 3.0.0
1a93d7c5 45Release: %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}}
c792012c 46License: GPL v2
563fc4ec 47Group: Base/Kernel
64471470 48Source0: http://downloads.asterisk.org/pub/telephony/dahdi-linux/releases/dahdi-linux-%{version}.tar.gz
446f5676 49# Source0-md5: 496baef9d2a3bec5a3380ade8efdc5e7
563fc4ec 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
d2a401d3 58Source7: %{FIRMWARE_URL}/dahdi-fw-hx8-2.06.tar.gz
59# Source7-md5: a7f3886942bb3e9fed349a41b3390c9f
563fc4ec 60URL: http://www.asterisk.org/
453aa04e 61%{?with_kernel:%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}}
563fc4ec 62BuildRequires: perl-base
fcd3b77f 63BuildRequires: rpmbuild(macros) >= 1.701
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
8be0f738 72%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
73%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
d2a401d3 74%define modules_2 voicebus/ wct4xxp/ wcte12xp/ %{?with_xpp:xpp/}
141723f4 75%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}
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
3f765485 91Summary(pl.UTF-8): Pliki nagłówkowe interfejsu dahdi
563fc4ec 92Group: Development/Libraries
563fc4ec 93
94%description devel
95Header files for dahdi interface.
96
3f765485
JB
97%description devel -l pl.UTF-8
98Pliki nagłówkowe interfejsu dahdi.
99
228a18e7
JR
100%define kernel_pkg()\
101%package -n kernel%{_alt_kernel}-%{pname}\
102Summary: DAHDI Linux kernel driver\
103Summary(pl.UTF-8): Sterownik DAHDI dla jądra Linuksa\
104Release: %{rel}@%{_kernel_ver_str}\
105Group: Base/Kernel\
106Requires(post,postun): /sbin/depmod\
228a18e7
JR
107%requires_releq_kernel\
108Requires(postun): %releq_kernel\
109%{?with_oslec:Requires: kernel-misc-oslec = 20070608-0.1@%{_kernel_ver_str}}\
228a18e7
JR
110\
111%description -n kernel%{_alt_kernel}-%{pname}\
112DAHDI telephony Linux kernel driver.\
113\
114%description -n kernel%{_alt_kernel}-%{pname} -l pl.UTF-8\
115Sterownik dla jądra Linuksa do urządzeń telefonicznych DAHDI.\
116\
117%if %{with kernel}\
118%files -n kernel%{_alt_kernel}-%{pname}\
119%defattr(644,root,root,755)\
120/lib/modules/%{_kernel_ver}/misc/dahdi*.ko*\
121/lib/modules/%{_kernel_ver}/misc/pciradio.ko*\
122/lib/modules/%{_kernel_ver}/misc/tor2.ko*\
123/lib/modules/%{_kernel_ver}/misc/wcb4xxp.ko*\
124/lib/modules/%{_kernel_ver}/misc/wcfxo.ko*\
125/lib/modules/%{_kernel_ver}/misc/wct1xxp.ko*\
126/lib/modules/%{_kernel_ver}/misc/wct4xxp.ko*\
127/lib/modules/%{_kernel_ver}/misc/wctc4xxp.ko*\
128/lib/modules/%{_kernel_ver}/misc/wctdm.ko*\
129/lib/modules/%{_kernel_ver}/misc/wctdm24xxp.ko*\
130/lib/modules/%{_kernel_ver}/misc/wcte11xp.ko*\
131/lib/modules/%{_kernel_ver}/misc/wcte12xp.ko*\
132%if %{with xpp}\
133/lib/modules/%{_kernel_ver}/misc/xpd_*.ko*\
134/lib/modules/%{_kernel_ver}/misc/xpp.ko*\
135/lib/modules/%{_kernel_ver}/misc/xpp_usb.ko*\
136%endif\
137%endif\
138\
139%post -n kernel%{_alt_kernel}-%{pname}\
140%depmod %{_kernel_ver}\
141\
142%postun -n kernel%{_alt_kernel}-%{pname}\
143%depmod %{_kernel_ver}\
144%{nil}
145
146%define build_kernel_pkg()\
147%if %{with kernel}\
e6cd4785 148%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\
228a18e7
JR
149cd drivers/dahdi\
150%install_kernel_modules -D ../../installed -m %{modules_in} -d misc\
151cd ../..\
152%endif\
153%{nil}
154
453aa04e 155%{?with_kernel:%{expand:%create_kernel_packages}}
563fc4ec 156
157%prep
158%setup -q -n %{pname}-%{version}
159
d2a401d3 160for a in %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} %{SOURCE7}; do
563fc4ec 161 ln -s $a drivers/dahdi/firmware
162 tar -C drivers/dahdi/firmware -xzf $a
163done
164
165cat > download-logger <<'EOF'
166#!/bin/sh
167# keep log of files make wanted to download in firmware/ dir
168echo "$@" >> download.log
169EOF
170chmod a+rx download-logger
171
172%build
173%{__make} include/dahdi/version.h
174
453aa04e 175%{?with_kernel:%{expand:%build_kernel_packages}}
563fc4ec 176
177%install
178rm -rf $RPM_BUILD_ROOT
228a18e7 179install -d $RPM_BUILD_ROOT%{_includedir}/dahdi
563fc4ec 180
56c839b0 181%if %{with userspace}
739efdd0 182%{__make} install-include \
3f765485 183 DESTDIR=$RPM_BUILD_ROOT
56c839b0 184%endif
563fc4ec 185
228a18e7
JR
186%if %{with kernel}
187cp -a installed/* $RPM_BUILD_ROOT
188%endif
189
563fc4ec 190%clean
191rm -rf $RPM_BUILD_ROOT
192
56c839b0 193%if %{with userspace}
563fc4ec 194%files devel
b603dc42 195%defattr(644,root,root,755)
563fc4ec 196%{_includedir}/dahdi
56c839b0 197%endif
This page took 0.064651 seconds and 4 git commands to generate.