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