#
# TODO:
# - IMPORTANT rename: http://www.asterisk.org/zaptel-to-dahdi
-#
-# - kernel modules doesn't build
-# - should more header files be installed?
-# - Installed (but unpackaged) file(s) found:
-# /etc/hotplug/usb/xpp_fxloader
-# /etc/hotplug/usb/xpp_fxloader.usermap
-# /etc/udev/rules.d/xpp.rules
+# - Fix --without xpp:
+# + check_modules
+# unpackaged module: drivers/dahdi/xpp/xpd_bri
+# unpackaged module: drivers/dahdi/xpp/xpd_fxo
+# unpackaged module: drivers/dahdi/xpp/xpd_fxs
+# unpackaged module: drivers/dahdi/xpp/xpd_pri
+# unpackaged module: drivers/dahdi/xpp/xpp
+# unpackaged module: drivers/dahdi/xpp/xpp_usb
#
# Conditional build:
%bcond_without dist_kernel # without distribution kernel
%bcond_with oslec # with Open Source Line Echo Canceller
-%bcond_with bristuff # with bristuff support
%bcond_without xpp # without Astribank
+%bcond_without userspace # don't build userspace packages
%bcond_with verbose
+%if "%{_alt_kernel}" != "%{nil}"
+%undefine with_userspace
+%endif
+
%ifarch sparc
%undefine with_smp
%endif
%undefine with_xpp
%endif
-%define rel 0.1
+%define rel 3
%define pname dahdi-linux
%define FIRMWARE_URL http://downloads.digium.com/pub/telephony/firmware/releases
Summary: DAHDI telephony device support
Summary(pl.UTF-8): Obsługa urządzeń telefonicznych DAHDI
Name: %{pname}%{_alt_kernel}
-Version: 2.2.0.1
-Release: %{rel}%{?with_bristuff:.bristuff}
+Version: 2.2.0.2
+Release: %{rel}
License: GPL
Group: Base/Kernel
Source0: http://downloads.digium.com/pub/telephony/dahdi-linux/dahdi-linux-%{version}.tar.gz
-# Source0-md5: 824919c1ee040a3c1999b4f70dd17c4a
+# Source0-md5: 1f932729ad28f2f028afcf2cc5ccf7ba
Source3: %{FIRMWARE_URL}/dahdi-fw-oct6114-064-1.05.01.tar.gz
# Source3-md5: 88db9b7a07d8392736171b1b3e6bcc66
Source4: %{FIRMWARE_URL}/dahdi-fw-oct6114-128-1.05.01.tar.gz
# Source5-md5: e1c7231d6225ac999cb18f4e858f66b6
Source6: %{FIRMWARE_URL}/dahdi-fw-tc400m-MR6.12.tar.gz
# Source6-md5: 2ea860bb8a9d8ede2858b9557b74ee3c
+Patch0: %{pname}-svn-fixes.patch
URL: http://www.asterisk.org/
%if %{with kernel} && %{with dist_kernel}
BuildRequires: kernel%{_alt_kernel}-module-build
BuildRequires: perl-base
BuildRequires: perl-tools-pod
BuildRequires: rpmbuild(macros) >= 1.379
-%{?with_bristuff:Provides: dahdi(bristuff)}
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
# Rules:
%define modules_1 dahdi.o dahdi_dynamic.o dahdi_dynamic_eth.o dahdi_dynamic_loc.o dahdi_dummy.o dahdi_echocan_jpah.o dahdi_echocan_kb1.o dahdi_echocan_mg2.o dahdi_echocan_sec.o dahdi_echocan_sec2.o pciradio.o tor2.o wcfxo.o wct1xxp.o wctdm.o wcte11xp.o
%define modules_1_in dahdi,dahdi_dynamic,dahdi_dynamic_eth,dahdi_dynamic_loc,dahdi_dummy,dahdi_echocan_jpah,dahdi_echocan_kb1,dahdi_echocan_mg2,dahdi_echocan_sec,dahdi_echocan_sec2,pciradio,tor2,wcfxo,wct1xxp,wctdm,wcte11xp
%define modules_2 voicebuss wct4xxp/ wcte12xp/ %{?with_xpp:xpp/}
-%define modules_2_in voicebus/dahdi_voicebus,wct4xxp/wct4xxp,wcte12xp/wcte12xp,%{?with_xpp:%{?with_bristuff:xpp/xpd_bri,}xpp/xpd_fxo,xpp/xpd_fxs,xpp/xpd_pri,xpp/xpp,xpp/xpp_usb}
+%define modules_2_in voicebus/dahdi_voicebus,wct4xxp/wct4xxp,wcte12xp/wcte12xp,%{?with_xpp:xpp/xpd_bri,xpp/xpd_fxo,xpp/xpd_fxs,xpp/xpd_pri,xpp/xpp,xpp/xpp_usb}
%ifnarch alpha
%define modules_nalpha wctc4xxp/ wctdm24xxp/ dahdi_transcode.o wcb4xxp/
%define modules_nalpha_in wctc4xxp/wctc4xxp,wctdm24xxp/wctdm24xxp,dahdi_transcode,wcb4xxp/wcb4xxp
%endif
-%if %{with bristuff}
-%define modules_bristuff cwain/ qozap/ vzaphfc/ zaphfc/ ztgsm/ opvxa1200.o wcopenpci.o
-%define modules_bristuff_in cwain/cwain,qozap/qozap,vzaphfc/vzaphfc,zaphfc/zaphfc,ztgsm/ztgsm,opvxa1200,wcopenpci
-%endif
-%define modules %{modules_1} %{modules_2}%{?modules_nalpha: %{modules_nalpha}}%{?modules_bristuff: %{modules_bristuff}}
-%define modules_in %{modules_1_in},%{modules_2_in}%{?modules_nalpha:,%{modules_nalpha_in}}%{?modules_bristuff:,%{modules_bristuff_in}}
+%define modules %{modules_1} %{modules_2}%{?modules_nalpha: %{modules_nalpha}}
+%define modules_in %{modules_1_in},%{modules_2_in}%{?modules_nalpha:,%{modules_nalpha_in}}
%description
DAHDI telephony device driver.
%description devel
Header files for dahdi interface.
+%package udev
+Summary: udev rules for DAHDI kernel modules
+Summary(pl.UTF-8): Reguły udev dla modułów jądra Linuksa dla DAHDI
+Release: %{rel}
+Group: Base/Kernel
+Requires: dahdi-tools >= 2.2.0
+Requires: udev-core
+
+%description udev
+udev rules for DAHDI kernel modules.
+
+%description udev -l pl.UTF-8
+Reguły udev dla modułów jądra Linuksa dla DAHDI.
+
%package -n kernel%{_alt_kernel}-%{pname}
Summary: DAHDI Linux kernel driver
Summary(pl.UTF-8): Sterownik DAHDI dla jądra Linuksa
%prep
%setup -q -n %{pname}-%{version}
+%patch0 -p1
for a in %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6}; do
ln -s $a drivers/dahdi/firmware
%install_kernel_modules -m %{modules_in} -d misc
cd ../..
-install include/dahdi/*.h $RPM_BUILD_ROOT%{_includedir}/dahdi/
+%if %{with userspace}
+install -d $RPM_BUILD_ROOT/etc/udev/rules.d
+
+%{make} \
+ DESTDIR=$RPM_BUILD_ROOT \
+ install-devices \
+ install-include
+%endif
%clean
rm -rf $RPM_BUILD_ROOT
%postun -n kernel%{_alt_kernel}-%{pname}
%depmod %{_kernel_ver}
+%if %{with userspace}
%files devel
%defattr(644,root,root,755)
%{_includedir}/dahdi
+%files udev
+%defattr(644,root,root,755)
+%config(noreplace) %verify(not md5 mtime size) /etc/udev/rules.d/dahdi.rules
+%config(noreplace) %verify(not md5 mtime size) /etc/udev/rules.d/xpp.rules
+%endif
+
%files -n kernel%{_alt_kernel}-%{pname}
%defattr(644,root,root,755)
/lib/modules/%{_kernel_ver}/misc/*.ko*