]>
Commit | Line | Data |
---|---|---|
a9ca2497 JB |
1 | # |
2 | # Conditional build: | |
a9ca2497 JB |
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) | |
40b8f1d3 | 7 | |
40b8f1d3 JR |
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} | |
14 | exit 1 | |
15 | %endif | |
16 | ||
40b8f1d3 JR |
17 | %if %{without userspace} |
18 | # nothing to be placed to debuginfo package | |
19 | %define _enable_debug_packages 0 | |
a9ca2497 | 20 | %endif |
faa79da0 | 21 | |
40b8f1d3 JR |
22 | %define _duplicate_files_terminate_build 0 |
23 | ||
1db68561 | 24 | %define rel 2 |
faa79da0 | 25 | %define pname vpb-driver |
a9ca2497 JB |
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 | |
40b8f1d3 | 28 | Name: %{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel} |
adc45f0b | 29 | Version: 4.2.58 |
40b8f1d3 | 30 | Release: %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}} |
a9ca2497 JB |
31 | License: LGPL v2.1+ (libraries), GPL v2+ (libpri library, kernel module) |
32 | Group: Libraries | |
faa79da0 | 33 | Source0: http://www.voicetronix.com.au/Downloads/vpb-driver-4.x/%{pname}-%{version}.tar.gz |
adc45f0b | 34 | # Source0-md5: f8c85b52e8d01b04d86632e98ac59d19 |
faa79da0 | 35 | Patch0: %{pname}-make.patch |
a9ca2497 | 36 | URL: http://www.voicetronix.com.au/downloads.htm#linux |
8fd9c3e5 JR |
37 | BuildRequires: rpmbuild(macros) >= 1.701 |
38 | %{?with_kernel:%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}} | |
a9ca2497 JB |
39 | BuildRequires: autoconf >= 2.59 |
40 | BuildRequires: libstdc++-devel | |
41 | BuildRequires: pciutils-devel | |
dbfa6bb9 | 42 | BuildRequires: sed >= 4.0 |
a9ca2497 JB |
43 | BuildRequires: zlib-devel |
44 | Requires: vpb-libs = %{version}-%{rel} | |
45 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
46 | ||
47 | %description | |
48 | This is the Voicetronix voice processing board (VPB) driver software. | |
49 | ||
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. | |
53 | ||
54 | %package -n vpb-libs | |
55 | Summary: Shared VPD libraries | |
56 | Summary(pl.UTF-8): Biblioteki współdzielone VPD | |
57 | License: LGPL v2.1+ | |
58 | Group: Libraries | |
59 | ||
60 | %description -n vpb-libs | |
61 | Shared VPD libraries. | |
62 | ||
63 | %description -n vpb-libs -l pl.UTF-8 | |
64 | Biblioteki współdzielone VPD. | |
65 | ||
66 | %package -n vpb-devel | |
67 | Summary: Header files for VPD libraries | |
68 | Summary(pl.UTF-8): Pliki nagłówkowe bibliotek VPD | |
69 | License: LGPL v2.1+ | |
70 | Group: Development/Libraries | |
71 | Requires: vpb-libs = %{version}-%{rel} | |
72 | ||
73 | %description -n vpb-devel | |
74 | Header files for VPD libraries. | |
75 | ||
76 | %description -n vpb-devel -l pl.UTF-8 | |
77 | Pliki nagłówkowe bibliotek VPD. | |
78 | ||
79 | %package -n vpb-static | |
80 | Summary: Static VPD libraries | |
81 | Summary(pl.UTF-8): Statyczne biblioteki VPD | |
82 | License: LGPL v2.1+ | |
83 | Group: Development/Libraries | |
84 | Requires: vpb-devel = %{version}-%{rel} | |
85 | ||
86 | %description -n vpb-static | |
87 | Static VPD libraries. | |
88 | ||
89 | %description -n vpb-static -l pl.UTF-8 | |
90 | Statyczne biblioteki VPD. | |
91 | ||
40b8f1d3 JR |
92 | %define kernel_pkg()\ |
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}\ | |
97 | License: GPL v2+\ | |
98 | Group: Base/Kernel\ | |
99 | Requires(post,postun): /sbin/depmod\ | |
40b8f1d3 JR |
100 | %requires_releq_kernel\ |
101 | Requires(postun): %releq_kernel\ | |
40b8f1d3 JR |
102 | \ |
103 | %description -n kernel%{_alt_kernel}-telephony-vpb\ | |
104 | Linux kernel driver for Voicetronix Voice Processing Board (VPB).\ | |
105 | \ | |
106 | %description -n kernel%{_alt_kernel}-telephony-vpb -l pl.UTF-8\ | |
107 | Sterownik jądra Linuksa do kart VPB firmy Voicetronix.\ | |
108 | \ | |
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\ | |
117 | \ | |
118 | %post -n kernel%{_alt_kernel}-telephony-vpb\ | |
119 | %depmod %{_kernel_ver}\ | |
120 | \ | |
121 | %postun -n kernel%{_alt_kernel}-telephony-vpb\ | |
122 | %depmod %{_kernel_ver}\ | |
123 | %{nil} | |
124 | ||
125 | %define build_kernel_pkg()\ | |
126 | %{__make} -C src/vtcore KSRC=%{_kernelsrcdir} \ | |
127 | %{__make} -C src/vpb KSRC=%{_kernelsrcdir} \ | |
128 | p=`pwd`\ | |
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}\ | |
135 | %{nil} | |
136 | ||
8fd9c3e5 | 137 | %{?with_kernel:%{expand:%create_kernel_packages}} |
a9ca2497 JB |
138 | |
139 | %prep | |
faa79da0 | 140 | %setup -q -n %{pname}-%{version} |
a9ca2497 | 141 | %patch0 -p1 |
dbfa6bb9 JB |
142 | |
143 | %if %{without kernel} | |
144 | %{__sed} -i -e 's,subdirs += $(srcdir)/vtcore $(srcdir)/vpb,,' src/Makefile.in | |
145 | %endif | |
146 | %if %{without userspace} | |
147 | %{__sed} -i -e 's,subdirs = libtoneg libvpb utils,,' src/Makefile.in | |
148 | %endif | |
a9ca2497 JB |
149 | |
150 | %build | |
151 | %{__aclocal} | |
152 | %{__autoconf} | |
153 | %if %{with userspace} && %{with static_libs} | |
154 | install -d build-static | |
155 | cd build-static | |
156 | ../%configure \ | |
157 | %{?with_pri:--with-pri} | |
dbfa6bb9 JB |
158 | %{__make} -C src/libtoneg \ |
159 | VPATH=%{_libdir} | |
160 | %{__make} -C src/libvpb \ | |
161 | VPATH=%{_libdir} | |
a9ca2497 JB |
162 | cd .. |
163 | %endif | |
40b8f1d3 | 164 | |
a9ca2497 JB |
165 | %configure \ |
166 | %{?with_pri:--with-pri} \ | |
167 | --enable-shared | |
9a1e9700 | 168 | |
40b8f1d3 | 169 | %if %{with userspace} |
dbfa6bb9 | 170 | %{__make} \ |
dbfa6bb9 | 171 | VPATH=%{_libdir} |
9a1e9700 | 172 | %endif |
a9ca2497 | 173 | |
8fd9c3e5 | 174 | %{?with_kernel:%{expand:%build_kernel_packages}} |
40b8f1d3 | 175 | |
a9ca2497 JB |
176 | %install |
177 | rm -rf $RPM_BUILD_ROOT | |
178 | ||
40b8f1d3 | 179 | %if %{with kernel} |
9a1e9700 JR |
180 | install -d $RPM_BUILD_ROOT/etc/modprobe.d |
181 | install src/libvpb/blunt-axe.conf $RPM_BUILD_ROOT/etc/modprobe.d | |
182 | ||
40b8f1d3 JR |
183 | cp -a installed/* $RPM_BUILD_ROOT |
184 | %endif | |
9a1e9700 | 185 | |
40b8f1d3 | 186 | %if %{with userspace} |
a9ca2497 | 187 | %{__make} install \ |
40b8f1d3 | 188 | DESTDIR=$RPM_BUILD_ROOT |
a9ca2497 | 189 | |
a9ca2497 JB |
190 | # let rpm generate dependencies |
191 | chmod 755 $RPM_BUILD_ROOT%{_libdir}/lib*.so* | |
192 | ||
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 | |
197 | ||
198 | %if %{with static_libs} | |
199 | install build-static/src/{libtoneg/libtoneg.a,libvpb/libvpb.a} $RPM_BUILD_ROOT%{_libdir} | |
200 | %endif | |
201 | %endif | |
202 | ||
203 | %clean | |
204 | rm -rf $RPM_BUILD_ROOT | |
205 | ||
206 | %post -n vpb-libs -p /sbin/ldconfig | |
207 | %postun -n vpb-libs -p /sbin/ldconfig | |
208 | ||
a9ca2497 JB |
209 | %if %{with userspace} |
210 | %files | |
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* | |
218 | ||
219 | %files -n vpb-libs | |
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 | |
225 | ||
226 | %files -n vpb-devel | |
227 | %defattr(644,root,root,755) | |
228 | %attr(755,root,root) %{_libdir}/libtoneg.so | |
229 | %attr(755,root,root) %{_libdir}/libvpb.so | |
230 | %{_includedir}/vt | |
231 | %{_includedir}/vpbapi.h | |
232 | %{_includedir}/vt_deprecated.h | |
233 | %{_includedir}/vtcore_ioctl.h | |
234 | ||
235 | %if %{with static_libs} | |
236 | %files -n vpb-static | |
237 | %defattr(644,root,root,755) | |
238 | %{_libdir}/libtoneg.a | |
239 | %{_libdir}/libvpb.a | |
240 | %endif | |
241 | %endif |