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