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