]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
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) | |
8 | # | |
9 | %if "%{_alt_kernel}" != "%{nil}" | |
10 | %undefine with_userspace | |
11 | %endif | |
12 | %if %{without kernel} | |
13 | %undefine with_dist_kernel | |
14 | %endif | |
15 | ||
16 | %define rel 1 | |
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} | |
21 | Version: 4.2.57 | |
22 | Release: %{rel} | |
23 | License: LGPL v2.1+ (libraries), GPL v2+ (libpri library, kernel module) | |
24 | Group: Libraries | |
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 | |
31 | %endif | |
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) | |
40 | ||
41 | %description | |
42 | This is the Voicetronix voice processing board (VPB) driver software. | |
43 | ||
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. | |
47 | ||
48 | %package -n vpb-libs | |
49 | Summary: Shared VPD libraries | |
50 | Summary(pl.UTF-8): Biblioteki współdzielone VPD | |
51 | License: LGPL v2.1+ | |
52 | Group: Libraries | |
53 | ||
54 | %description -n vpb-libs | |
55 | Shared VPD libraries. | |
56 | ||
57 | %description -n vpb-libs -l pl.UTF-8 | |
58 | Biblioteki współdzielone VPD. | |
59 | ||
60 | %package -n vpb-devel | |
61 | Summary: Header files for VPD libraries | |
62 | Summary(pl.UTF-8): Pliki nagłówkowe bibliotek VPD | |
63 | License: LGPL v2.1+ | |
64 | Group: Development/Libraries | |
65 | Requires: vpb-libs = %{version}-%{rel} | |
66 | ||
67 | %description -n vpb-devel | |
68 | Header files for VPD libraries. | |
69 | ||
70 | %description -n vpb-devel -l pl.UTF-8 | |
71 | Pliki nagłówkowe bibliotek VPD. | |
72 | ||
73 | %package -n vpb-static | |
74 | Summary: Static VPD libraries | |
75 | Summary(pl.UTF-8): Statyczne biblioteki VPD | |
76 | License: LGPL v2.1+ | |
77 | Group: Development/Libraries | |
78 | Requires: vpb-devel = %{version}-%{rel} | |
79 | ||
80 | %description -n vpb-static | |
81 | Static VPD libraries. | |
82 | ||
83 | %description -n vpb-static -l pl.UTF-8 | |
84 | Statyczne biblioteki VPD. | |
85 | ||
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} | |
90 | License: GPL v2+ | |
91 | Group: Base/Kernel | |
92 | Requires(post,postun): /sbin/depmod | |
93 | %if %{with dist_kernel} | |
94 | %requires_releq_kernel | |
95 | Requires(postun): %releq_kernel | |
96 | %endif | |
97 | ||
98 | %description -n kernel%{_alt_kernel}-telephony-vpb | |
99 | Linux kernel driver for Voicetronix Voice Processing Board (VPB). | |
100 | ||
101 | %description -n kernel%{_alt_kernel}-telephony-vpb -l pl.UTF-8 | |
102 | Sterownik jądra Linuksa do kart VPB firmy Voicetronix. | |
103 | ||
104 | %prep | |
105 | %setup -q -n %{pname}-%{version} | |
106 | %patch0 -p1 | |
107 | ||
108 | %if %{without kernel} | |
109 | %{__sed} -i -e 's,subdirs += $(srcdir)/vtcore $(srcdir)/vpb,,' src/Makefile.in | |
110 | %endif | |
111 | %if %{without userspace} | |
112 | %{__sed} -i -e 's,subdirs = libtoneg libvpb utils,,' src/Makefile.in | |
113 | %endif | |
114 | ||
115 | %build | |
116 | %{__aclocal} | |
117 | %{__autoconf} | |
118 | %if %{with userspace} && %{with static_libs} | |
119 | install -d build-static | |
120 | cd build-static | |
121 | ../%configure \ | |
122 | %{?with_pri:--with-pri} | |
123 | %{__make} -C src/libtoneg \ | |
124 | VPATH=%{_libdir} | |
125 | %{__make} -C src/libvpb \ | |
126 | VPATH=%{_libdir} | |
127 | cd .. | |
128 | %endif | |
129 | %configure \ | |
130 | %{?with_pri:--with-pri} \ | |
131 | --enable-shared | |
132 | ||
133 | %if %{without userspace} | |
134 | %{__make} -C src \ | |
135 | %{?with_kernel:KSRC=%{_kernelsrcdir}} \ | |
136 | VPATH=%{_libdir} | |
137 | %else | |
138 | %{__make} \ | |
139 | %{?with_kernel:KSRC=%{_kernelsrcdir}} \ | |
140 | VPATH=%{_libdir} | |
141 | %endif | |
142 | ||
143 | %install | |
144 | rm -rf $RPM_BUILD_ROOT | |
145 | ||
146 | %if %{without userspace} | |
147 | %{__make} -C src install \ | |
148 | DESTDIR=$RPM_BUILD_ROOT \ | |
149 | %{?with_kernel:KSRC=%{_kernelsrcdir}} | |
150 | ||
151 | install -d $RPM_BUILD_ROOT/etc/modprobe.d | |
152 | install src/libvpb/blunt-axe.conf $RPM_BUILD_ROOT/etc/modprobe.d | |
153 | ||
154 | %else | |
155 | ||
156 | %{__make} install \ | |
157 | DESTDIR=$RPM_BUILD_ROOT \ | |
158 | %{?with_kernel:KSRC=%{_kernelsrcdir}} | |
159 | ||
160 | # let rpm generate dependencies | |
161 | chmod 755 $RPM_BUILD_ROOT%{_libdir}/lib*.so* | |
162 | ||
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 | |
167 | ||
168 | %if %{with static_libs} | |
169 | install build-static/src/{libtoneg/libtoneg.a,libvpb/libvpb.a} $RPM_BUILD_ROOT%{_libdir} | |
170 | %endif | |
171 | %endif | |
172 | ||
173 | %clean | |
174 | rm -rf $RPM_BUILD_ROOT | |
175 | ||
176 | %post -n vpb-libs -p /sbin/ldconfig | |
177 | %postun -n vpb-libs -p /sbin/ldconfig | |
178 | ||
179 | %post -n kernel%{_alt_kernel}-telephony-vpb | |
180 | %depmod %{_kernel_ver} | |
181 | ||
182 | %postun -n kernel%{_alt_kernel}-telephony-vpb | |
183 | %depmod %{_kernel_ver} | |
184 | ||
185 | %if %{with userspace} | |
186 | %files | |
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* | |
194 | ||
195 | %files -n vpb-libs | |
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 | |
201 | ||
202 | %files -n vpb-devel | |
203 | %defattr(644,root,root,755) | |
204 | %attr(755,root,root) %{_libdir}/libtoneg.so | |
205 | %attr(755,root,root) %{_libdir}/libvpb.so | |
206 | %{_includedir}/vt | |
207 | %{_includedir}/vpbapi.h | |
208 | %{_includedir}/vt_deprecated.h | |
209 | %{_includedir}/vtcore_ioctl.h | |
210 | ||
211 | %if %{with static_libs} | |
212 | %files -n vpb-static | |
213 | %defattr(644,root,root,755) | |
214 | %{_libdir}/libtoneg.a | |
215 | %{_libdir}/libvpb.a | |
216 | %endif | |
217 | %endif | |
218 | ||
219 | %if %{with kernel} | |
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 | |
228 | %endif |