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)
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}
17 %if %{without userspace}
18 # nothing to be placed to debuginfo package
19 %define _enable_debug_packages 0
22 %define _duplicate_files_terminate_build 0
25 %define pname vpb-driver
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
28 Name: %{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel}
30 Release: %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}}
31 License: LGPL v2.1+ (libraries), GPL v2+ (libpri library, kernel module)
33 Source0: http://www.voicetronix.com.au/Downloads/vpb-driver-4.x/%{pname}-%{version}.tar.gz
34 # Source0-md5: f8c85b52e8d01b04d86632e98ac59d19
35 Patch0: %{pname}-make.patch
36 URL: http://www.voicetronix.com.au/downloads.htm#linux
37 BuildRequires: rpmbuild(macros) >= 1.701
38 %{?with_kernel:%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}}
39 BuildRequires: autoconf >= 2.59
40 BuildRequires: libstdc++-devel
41 BuildRequires: pciutils-devel
42 BuildRequires: sed >= 4.0
43 BuildRequires: zlib-devel
44 Requires: vpb-libs = %{version}-%{rel}
45 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
48 This is the Voicetronix voice processing board (VPB) driver software.
50 %description -l pl.UTF-8
51 Ten pakiet zawiera oprogramowanie sterowników kart przetwarzających
52 głos (VPB - voice processing board) firmy Voicetronix.
55 Summary: Shared VPD libraries
56 Summary(pl.UTF-8): Biblioteki współdzielone VPD
60 %description -n vpb-libs
63 %description -n vpb-libs -l pl.UTF-8
64 Biblioteki współdzielone VPD.
67 Summary: Header files for VPD libraries
68 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek VPD
70 Group: Development/Libraries
71 Requires: vpb-libs = %{version}-%{rel}
73 %description -n vpb-devel
74 Header files for VPD libraries.
76 %description -n vpb-devel -l pl.UTF-8
77 Pliki nagłówkowe bibliotek VPD.
79 %package -n vpb-static
80 Summary: Static VPD libraries
81 Summary(pl.UTF-8): Statyczne biblioteki VPD
83 Group: Development/Libraries
84 Requires: vpb-devel = %{version}-%{rel}
86 %description -n vpb-static
89 %description -n vpb-static -l pl.UTF-8
90 Statyczne biblioteki VPD.
93 %package -n kernel%{_alt_kernel}-telephony-vpb\
94 Summary: Linux kernel driver for Voicetronix Voice Processing Board (VPB)\
95 Summary(pl.UTF-8): Sterownik jądra Linuksa do kart VPB firmy Voicetronix\
96 Release: %{rel}@%{_kernel_ver_str}\
99 Requires(post,postun): /sbin/depmod\
100 %requires_releq_kernel\
101 Requires(postun): %releq_kernel\
103 %description -n kernel%{_alt_kernel}-telephony-vpb\
104 Linux kernel driver for Voicetronix Voice Processing Board (VPB).\
106 %description -n kernel%{_alt_kernel}-telephony-vpb -l pl.UTF-8\
107 Sterownik jądra Linuksa do kart VPB firmy Voicetronix.\
109 %files -n kernel%{_alt_kernel}-telephony-vpb\
110 %defattr(644,root,root,755)\
111 %dir /lib/modules/%{_kernel_ver}/kernel/drivers/telephony\
112 /lib/modules/%{_kernel_ver}/kernel/drivers/telephony/vpb.ko*\
113 /lib/modules/%{_kernel_ver}/kernel/drivers/telephony/vtcore.ko*\
114 /lib/modules/%{_kernel_ver}/kernel/drivers/telephony/vtopenpci.ko*\
115 /lib/modules/%{_kernel_ver}/kernel/drivers/telephony/vtopenswitch.ko*\
116 %config(noreplace) %verify(not md5 mtime size) /etc/modprobe.d/blunt-axe.conf\
118 %post -n kernel%{_alt_kernel}-telephony-vpb\
119 %depmod %{_kernel_ver}\
121 %postun -n kernel%{_alt_kernel}-telephony-vpb\
122 %depmod %{_kernel_ver}\
125 %define build_kernel_pkg()\
126 %{__make} -C src/vtcore KSRC=%{_kernelsrcdir} \
127 %{__make} -C src/vpb KSRC=%{_kernelsrcdir} \
129 %{__make} -C src/vtcore install \\\
130 DESTDIR=$p/installed \\\
131 KSRC=%{_kernelsrcdir}\
132 %{__make} -C src/vpb install \\\
133 DESTDIR=$p/installed \\\
134 KSRC=%{_kernelsrcdir}\
137 %{?with_kernel:%{expand:%create_kernel_packages}}
140 %setup -q -n %{pname}-%{version}
143 %if %{without kernel}
144 %{__sed} -i -e 's,subdirs += $(srcdir)/vtcore $(srcdir)/vpb,,' src/Makefile.in
146 %if %{without userspace}
147 %{__sed} -i -e 's,subdirs = libtoneg libvpb utils,,' src/Makefile.in
153 %if %{with userspace} && %{with static_libs}
154 install -d build-static
157 %{?with_pri:--with-pri}
158 %{__make} -C src/libtoneg \
160 %{__make} -C src/libvpb \
166 %{?with_pri:--with-pri} \
169 %if %{with userspace}
174 %{?with_kernel:%{expand:%build_kernel_packages}}
177 rm -rf $RPM_BUILD_ROOT
180 install -d $RPM_BUILD_ROOT/etc/modprobe.d
181 install src/libvpb/blunt-axe.conf $RPM_BUILD_ROOT/etc/modprobe.d
183 cp -a installed/* $RPM_BUILD_ROOT
186 %if %{with userspace}
188 DESTDIR=$RPM_BUILD_ROOT
190 # let rpm generate dependencies
191 chmod 755 $RPM_BUILD_ROOT%{_libdir}/lib*.so*
193 # install man pages only for packaged software
194 install -d $RPM_BUILD_ROOT%{_mandir}/man1
195 install doc/vpbconf.1 $RPM_BUILD_ROOT%{_mandir}/man1
196 install doc/vpbscan.1 $RPM_BUILD_ROOT%{_mandir}/man1
198 %if %{with static_libs}
199 install build-static/src/{libtoneg/libtoneg.a,libvpb/libvpb.a} $RPM_BUILD_ROOT%{_libdir}
204 rm -rf $RPM_BUILD_ROOT
206 %post -n vpb-libs -p /sbin/ldconfig
207 %postun -n vpb-libs -p /sbin/ldconfig
209 %if %{with userspace}
211 %defattr(644,root,root,755)
212 %doc COPYING README README.{OpenPCI,OpenPRI,OpenSwitch12,VTCore,VpbConfig}
213 %attr(755,root,root) %{_sbindir}/vpbconf
214 %attr(755,root,root) %{_sbindir}/vpbscan
215 %{_datadir}/vpb-driver
216 %{_mandir}/man1/vpbconf.1*
217 %{_mandir}/man1/vpbscan.1*
220 %defattr(644,root,root,755)
221 %attr(755,root,root) %{_libdir}/libtoneg.so.*.*.*
222 %attr(755,root,root) %ghost %{_libdir}/libtoneg.so.0
223 %attr(755,root,root) %{_libdir}/libvpb.so.*.*.*
224 %attr(755,root,root) %ghost %{_libdir}/libvpb.so.0
227 %defattr(644,root,root,755)
228 %attr(755,root,root) %{_libdir}/libtoneg.so
229 %attr(755,root,root) %{_libdir}/libvpb.so
231 %{_includedir}/vpbapi.h
232 %{_includedir}/vt_deprecated.h
233 %{_includedir}/vtcore_ioctl.h
235 %if %{with static_libs}
237 %defattr(644,root,root,755)
238 %{_libdir}/libtoneg.a