]>
Commit | Line | Data |
---|---|---|
a9ca2497 JB |
1 | # |
2 | # Conditional build: | |
a9ca2497 JB |
3 | %bcond_without kernel # don't build kernel modules |
4 | %bcond_without userspace # don't build userspace package | |
5 | %bcond_without static_libs # don't build static libraries | |
6 | %bcond_with pri # ISDN devices support (modified libpri) | |
40b8f1d3 | 7 | |
40b8f1d3 JR |
8 | # The goal here is to have main, userspace, package built once with |
9 | # simple release number, and only rebuild kernel packages with kernel | |
10 | # version as part of release number, without the need to bump release | |
11 | # with every kernel change. | |
12 | %if 0%{?_pld_builder:1} && %{with kernel} && %{with userspace} | |
13 | %{error:kernel and userspace cannot be built at the same time on PLD builders} | |
14 | exit 1 | |
15 | %endif | |
16 | ||
40b8f1d3 JR |
17 | %if %{without userspace} |
18 | # nothing to be placed to debuginfo package | |
19 | %define _enable_debug_packages 0 | |
a9ca2497 | 20 | %endif |
faa79da0 | 21 | |
40b8f1d3 JR |
22 | %define _duplicate_files_terminate_build 0 |
23 | ||
e5621208 | 24 | %define rel 10 |
faa79da0 | 25 | %define pname vpb-driver |
a9ca2497 JB |
26 | Summary: Voicetronix voice processing board (VPB) driver software |
27 | Summary(pl.UTF-8): Oprogramowanie sterowników dla kart przetwarzających głos (VPB) Voicetronix | |
40b8f1d3 | 28 | Name: %{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel} |
adc45f0b | 29 | Version: 4.2.58 |
40b8f1d3 | 30 | Release: %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}} |
a9ca2497 JB |
31 | License: LGPL v2.1+ (libraries), GPL v2+ (libpri library, kernel module) |
32 | Group: Libraries | |
faa79da0 | 33 | Source0: http://www.voicetronix.com.au/Downloads/vpb-driver-4.x/%{pname}-%{version}.tar.gz |
adc45f0b | 34 | # Source0-md5: f8c85b52e8d01b04d86632e98ac59d19 |
faa79da0 | 35 | Patch0: %{pname}-make.patch |
be35dc39 JR |
36 | Patch1: userspace-only.patch |
37 | Patch2: linux-4.12.patch | |
f8218dd9 | 38 | Patch3: kernel-4.14.patch |
d2010795 | 39 | Patch4: gcc8.patch |
848bd219 | 40 | Patch5: kernel-5.6.patch |
5f1d32c5 | 41 | Patch6: kernel-5.13.patch |
571cdb94 | 42 | Patch7: kernel-5.17.patch |
c4534f52 | 43 | Patch8: kernel-5.18.patch |
2d10ea89 | 44 | Patch9: pthread.patch |
d015d284 | 45 | Patch10: kernel-6.5.patch |
a9ca2497 | 46 | URL: http://www.voicetronix.com.au/downloads.htm#linux |
8fd9c3e5 JR |
47 | BuildRequires: rpmbuild(macros) >= 1.701 |
48 | %{?with_kernel:%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}} | |
a9ca2497 JB |
49 | BuildRequires: autoconf >= 2.59 |
50 | BuildRequires: libstdc++-devel | |
51 | BuildRequires: pciutils-devel | |
dbfa6bb9 | 52 | BuildRequires: sed >= 4.0 |
a9ca2497 JB |
53 | BuildRequires: zlib-devel |
54 | Requires: vpb-libs = %{version}-%{rel} | |
55 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
56 | ||
57 | %description | |
58 | This is the Voicetronix voice processing board (VPB) driver software. | |
59 | ||
60 | %description -l pl.UTF-8 | |
61 | Ten pakiet zawiera oprogramowanie sterowników kart przetwarzających | |
62 | głos (VPB - voice processing board) firmy Voicetronix. | |
63 | ||
64 | %package -n vpb-libs | |
65 | Summary: Shared VPD libraries | |
66 | Summary(pl.UTF-8): Biblioteki współdzielone VPD | |
67 | License: LGPL v2.1+ | |
68 | Group: Libraries | |
69 | ||
70 | %description -n vpb-libs | |
71 | Shared VPD libraries. | |
72 | ||
73 | %description -n vpb-libs -l pl.UTF-8 | |
74 | Biblioteki współdzielone VPD. | |
75 | ||
76 | %package -n vpb-devel | |
77 | Summary: Header files for VPD libraries | |
78 | Summary(pl.UTF-8): Pliki nagłówkowe bibliotek VPD | |
79 | License: LGPL v2.1+ | |
80 | Group: Development/Libraries | |
81 | Requires: vpb-libs = %{version}-%{rel} | |
82 | ||
83 | %description -n vpb-devel | |
84 | Header files for VPD libraries. | |
85 | ||
86 | %description -n vpb-devel -l pl.UTF-8 | |
87 | Pliki nagłówkowe bibliotek VPD. | |
88 | ||
89 | %package -n vpb-static | |
90 | Summary: Static VPD libraries | |
91 | Summary(pl.UTF-8): Statyczne biblioteki VPD | |
92 | License: LGPL v2.1+ | |
93 | Group: Development/Libraries | |
94 | Requires: vpb-devel = %{version}-%{rel} | |
95 | ||
96 | %description -n vpb-static | |
97 | Static VPD libraries. | |
98 | ||
99 | %description -n vpb-static -l pl.UTF-8 | |
100 | Statyczne biblioteki VPD. | |
101 | ||
40b8f1d3 JR |
102 | %define kernel_pkg()\ |
103 | %package -n kernel%{_alt_kernel}-telephony-vpb\ | |
104 | Summary: Linux kernel driver for Voicetronix Voice Processing Board (VPB)\ | |
105 | Summary(pl.UTF-8): Sterownik jądra Linuksa do kart VPB firmy Voicetronix\ | |
106 | Release: %{rel}@%{_kernel_ver_str}\ | |
107 | License: GPL v2+\ | |
108 | Group: Base/Kernel\ | |
109 | Requires(post,postun): /sbin/depmod\ | |
40b8f1d3 JR |
110 | %requires_releq_kernel\ |
111 | Requires(postun): %releq_kernel\ | |
40b8f1d3 JR |
112 | \ |
113 | %description -n kernel%{_alt_kernel}-telephony-vpb\ | |
114 | Linux kernel driver for Voicetronix Voice Processing Board (VPB).\ | |
115 | \ | |
116 | %description -n kernel%{_alt_kernel}-telephony-vpb -l pl.UTF-8\ | |
117 | Sterownik jądra Linuksa do kart VPB firmy Voicetronix.\ | |
118 | \ | |
119 | %files -n kernel%{_alt_kernel}-telephony-vpb\ | |
120 | %defattr(644,root,root,755)\ | |
121 | %dir /lib/modules/%{_kernel_ver}/kernel/drivers/telephony\ | |
122 | /lib/modules/%{_kernel_ver}/kernel/drivers/telephony/vpb.ko*\ | |
123 | /lib/modules/%{_kernel_ver}/kernel/drivers/telephony/vtcore.ko*\ | |
124 | /lib/modules/%{_kernel_ver}/kernel/drivers/telephony/vtopenpci.ko*\ | |
125 | /lib/modules/%{_kernel_ver}/kernel/drivers/telephony/vtopenswitch.ko*\ | |
126 | %config(noreplace) %verify(not md5 mtime size) /etc/modprobe.d/blunt-axe.conf\ | |
127 | \ | |
128 | %post -n kernel%{_alt_kernel}-telephony-vpb\ | |
129 | %depmod %{_kernel_ver}\ | |
130 | \ | |
131 | %postun -n kernel%{_alt_kernel}-telephony-vpb\ | |
132 | %depmod %{_kernel_ver}\ | |
133 | %{nil} | |
134 | ||
135 | %define build_kernel_pkg()\ | |
7bb9bed9 JR |
136 | %{__make} -C src/vtcore KSRC=%{_kernelsrcdir} clean \ |
137 | %{__make} -C src/vpb KSRC=%{_kernelsrcdir} clean \ | |
40b8f1d3 JR |
138 | %{__make} -C src/vtcore KSRC=%{_kernelsrcdir} \ |
139 | %{__make} -C src/vpb KSRC=%{_kernelsrcdir} \ | |
140 | p=`pwd`\ | |
141 | %{__make} -C src/vtcore install \\\ | |
142 | DESTDIR=$p/installed \\\ | |
143 | KSRC=%{_kernelsrcdir}\ | |
144 | %{__make} -C src/vpb install \\\ | |
145 | DESTDIR=$p/installed \\\ | |
146 | KSRC=%{_kernelsrcdir}\ | |
147 | %{nil} | |
148 | ||
8fd9c3e5 | 149 | %{?with_kernel:%{expand:%create_kernel_packages}} |
a9ca2497 JB |
150 | |
151 | %prep | |
faa79da0 | 152 | %setup -q -n %{pname}-%{version} |
a9ca2497 | 153 | %patch0 -p1 |
be35dc39 JR |
154 | %patch1 -p1 |
155 | %patch2 -p1 | |
f8218dd9 | 156 | %patch3 -p1 |
d2010795 | 157 | %patch4 -p1 |
848bd219 | 158 | %patch5 -p1 |
5f1d32c5 | 159 | %patch6 -p1 |
571cdb94 | 160 | %patch7 -p1 |
c4534f52 | 161 | %patch8 -p1 |
2d10ea89 | 162 | %patch9 -p1 |
d015d284 | 163 | %patch10 -p1 |
dbfa6bb9 JB |
164 | |
165 | %if %{without kernel} | |
166 | %{__sed} -i -e 's,subdirs += $(srcdir)/vtcore $(srcdir)/vpb,,' src/Makefile.in | |
167 | %endif | |
168 | %if %{without userspace} | |
169 | %{__sed} -i -e 's,subdirs = libtoneg libvpb utils,,' src/Makefile.in | |
170 | %endif | |
a9ca2497 JB |
171 | |
172 | %build | |
173 | %{__aclocal} | |
174 | %{__autoconf} | |
175 | %if %{with userspace} && %{with static_libs} | |
176 | install -d build-static | |
177 | cd build-static | |
178 | ../%configure \ | |
179 | %{?with_pri:--with-pri} | |
dbfa6bb9 JB |
180 | %{__make} -C src/libtoneg \ |
181 | VPATH=%{_libdir} | |
182 | %{__make} -C src/libvpb \ | |
183 | VPATH=%{_libdir} | |
a9ca2497 JB |
184 | cd .. |
185 | %endif | |
40b8f1d3 | 186 | |
a9ca2497 JB |
187 | %configure \ |
188 | %{?with_pri:--with-pri} \ | |
189 | --enable-shared | |
9a1e9700 | 190 | |
40b8f1d3 | 191 | %if %{with userspace} |
dbfa6bb9 | 192 | %{__make} \ |
dbfa6bb9 | 193 | VPATH=%{_libdir} |
9a1e9700 | 194 | %endif |
a9ca2497 | 195 | |
8fd9c3e5 | 196 | %{?with_kernel:%{expand:%build_kernel_packages}} |
40b8f1d3 | 197 | |
a9ca2497 JB |
198 | %install |
199 | rm -rf $RPM_BUILD_ROOT | |
200 | ||
40b8f1d3 | 201 | %if %{with kernel} |
9a1e9700 JR |
202 | install -d $RPM_BUILD_ROOT/etc/modprobe.d |
203 | install src/libvpb/blunt-axe.conf $RPM_BUILD_ROOT/etc/modprobe.d | |
204 | ||
40b8f1d3 JR |
205 | cp -a installed/* $RPM_BUILD_ROOT |
206 | %endif | |
9a1e9700 | 207 | |
40b8f1d3 | 208 | %if %{with userspace} |
a9ca2497 | 209 | %{__make} install \ |
40b8f1d3 | 210 | DESTDIR=$RPM_BUILD_ROOT |
a9ca2497 | 211 | |
a9ca2497 JB |
212 | # let rpm generate dependencies |
213 | chmod 755 $RPM_BUILD_ROOT%{_libdir}/lib*.so* | |
214 | ||
215 | # install man pages only for packaged software | |
216 | install -d $RPM_BUILD_ROOT%{_mandir}/man1 | |
217 | install doc/vpbconf.1 $RPM_BUILD_ROOT%{_mandir}/man1 | |
218 | install doc/vpbscan.1 $RPM_BUILD_ROOT%{_mandir}/man1 | |
219 | ||
220 | %if %{with static_libs} | |
221 | install build-static/src/{libtoneg/libtoneg.a,libvpb/libvpb.a} $RPM_BUILD_ROOT%{_libdir} | |
222 | %endif | |
223 | %endif | |
224 | ||
225 | %clean | |
226 | rm -rf $RPM_BUILD_ROOT | |
227 | ||
228 | %post -n vpb-libs -p /sbin/ldconfig | |
229 | %postun -n vpb-libs -p /sbin/ldconfig | |
230 | ||
a9ca2497 JB |
231 | %if %{with userspace} |
232 | %files | |
233 | %defattr(644,root,root,755) | |
234 | %doc COPYING README README.{OpenPCI,OpenPRI,OpenSwitch12,VTCore,VpbConfig} | |
235 | %attr(755,root,root) %{_sbindir}/vpbconf | |
236 | %attr(755,root,root) %{_sbindir}/vpbscan | |
237 | %{_datadir}/vpb-driver | |
238 | %{_mandir}/man1/vpbconf.1* | |
239 | %{_mandir}/man1/vpbscan.1* | |
240 | ||
241 | %files -n vpb-libs | |
242 | %defattr(644,root,root,755) | |
243 | %attr(755,root,root) %{_libdir}/libtoneg.so.*.*.* | |
244 | %attr(755,root,root) %ghost %{_libdir}/libtoneg.so.0 | |
245 | %attr(755,root,root) %{_libdir}/libvpb.so.*.*.* | |
246 | %attr(755,root,root) %ghost %{_libdir}/libvpb.so.0 | |
247 | ||
248 | %files -n vpb-devel | |
249 | %defattr(644,root,root,755) | |
250 | %attr(755,root,root) %{_libdir}/libtoneg.so | |
251 | %attr(755,root,root) %{_libdir}/libvpb.so | |
252 | %{_includedir}/vt | |
253 | %{_includedir}/vpbapi.h | |
254 | %{_includedir}/vt_deprecated.h | |
255 | %{_includedir}/vtcore_ioctl.h | |
256 | ||
257 | %if %{with static_libs} | |
258 | %files -n vpb-static | |
259 | %defattr(644,root,root,755) | |
260 | %{_libdir}/libtoneg.a | |
261 | %{_libdir}/libvpb.a | |
262 | %endif | |
263 | %endif |