]>
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 | ||
571cdb94 | 24 | %define rel 8 |
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 |
a9ca2497 | 43 | URL: http://www.voicetronix.com.au/downloads.htm#linux |
8fd9c3e5 JR |
44 | BuildRequires: rpmbuild(macros) >= 1.701 |
45 | %{?with_kernel:%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}} | |
a9ca2497 JB |
46 | BuildRequires: autoconf >= 2.59 |
47 | BuildRequires: libstdc++-devel | |
48 | BuildRequires: pciutils-devel | |
dbfa6bb9 | 49 | BuildRequires: sed >= 4.0 |
a9ca2497 JB |
50 | BuildRequires: zlib-devel |
51 | Requires: vpb-libs = %{version}-%{rel} | |
52 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
53 | ||
54 | %description | |
55 | This is the Voicetronix voice processing board (VPB) driver software. | |
56 | ||
57 | %description -l pl.UTF-8 | |
58 | Ten pakiet zawiera oprogramowanie sterowników kart przetwarzających | |
59 | głos (VPB - voice processing board) firmy Voicetronix. | |
60 | ||
61 | %package -n vpb-libs | |
62 | Summary: Shared VPD libraries | |
63 | Summary(pl.UTF-8): Biblioteki współdzielone VPD | |
64 | License: LGPL v2.1+ | |
65 | Group: Libraries | |
66 | ||
67 | %description -n vpb-libs | |
68 | Shared VPD libraries. | |
69 | ||
70 | %description -n vpb-libs -l pl.UTF-8 | |
71 | Biblioteki współdzielone VPD. | |
72 | ||
73 | %package -n vpb-devel | |
74 | Summary: Header files for VPD libraries | |
75 | Summary(pl.UTF-8): Pliki nagłówkowe bibliotek VPD | |
76 | License: LGPL v2.1+ | |
77 | Group: Development/Libraries | |
78 | Requires: vpb-libs = %{version}-%{rel} | |
79 | ||
80 | %description -n vpb-devel | |
81 | Header files for VPD libraries. | |
82 | ||
83 | %description -n vpb-devel -l pl.UTF-8 | |
84 | Pliki nagłówkowe bibliotek VPD. | |
85 | ||
86 | %package -n vpb-static | |
87 | Summary: Static VPD libraries | |
88 | Summary(pl.UTF-8): Statyczne biblioteki VPD | |
89 | License: LGPL v2.1+ | |
90 | Group: Development/Libraries | |
91 | Requires: vpb-devel = %{version}-%{rel} | |
92 | ||
93 | %description -n vpb-static | |
94 | Static VPD libraries. | |
95 | ||
96 | %description -n vpb-static -l pl.UTF-8 | |
97 | Statyczne biblioteki VPD. | |
98 | ||
40b8f1d3 JR |
99 | %define kernel_pkg()\ |
100 | %package -n kernel%{_alt_kernel}-telephony-vpb\ | |
101 | Summary: Linux kernel driver for Voicetronix Voice Processing Board (VPB)\ | |
102 | Summary(pl.UTF-8): Sterownik jądra Linuksa do kart VPB firmy Voicetronix\ | |
103 | Release: %{rel}@%{_kernel_ver_str}\ | |
104 | License: GPL v2+\ | |
105 | Group: Base/Kernel\ | |
106 | Requires(post,postun): /sbin/depmod\ | |
40b8f1d3 JR |
107 | %requires_releq_kernel\ |
108 | Requires(postun): %releq_kernel\ | |
40b8f1d3 JR |
109 | \ |
110 | %description -n kernel%{_alt_kernel}-telephony-vpb\ | |
111 | Linux kernel driver for Voicetronix Voice Processing Board (VPB).\ | |
112 | \ | |
113 | %description -n kernel%{_alt_kernel}-telephony-vpb -l pl.UTF-8\ | |
114 | Sterownik jądra Linuksa do kart VPB firmy Voicetronix.\ | |
115 | \ | |
116 | %files -n kernel%{_alt_kernel}-telephony-vpb\ | |
117 | %defattr(644,root,root,755)\ | |
118 | %dir /lib/modules/%{_kernel_ver}/kernel/drivers/telephony\ | |
119 | /lib/modules/%{_kernel_ver}/kernel/drivers/telephony/vpb.ko*\ | |
120 | /lib/modules/%{_kernel_ver}/kernel/drivers/telephony/vtcore.ko*\ | |
121 | /lib/modules/%{_kernel_ver}/kernel/drivers/telephony/vtopenpci.ko*\ | |
122 | /lib/modules/%{_kernel_ver}/kernel/drivers/telephony/vtopenswitch.ko*\ | |
123 | %config(noreplace) %verify(not md5 mtime size) /etc/modprobe.d/blunt-axe.conf\ | |
124 | \ | |
125 | %post -n kernel%{_alt_kernel}-telephony-vpb\ | |
126 | %depmod %{_kernel_ver}\ | |
127 | \ | |
128 | %postun -n kernel%{_alt_kernel}-telephony-vpb\ | |
129 | %depmod %{_kernel_ver}\ | |
130 | %{nil} | |
131 | ||
132 | %define build_kernel_pkg()\ | |
7bb9bed9 JR |
133 | %{__make} -C src/vtcore KSRC=%{_kernelsrcdir} clean \ |
134 | %{__make} -C src/vpb KSRC=%{_kernelsrcdir} clean \ | |
40b8f1d3 JR |
135 | %{__make} -C src/vtcore KSRC=%{_kernelsrcdir} \ |
136 | %{__make} -C src/vpb KSRC=%{_kernelsrcdir} \ | |
137 | p=`pwd`\ | |
138 | %{__make} -C src/vtcore install \\\ | |
139 | DESTDIR=$p/installed \\\ | |
140 | KSRC=%{_kernelsrcdir}\ | |
141 | %{__make} -C src/vpb install \\\ | |
142 | DESTDIR=$p/installed \\\ | |
143 | KSRC=%{_kernelsrcdir}\ | |
144 | %{nil} | |
145 | ||
8fd9c3e5 | 146 | %{?with_kernel:%{expand:%create_kernel_packages}} |
a9ca2497 JB |
147 | |
148 | %prep | |
faa79da0 | 149 | %setup -q -n %{pname}-%{version} |
a9ca2497 | 150 | %patch0 -p1 |
be35dc39 JR |
151 | %patch1 -p1 |
152 | %patch2 -p1 | |
f8218dd9 | 153 | %patch3 -p1 |
d2010795 | 154 | %patch4 -p1 |
848bd219 | 155 | %patch5 -p1 |
5f1d32c5 | 156 | %patch6 -p1 |
571cdb94 | 157 | %patch7 -p1 |
dbfa6bb9 JB |
158 | |
159 | %if %{without kernel} | |
160 | %{__sed} -i -e 's,subdirs += $(srcdir)/vtcore $(srcdir)/vpb,,' src/Makefile.in | |
161 | %endif | |
162 | %if %{without userspace} | |
163 | %{__sed} -i -e 's,subdirs = libtoneg libvpb utils,,' src/Makefile.in | |
164 | %endif | |
a9ca2497 JB |
165 | |
166 | %build | |
167 | %{__aclocal} | |
168 | %{__autoconf} | |
169 | %if %{with userspace} && %{with static_libs} | |
170 | install -d build-static | |
171 | cd build-static | |
172 | ../%configure \ | |
173 | %{?with_pri:--with-pri} | |
dbfa6bb9 JB |
174 | %{__make} -C src/libtoneg \ |
175 | VPATH=%{_libdir} | |
176 | %{__make} -C src/libvpb \ | |
177 | VPATH=%{_libdir} | |
a9ca2497 JB |
178 | cd .. |
179 | %endif | |
40b8f1d3 | 180 | |
a9ca2497 JB |
181 | %configure \ |
182 | %{?with_pri:--with-pri} \ | |
183 | --enable-shared | |
9a1e9700 | 184 | |
40b8f1d3 | 185 | %if %{with userspace} |
dbfa6bb9 | 186 | %{__make} \ |
dbfa6bb9 | 187 | VPATH=%{_libdir} |
9a1e9700 | 188 | %endif |
a9ca2497 | 189 | |
8fd9c3e5 | 190 | %{?with_kernel:%{expand:%build_kernel_packages}} |
40b8f1d3 | 191 | |
a9ca2497 JB |
192 | %install |
193 | rm -rf $RPM_BUILD_ROOT | |
194 | ||
40b8f1d3 | 195 | %if %{with kernel} |
9a1e9700 JR |
196 | install -d $RPM_BUILD_ROOT/etc/modprobe.d |
197 | install src/libvpb/blunt-axe.conf $RPM_BUILD_ROOT/etc/modprobe.d | |
198 | ||
40b8f1d3 JR |
199 | cp -a installed/* $RPM_BUILD_ROOT |
200 | %endif | |
9a1e9700 | 201 | |
40b8f1d3 | 202 | %if %{with userspace} |
a9ca2497 | 203 | %{__make} install \ |
40b8f1d3 | 204 | DESTDIR=$RPM_BUILD_ROOT |
a9ca2497 | 205 | |
a9ca2497 JB |
206 | # let rpm generate dependencies |
207 | chmod 755 $RPM_BUILD_ROOT%{_libdir}/lib*.so* | |
208 | ||
209 | # install man pages only for packaged software | |
210 | install -d $RPM_BUILD_ROOT%{_mandir}/man1 | |
211 | install doc/vpbconf.1 $RPM_BUILD_ROOT%{_mandir}/man1 | |
212 | install doc/vpbscan.1 $RPM_BUILD_ROOT%{_mandir}/man1 | |
213 | ||
214 | %if %{with static_libs} | |
215 | install build-static/src/{libtoneg/libtoneg.a,libvpb/libvpb.a} $RPM_BUILD_ROOT%{_libdir} | |
216 | %endif | |
217 | %endif | |
218 | ||
219 | %clean | |
220 | rm -rf $RPM_BUILD_ROOT | |
221 | ||
222 | %post -n vpb-libs -p /sbin/ldconfig | |
223 | %postun -n vpb-libs -p /sbin/ldconfig | |
224 | ||
a9ca2497 JB |
225 | %if %{with userspace} |
226 | %files | |
227 | %defattr(644,root,root,755) | |
228 | %doc COPYING README README.{OpenPCI,OpenPRI,OpenSwitch12,VTCore,VpbConfig} | |
229 | %attr(755,root,root) %{_sbindir}/vpbconf | |
230 | %attr(755,root,root) %{_sbindir}/vpbscan | |
231 | %{_datadir}/vpb-driver | |
232 | %{_mandir}/man1/vpbconf.1* | |
233 | %{_mandir}/man1/vpbscan.1* | |
234 | ||
235 | %files -n vpb-libs | |
236 | %defattr(644,root,root,755) | |
237 | %attr(755,root,root) %{_libdir}/libtoneg.so.*.*.* | |
238 | %attr(755,root,root) %ghost %{_libdir}/libtoneg.so.0 | |
239 | %attr(755,root,root) %{_libdir}/libvpb.so.*.*.* | |
240 | %attr(755,root,root) %ghost %{_libdir}/libvpb.so.0 | |
241 | ||
242 | %files -n vpb-devel | |
243 | %defattr(644,root,root,755) | |
244 | %attr(755,root,root) %{_libdir}/libtoneg.so | |
245 | %attr(755,root,root) %{_libdir}/libvpb.so | |
246 | %{_includedir}/vt | |
247 | %{_includedir}/vpbapi.h | |
248 | %{_includedir}/vt_deprecated.h | |
249 | %{_includedir}/vtcore_ioctl.h | |
250 | ||
251 | %if %{with static_libs} | |
252 | %files -n vpb-static | |
253 | %defattr(644,root,root,755) | |
254 | %{_libdir}/libtoneg.a | |
255 | %{_libdir}/libvpb.a | |
256 | %endif | |
257 | %endif |