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