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: d014a29043334923e0976a9273627b63
27 Patch0: %{pname}-make.patch
28 Patch1: %{pname}-kernel.patch
29 URL: http://www.voicetronix.com.au/downloads.htm#linux
30 %if %{with dist_kernel}
31 BuildRequires: kernel%{_alt_kernel}-module-build
33 BuildRequires: autoconf >= 2.59
34 BuildRequires: libstdc++-devel
35 BuildRequires: pciutils-devel
36 BuildRequires: rpmbuild(macros) >= 1.379
37 BuildRequires: sed >= 4.0
38 BuildRequires: zlib-devel
39 Requires: vpb-libs = %{version}-%{rel}
40 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43 This is the Voicetronix voice processing board (VPB) driver software.
45 %description -l pl.UTF-8
46 Ten pakiet zawiera oprogramowanie sterowników kart przetwarzających
47 głos (VPB - voice processing board) firmy Voicetronix.
50 Summary: Shared VPD libraries
51 Summary(pl.UTF-8): Biblioteki współdzielone VPD
55 %description -n vpb-libs
58 %description -n vpb-libs -l pl.UTF-8
59 Biblioteki współdzielone VPD.
62 Summary: Header files for VPD libraries
63 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek VPD
65 Group: Development/Libraries
66 Requires: vpb-libs = %{version}-%{rel}
68 %description -n vpb-devel
69 Header files for VPD libraries.
71 %description -n vpb-devel -l pl.UTF-8
72 Pliki nagłówkowe bibliotek VPD.
74 %package -n vpb-static
75 Summary: Static VPD libraries
76 Summary(pl.UTF-8): Statyczne biblioteki VPD
78 Group: Development/Libraries
79 Requires: vpb-devel = %{version}-%{rel}
81 %description -n vpb-static
84 %description -n vpb-static -l pl.UTF-8
85 Statyczne biblioteki VPD.
87 %package -n kernel%{_alt_kernel}-telephony-vpb
88 Summary: Linux kernel driver for Voicetronix Voice Processing Board (VPB)
89 Summary(pl.UTF-8): Sterownik jądra Linuksa do kart VPB firmy Voicetronix
90 Release: %{rel}@%{_kernel_ver_str}
93 Requires(post,postun): /sbin/depmod
94 %if %{with dist_kernel}
95 %requires_releq_kernel
96 Requires(postun): %releq_kernel
99 %description -n kernel%{_alt_kernel}-telephony-vpb
100 Linux kernel driver for Voicetronix Voice Processing Board (VPB).
102 %description -n kernel%{_alt_kernel}-telephony-vpb -l pl.UTF-8
103 Sterownik jądra Linuksa do kart VPB firmy Voicetronix.
106 %setup -q -n %{pname}-%{version}
110 %if %{without kernel}
111 %{__sed} -i -e 's,subdirs += $(srcdir)/vtcore $(srcdir)/vpb,,' src/Makefile.in
113 %if %{without userspace}
114 %{__sed} -i -e 's,subdirs = libtoneg libvpb utils,,' src/Makefile.in
120 %if %{with userspace} && %{with static_libs}
121 install -d build-static
124 %{?with_pri:--with-pri}
125 %{__make} -C src/libtoneg \
127 %{__make} -C src/libvpb \
132 %{?with_pri:--with-pri} \
135 %if %{without userspace}
137 %{?with_kernel:KSRC=%{_kernelsrcdir}} \
141 %{?with_kernel:KSRC=%{_kernelsrcdir}} \
146 rm -rf $RPM_BUILD_ROOT
148 %if %{without userspace}
149 %{__make} -C src install \
150 DESTDIR=$RPM_BUILD_ROOT \
151 %{?with_kernel:KSRC=%{_kernelsrcdir}}
153 install -d $RPM_BUILD_ROOT/etc/modprobe.d
154 install src/libvpb/blunt-axe.conf $RPM_BUILD_ROOT/etc/modprobe.d
159 DESTDIR=$RPM_BUILD_ROOT \
160 %{?with_kernel:KSRC=%{_kernelsrcdir}}
162 # let rpm generate dependencies
163 chmod 755 $RPM_BUILD_ROOT%{_libdir}/lib*.so*
165 # install man pages only for packaged software
166 install -d $RPM_BUILD_ROOT%{_mandir}/man1
167 install doc/vpbconf.1 $RPM_BUILD_ROOT%{_mandir}/man1
168 install doc/vpbscan.1 $RPM_BUILD_ROOT%{_mandir}/man1
170 %if %{with static_libs}
171 install build-static/src/{libtoneg/libtoneg.a,libvpb/libvpb.a} $RPM_BUILD_ROOT%{_libdir}
176 rm -rf $RPM_BUILD_ROOT
178 %post -n vpb-libs -p /sbin/ldconfig
179 %postun -n vpb-libs -p /sbin/ldconfig
181 %post -n kernel%{_alt_kernel}-telephony-vpb
182 %depmod %{_kernel_ver}
184 %postun -n kernel%{_alt_kernel}-telephony-vpb
185 %depmod %{_kernel_ver}
187 %if %{with userspace}
189 %defattr(644,root,root,755)
190 %doc COPYING README README.{OpenPCI,OpenPRI,OpenSwitch12,VTCore,VpbConfig}
191 %attr(755,root,root) %{_sbindir}/vpbconf
192 %attr(755,root,root) %{_sbindir}/vpbscan
193 %{_datadir}/vpb-driver
194 %{_mandir}/man1/vpbconf.1*
195 %{_mandir}/man1/vpbscan.1*
198 %defattr(644,root,root,755)
199 %attr(755,root,root) %{_libdir}/libtoneg.so.*.*.*
200 %attr(755,root,root) %ghost %{_libdir}/libtoneg.so.0
201 %attr(755,root,root) %{_libdir}/libvpb.so.*.*.*
202 %attr(755,root,root) %ghost %{_libdir}/libvpb.so.0
205 %defattr(644,root,root,755)
206 %attr(755,root,root) %{_libdir}/libtoneg.so
207 %attr(755,root,root) %{_libdir}/libvpb.so
209 %{_includedir}/vpbapi.h
210 %{_includedir}/vt_deprecated.h
211 %{_includedir}/vtcore_ioctl.h
213 %if %{with static_libs}
215 %defattr(644,root,root,755)
216 %{_libdir}/libtoneg.a
222 %files -n kernel%{_alt_kernel}-telephony-vpb
223 %defattr(644,root,root,755)
224 %dir /lib/modules/%{_kernel_ver}/kernel/drivers/telephony
225 /lib/modules/%{_kernel_ver}/kernel/drivers/telephony/vpb.ko*
226 /lib/modules/%{_kernel_ver}/kernel/drivers/telephony/vtcore.ko*
227 /lib/modules/%{_kernel_ver}/kernel/drivers/telephony/vtopenpci.ko*
228 /lib/modules/%{_kernel_ver}/kernel/drivers/telephony/vtopenswitch.ko*
229 %config(noreplace) %verify(not md5 mtime size) /etc/modprobe.d/blunt-axe.conf