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