]>
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 | ||
be35dc39 | 24 | %define rel 3 |
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 |
be35dc39 JR |
36 | Patch1: userspace-only.patch |
37 | Patch2: linux-4.12.patch | |
a9ca2497 | 38 | URL: http://www.voicetronix.com.au/downloads.htm#linux |
8fd9c3e5 JR |
39 | BuildRequires: rpmbuild(macros) >= 1.701 |
40 | %{?with_kernel:%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}} | |
a9ca2497 JB |
41 | BuildRequires: autoconf >= 2.59 |
42 | BuildRequires: libstdc++-devel | |
43 | BuildRequires: pciutils-devel | |
dbfa6bb9 | 44 | BuildRequires: sed >= 4.0 |
a9ca2497 JB |
45 | BuildRequires: zlib-devel |
46 | Requires: vpb-libs = %{version}-%{rel} | |
47 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
48 | ||
49 | %description | |
50 | This is the Voicetronix voice processing board (VPB) driver software. | |
51 | ||
52 | %description -l pl.UTF-8 | |
53 | Ten pakiet zawiera oprogramowanie sterowników kart przetwarzających | |
54 | głos (VPB - voice processing board) firmy Voicetronix. | |
55 | ||
56 | %package -n vpb-libs | |
57 | Summary: Shared VPD libraries | |
58 | Summary(pl.UTF-8): Biblioteki współdzielone VPD | |
59 | License: LGPL v2.1+ | |
60 | Group: Libraries | |
61 | ||
62 | %description -n vpb-libs | |
63 | Shared VPD libraries. | |
64 | ||
65 | %description -n vpb-libs -l pl.UTF-8 | |
66 | Biblioteki współdzielone VPD. | |
67 | ||
68 | %package -n vpb-devel | |
69 | Summary: Header files for VPD libraries | |
70 | Summary(pl.UTF-8): Pliki nagłówkowe bibliotek VPD | |
71 | License: LGPL v2.1+ | |
72 | Group: Development/Libraries | |
73 | Requires: vpb-libs = %{version}-%{rel} | |
74 | ||
75 | %description -n vpb-devel | |
76 | Header files for VPD libraries. | |
77 | ||
78 | %description -n vpb-devel -l pl.UTF-8 | |
79 | Pliki nagłówkowe bibliotek VPD. | |
80 | ||
81 | %package -n vpb-static | |
82 | Summary: Static VPD libraries | |
83 | Summary(pl.UTF-8): Statyczne biblioteki VPD | |
84 | License: LGPL v2.1+ | |
85 | Group: Development/Libraries | |
86 | Requires: vpb-devel = %{version}-%{rel} | |
87 | ||
88 | %description -n vpb-static | |
89 | Static VPD libraries. | |
90 | ||
91 | %description -n vpb-static -l pl.UTF-8 | |
92 | Statyczne biblioteki VPD. | |
93 | ||
40b8f1d3 JR |
94 | %define kernel_pkg()\ |
95 | %package -n kernel%{_alt_kernel}-telephony-vpb\ | |
96 | Summary: Linux kernel driver for Voicetronix Voice Processing Board (VPB)\ | |
97 | Summary(pl.UTF-8): Sterownik jądra Linuksa do kart VPB firmy Voicetronix\ | |
98 | Release: %{rel}@%{_kernel_ver_str}\ | |
99 | License: GPL v2+\ | |
100 | Group: Base/Kernel\ | |
101 | Requires(post,postun): /sbin/depmod\ | |
40b8f1d3 JR |
102 | %requires_releq_kernel\ |
103 | Requires(postun): %releq_kernel\ | |
40b8f1d3 JR |
104 | \ |
105 | %description -n kernel%{_alt_kernel}-telephony-vpb\ | |
106 | Linux kernel driver for Voicetronix Voice Processing Board (VPB).\ | |
107 | \ | |
108 | %description -n kernel%{_alt_kernel}-telephony-vpb -l pl.UTF-8\ | |
109 | Sterownik jądra Linuksa do kart VPB firmy Voicetronix.\ | |
110 | \ | |
111 | %files -n kernel%{_alt_kernel}-telephony-vpb\ | |
112 | %defattr(644,root,root,755)\ | |
113 | %dir /lib/modules/%{_kernel_ver}/kernel/drivers/telephony\ | |
114 | /lib/modules/%{_kernel_ver}/kernel/drivers/telephony/vpb.ko*\ | |
115 | /lib/modules/%{_kernel_ver}/kernel/drivers/telephony/vtcore.ko*\ | |
116 | /lib/modules/%{_kernel_ver}/kernel/drivers/telephony/vtopenpci.ko*\ | |
117 | /lib/modules/%{_kernel_ver}/kernel/drivers/telephony/vtopenswitch.ko*\ | |
118 | %config(noreplace) %verify(not md5 mtime size) /etc/modprobe.d/blunt-axe.conf\ | |
119 | \ | |
120 | %post -n kernel%{_alt_kernel}-telephony-vpb\ | |
121 | %depmod %{_kernel_ver}\ | |
122 | \ | |
123 | %postun -n kernel%{_alt_kernel}-telephony-vpb\ | |
124 | %depmod %{_kernel_ver}\ | |
125 | %{nil} | |
126 | ||
127 | %define build_kernel_pkg()\ | |
128 | %{__make} -C src/vtcore KSRC=%{_kernelsrcdir} \ | |
129 | %{__make} -C src/vpb KSRC=%{_kernelsrcdir} \ | |
130 | p=`pwd`\ | |
131 | %{__make} -C src/vtcore install \\\ | |
132 | DESTDIR=$p/installed \\\ | |
133 | KSRC=%{_kernelsrcdir}\ | |
134 | %{__make} -C src/vpb install \\\ | |
135 | DESTDIR=$p/installed \\\ | |
136 | KSRC=%{_kernelsrcdir}\ | |
137 | %{nil} | |
138 | ||
8fd9c3e5 | 139 | %{?with_kernel:%{expand:%create_kernel_packages}} |
a9ca2497 JB |
140 | |
141 | %prep | |
faa79da0 | 142 | %setup -q -n %{pname}-%{version} |
a9ca2497 | 143 | %patch0 -p1 |
be35dc39 JR |
144 | %patch1 -p1 |
145 | %patch2 -p1 | |
dbfa6bb9 JB |
146 | |
147 | %if %{without kernel} | |
148 | %{__sed} -i -e 's,subdirs += $(srcdir)/vtcore $(srcdir)/vpb,,' src/Makefile.in | |
149 | %endif | |
150 | %if %{without userspace} | |
151 | %{__sed} -i -e 's,subdirs = libtoneg libvpb utils,,' src/Makefile.in | |
152 | %endif | |
a9ca2497 JB |
153 | |
154 | %build | |
155 | %{__aclocal} | |
156 | %{__autoconf} | |
157 | %if %{with userspace} && %{with static_libs} | |
158 | install -d build-static | |
159 | cd build-static | |
160 | ../%configure \ | |
161 | %{?with_pri:--with-pri} | |
dbfa6bb9 JB |
162 | %{__make} -C src/libtoneg \ |
163 | VPATH=%{_libdir} | |
164 | %{__make} -C src/libvpb \ | |
165 | VPATH=%{_libdir} | |
a9ca2497 JB |
166 | cd .. |
167 | %endif | |
40b8f1d3 | 168 | |
a9ca2497 JB |
169 | %configure \ |
170 | %{?with_pri:--with-pri} \ | |
171 | --enable-shared | |
9a1e9700 | 172 | |
40b8f1d3 | 173 | %if %{with userspace} |
dbfa6bb9 | 174 | %{__make} \ |
dbfa6bb9 | 175 | VPATH=%{_libdir} |
9a1e9700 | 176 | %endif |
a9ca2497 | 177 | |
8fd9c3e5 | 178 | %{?with_kernel:%{expand:%build_kernel_packages}} |
40b8f1d3 | 179 | |
a9ca2497 JB |
180 | %install |
181 | rm -rf $RPM_BUILD_ROOT | |
182 | ||
40b8f1d3 | 183 | %if %{with kernel} |
9a1e9700 JR |
184 | install -d $RPM_BUILD_ROOT/etc/modprobe.d |
185 | install src/libvpb/blunt-axe.conf $RPM_BUILD_ROOT/etc/modprobe.d | |
186 | ||
40b8f1d3 JR |
187 | cp -a installed/* $RPM_BUILD_ROOT |
188 | %endif | |
9a1e9700 | 189 | |
40b8f1d3 | 190 | %if %{with userspace} |
a9ca2497 | 191 | %{__make} install \ |
40b8f1d3 | 192 | DESTDIR=$RPM_BUILD_ROOT |
a9ca2497 | 193 | |
a9ca2497 JB |
194 | # let rpm generate dependencies |
195 | chmod 755 $RPM_BUILD_ROOT%{_libdir}/lib*.so* | |
196 | ||
197 | # install man pages only for packaged software | |
198 | install -d $RPM_BUILD_ROOT%{_mandir}/man1 | |
199 | install doc/vpbconf.1 $RPM_BUILD_ROOT%{_mandir}/man1 | |
200 | install doc/vpbscan.1 $RPM_BUILD_ROOT%{_mandir}/man1 | |
201 | ||
202 | %if %{with static_libs} | |
203 | install build-static/src/{libtoneg/libtoneg.a,libvpb/libvpb.a} $RPM_BUILD_ROOT%{_libdir} | |
204 | %endif | |
205 | %endif | |
206 | ||
207 | %clean | |
208 | rm -rf $RPM_BUILD_ROOT | |
209 | ||
210 | %post -n vpb-libs -p /sbin/ldconfig | |
211 | %postun -n vpb-libs -p /sbin/ldconfig | |
212 | ||
a9ca2497 JB |
213 | %if %{with userspace} |
214 | %files | |
215 | %defattr(644,root,root,755) | |
216 | %doc COPYING README README.{OpenPCI,OpenPRI,OpenSwitch12,VTCore,VpbConfig} | |
217 | %attr(755,root,root) %{_sbindir}/vpbconf | |
218 | %attr(755,root,root) %{_sbindir}/vpbscan | |
219 | %{_datadir}/vpb-driver | |
220 | %{_mandir}/man1/vpbconf.1* | |
221 | %{_mandir}/man1/vpbscan.1* | |
222 | ||
223 | %files -n vpb-libs | |
224 | %defattr(644,root,root,755) | |
225 | %attr(755,root,root) %{_libdir}/libtoneg.so.*.*.* | |
226 | %attr(755,root,root) %ghost %{_libdir}/libtoneg.so.0 | |
227 | %attr(755,root,root) %{_libdir}/libvpb.so.*.*.* | |
228 | %attr(755,root,root) %ghost %{_libdir}/libvpb.so.0 | |
229 | ||
230 | %files -n vpb-devel | |
231 | %defattr(644,root,root,755) | |
232 | %attr(755,root,root) %{_libdir}/libtoneg.so | |
233 | %attr(755,root,root) %{_libdir}/libvpb.so | |
234 | %{_includedir}/vt | |
235 | %{_includedir}/vpbapi.h | |
236 | %{_includedir}/vt_deprecated.h | |
237 | %{_includedir}/vtcore_ioctl.h | |
238 | ||
239 | %if %{with static_libs} | |
240 | %files -n vpb-static | |
241 | %defattr(644,root,root,755) | |
242 | %{_libdir}/libtoneg.a | |
243 | %{_libdir}/libvpb.a | |
244 | %endif | |
245 | %endif |