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