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