%define _disable_ld_as_needed 1 %define _disable_ld_no_undefined 1 %define tools_version 2.6.1 %define linux_version 2.6.1 %define progs dahdi_diag fxstest hdlcgen hdlcstress hdlctest hdlcverify patgen patlooptest pattest timertest %define major 2 %define libname %mklibname tonezone %{major} %define devname %mklibname tonezone -d %define __noautoreq '/bin/true' Summary: Userspace tools and DAHDI kernel modules Name: dahdi Version: %{tools_version} Release: 10 Group: System/Kernel and hardware License: GPLv2+ and LGPLv2+ Url: http://www.asterisk.org/ Source0: http://downloads.asterisk.org/pub/telephony/dahdi-tools/releases/dahdi-tools-%{tools_version}.tar.gz # this is original tarball with stripped binary firmware Source1: dahdi-linux-%{linux_version}.tar.xz Patch0: dahdi-tools-mdv.diff Patch1: dahdi-genudevrules-2.2.0.1.diff Patch2: dahdi-2.6.1-rosa-null.patch Patch3: dahdi-2.6.1-rosa-no_blobs.patch BuildRequires: ppp-devel BuildRequires: pkgconfig(libnewt) BuildRequires: pkgconfig(libusb) BuildConflicts: libtonezone-devel %description DAHDI stands for Digium Asterisk Hardware Device Interface. This package provides the userspace tools to configure the DAHDI kernel modules and the kernel modules. DAHDI is the replacement for Zaptel, which must be renamed due to trademark issues. %package tools Summary: Userspace tools to configure the DAHDI kernel modules Group: System/Kernel and hardware Provides: zaptel-tools = %{tools_version}-%{release} %description tools DAHDI stands for Digium Asterisk Hardware Device Interface. This package contains the userspace tools to configure the DAHDI kernel modules. DAHDI is the replacement for Zaptel, which must be renamed due to trademark issues. The DAHDI Telephony Interface drivers is contained in the kernel-dahdi (or dkms) package. %package -n %{libname} Summary: The shared DAHDI Library Group: System/Libraries %description -n %{libname} DAHDI stands for Digium Asterisk Hardware Device Interface. This package contains the userspace tools to configure the DAHDI kernel modules. DAHDI is the replacement for Zaptel, which must be renamed due to trademark issues. This package contains libraries for accessing DAHDI hardware. The DAHDI drivers is contained in the kernel-dahdi (or dkms) package. %package -n %{devname} Summary: Development files for the DAHDI Library Group: Development/C Requires: %{libname} = %{EVRD} Provides: tonezone-devel = %{EVRD} Provides: dahdi-devel = %{EVRD} Provides: libtonezone-devel = %{EVRD} %description -n %{devname} DAHDI stands for Digium Asterisk Hardware Device Interface. This package contains the userspace tools to configure the DAHDI kernel modules. DAHDI is the replacement for Zaptel, which must be renamed due to trademark issues. This package contains the tonezone library and the development headers for DAHDI. %package -n perl-Dahdi Summary: Interface to Dahdi information Group: Development/Perl %description -n perl-Dahdi DAHDI stands for Digium Asterisk Hardware Device Interface. This package contains the userspace tools to configure the DAHDI kernel modules. DAHDI is the replacement for Zaptel, which must be renamed due to trademark issues. This package allows access from Perl to information about Dahdi hardware and loaded Dahdi devices. %package -n dkms-dahdi Summary: Kernel drivers for the Digium Asterisk Hardware Device Interface (DAHDI) Group: System/Kernel and hardware Requires(pre): rpm-helper Requires(postun): rpm-helper Requires(post): rpm-helper Requires(preun): rpm-helper Requires(post): dkms Requires(preun): dkms Requires: dahdi-tools >= %{tools_version} Requires: sethdlc >= 1.15 Suggests: dahdi-firmware >= %{linux_version} Provides: dkms-zaptel = %{linux_version}-%{release} %description -n dkms-dahdi DAHDI stands for Digium Asterisk Hardware Device Interface. This package contains the kernel modules for DAHDI. For the required userspace tools see the package dahdi-tools. %prep %setup -q -n dahdi-tools-%{tools_version} -a1 ln -s dahdi-linux-%{linux_version}/include include find . -type d -perm 0700 -exec chmod 755 {} \; find . -type d -perm 0555 -exec chmod 755 {} \; find . -type f -perm 0555 -exec chmod 755 {} \; find . -type f -perm 0444 -exec chmod 644 {} \; for i in `find . -type d -name CVS` `find . -type f -name .cvs\*` `find . -type f -name .#\*`; do if [ -e "$i" ]; then rm -rf $i; fi >&/dev/null done %patch0 -p1 -b .mdv pushd dahdi-linux-%{linux_version} %patch1 -p0 -b .udevrules %patch3 -p1 popd %patch2 -p1 pushd dahdi-linux-%{linux_version}/drivers/dahdi %patch2 -p2 popd %{__perl} -pi -e 's/chkconfig:\s([0-9]+)\s([0-9]+)\s([0-9]+)/chkconfig: - \2 \3/' dahdi.init %build export CXX=g++ export CC=gcc pushd menuselect/mxml %configure popd pushd menuselect %configure popd %configure \ --disable-static \ --with-dahdi=`pwd` \ --with-newt=%{_prefix} \ --with-usb=%{_prefix} \ --without-selinux \ --with-ppp=%{_prefix} cat >> menuselect.makeopts < %{buildroot}/usr/src/dahdi-%{linux_version}-%{release}/dkms.conf <