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