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