]> git.pld-linux.org Git - packages/dazuko.git/blob - dazuko.spec
5c934cbff0482df1d768d390e13b9f246bac34fd
[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 (library), GPL (Linux kernel module)
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 kernel} && %{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 kernel} && %{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 License:        BSD
94 Group:          Development/Libraries
95
96 %description examples
97 Example code for Dazuko.
98
99 %description examples -l pl
100 Przyk³adowy kod dla Dazuko.
101
102 %package devel
103 Summary:        Headers for Dazuko
104 Summary(pl):    Pliki nag³ówkowe Dazuko
105 License:        BSD
106 Group:          Development/Libraries
107 Requires:       %{name} = %{version}-%{release}
108
109 %description devel
110 Headers for Dazuko.
111
112 %description devel -l pl
113 Pliki nag³ówkowe Dazuko.
114
115 %package static
116 Summary:        Static libraries for Dazuko
117 Summary(pl):    Statyczne biblioteki Dazuko
118 License:        BSD
119 Group:          Development/Libraries
120 Requires:       %{name}-devel = %{version}-%{release}
121
122 %description static
123 Static libraries for Dazuko.
124
125 %description static -l pl
126 Statyczne biblioteki Dazuko.
127
128 %prep
129 %setup -q
130
131 %build
132 # NOTE: It's not autoconf configure.
133 bash ./configure \
134         --kernelsrcdir=%{_kernelsrcdir} \
135         --disable-local-dpath \
136         %{!?with_userspace:--without-library} \
137         %{!?with_kernel:--without-module}
138
139 %if %{with kernel}
140 for cfg in %{?with_dist_kernel:%{?with_smp:smp} up}%{!?with_dist_kernel:nondist}; do
141         if [ ! -r "%{_kernelsrcdir}/config-$cfg" ]; then
142                 exit 1
143         fi
144         rm -rf include
145         install -d include/{linux,config}
146         ln -sf %{_kernelsrcdir}/config-$cfg .config
147         ln -sf %{_kernelsrcdir}/include/linux/autoconf-$cfg.h include/linux/autoconf.h
148         ln -sf %{_kernelsrcdir}/include/asm-%{_target_base_arch} include/asm
149         ln -sf %{_kernelsrcdir}/Module.symvers-$cfg Module.symvers
150         touch include/config/MARKER
151 #
152 #       patching/creating makefile(s) (optional)
153 #
154         %{__make} -C %{_kernelsrcdir} clean \
155                 RCS_FIND_IGNORE="-name '*.ko' -o" \
156                 M=$PWD O=$PWD \
157                 %{?with_verbose:V=1}
158         %{__make} -C %{_kernelsrcdir} modules \
159                 CC="%{__cc}" CPP="%{__cpp}" \
160                 M=$PWD O=$PWD \
161                 %{?with_verbose:V=1}
162
163         mv dazuko{,-$cfg}.ko
164 done
165 %endif
166
167 %if %{with userspace}
168 cd library
169 %{__make} \
170         CC="%{__cc}" \
171         CFLAGS="%{rpmcflags} -fPIC"
172 %{__cc} -shared -Wl,-soname,libdazuko.so.0 -o libdazuko.so.0.0.0 *.o
173 ln -s libdazuko.so.0.0.0 libdazuko.so.0
174 ln -s libdazuko.so.0.0.0 libdazuko.so
175 cd ..
176 %endif
177
178 %install
179 rm -rf $RPM_BUILD_ROOT
180
181 %if %{with userspace}
182 install -d $RPM_BUILD_ROOT{%{_examplesdir}/%{name}-%{version},%{_libdir},%{_includedir}}
183
184 cp -a example* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
185
186 cp -af library/libdazuko.* $RPM_BUILD_ROOT%{_libdir}
187 install dazukoio.h $RPM_BUILD_ROOT%{_includedir}
188 %endif
189
190 %if %{with kernel}
191 install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}{,smp}/misc
192 install dazuko-%{?with_dist_kernel:up}%{!?with_dist_kernel:nondist}.ko \
193         $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/misc/dazuko.ko
194 %if %{with smp} && %{with dist_kernel}
195 install dazuko-smp.ko \
196         $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/misc/dazuko.ko
197 %endif
198 %endif
199
200 %clean
201 rm -rf $RPM_BUILD_ROOT
202
203 %post   -p /sbin/ldconfig
204 %postun -p /sbin/ldconfig
205
206 %post   -n kernel-misc-dazuko
207 %depmod %{_kernel_ver}
208
209 %postun -n kernel-misc-dazuko
210 %depmod %{_kernel_ver}
211
212 %post   -n kernel-smp-misc-dazuko
213 %depmod %{_kernel_ver}smp
214
215 %postun -n kernel-smp-misc-dazuko
216 %depmod %{_kernel_ver}smp
217
218 %if %{with kernel}
219 %files -n kernel-misc-dazuko
220 %defattr(644,root,root,755)
221 /lib/modules/%{_kernel_ver}/misc/*.ko*
222
223 %if %{with smp} && %{with dist_kernel}
224 %files -n kernel-smp-misc-dazuko
225 %defattr(644,root,root,755)
226 /lib/modules/%{_kernel_ver}smp/misc/*.ko*
227 %endif
228 %endif
229
230 %if %{with userspace}
231 %files
232 %defattr(644,root,root,755)
233 %attr(755,root,root) %{_libdir}/libdazuko.so.*.*.*
234
235 %files examples
236 %defattr(644,root,root,755)
237 %doc README
238 %{_examplesdir}/%{name}-%{version}
239
240 %files devel
241 %defattr(644,root,root,755)
242 %attr(755,root,root) %{_libdir}/libdazuko.so
243 %{_includedir}/dazukoio.h
244
245 %files static
246 %defattr(644,root,root,755)
247 %{_libdir}/lib*.a
248 %endif
This page took 0.068025 seconds and 2 git commands to generate.