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