]> git.pld-linux.org Git - packages/dahdi-linux.git/blobdiff - dahdi-linux.spec
- up to 3.0.0, doesn't build with kernel 5.0
[packages/dahdi-linux.git] / dahdi-linux.spec
index f57bf0560caa97d0cf317116cae245c6e79bdef9..a1442588b9458545f6cd5ceb09201df6a36de86c 100644 (file)
 #   unpackaged module: drivers/dahdi/xpp/xpp_usb
 #
 # Conditional build:
-%bcond_without dist_kernel     # without distribution kernel
 %bcond_without  kernel         # don't build kernel modules
 %bcond_with    oslec           # with Open Source Line Echo Canceller
 %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
 %ifarch alpha
 %undefine      with_xpp
 %endif
-%if %{without kernel}
-%undefine      with_dist_kernel
+
+# The goal here is to have main, userspace, package built once with
+# simple release number, and only rebuild kernel packages with kernel
+# version as part of release number, without the need to bump release
+# with every kernel change.
+%if 0%{?_pld_builder:1} && %{with kernel} && %{with userspace}
+%{error:kernel and userspace cannot be built at the same time on PLD builders}
+exit 1
+%endif
+
+%if %{without userspace}
+# nothing to be placed to debuginfo package
+%define                _enable_debug_packages  0
 %endif
 
-%define                rel     26
+%define                rel     0.1
 %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.6.0
-Release:       %{rel}
-License:       GPL
+Name:          %{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel}
+Version:       3.0.0
+Release:       %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}}
+License:       GPL v2
 Group:         Base/Kernel
 Source0:       http://downloads.asterisk.org/pub/telephony/dahdi-linux/releases/dahdi-linux-%{version}.tar.gz
-# Source0-md5: ea35ad29dafe5490028ff642c35ef9a2
+# Source0-md5: 496baef9d2a3bec5a3380ade8efdc5e7
 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
@@ -54,16 +57,10 @@ Source6:    %{FIRMWARE_URL}/dahdi-fw-tc400m-MR6.12.tar.gz
 # Source6-md5: 2ea860bb8a9d8ede2858b9557b74ee3c
 Source7:       %{FIRMWARE_URL}/dahdi-fw-hx8-2.06.tar.gz
 # Source7-md5: a7f3886942bb3e9fed349a41b3390c9f
-Patch0:                %{pname}-build.patch
-# http://oss.axsentis.de/people/stkn/openzap/dahdi-2.4.0-linux-2.6.37.patch
-Patch1:                dahdi-2.4.0-linux-2.6.37.patch
-Patch2:                dahdi-linux-kernel-3.4.patch
 URL:           http://www.asterisk.org/
-%if %{with dist_kernel}
-BuildRequires: kernel%{_alt_kernel}-module-build
-%endif
+%{?with_kernel:%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}}
 BuildRequires: perl-base
-BuildRequires: rpmbuild(macros) >= 1.379
+BuildRequires: rpmbuild(macros) >= 1.701
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 # Rules:
@@ -91,52 +88,74 @@ Sterownik do urządzeń telefonicznych DAHDI.
 
 %package devel
 Summary:       Header files for dahdi interface
+Summary(pl.UTF-8):     Pliki nagłówkowe interfejsu dahdi
 Group:         Development/Libraries
-# if base package contains shared library for which these headers are
-#Requires:     %{name} = %{version}-%{release}
-# if -libs package contains shared library for which these headers are
-#Requires:     %{name}-libs = %{version}-%{release}
 
 %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
