]>
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) | |
40b8f1d3 JR |
8 | |
9 | %if %{without kernel} | |
10 | %undefine with_dist_kernel | |
11 | %endif | |
12 | ||
13 | # The goal here is to have main, userspace, package built once with | |
14 | # simple release number, and only rebuild kernel packages with kernel | |
15 | # version as part of release number, without the need to bump release | |
16 | # with every kernel change. | |
17 | %if 0%{?_pld_builder:1} && %{with kernel} && %{with userspace} | |
18 | %{error:kernel and userspace cannot be built at the same time on PLD builders} | |
19 | exit 1 | |
20 | %endif | |
21 | ||
a9ca2497 | 22 | %if "%{_alt_kernel}" != "%{nil}" |
40b8f1d3 JR |
23 | %if 0%{?build_kernels:1} |
24 | %{error:alt_kernel and build_kernels are mutually exclusive} | |
25 | exit 1 | |
26 | %endif | |
a9ca2497 | 27 | %undefine with_userspace |
40b8f1d3 JR |
28 | %global _build_kernels %{alt_kernel} |
29 | %else | |
30 | %global _build_kernels %{?build_kernels:,%{?build_kernels}} | |
a9ca2497 | 31 | %endif |
40b8f1d3 JR |
32 | |
33 | %if %{without userspace} | |
34 | # nothing to be placed to debuginfo package | |
35 | %define _enable_debug_packages 0 | |
a9ca2497 | 36 | %endif |
faa79da0 | 37 | |
40b8f1d3 JR |
38 | %define _duplicate_files_terminate_build 0 |
39 | ||
40 | %define kbrs %(echo %{_build_kernels} | tr , '\\n' | while read n ; do echo %%undefine alt_kernel ; [ -z "$n" ] || echo %%define alt_kernel $n ; echo "BuildRequires:kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2" ; done) | |
41 | %define kpkg %(echo %{_build_kernels} | tr , '\\n' | while read n ; do echo %%undefine alt_kernel ; [ -z "$n" ] || echo %%define alt_kernel $n ; echo %%kernel_pkg ; done) | |
42 | %define bkpkg %(echo %{_build_kernels} | tr , '\\n' | while read n ; do echo %%undefine alt_kernel ; [ -z "$n" ] || echo %%define alt_kernel $n ; echo %%build_kernel_pkg ; done) | |
43 | ||
44 | %define rel 8 | |
faa79da0 | 45 | %define pname vpb-driver |
a9ca2497 JB |
46 | Summary: Voicetronix voice processing board (VPB) driver software |
47 | Summary(pl.UTF-8): Oprogramowanie sterowników dla kart przetwarzających głos (VPB) Voicetronix | |
40b8f1d3 | 48 | Name: %{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel} |
b0e7dc09 | 49 | Version: 4.2.57 |
40b8f1d3 | 50 | Release: %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}} |
a9ca2497 JB |
51 | License: LGPL v2.1+ (libraries), GPL v2+ (libpri library, kernel module) |
52 | Group: Libraries | |
faa79da0 | 53 | Source0: http://www.voicetronix.com.au/Downloads/vpb-driver-4.x/%{pname}-%{version}.tar.gz |
b0e7dc09 | 54 | # Source0-md5: 35d0ea8ab7a6bda267603ca7c9b78671 |
faa79da0 | 55 | Patch0: %{pname}-make.patch |
a9ca2497 | 56 | URL: http://www.voicetronix.com.au/downloads.htm#linux |
40b8f1d3 JR |
57 | BuildRequires: rpmbuild(macros) >= 1.678 |
58 | %{?with_dist_kernel:%{expand:%kbrs}} | |
a9ca2497 JB |
59 | BuildRequires: autoconf >= 2.59 |
60 | BuildRequires: libstdc++-devel | |
61 | BuildRequires: pciutils-devel | |
dbfa6bb9 | 62 | BuildRequires: sed >= 4.0 |
a9ca2497 JB |
63 | BuildRequires: zlib-devel |
64 | Requires: vpb-libs = %{version}-%{rel} | |
65 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
66 | ||
67 | %description | |
68 | This is the Voicetronix voice processing board (VPB) driver software. | |
69 | ||
70 | %description -l pl.UTF-8 | |
71 | Ten pakiet zawiera oprogramowanie sterowników kart przetwarzających | |
72 | głos (VPB - voice processing board) firmy Voicetronix. | |
73 | ||
74 | %package -n vpb-libs | |
75 | Summary: Shared VPD libraries | |
76 | Summary(pl.UTF-8): Biblioteki współdzielone VPD | |
77 | License: LGPL v2.1+ | |
78 | Group: Libraries | |
79 | ||
80 | %description -n vpb-libs | |
81 | Shared VPD libraries. | |
82 | ||
83 | %description -n vpb-libs -l pl.UTF-8 | |
84 | Biblioteki współdzielone VPD. | |
85 | ||
86 | %package -n vpb-devel | |
87 | Summary: Header files for VPD libraries | |
88 | Summary(pl.UTF-8): Pliki nagłówkowe bibliotek VPD | |
89 | License: LGPL v2.1+ | |
90 | Group: Development/Libraries | |
91 | Requires: vpb-libs = %{version}-%{rel} | |
92 | ||
93 | %description -n vpb-devel | |
94 | Header files for VPD libraries. | |
95 | ||
96 | %description -n vpb-devel -l pl.UTF-8 | |
97 | Pliki nagłówkowe bibliotek VPD. | |
98 | ||
99 | %package -n vpb-static | |
100 | Summary: Static VPD libraries | |
101 | Summary(pl.UTF-8): Statyczne biblioteki VPD | |
102 | License: LGPL v2.1+ | |
103 | Group: Development/Libraries | |
104 | Requires: vpb-devel = %{version}-%{rel} | |
105 | ||
106 | %description -n vpb-static | |
107 | Static VPD libraries. | |
108 | ||
109 | %description -n vpb-static -l pl.UTF-8 | |
110 | Statyczne biblioteki VPD. | |
111 | ||
40b8f1d3 JR |
112 | %define kernel_pkg()\ |
113 | %package -n kernel%{_alt_kernel}-telephony-vpb\ | |
114 | Summary: Linux kernel driver for Voicetronix Voice Processing Board (VPB)\ | |
115 | Summary(pl.UTF-8): Sterownik jądra Linuksa do kart VPB firmy Voicetronix\ | |
116 | Release: %{rel}@%{_kernel_ver_str}\ | |
117 | License: GPL v2+\ | |
118 | Group: Base/Kernel\ | |
119 | Requires(post,postun): /sbin/depmod\ | |
120 | %if %{with dist_kernel}\ | |
121 | %requires_releq_kernel\ | |
122 | Requires(postun): %releq_kernel\ | |
123 | %endif\ | |
124 | \ | |
125 | %description -n kernel%{_alt_kernel}-telephony-vpb\ | |
126 | Linux kernel driver for Voicetronix Voice Processing Board (VPB).\ | |
127 | \ | |
128 | %description -n kernel%{_alt_kernel}-telephony-vpb -l pl.UTF-8\ | |
129 | Sterownik jądra Linuksa do kart VPB firmy Voicetronix.\ | |
130 | \ | |
131 | %files -n kernel%{_alt_kernel}-telephony-vpb\ | |
132 | %defattr(644,root,root,755)\ | |
133 | %dir /lib/modules/%{_kernel_ver}/kernel/drivers/telephony\ | |
134 | /lib/modules/%{_kernel_ver}/kernel/drivers/telephony/vpb.ko*\ | |
135 | /lib/modules/%{_kernel_ver}/kernel/drivers/telephony/vtcore.ko*\ | |
136 | /lib/modules/%{_kernel_ver}/kernel/drivers/telephony/vtopenpci.ko*\ | |
137 | /lib/modules/%{_kernel_ver}/kernel/drivers/telephony/vtopenswitch.ko*\ | |
138 | %config(noreplace) %verify(not md5 mtime size) /etc/modprobe.d/blunt-axe.conf\ | |
139 | \ | |
140 | %post -n kernel%{_alt_kernel}-telephony-vpb\ | |
141 | %depmod %{_kernel_ver}\ | |
142 | \ | |
143 | %postun -n kernel%{_alt_kernel}-telephony-vpb\ | |
144 | %depmod %{_kernel_ver}\ | |
145 | %{nil} | |
146 | ||
147 | %define build_kernel_pkg()\ | |
148 | %{__make} -C src/vtcore KSRC=%{_kernelsrcdir} \ | |
149 | %{__make} -C src/vpb KSRC=%{_kernelsrcdir} \ | |
150 | p=`pwd`\ | |
151 | %{__make} -C src/vtcore install \\\ | |
152 | DESTDIR=$p/installed \\\ | |
153 | KSRC=%{_kernelsrcdir}\ | |
154 | %{__make} -C src/vpb install \\\ | |
155 | DESTDIR=$p/installed \\\ | |
156 | KSRC=%{_kernelsrcdir}\ | |
157 | %{nil} | |
158 | ||
159 | %{?with_kernel:%{expand:%kpkg}} | |
a9ca2497 JB |
160 | |
161 | %prep | |
faa79da0 | 162 | %setup -q -n %{pname}-%{version} |
a9ca2497 | 163 | %patch0 -p1 |
dbfa6bb9 JB |
164 | |
165 | %if %{without kernel} | |
166 | %{__sed} -i -e 's,subdirs += $(srcdir)/vtcore $(srcdir)/vpb,,' src/Makefile.in | |
167 | %endif | |
168 | %if %{without userspace} | |
169 | %{__sed} -i -e 's,subdirs = libtoneg libvpb utils,,' src/Makefile.in | |
170 | %endif | |
a9ca2497 JB |
171 | |
172 | %build | |
173 | %{__aclocal} | |
174 | %{__autoconf} | |
175 | %if %{with userspace} && %{with static_libs} | |
176 | install -d build-static | |
177 | cd build-static | |
178 | ../%configure \ | |
179 | %{?with_pri:--with-pri} | |
dbfa6bb9 JB |
180 | %{__make} -C src/libtoneg \ |
181 | VPATH=%{_libdir} | |
182 | %{__make} -C src/libvpb \ | |
183 | VPATH=%{_libdir} | |
a9ca2497 JB |
184 | cd .. |
185 | %endif | |
40b8f1d3 | 186 | |
a9ca2497 JB |
187 | %configure \ |
188 | %{?with_pri:--with-pri} \ | |
189 | --enable-shared | |
9a1e9700 | 190 | |
40b8f1d3 | 191 | %if %{with userspace} |
dbfa6bb9 | 192 | %{__make} \ |
dbfa6bb9 | 193 | VPATH=%{_libdir} |
9a1e9700 | 194 | %endif |
a9ca2497 | 195 | |
40b8f1d3 JR |
196 | %{?with_kernel:%{expand:%bkpkg}} |
197 | ||
a9ca2497 JB |
198 | %install |
199 | rm -rf $RPM_BUILD_ROOT | |
200 | ||
40b8f1d3 | 201 | %if %{with kernel} |
9a1e9700 JR |
202 | install -d $RPM_BUILD_ROOT/etc/modprobe.d |
203 | install src/libvpb/blunt-axe.conf $RPM_BUILD_ROOT/etc/modprobe.d | |
204 | ||
40b8f1d3 JR |
205 | cp -a installed/* $RPM_BUILD_ROOT |
206 | %endif | |
9a1e9700 | 207 | |
40b8f1d3 | 208 | %if %{with userspace} |
a9ca2497 | 209 | %{__make} install \ |
40b8f1d3 | 210 | DESTDIR=$RPM_BUILD_ROOT |
a9ca2497 | 211 | |
a9ca2497 JB |
212 | # let rpm generate dependencies |
213 | chmod 755 $RPM_BUILD_ROOT%{_libdir}/lib*.so* | |
214 | ||
215 | # install man pages only for packaged software | |
216 | install -d $RPM_BUILD_ROOT%{_mandir}/man1 | |
217 | install doc/vpbconf.1 $RPM_BUILD_ROOT%{_mandir}/man1 | |
218 | install doc/vpbscan.1 $RPM_BUILD_ROOT%{_mandir}/man1 | |
219 | ||
220 | %if %{with static_libs} | |
221 | install build-static/src/{libtoneg/libtoneg.a,libvpb/libvpb.a} $RPM_BUILD_ROOT%{_libdir} | |
222 | %endif | |
223 | %endif | |
224 | ||
225 | %clean | |
226 | rm -rf $RPM_BUILD_ROOT | |
227 | ||
228 | %post -n vpb-libs -p /sbin/ldconfig | |
229 | %postun -n vpb-libs -p /sbin/ldconfig | |
230 | ||
a9ca2497 JB |
231 | %if %{with userspace} |
232 | %files | |
233 | %defattr(644,root,root,755) | |
234 | %doc COPYING README README.{OpenPCI,OpenPRI,OpenSwitch12,VTCore,VpbConfig} | |
235 | %attr(755,root,root) %{_sbindir}/vpbconf | |
236 | %attr(755,root,root) %{_sbindir}/vpbscan | |
237 | %{_datadir}/vpb-driver | |
238 | %{_mandir}/man1/vpbconf.1* | |
239 | %{_mandir}/man1/vpbscan.1* | |
240 | ||
241 | %files -n vpb-libs | |
242 | %defattr(644,root,root,755) | |
243 | %attr(755,root,root) %{_libdir}/libtoneg.so.*.*.* | |
244 | %attr(755,root,root) %ghost %{_libdir}/libtoneg.so.0 | |
245 | %attr(755,root,root) %{_libdir}/libvpb.so.*.*.* | |
246 | %attr(755,root,root) %ghost %{_libdir}/libvpb.so.0 | |
247 | ||
248 | %files -n vpb-devel | |
249 | %defattr(644,root,root,755) | |
250 | %attr(755,root,root) %{_libdir}/libtoneg.so | |
251 | %attr(755,root,root) %{_libdir}/libvpb.so | |
252 | %{_includedir}/vt | |
253 | %{_includedir}/vpbapi.h | |
254 | %{_includedir}/vt_deprecated.h | |
255 | %{_includedir}/vtcore_ioctl.h | |
256 | ||
257 | %if %{with static_libs} | |
258 | %files -n vpb-static | |
259 | %defattr(644,root,root,755) | |
260 | %{_libdir}/libtoneg.a | |
261 | %{_libdir}/libvpb.a | |
262 | %endif | |
263 | %endif |