]> git.pld-linux.org Git - packages/dahdi-linux.git/blame - dahdi-linux.spec
Release 9 (by relup.sh)
[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# nothing to be placed to debuginfo package
34%define _enable_debug_packages 0
228a18e7 35
5976fca9 36%define rel 9
563fc4ec 37%define pname dahdi-linux
38%define FIRMWARE_URL http://downloads.digium.com/pub/telephony/firmware/releases
39Summary: DAHDI telephony device support
40Summary(pl.UTF-8): Obsługa urządzeń telefonicznych DAHDI
1a93d7c5 41Name: %{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel}
cdd97bd2 42Version: 3.1.0
1a93d7c5 43Release: %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}}
c792012c 44License: GPL v2
563fc4ec 45Group: Base/Kernel
64471470 46Source0: http://downloads.asterisk.org/pub/telephony/dahdi-linux/releases/dahdi-linux-%{version}.tar.gz
cdd97bd2 47# Source0-md5: 17d7542e613afd6cf860516fe785d56c
563fc4ec 48Source3: %{FIRMWARE_URL}/dahdi-fw-oct6114-064-1.05.01.tar.gz
49# Source3-md5: 88db9b7a07d8392736171b1b3e6bcc66
50Source4: %{FIRMWARE_URL}/dahdi-fw-oct6114-128-1.05.01.tar.gz
51# Source4-md5: c1f1a18d3e20d283f42c71e580a64b5a
52Source5: %{FIRMWARE_URL}/dahdi-fw-vpmadt032-1.07.tar.gz
53# Source5-md5: e1c7231d6225ac999cb18f4e858f66b6
54Source6: %{FIRMWARE_URL}/dahdi-fw-tc400m-MR6.12.tar.gz
55# Source6-md5: 2ea860bb8a9d8ede2858b9557b74ee3c
d2a401d3 56Source7: %{FIRMWARE_URL}/dahdi-fw-hx8-2.06.tar.gz
57# Source7-md5: a7f3886942bb3e9fed349a41b3390c9f
cdd97bd2
JR
58Patch0: kernel-4.14.patch
59Patch1: kernel-5.4.patch
e40e5478 60Patch2: math64.patch
22d881ca 61Patch3: kernel-5.6.patch
9a3e0e89 62Patch4: kernel-5.9.patch
a80a7846 63Patch5: kernel-4.9.256.patch
fa56d27b 64Patch6: nostdinc.patch
1ccd2f24 65Patch7: kernel-5.17.patch
52da1155 66Patch8: kernel-5.18.patch
563fc4ec 67URL: http://www.asterisk.org/
453aa04e 68%{?with_kernel:%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}}
563fc4ec 69BuildRequires: perl-base
fcd3b77f 70BuildRequires: rpmbuild(macros) >= 1.701
563fc4ec 71BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
72
73# Rules:
74# - modules_X: single modules, just name module with no suffix
75# - modules_X: subdir modules are just directory name with slash like dirname/
76# - keep X and X_in in sync
77# - X is used for actual building (entries separated with space), X_in for pld macros (entries separated with comma)
78
33dcd229
JR
79%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
80%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
81%define modules_2 voicebus/ oct612x/ wct4xxp/ %{?with_xpp:xpp/}
82%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}
83
563fc4ec 84%ifnarch alpha
85%define modules_nalpha wctc4xxp/ wctdm24xxp/ dahdi_transcode.o wcb4xxp/
86%define modules_nalpha_in wctc4xxp/wctc4xxp,wctdm24xxp/wctdm24xxp,dahdi_transcode,wcb4xxp/wcb4xxp
563fc4ec 87%endif
b800683f 88%define modules %{modules_1} %{modules_2}%{?modules_nalpha: %{modules_nalpha}}
89%define modules_in %{modules_1_in},%{modules_2_in}%{?modules_nalpha:,%{modules_nalpha_in}}
563fc4ec 90
91%description
92DAHDI telephony device driver.
93
94%description -l pl.UTF-8
95Sterownik do urządzeń telefonicznych DAHDI.
96
97%package devel
98Summary: Header files for dahdi interface
3f765485 99Summary(pl.UTF-8): Pliki nagłówkowe interfejsu dahdi
563fc4ec 100Group: Development/Libraries
563fc4ec 101
102%description devel
103Header files for dahdi interface.
104
3f765485
JB
105%description devel -l pl.UTF-8
106Pliki nagłówkowe interfejsu dahdi.
107
228a18e7
JR
108%define kernel_pkg()\
109%package -n kernel%{_alt_kernel}-%{pname}\
110Summary: DAHDI Linux kernel driver\
111Summary(pl.UTF-8): Sterownik DAHDI dla jądra Linuksa\
112Release: %{rel}@%{_kernel_ver_str}\
113Group: Base/Kernel\
114Requires(post,postun): /sbin/depmod\
228a18e7
JR
115%requires_releq_kernel\
116Requires(postun): %releq_kernel\
117%{?with_oslec:Requires: kernel-misc-oslec = 20070608-0.1@%{_kernel_ver_str}}\
228a18e7
JR
118\
119%description -n kernel%{_alt_kernel}-%{pname}\
120DAHDI telephony Linux kernel driver.\
121\
122%description -n kernel%{_alt_kernel}-%{pname} -l pl.UTF-8\
123Sterownik dla jądra Linuksa do urządzeń telefonicznych DAHDI.\
124\
125%if %{with kernel}\
126%files -n kernel%{_alt_kernel}-%{pname}\
127%defattr(644,root,root,755)\
128/lib/modules/%{_kernel_ver}/misc/dahdi*.ko*\
228a18e7 129/lib/modules/%{_kernel_ver}/misc/wcb4xxp.ko*\
228a18e7
JR
130/lib/modules/%{_kernel_ver}/misc/wct4xxp.ko*\
131/lib/modules/%{_kernel_ver}/misc/wctc4xxp.ko*\
228a18e7 132/lib/modules/%{_kernel_ver}/misc/wctdm24xxp.ko*\
33dcd229
JR
133/lib/modules/%{_kernel_ver}/misc/wcte13xp.ko*\
134/lib/modules/%{_kernel_ver}/misc/oct612x.ko*\
135/lib/modules/%{_kernel_ver}/misc/wcaxx.ko*\
136/lib/modules/%{_kernel_ver}/misc/wcte43x.ko*\
228a18e7
JR
137%if %{with xpp}\
138/lib/modules/%{_kernel_ver}/misc/xpd_*.ko*\
139/lib/modules/%{_kernel_ver}/misc/xpp.ko*\
140/lib/modules/%{_kernel_ver}/misc/xpp_usb.ko*\
141%endif\
142%endif\
143\
144%post -n kernel%{_alt_kernel}-%{pname}\
145%depmod %{_kernel_ver}\
146\
147%postun -n kernel%{_alt_kernel}-%{pname}\
148%depmod %{_kernel_ver}\
149%{nil}
150
151%define build_kernel_pkg()\
152%if %{with kernel}\
fa56d27b 153%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
154cd drivers/dahdi\
155%install_kernel_modules -D ../../installed -m %{modules_in} -d misc\
156cd ../..\
157%endif\
158%{nil}
159
453aa04e 160%{?with_kernel:%{expand:%create_kernel_packages}}
563fc4ec 161
162%prep
163%setup -q -n %{pname}-%{version}
33dcd229 164%patch0 -p1
10f904f3 165%patch1 -p1
e40e5478
JR
166%ifarch %{ix86}
167%patch2 -p1
168%endif
22d881ca 169%patch3 -p1
9a3e0e89 170%patch4 -p1
a80a7846 171%patch5 -p1
fa56d27b 172%patch6 -p1
1ccd2f24 173%patch7 -p1
52da1155 174%patch8 -p1
563fc4ec 175
d2a401d3 176for a in %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} %{SOURCE7}; do
563fc4ec 177 ln -s $a drivers/dahdi/firmware
178 tar -C drivers/dahdi/firmware -xzf $a
179done
180
181cat > download-logger <<'EOF'
182#!/bin/sh
183# keep log of files make wanted to download in firmware/ dir
184echo "$@" >> download.log
185EOF
186chmod a+rx download-logger
187
188%build
189%{__make} include/dahdi/version.h
190
453aa04e 191%{?with_kernel:%{expand:%build_kernel_packages}}
563fc4ec 192
193%install
194rm -rf $RPM_BUILD_ROOT
228a18e7 195install -d $RPM_BUILD_ROOT%{_includedir}/dahdi
563fc4ec 196
56c839b0 197%if %{with userspace}
739efdd0 198%{__make} install-include \
3f765485 199 DESTDIR=$RPM_BUILD_ROOT
56c839b0 200%endif
563fc4ec 201
228a18e7
JR
202%if %{with kernel}
203cp -a installed/* $RPM_BUILD_ROOT
204%endif
205
563fc4ec 206%clean
207rm -rf $RPM_BUILD_ROOT
208
56c839b0 209%if %{with userspace}
563fc4ec 210%files devel
b603dc42 211%defattr(644,root,root,755)
563fc4ec 212%{_includedir}/dahdi
56c839b0 213%endif
This page took 0.115603 seconds and 4 git commands to generate.