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: 35d0ea8ab7a6bda267603ca7c9b78671
27 Patch0: %{pname}-make.patch
28 URL: http://www.voicetronix.com.au/downloads.htm#linux
29 %if %{with dist_kernel}
30 BuildRequires: kernel%{_alt_kernel}-module-build
32 BuildRequires: autoconf >= 2.59
33 BuildRequires: libstdc++-devel
34 BuildRequires: pciutils-devel
35 BuildRequires: rpmbuild(macros) >= 1.379
36 BuildRequires: sed >= 4.0
37 BuildRequires: zlib-devel
38 Requires: vpb-libs = %{version}-%{rel}
39 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
42 This is the Voicetronix voice processing board (VPB) driver software.
44 %description -l pl.UTF-8
45 Ten pakiet zawiera oprogramowanie sterowników kart przetwarzających
46 głos (VPB - voice processing board) firmy Voicetronix.
49 Summary: Shared VPD libraries
50 Summary(pl.UTF-8): Biblioteki współdzielone VPD
54 %description -n vpb-libs
57 %description -n vpb-libs -l pl.UTF-8
58 Biblioteki współdzielone VPD.
61 Summary: Header files for VPD libraries
62 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek VPD
64 Group: Development/Libraries
65 Requires: vpb-libs = %{version}-%{rel}
67 %description -n vpb-devel
68 Header files for VPD libraries.
70 %description -n vpb-devel -l pl.UTF-8
71 Pliki nagłówkowe bibliotek VPD.
73 %package -n vpb-static
74 Summary: Static VPD libraries
75 Summary(pl.UTF-8): Statyczne biblioteki VPD
77 Group: Development/Libraries
78 Requires: vpb-devel = %{version}-%{rel}
80 %description -n vpb-static
83 %description -n vpb-static -l pl.UTF-8
84 Statyczne biblioteki VPD.
86 %package -n kernel%{_alt_kernel}-telephony-vpb
87 Summary: Linux kernel driver for Voicetronix Voice Processing Board (VPB)
88 Summary(pl.UTF-8): Sterownik jądra Linuksa do kart VPB firmy Voicetronix
89 Release: %{rel}@%{_kernel_ver_str}
92 Requires(post,postun): /sbin/depmod
93 %if %{with dist_kernel}
94 %requires_releq_kernel
95 Requires(postun): %releq_kernel
98 %description -n kernel%{_alt_kernel}-telephony-vpb
99 Linux kernel driver for Voicetronix Voice Processing Board (VPB).
101 %description -n kernel%{_alt_kernel}-telephony-vpb -l pl.UTF-8
102 Sterownik jądra Linuksa do kart VPB firmy Voicetronix.
105 %setup -q -n %{pname}-%{version}
108 %if %{without kernel}
109 %{__sed} -i -e 's,subdirs += $(srcdir)/vtcore $(srcdir)/vpb,,' src/Makefile.in
111 %if %{without userspace}
112 %{__sed} -i -e 's,subdirs = libtoneg libvpb utils,,' src/Makefile.in
118 %if %{with userspace} && %{with static_libs}
119 install -d build-static
122 %{?with_pri:--with-pri}
123 %{__make} -C src/libtoneg \
125 %{__make} -C src/libvpb \
130 %{?with_pri:--with-pri} \
133 %if %{without userspace}
135 %{?with_kernel:KSRC=%{_kernelsrcdir}} \
139 %{?with_kernel:KSRC=%{_kernelsrcdir}} \
144 rm -rf $RPM_BUILD_ROOT
146 %if %{without userspace}
147 %{__make} -C src install \
148 DESTDIR=$RPM_BUILD_ROOT \
149 %{?with_kernel:KSRC=%{_kernelsrcdir}}
151 install -d $RPM_BUILD_ROOT/etc/modprobe.d
152 install src/libvpb/blunt-axe.conf $RPM_BUILD_ROOT/etc/modprobe.d
157 DESTDIR=$RPM_BUILD_ROOT \
158 %{?with_kernel:KSRC=%{_kernelsrcdir}}
160 # let rpm generate dependencies
161 chmod 755 $RPM_BUILD_ROOT%{_libdir}/lib*.so*
163 # install man pages only for packaged software
164 install -d $RPM_BUILD_ROOT%{_mandir}/man1
165 install doc/vpbconf.1 $RPM_BUILD_ROOT%{_mandir}/man1
166 install doc/vpbscan.1 $RPM_BUILD_ROOT%{_mandir}/man1
168 %if %{with static_libs}
169 install build-static/src/{libtoneg/libtoneg.a,libvpb/libvpb.a} $RPM_BUILD_ROOT%{_libdir}
174 rm -rf $RPM_BUILD_ROOT
176 %post -n vpb-libs -p /sbin/ldconfig
177 %postun -n vpb-libs -p /sbin/ldconfig
179 %post -n kernel%{_alt_kernel}-telephony-vpb
180 %depmod %{_kernel_ver}
182 %postun -n kernel%{_alt_kernel}-telephony-vpb
183 %depmod %{_kernel_ver}
185 %if %{with userspace}
187 %defattr(644,root,root,755)
188 %doc COPYING README README.{OpenPCI,OpenPRI,OpenSwitch12,VTCore,VpbConfig}
189 %attr(755,root,root) %{_sbindir}/vpbconf
190 %attr(755,root,root) %{_sbindir}/vpbscan
191 %{_datadir}/vpb-driver
192 %{_mandir}/man1/vpbconf.1*
193 %{_mandir}/man1/vpbscan.1*
196 %defattr(644,root,root,755)
197 %attr(755,root,root) %{_libdir}/libtoneg.so.*.*.*
198 %attr(755,root,root) %ghost %{_libdir}/libtoneg.so.0
199 %attr(755,root,root) %{_libdir}/libvpb.so.*.*.*
200 %attr(755,root,root) %ghost %{_libdir}/libvpb.so.0
203 %defattr(644,root,root,755)
204 %attr(755,root,root) %{_libdir}/libtoneg.so
205 %attr(755,root,root) %{_libdir}/libvpb.so
207 %{_includedir}/vpbapi.h
208 %{_includedir}/vt_deprecated.h
209 %{_includedir}/vtcore_ioctl.h
211 %if %{with static_libs}
213 %defattr(644,root,root,755)
214 %{_libdir}/libtoneg.a
220 %files -n kernel%{_alt_kernel}-telephony-vpb
221 %defattr(644,root,root,755)
222 %dir /lib/modules/%{_kernel_ver}/kernel/drivers/telephony
223 /lib/modules/%{_kernel_ver}/kernel/drivers/telephony/vpb.ko*
224 /lib/modules/%{_kernel_ver}/kernel/drivers/telephony/vtcore.ko*
225 /lib/modules/%{_kernel_ver}/kernel/drivers/telephony/vtopenpci.ko*
226 /lib/modules/%{_kernel_ver}/kernel/drivers/telephony/vtopenswitch.ko*
227 %config(noreplace) %verify(not md5 mtime size) /etc/modprobe.d/blunt-axe.conf