]> git.pld-linux.org Git - packages/dazuko.git/blob - dazuko.spec
- prepared for kernel >= 2.6.13: link Module.symvers
[packages/dazuko.git] / dazuko.spec
1 #
2 # Conditional build:
3 %bcond_without  dist_kernel     # allow non-distribution kernel
4 %bcond_without  kernel          # don't build kernel modules
5 %bcond_without  smp             # don't build SMP module
6 %bcond_without  userspace       # don't build userspace module
7 %bcond_with     verbose         # verbose build (V=1)
8 #
9 Summary:        Linux Dazuko driver
10 Summary(pl):    Sterownik Dazuko dla Linuksa
11 Name:           dazuko
12 Version:        2.0.6
13 %define         _rel    1
14 Release:        %{_rel}
15 Epoch:          0
16 License:        BSD/GPL
17 Group:          Base/Kernel
18 Source0:        http://www.dazuko.org/files/dazuko-%{version}.tar.gz
19 # Source0-md5:  844498651d22ddd76bea4104bf7c3e43
20 URL:            http://www.dazuko.org/
21 %if %{with kernel}
22 %{?with_dist_kernel:BuildRequires:      kernel-module-build >= 2.6.7}
23 BuildRequires:  rpmbuild(macros) >= 1.153
24 %endif
25 BuildRequires:  bash
26 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27
28 %description
29 Dazuko aims to be a cross-platform device driver that allows
30 applications to control file access on a system. By installing the
31 driver, your system will be able to support file access control
32 applications that are based on Dazuko. As this project becomes more
33 popular and more applications choose Dazuko for their file access
34 needs, it is hoped that this driver will become a common component
35 of most systems. 
36
37 To install the dazuko kernel module install kernel-misc-dazuko or
38 kernel-smp-misc-dazuko.
39
40 %description -l pl
41 Dazuko ma byæ wieloplatformowym sterownikiem urz±dzenia pozwalaj±cym
42 aplikacjom sterowaæ dostêpem do plików w systemie. Poprzez
43 zainstalowanie sterownika system bêdzie móg³ wspieraæ aplikacje
44 steruj±ce dostêpem do plików w oparciu o Dazuko. Kiedy ten projekt
45 stanie siê popularny, autorzy maj± nadziejê, ¿e sterownik ten bêdzie
46 popularnym elementem wiêkszo¶ci systemów.
47
48 Aby zainstalowaæ modu³ j±dra nale¿y zainstalowaæ pakiet
49 kernel-misc-dazuko lub kernel-smp-misc-dazuko.
50
51 # kernel subpackages.
52 %package -n kernel-misc-%{name}
53 Summary:        Linux driver for dazuko
54 Summary(pl):    Linuksowy sterownik dazuko
55 Release:        %{_rel}@%{_kernel_ver_str}
56 Group:          Base/Kernel
57 Requires(post,postun):  /sbin/depmod
58 %if %{with dist_kernel}
59 %requires_releq_kernel_up
60 Requires(postun):       %releq_kernel_up
61 %endif
62
63 %description -n kernel-misc-%{name}
64 This is driver for dazuko for Linux.
65
66 This package contains Linux module.
67
68 %description -n kernel-misc-%{name} -l pl
69 Ten pakiet zawiera sterownik dazuko dla Linuksa.
70
71 %package -n kernel-smp-misc-%{name}
72 Summary:        Linux SMP driver for dazuko
73 Summary(pl):    Sterownik dazuko dla Linuksa SMP
74 Release:        %{_rel}@%{_kernel_ver_str}
75 Group:          Base/Kernel
76 Requires(post,postun):  /sbin/depmod
77 %if %{with dist_kernel}
78 %requires_releq_kernel_smp
79 Requires(postun):       %releq_kernel_smp
80 %endif
81
82 %description -n kernel-smp-misc-%{name}
83 This is driver for dazuko for Linux.
84
85 This package contains Linux SMP module.
86
87 %description -n kernel-smp-misc-%{name} -l pl
88 Ten pakiet zawiera sterownik dazuko dla Linuksa SMP.
89
90 %package examples
91 Summary:        Example code for Dazuko
92 Summary(pl):    Przyk³adowy kod dla Dazuko
93 Group:          Development/Libraries
94
95 %description examples
96 Example code for Dazuko.
97
98 %description examples -l pl
99 Przyk³adowy kod dla Dazuko.
100
101 %package devel
102 Summary:        Headers for Dazuko
103 Summary(pl):    Pliki nag³ówkowe Dazuko
104 Group:          Development/Libraries
105 Requires:       %{name} = %{version}-%{release}
106
107 %description devel
108 Headers for Dazuko.
109
110 %description devel -l pl
111 Pliki nag³ówkowe Dazuko.
112
113 %package static
114 Summary:        Static libraries for Dazuko
115 Summary(pl):    Statyczne biblioteki Dazuko
116 Group:          Development/Libraries
117 Requires:       %{name}-devel = %{version}-%{release}
118
119 %description static
120 Static libraries for Dazuko.
121
122 %description static -l pl
123 Statyczne biblioteki Dazuko.
124
125 %prep
126 %setup -q
127
128 %build
129
130 %if %{with kernel}
131 # NOTE: It's not autoconf configure.
132 bash ./configure \
133         --kernelsrcdir=%{_kernelsrcdir} \
134         --disable-local-dpath
135
136 # kernel module(s)
137 for cfg in %{?with_dist_kernel:%{?with_smp:smp} up}%{!?with_dist_kernel:nondist}; do
138         if [ ! -r "%{_kernelsrcdir}/config-$cfg" ]; then
139                 exit 1
140         fi
141         rm -rf include
142         install -d include/{linux,config}
143         ln -sf %{_kernelsrcdir}/config-$cfg .config
144         ln -sf %{_kernelsrcdir}/include/linux/autoconf-$cfg.h include/linux/autoconf.h
145         ln -sf %{_kernelsrcdir}/include/asm-%{_target_base_arch} include/asm
146         ln -sf %{_kernelsrcdir}/Module.symvers-$cfg Module.symvers
147         touch include/config/MARKER
148 #
149 #       patching/creating makefile(s) (optional)
150 #
151         %{__make} -C %{_kernelsrcdir} clean \
152                 RCS_FIND_IGNORE="-name '*.ko' -o" \
153                 M=$PWD O=$PWD \
154                 %{?with_verbose:V=1}
155         %{__make} -C %{_kernelsrcdir} modules \
156                 CC="%{__cc}" CPP="%{__cpp}" \
157                 M=$PWD O=$PWD \
158                 %{?with_verbose:V=1}
159
160         mv dazuko{,-$cfg}.ko
161 done
162 %endif
163
164 %if %{with userspace}
165 cd library
166 %{__make} \
167         CFLAGS="-fPIC"
168 %{__cc} -shared -Wl,-soname,libdazuko.so.0 -o libdazuko.so.0.0.0 *.o
169 ln -s libdazuko.so.0.0.0 libdazuko.so.0
170 ln -s libdazuko.so.0.0.0 libdazuko.so
171 cd ..
172 %endif
173
174 %install
175 rm -rf $RPM_BUILD_ROOT
176
177 %if %{with userspace}
178 install -d $RPM_BUILD_ROOT{%{_examplesdir}/%{name}-%{version},%{_libdir},%{_includedir}}
179
180 cp -a example* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
181
182 cp -af library/libdazuko.* $RPM_BUILD_ROOT/%{_libdir}
183 install dazukoio.h $RPM_BUILD_ROOT/%{_includedir}
184 %endif
185
186 %if %{with kernel}
187 install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}{,smp}/misc
188 install dazuko-%{?with_dist_kernel:up}%{!?with_dist_kernel:nondist}.ko \
189         $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/misc/dazuko.ko
190 %if %{with smp} && %{with dist_kernel}
191 install dazuko-smp.ko \
192         $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/misc/dazuko.ko
193 %endif
194 %endif
195
196 %clean
197 rm -rf $RPM_BUILD_ROOT
198
199 %post   -p /sbin/ldconfig
200 %postun -p /sbin/ldconfig
201
202 %post   -n kernel-misc-dazuko
203 %depmod %{_kernel_ver}
204
205 %postun -n kernel-misc-dazuko
206 %depmod %{_kernel_ver}
207
208 %post   -n kernel-smp-misc-dazuko
209 %depmod %{_kernel_ver}smp
210
211 %postun -n kernel-smp-misc-dazuko
212 %depmod %{_kernel_ver}smp
213
214 %if %{with kernel}
215 %files -n kernel-misc-dazuko
216 %defattr(644,root,root,755)
217 /lib/modules/%{_kernel_ver}/misc/*.ko*
218
219 %if %{with smp} && %{with dist_kernel}
220 %files -n kernel-smp-misc-dazuko
221 %defattr(644,root,root,755)
222 /lib/modules/%{_kernel_ver}smp/misc/*.ko*
223 %endif
224 %endif
225
226 %if %{with userspace}
227 %files
228 %defattr(644,root,root,755)
229 %attr(755,root,root) %{_libdir}/libdazuko.so.*.*.*
230
231 %files examples
232 %defattr(644,root,root,755)
233 %doc README
234 %{_examplesdir}/%{name}-%{version}
235
236 %files devel
237 %defattr(644,root,root,755)
238 %attr(755,root,root) %{_libdir}/libdazuko.so
239 %{_includedir}/dazukoio.h
240
241 %files static
242 %defattr(644,root,root,755)
243 %{_libdir}/lib*.a
244 %endif
This page took 0.057937 seconds and 3 git commands to generate.