]>
Commit | Line | Data |
---|---|---|
a9ca2497 JB |
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 | |
faa79da0 JR |
15 | |
16 | %define rel 1 | |
17 | %define pname vpb-driver | |
a9ca2497 JB |
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 | |
faa79da0 | 20 | Name: %{pname}%{_alt_kernel} |
a9ca2497 | 21 | Version: 4.2.55 |
a9ca2497 JB |
22 | Release: %{rel} |
23 | License: LGPL v2.1+ (libraries), GPL v2+ (libpri library, kernel module) | |
24 | Group: Libraries | |
faa79da0 | 25 | Source0: http://www.voicetronix.com.au/Downloads/vpb-driver-4.x/%{pname}-%{version}.tar.gz |
a9ca2497 | 26 | # Source0-md5: d014a29043334923e0976a9273627b63 |
faa79da0 JR |
27 | Patch0: %{pname}-make.patch |
28 | Patch1: %{pname}-kernel.patch | |
a9ca2497 JB |
29 | URL: http://www.voicetronix.com.au/downloads.htm#linux |
30 | %if %{with dist_kernel} | |
31 | BuildRequires: kernel%{_alt_kernel}-module-build | |
32 | %endif | |
33 | BuildRequires: autoconf >= 2.59 | |
34 | BuildRequires: libstdc++-devel | |
35 | BuildRequires: pciutils-devel | |
36 | BuildRequires: rpmbuild(macros) >= 1.379 | |
dbfa6bb9 | 37 | BuildRequires: sed >= 4.0 |
a9ca2497 JB |
38 | BuildRequires: zlib-devel |
39 | Requires: vpb-libs = %{version}-%{rel} | |
40 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
41 | ||
42 | %description | |
43 | This is the Voicetronix voice processing board (VPB) driver software. | |
44 | ||
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. | |
48 | ||
49 | %package -n vpb-libs | |
50 | Summary: Shared VPD libraries | |
51 | Summary(pl.UTF-8): Biblioteki współdzielone VPD | |
52 | License: LGPL v2.1+ | |
53 | Group: Libraries | |
54 | ||
55 | %description -n vpb-libs | |
56 | Shared VPD libraries. | |
57 | ||
58 | %description -n vpb-libs -l pl.UTF-8 | |
59 | Biblioteki współdzielone VPD. | |
60 | ||
61 | %package -n vpb-devel | |
62 | Summary: Header files for VPD libraries | |
63 | Summary(pl.UTF-8): Pliki nagłówkowe bibliotek VPD | |
64 | License: LGPL v2.1+ | |
65 | Group: Development/Libraries | |
66 | Requires: vpb-libs = %{version}-%{rel} | |
67 | ||
68 | %description -n vpb-devel | |
69 | Header files for VPD libraries. | |
70 | ||
71 | %description -n vpb-devel -l pl.UTF-8 | |
72 | Pliki nagłówkowe bibliotek VPD. | |
73 | ||
74 | %package -n vpb-static | |
75 | Summary: Static VPD libraries | |
76 | Summary(pl.UTF-8): Statyczne biblioteki VPD | |
77 | License: LGPL v2.1+ | |
78 | Group: Development/Libraries | |
79 | Requires: vpb-devel = %{version}-%{rel} | |
80 | ||
81 | %description -n vpb-static | |
82 | Static VPD libraries. | |
83 | ||
84 | %description -n vpb-static -l pl.UTF-8 | |
85 | Statyczne biblioteki VPD. | |
86 | ||
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} | |
91 | License: GPL v2+ | |
92 | Group: Base/Kernel | |
93 | Requires(post,postun): /sbin/depmod | |
94 | %if %{with dist_kernel} | |
95 | %requires_releq_kernel | |
96 | Requires(postun): %releq_kernel | |
97 | %endif | |
98 | ||
99 | %description -n kernel%{_alt_kernel}-telephony-vpb | |
100 | Linux kernel driver for Voicetronix Voice Processing Board (VPB). | |
101 | ||
102 | %description -n kernel%{_alt_kernel}-telephony-vpb -l pl.UTF-8 | |
103 | Sterownik jądra Linuksa do kart VPB firmy Voicetronix. | |
104 | ||
105 | %prep | |
faa79da0 | 106 | %setup -q -n %{pname}-%{version} |
a9ca2497 | 107 | %patch0 -p1 |
dbfa6bb9 JB |
108 | %patch1 -p1 |
109 | ||
110 | %if %{without kernel} | |
111 | %{__sed} -i -e 's,subdirs += $(srcdir)/vtcore $(srcdir)/vpb,,' src/Makefile.in | |
112 | %endif | |
113 | %if %{without userspace} | |
114 | %{__sed} -i -e 's,subdirs = libtoneg libvpb utils,,' src/Makefile.in | |
115 | %endif | |
a9ca2497 JB |
116 | |
117 | %build | |
118 | %{__aclocal} | |
119 | %{__autoconf} | |
120 | %if %{with userspace} && %{with static_libs} | |
121 | install -d build-static | |
122 | cd build-static | |
123 | ../%configure \ | |
124 | %{?with_pri:--with-pri} | |
dbfa6bb9 JB |
125 | %{__make} -C src/libtoneg \ |
126 | VPATH=%{_libdir} | |
127 | %{__make} -C src/libvpb \ | |
128 | VPATH=%{_libdir} | |
a9ca2497 JB |
129 | cd .. |
130 | %endif | |
131 | %configure \ | |
132 | %{?with_pri:--with-pri} \ | |
133 | --enable-shared | |
dbfa6bb9 JB |
134 | %{__make} \ |
135 | %{?with_kernel:KSRC=%{_kernelsrcdir}} \ | |
136 | VPATH=%{_libdir} | |
a9ca2497 JB |
137 | |
138 | %install | |
139 | rm -rf $RPM_BUILD_ROOT | |
140 | ||
141 | %{__make} install \ | |
dbfa6bb9 JB |
142 | DESTDIR=$RPM_BUILD_ROOT \ |
143 | %{?with_kernel:KSRC=%{_kernelsrcdir}} | |
a9ca2497 JB |
144 | |
145 | %if %{with userspace} | |
146 | # let rpm generate dependencies | |
147 | chmod 755 $RPM_BUILD_ROOT%{_libdir}/lib*.so* | |
148 | ||
149 | # install man pages only for packaged software | |
150 | install -d $RPM_BUILD_ROOT%{_mandir}/man1 | |
151 | install doc/vpbconf.1 $RPM_BUILD_ROOT%{_mandir}/man1 | |
152 | install doc/vpbscan.1 $RPM_BUILD_ROOT%{_mandir}/man1 | |
153 | ||
154 | %if %{with static_libs} | |
155 | install build-static/src/{libtoneg/libtoneg.a,libvpb/libvpb.a} $RPM_BUILD_ROOT%{_libdir} | |
156 | %endif | |
157 | %endif | |
158 | ||
159 | %clean | |
160 | rm -rf $RPM_BUILD_ROOT | |
161 | ||
162 | %post -n vpb-libs -p /sbin/ldconfig | |
163 | %postun -n vpb-libs -p /sbin/ldconfig | |
164 | ||
165 | %post -n kernel%{_alt_kernel}-telephony-vpb | |
166 | %depmod %{_kernel_ver} | |
167 | ||
168 | %postun -n kernel%{_alt_kernel}-telephony-vpb | |
169 | %depmod %{_kernel_ver} | |
170 | ||
171 | %if %{with userspace} | |
172 | %files | |
173 | %defattr(644,root,root,755) | |
174 | %doc COPYING README README.{OpenPCI,OpenPRI,OpenSwitch12,VTCore,VpbConfig} | |
175 | %attr(755,root,root) %{_sbindir}/vpbconf | |
176 | %attr(755,root,root) %{_sbindir}/vpbscan | |
177 | %{_datadir}/vpb-driver | |
178 | %{_mandir}/man1/vpbconf.1* | |
179 | %{_mandir}/man1/vpbscan.1* | |
180 | ||
181 | %files -n vpb-libs | |
182 | %defattr(644,root,root,755) | |
183 | %attr(755,root,root) %{_libdir}/libtoneg.so.*.*.* | |
184 | %attr(755,root,root) %ghost %{_libdir}/libtoneg.so.0 | |
185 | %attr(755,root,root) %{_libdir}/libvpb.so.*.*.* | |
186 | %attr(755,root,root) %ghost %{_libdir}/libvpb.so.0 | |
187 | ||
188 | %files -n vpb-devel | |
189 | %defattr(644,root,root,755) | |
190 | %attr(755,root,root) %{_libdir}/libtoneg.so | |
191 | %attr(755,root,root) %{_libdir}/libvpb.so | |
192 | %{_includedir}/vt | |
193 | %{_includedir}/vpbapi.h | |
194 | %{_includedir}/vt_deprecated.h | |
195 | %{_includedir}/vtcore_ioctl.h | |
196 | ||
197 | %if %{with static_libs} | |
198 | %files -n vpb-static | |
199 | %defattr(644,root,root,755) | |
200 | %{_libdir}/libtoneg.a | |
201 | %{_libdir}/libvpb.a | |
202 | %endif | |
203 | %endif | |
204 | ||
205 | %if %{with kernel} | |
206 | %files -n kernel-telephony-vpb | |
207 | %defattr(644,root,root,755) | |
faa79da0 | 208 | %dir /lib/modules/%{_kernel_ver}/kernel/drivers/telephony |
a9ca2497 JB |
209 | /lib/modules/%{_kernel_ver}/kernel/drivers/telephony/vpb.ko* |
210 | /lib/modules/%{_kernel_ver}/kernel/drivers/telephony/vtcore.ko* | |
211 | /lib/modules/%{_kernel_ver}/kernel/drivers/telephony/vtopenpci.ko* | |
212 | /lib/modules/%{_kernel_ver}/kernel/drivers/telephony/vtopenswitch.ko* | |
213 | %config(noreplace) %verify(not md5 mtime size) /etc/modprobe.d/blunt-axe.conf | |
214 | %endif |