-Release:       %{rel}@%{_kernel_ver_str}
-Group:         Base/Kernel
-Requires(post,postun): /sbin/depmod
-%if %{with dist_kernel}
-%requires_releq_kernel
-Requires(postun):      %releq_kernel
-%{?with_oslec:Requires:        kernel-misc-oslec = 20070608-0.1@%{_kernel_ver_str}}
-%endif
-
-%description -n kernel%{_alt_kernel}-%{pname}
-DAHDI telephony Linux kernel driver.
-
-%description -n kernel%{_alt_kernel}-%{pname} -l pl.UTF-8
-Sterownik dla jądra Linuksa do urządzeń telefonicznych DAHDI.
+%description devel -l pl.UTF-8
+Pliki nagłówkowe interfejsu dahdi.
+
+%define        kernel_pkg()\
+%package -n kernel%{_alt_kernel}-%{pname}\
+Summary:       DAHDI Linux kernel driver\
+Summary(pl.UTF-8):     Sterownik DAHDI dla jądra Linuksa\
+Release:       %{rel}@%{_kernel_ver_str}\
+Group:         Base/Kernel\
+Requires(post,postun): /sbin/depmod\
+%requires_releq_kernel\
+Requires(postun):      %releq_kernel\
+%{?with_oslec:Requires:        kernel-misc-oslec = 20070608-0.1@%{_kernel_ver_str}}\
+\
+%description -n kernel%{_alt_kernel}-%{pname}\
+DAHDI telephony Linux kernel driver.\
+\
+%description -n kernel%{_alt_kernel}-%{pname} -l pl.UTF-8\
+Sterownik dla jądra Linuksa do urządzeń telefonicznych DAHDI.\
+\
+%if %{with kernel}\
+%files -n kernel%{_alt_kernel}-%{pname}\
+%defattr(644,root,root,755)\
+/lib/modules/%{_kernel_ver}/misc/dahdi*.ko*\
+/lib/modules/%{_kernel_ver}/misc/pciradio.ko*\
+/lib/modules/%{_kernel_ver}/misc/tor2.ko*\
+/lib/modules/%{_kernel_ver}/misc/wcb4xxp.ko*\
+/lib/modules/%{_kernel_ver}/misc/wcfxo.ko*\
+/lib/modules/%{_kernel_ver}/misc/wct1xxp.ko*\
+/lib/modules/%{_kernel_ver}/misc/wct4xxp.ko*\
+/lib/modules/%{_kernel_ver}/misc/wctc4xxp.ko*\
+/lib/modules/%{_kernel_ver}/misc/wctdm.ko*\
+/lib/modules/%{_kernel_ver}/misc/wctdm24xxp.ko*\
+/lib/modules/%{_kernel_ver}/misc/wcte11xp.ko*\
+/lib/modules/%{_kernel_ver}/misc/wcte12xp.ko*\
+%if %{with xpp}\
+/lib/modules/%{_kernel_ver}/misc/xpd_*.ko*\
+/lib/modules/%{_kernel_ver}/misc/xpp.ko*\
+/lib/modules/%{_kernel_ver}/misc/xpp_usb.ko*\
+%endif\
+%endif\
+\
+%post -n kernel%{_alt_kernel}-%{pname}\
+%depmod %{_kernel_ver}\
+\
+%postun -n kernel%{_alt_kernel}-%{pname}\
+%depmod %{_kernel_ver}\
+%{nil}
+
+%define build_kernel_pkg()\
+%if %{with kernel}\
+%build_kernel_modules SUBDIRS=$PWD/drivers/dahdi DAHDI_BUILD_ALL=m HOTPLUG_FIRMWARE=yes DAHDI_MODULES_EXTRA=" " -m %{modules_in} KSRC=$PWD/o -C drivers/dahdi DAHDI_INCLUDE=$PWD/../../include\
+cd drivers/dahdi\
+%install_kernel_modules -D ../../installed -m %{modules_in} -d misc\
+cd ../..\
+%endif\
+%{nil}
+
+%{?with_kernel:%{expand:%create_kernel_packages}}
 
 %prep
 %setup -q -n %{pname}-%{version}
-%patch0 -p1
-#%patch1 -p1
-%patch2 -p1
 
 for a in %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} %{SOURCE7}; do
        ln -s $a drivers/dahdi/firmware
@@ -153,67 +172,26 @@ chmod a+rx download-logger
 %build
 %{__make} include/dahdi/version.h
 
-%if %{with kernel}
-%build_kernel_modules SUBDIRS=$PWD/drivers/dahdi DAHDI_BUILD_ALL=m HOTPLUG_FIRMWARE=yes DAHDI_MODULES_EXTRA=" " -m %{modules_in} KSRC=$PWD/o -C drivers/dahdi DAHDI_INCLUDE=$PWD/../../include
-
-# check that all built .ko is handled by build_kernel_modules
-# (renamed to either -dist, -up, or -smp suffix)
-# if some missing, check the 'modules*' macros above
-check_modules() {
-       err=0
-       for a in drivers/dahdi/{*/,}*.ko; do
-               [[ $a = *-dist.ko ]] && continue
-               [[ $a = *-up.ko ]] && continue
-               [[ $a = *-smp.ko ]] && continue
-               echo >&2 "unpackaged module: ${a%.ko}"
-               err=1
-       done
-
-       [ $err = 0 ] || exit 1
-}
-#check_modules
-%endif
+%{?with_kernel:%{expand:%build_kernel_packages}}
 
 %install
 rm -rf $RPM_BUILD_ROOT
-mkdir $RPM_BUILD_ROOT%{_includedir}/dahdi -p
-%if %{with kernel}
-cd drivers/dahdi
-%install_kernel_modules -m %{modules_in} -d misc
-cd ../..
-%endif
+install -d $RPM_BUILD_ROOT%{_includedir}/dahdi
 
 %if %{with userspace}
-install -d $RPM_BUILD_ROOT/etc/udev/rules.d
+%{__make} install-include \
+       DESTDIR=$RPM_BUILD_ROOT
+%endif
 
-%{make} \
-       DESTDIR=$RPM_BUILD_ROOT \
-       install-devices \
-       install-include
+%if %{with kernel}
+cp -a installed/* $RPM_BUILD_ROOT
 %endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%post -n kernel%{_alt_kernel}-%{pname}
-%depmod %{_kernel_ver}
-
-%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
-
-%if %{with kernel}
-%files -n kernel%{_alt_kernel}-%{pname}
-%defattr(644,root,root,755)
-/lib/modules/%{_kernel_ver}/misc/*.ko*
 %endif
This page took 0.548526 seconds and 4 git commands to generate.