3 # - IMPORTANT rename: http://www.asterisk.org/zaptel-to-dahdi
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
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
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}
33 # nothing to be placed to debuginfo package
34 %define _enable_debug_packages 0
37 %define pname dahdi-linux
38 %define FIRMWARE_URL http://downloads.digium.com/pub/telephony/firmware/releases
39 Summary: DAHDI telephony device support
40 Summary(pl.UTF-8): Obsługa urządzeń telefonicznych DAHDI
41 Name: %{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel}
43 Release: %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}}
46 Source0: http://downloads.asterisk.org/pub/telephony/dahdi-linux/releases/dahdi-linux-%{version}.tar.gz
47 # Source0-md5: 17d7542e613afd6cf860516fe785d56c
48 Source3: %{FIRMWARE_URL}/dahdi-fw-oct6114-064-1.05.01.tar.gz
49 # Source3-md5: 88db9b7a07d8392736171b1b3e6bcc66
50 Source4: %{FIRMWARE_URL}/dahdi-fw-oct6114-128-1.05.01.tar.gz
51 # Source4-md5: c1f1a18d3e20d283f42c71e580a64b5a
52 Source5: %{FIRMWARE_URL}/dahdi-fw-vpmadt032-1.07.tar.gz
53 # Source5-md5: e1c7231d6225ac999cb18f4e858f66b6
54 Source6: %{FIRMWARE_URL}/dahdi-fw-tc400m-MR6.12.tar.gz
55 # Source6-md5: 2ea860bb8a9d8ede2858b9557b74ee3c
56 Source7: %{FIRMWARE_URL}/dahdi-fw-hx8-2.06.tar.gz
57 # Source7-md5: a7f3886942bb3e9fed349a41b3390c9f
58 Patch0: kernel-4.14.patch
59 Patch1: kernel-5.4.patch
61 Patch3: kernel-5.6.patch
62 Patch4: kernel-5.9.patch
63 Patch5: kernel-4.9.256.patch
64 Patch6: nostdinc.patch
65 Patch7: kernel-5.17.patch
66 URL: http://www.asterisk.org/
67 %{?with_kernel:%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}}
68 BuildRequires: perl-base
69 BuildRequires: rpmbuild(macros) >= 1.701
70 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
73 # - modules_X: single modules, just name module with no suffix
74 # - modules_X: subdir modules are just directory name with slash like dirname/
75 # - keep X and X_in in sync
76 # - X is used for actual building (entries separated with space), X_in for pld macros (entries separated with comma)
78 %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
79 %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
80 %define modules_2 voicebus/ oct612x/ wct4xxp/ %{?with_xpp:xpp/}
81 %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}
84 %define modules_nalpha wctc4xxp/ wctdm24xxp/ dahdi_transcode.o wcb4xxp/
85 %define modules_nalpha_in wctc4xxp/wctc4xxp,wctdm24xxp/wctdm24xxp,dahdi_transcode,wcb4xxp/wcb4xxp
87 %define modules %{modules_1} %{modules_2}%{?modules_nalpha: %{modules_nalpha}}
88 %define modules_in %{modules_1_in},%{modules_2_in}%{?modules_nalpha:,%{modules_nalpha_in}}
91 DAHDI telephony device driver.
93 %description -l pl.UTF-8
94 Sterownik do urządzeń telefonicznych DAHDI.
97 Summary: Header files for dahdi interface
98 Summary(pl.UTF-8): Pliki nagłówkowe interfejsu dahdi
99 Group: Development/Libraries
102 Header files for dahdi interface.
104 %description devel -l pl.UTF-8
105 Pliki nagłówkowe interfejsu dahdi.
107 %define kernel_pkg()\
108 %package -n kernel%{_alt_kernel}-%{pname}\
109 Summary: DAHDI Linux kernel driver\
110 Summary(pl.UTF-8): Sterownik DAHDI dla jądra Linuksa\
111 Release: %{rel}@%{_kernel_ver_str}\
113 Requires(post,postun): /sbin/depmod\
114 %requires_releq_kernel\
115 Requires(postun): %releq_kernel\
116 %{?with_oslec:Requires: kernel-misc-oslec = 20070608-0.1@%{_kernel_ver_str}}\
118 %description -n kernel%{_alt_kernel}-%{pname}\
119 DAHDI telephony Linux kernel driver.\
121 %description -n kernel%{_alt_kernel}-%{pname} -l pl.UTF-8\
122 Sterownik dla jądra Linuksa do urządzeń telefonicznych DAHDI.\
125 %files -n kernel%{_alt_kernel}-%{pname}\
126 %defattr(644,root,root,755)\
127 /lib/modules/%{_kernel_ver}/misc/dahdi*.ko*\
128 /lib/modules/%{_kernel_ver}/misc/wcb4xxp.ko*\
129 /lib/modules/%{_kernel_ver}/misc/wct4xxp.ko*\
130 /lib/modules/%{_kernel_ver}/misc/wctc4xxp.ko*\
131 /lib/modules/%{_kernel_ver}/misc/wctdm24xxp.ko*\
132 /lib/modules/%{_kernel_ver}/misc/wcte13xp.ko*\
133 /lib/modules/%{_kernel_ver}/misc/oct612x.ko*\
134 /lib/modules/%{_kernel_ver}/misc/wcaxx.ko*\
135 /lib/modules/%{_kernel_ver}/misc/wcte43x.ko*\
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*\
143 %post -n kernel%{_alt_kernel}-%{pname}\
144 %depmod %{_kernel_ver}\
146 %postun -n kernel%{_alt_kernel}-%{pname}\
147 %depmod %{_kernel_ver}\
150 %define build_kernel_pkg()\
152 %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\
154 %install_kernel_modules -D ../../installed -m %{modules_in} -d misc\
159 %{?with_kernel:%{expand:%create_kernel_packages}}
162 %setup -q -n %{pname}-%{version}
174 for a in %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} %{SOURCE7}; do
175 ln -s $a drivers/dahdi/firmware
176 tar -C drivers/dahdi/firmware -xzf $a
179 cat > download-logger <<'EOF'
181 # keep log of files make wanted to download in firmware/ dir
182 echo "$@" >> download.log
184 chmod a+rx download-logger
187 %{__make} include/dahdi/version.h
189 %{?with_kernel:%{expand:%build_kernel_packages}}
192 rm -rf $RPM_BUILD_ROOT
193 install -d $RPM_BUILD_ROOT%{_includedir}/dahdi
195 %if %{with userspace}
196 %{__make} install-include \
197 DESTDIR=$RPM_BUILD_ROOT
201 cp -a installed/* $RPM_BUILD_ROOT
205 rm -rf $RPM_BUILD_ROOT
207 %if %{with userspace}
209 %defattr(644,root,root,755)