3 %bcond_without dist_kernel # without distribution kernel
4 %bcond_without kernel # don't build kernel modules
5 %bcond_without userspace # don't build userspace package
6 %bcond_without static_libs # don't build static libraries
7 %bcond_with pri # ISDN devices support (modified libpri)
9 %if "%{_alt_kernel}" != "%{nil}"
10 %undefine with_userspace
13 %undefine with_dist_kernel
17 %define pname vpb-driver
18 Summary: Voicetronix voice processing board (VPB) driver software
19 Summary(pl.UTF-8): Oprogramowanie sterowników dla kart przetwarzających głos (VPB) Voicetronix
20 Name: %{pname}%{_alt_kernel}
23 License: LGPL v2.1+ (libraries), GPL v2+ (libpri library, kernel module)
25 Source0: http://www.voicetronix.com.au/Downloads/vpb-driver-4.x/%{pname}-%{version}.tar.gz
26 # Source0-md5: aa7442b5b98a566fe67544115d83e20a
27 Patch0: %{pname}-make.patch
28 Patch1: %{pname}-kernel.patch
29 Patch2: linux-3.8.patch
30 URL: http://www.voicetronix.com.au/downloads.htm#linux
31 %if %{with dist_kernel}
32 BuildRequires: kernel%{_alt_kernel}-module-build
34 BuildRequires: autoconf >= 2.59
35 BuildRequires: libstdc++-devel
36 BuildRequires: pciutils-devel
37 BuildRequires: rpmbuild(macros) >= 1.379
38 BuildRequires: sed >= 4.0
39 BuildRequires: zlib-devel
40 Requires: vpb-libs = %{version}-%{rel}
41 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
44 This is the Voicetronix voice processing board (VPB) driver software.
46 %description -l pl.UTF-8
47 Ten pakiet zawiera oprogramowanie sterowników kart przetwarzających
48 głos (VPB - voice processing board) firmy Voicetronix.
51 Summary: Shared VPD libraries
52 Summary(pl.UTF-8): Biblioteki współdzielone VPD
56 %description -n vpb-libs
59 %description -n vpb-libs -l pl.UTF-8
60 Biblioteki współdzielone VPD.
63 Summary: Header files for VPD libraries
64 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek VPD
66 Group: Development/Libraries
67 Requires: vpb-libs = %{version}-%{rel}
69 %description -n vpb-devel
70 Header files for VPD libraries.
72 %description -n vpb-devel -l pl.UTF-8
73 Pliki nagłówkowe bibliotek VPD.
75 %package -n vpb-static
76 Summary: Static VPD libraries
77 Summary(pl.UTF-8): Statyczne biblioteki VPD
79 Group: Development/Libraries
80 Requires: vpb-devel = %{version}-%{rel}
82 %description -n vpb-static
85 %description -n vpb-static -l pl.UTF-8
86 Statyczne biblioteki VPD.
88 %package -n kernel%{_alt_kernel}-telephony-vpb
89 Summary: Linux kernel driver for Voicetronix Voice Processing Board (VPB)
90 Summary(pl.UTF-8): Sterownik jądra Linuksa do kart VPB firmy Voicetronix
91 Release: %{rel}@%{_kernel_ver_str}
94 Requires(post,postun): /sbin/depmod
95 %if %{with dist_kernel}
96 %requires_releq_kernel
97 Requires(postun): %releq_kernel
100 %description -n kernel%{_alt_kernel}-telephony-vpb
101 Linux kernel driver for Voicetronix Voice Processing Board (VPB).
103 %description -n kernel%{_alt_kernel}-telephony-vpb -l pl.UTF-8
104 Sterownik jądra Linuksa do kart VPB firmy Voicetronix.
107 %setup -q -n %{pname}-%{version}
110 %if "%{_alt_kernel}" == "%{nil}"
114 %if %{without kernel}
115 %{__sed} -i -e 's,subdirs += $(srcdir)/vtcore $(srcdir)/vpb,,' src/Makefile.in
117 %if %{without userspace}
118 %{__sed} -i -e 's,subdirs = libtoneg libvpb utils,,' src/Makefile.in
124 %if %{with userspace} && %{with static_libs}
125 install -d build-static
128 %{?with_pri:--with-pri}
129 %{__make} -C src/libtoneg \
131 %{__make} -C src/libvpb \
136 %{?with_pri:--with-pri} \
139 %if %{without userspace}
141 %{?with_kernel:KSRC=%{_kernelsrcdir}} \
145 %{?with_kernel:KSRC=%{_kernelsrcdir}} \
150 rm -rf $RPM_BUILD_ROOT
152 %if %{without userspace}
153 %{__make} -C src install \
154 DESTDIR=$RPM_BUILD_ROOT \
155 %{?with_kernel:KSRC=%{_kernelsrcdir}}
157 install -d $RPM_BUILD_ROOT/etc/modprobe.d
158 install src/libvpb/blunt-axe.conf $RPM_BUILD_ROOT/etc/modprobe.d
163 DESTDIR=$RPM_BUILD_ROOT \
164 %{?with_kernel:KSRC=%{_kernelsrcdir}}
166 # let rpm generate dependencies
167 chmod 755 $RPM_BUILD_ROOT%{_libdir}/lib*.so*
169 # install man pages only for packaged software
170 install -d $RPM_BUILD_ROOT%{_mandir}/man1
171 install doc/vpbconf.1 $RPM_BUILD_ROOT%{_mandir}/man1
172 install doc/vpbscan.1 $RPM_BUILD_ROOT%{_mandir}/man1
174 %if %{with static_libs}
175 install build-static/src/{libtoneg/libtoneg.a,libvpb/libvpb.a} $RPM_BUILD_ROOT%{_libdir}
180 rm -rf $RPM_BUILD_ROOT
182 %post -n vpb-libs -p /sbin/ldconfig
183 %postun -n vpb-libs -p /sbin/ldconfig
185 %post -n kernel%{_alt_kernel}-telephony-vpb
186 %depmod %{_kernel_ver}
188 %postun -n kernel%{_alt_kernel}-telephony-vpb
189 %depmod %{_kernel_ver}
191 %if %{with userspace}
193 %defattr(644,root,root,755)
194 %doc COPYING README README.{OpenPCI,OpenPRI,OpenSwitch12,VTCore,VpbConfig}
195 %attr(755,root,root) %{_sbindir}/vpbconf
196 %attr(755,root,root) %{_sbindir}/vpbscan
197 %{_datadir}/vpb-driver
198 %{_mandir}/man1/vpbconf.1*
199 %{_mandir}/man1/vpbscan.1*
202 %defattr(644,root,root,755)
203 %attr(755,root,root) %{_libdir}/libtoneg.so.*.*.*
204 %attr(755,root,root) %ghost %{_libdir}/libtoneg.so.0
205 %attr(755,root,root) %{_libdir}/libvpb.so.*.*.*
206 %attr(755,root,root) %ghost %{_libdir}/libvpb.so.0
209 %defattr(644,root,root,755)
210 %attr(755,root,root) %{_libdir}/libtoneg.so
211 %attr(755,root,root) %{_libdir}/libvpb.so
213 %{_includedir}/vpbapi.h
214 %{_includedir}/vt_deprecated.h
215 %{_includedir}/vtcore_ioctl.h
217 %if %{with static_libs}
219 %defattr(644,root,root,755)
220 %{_libdir}/libtoneg.a
226 %files -n kernel%{_alt_kernel}-telephony-vpb
227 %defattr(644,root,root,755)
228 %dir /lib/modules/%{_kernel_ver}/kernel/drivers/telephony
229 /lib/modules/%{_kernel_ver}/kernel/drivers/telephony/vpb.ko*
230 /lib/modules/%{_kernel_ver}/kernel/drivers/telephony/vtcore.ko*
231 /lib/modules/%{_kernel_ver}/kernel/drivers/telephony/vtopenpci.ko*
232 /lib/modules/%{_kernel_ver}/kernel/drivers/telephony/vtopenswitch.ko*
233 %config(noreplace) %verify(not md5 mtime size) /etc/modprobe.d/blunt-axe.conf