]> git.pld-linux.org Git - packages/dahdi-linux.git/blob - dahdi-linux.spec
- reenable building of dahdi_dummy
[packages/dahdi-linux.git] / dahdi-linux.spec
1 #
2 # TODO:
3 # - IMPORTANT rename: http://www.asterisk.org/zaptel-to-dahdi
4 # - Fix --without xpp:
5 #   + check_modules
6 #   unpackaged module: drivers/dahdi/xpp/xpd_bri
7 #   unpackaged module: drivers/dahdi/xpp/xpd_fxo
8 #   unpackaged module: drivers/dahdi/xpp/xpd_fxs
9 #   unpackaged module: drivers/dahdi/xpp/xpd_pri
10 #   unpackaged module: drivers/dahdi/xpp/xpp
11 #   unpackaged module: drivers/dahdi/xpp/xpp_usb
12 #
13 # Conditional build:
14 %bcond_without  dist_kernel     # without distribution kernel
15 %bcond_with     oslec           # with Open Source Line Echo Canceller
16 %bcond_without  xpp             # without Astribank
17 %bcond_without  userspace       # don't build userspace packages
18 %bcond_with     verbose
19
20 %if "%{_alt_kernel}" != "%{nil}"
21 %undefine       with_userspace
22 %endif
23
24 %ifarch sparc
25 %undefine       with_smp
26 %endif
27 %ifarch alpha
28 %undefine       with_xpp
29 %endif
30
31 %define         rel     16
32 %define         pname   dahdi-linux
33 %define         FIRMWARE_URL http://downloads.digium.com/pub/telephony/firmware/releases
34 Summary:        DAHDI telephony device support
35 Summary(pl.UTF-8):      Obsługa urządzeń telefonicznych DAHDI
36 Name:           %{pname}%{_alt_kernel}
37 Version:        2.2.0.2
38 Release:        %{rel}
39 License:        GPL
40 Group:          Base/Kernel
41 Source0:        http://downloads.digium.com/pub/telephony/dahdi-linux/dahdi-linux-%{version}.tar.gz
42 # Source0-md5:  1f932729ad28f2f028afcf2cc5ccf7ba
43 Source3:        %{FIRMWARE_URL}/dahdi-fw-oct6114-064-1.05.01.tar.gz
44 # Source3-md5:  88db9b7a07d8392736171b1b3e6bcc66
45 Source4:        %{FIRMWARE_URL}/dahdi-fw-oct6114-128-1.05.01.tar.gz
46 # Source4-md5:  c1f1a18d3e20d283f42c71e580a64b5a
47 Source5:        %{FIRMWARE_URL}/dahdi-fw-vpmadt032-1.07.tar.gz
48 # Source5-md5:  e1c7231d6225ac999cb18f4e858f66b6
49 Source6:        %{FIRMWARE_URL}/dahdi-fw-tc400m-MR6.12.tar.gz
50 # Source6-md5:  2ea860bb8a9d8ede2858b9557b74ee3c
51 Patch0:         %{pname}-gentoo.patch
52 URL:            http://www.asterisk.org/
53 %if %{with dist_kernel}
54 BuildRequires:  kernel%{_alt_kernel}-module-build
55 %endif
56 BuildRequires:  perl-base
57 BuildRequires:  rpmbuild(macros) >= 1.379
58 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
59
60 # Rules:
61 # - modules_X: single modules, just name module with no suffix
62 # - modules_X: subdir modules are just directory name with slash like dirname/
63 # - keep X and X_in in sync
64 # - X is used for actual building (entries separated with space), X_in for pld macros (entries separated with comma)
65
66 %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
67 %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
68 %define modules_2       voicebuss wct4xxp/ wcte12xp/ %{?with_xpp:xpp/}
69 %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}
70 %ifnarch alpha
71 %define modules_nalpha  wctc4xxp/ wctdm24xxp/ dahdi_transcode.o wcb4xxp/
72 %define modules_nalpha_in       wctc4xxp/wctc4xxp,wctdm24xxp/wctdm24xxp,dahdi_transcode,wcb4xxp/wcb4xxp
73
74 %endif
75 %define modules         %{modules_1} %{modules_2}%{?modules_nalpha: %{modules_nalpha}}
76 %define modules_in      %{modules_1_in},%{modules_2_in}%{?modules_nalpha:,%{modules_nalpha_in}}
77
78 %description
79 DAHDI telephony device driver.
80
81 %description -l pl.UTF-8
82 Sterownik do urządzeń telefonicznych DAHDI.
83
84 %package devel
85 Summary:        Header files for dahdi interface
86 Group:          Development/Libraries
87 # if base package contains shared library for which these headers are
88 #Requires:      %{name} = %{version}-%{release}
89 # if -libs package contains shared library for which these headers are
90 #Requires:      %{name}-libs = %{version}-%{release}
91
92 %description devel
93 Header files for dahdi interface.
94
95 %package udev
96 Summary:        udev rules for DAHDI kernel modules
97 Summary(pl.UTF-8):      Reguły udev dla modułów jądra Linuksa dla DAHDI
98 Release:        %{rel}
99 Group:          Base/Kernel
100 Requires:       dahdi-tools >= 2.2.0
101 Requires:       udev-core
102
103 %description udev
104 udev rules for DAHDI kernel modules.
105
106 %description udev -l pl.UTF-8
107 Reguły udev dla modułów jądra Linuksa dla DAHDI.
108
109 %package -n kernel%{_alt_kernel}-%{pname}
110 Summary:        DAHDI Linux kernel driver
111 Summary(pl.UTF-8):      Sterownik DAHDI dla jądra Linuksa
112 Release:        %{rel}@%{_kernel_ver_str}
113 Group:          Base/Kernel
114 Requires(post,postun):  /sbin/depmod
115 %if %{with dist_kernel}
116 %requires_releq_kernel
117 Requires(postun):       %releq_kernel
118 %{?with_oslec:Requires: kernel-misc-oslec = 20070608-0.1@%{_kernel_ver_str}}
119 %endif
120
121 %description -n kernel%{_alt_kernel}-%{pname}
122 DAHDI telephony Linux kernel driver.
123
124 %description -n kernel%{_alt_kernel}-%{pname} -l pl.UTF-8
125 Sterownik dla jądra Linuksa do urządzeń telefonicznych DAHDI.
126
127 %prep
128 %setup -q -n %{pname}-%{version}
129 %patch0 -p1
130
131 for a in %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6}; do
132         ln -s $a drivers/dahdi/firmware
133         tar -C drivers/dahdi/firmware -xzf $a
134 done
135
136 cat > download-logger <<'EOF'
137 #!/bin/sh
138 # keep log of files make wanted to download in firmware/ dir
139 echo "$@" >> download.log
140 EOF
141 chmod a+rx download-logger
142
143 %build
144 %{__make} include/dahdi/version.h
145
146 %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
147
148 check_modules() {
149         err=0
150         for a in drivers/dahdi/{*/,}*.ko; do
151                 [[ $a = *-dist.ko ]] && continue
152                 [[ $a = *-up.ko ]] && continue
153                 [[ $a = *-smp.ko ]] && continue
154                 echo >&2 "unpackaged module: ${a%.ko}"
155                 err=1
156         done
157
158         [ $err = 0 ] || exit 1
159 }
160 check_modules
161
162 %install
163 rm -rf $RPM_BUILD_ROOT
164 mkdir $RPM_BUILD_ROOT%{_includedir}/dahdi -p
165 cd drivers/dahdi
166 %install_kernel_modules -m %{modules_in} -d misc
167 cd ../..
168
169 %if %{with userspace}
170 install -d $RPM_BUILD_ROOT/etc/udev/rules.d
171
172 %{make} \
173         DESTDIR=$RPM_BUILD_ROOT \
174         install-devices \
175         install-include
176 %endif
177
178 %clean
179 rm -rf $RPM_BUILD_ROOT
180
181 %post -n kernel%{_alt_kernel}-%{pname}
182 %depmod %{_kernel_ver}
183
184 %postun -n kernel%{_alt_kernel}-%{pname}
185 %depmod %{_kernel_ver}
186
187 %if %{with userspace}
188 %files devel
189 %defattr(644,root,root,755)
190 %{_includedir}/dahdi
191
192 %files udev
193 %defattr(644,root,root,755)
194 %config(noreplace) %verify(not md5 mtime size) /etc/udev/rules.d/dahdi.rules
195 %config(noreplace) %verify(not md5 mtime size) /etc/udev/rules.d/xpp.rules
196 %endif
197
198 %files -n kernel%{_alt_kernel}-%{pname}
199 %defattr(644,root,root,755)
200 /lib/modules/%{_kernel_ver}/misc/*.ko*
This page took 0.090741 seconds and 4 git commands to generate.