]> git.pld-linux.org Git - packages/dazuko.git/blobdiff - dazuko.spec
- fixed build without kernel
[packages/dazuko.git] / dazuko.spec
index 86bbd3ceee4dd95cc5ef61cb246c9ebe67a54e51..5c934cbff0482df1d768d390e13b9f246bac34fd 100644 (file)
@@ -1,4 +1,3 @@
-# TODO: fix Name vs filename
 #
 # Conditional build:
 %bcond_without dist_kernel     # allow non-distribution kernel
@@ -7,8 +6,6 @@
 %bcond_without userspace       # don't build userspace module
 %bcond_with    verbose         # verbose build (V=1)
 #
-# main package.
-#
 Summary:       Linux Dazuko driver
 Summary(pl):   Sterownik Dazuko dla Linuksa
 Name:          dazuko
@@ -16,7 +13,7 @@ Version:      2.0.6
 %define                _rel    1
 Release:       %{_rel}
 Epoch:         0
-License:       BSD/GPL
+License:       BSD (library), GPL (Linux kernel module)
 Group:         Base/Kernel
 Source0:       http://www.dazuko.org/files/dazuko-%{version}.tar.gz
 # Source0-md5: 844498651d22ddd76bea4104bf7c3e43
@@ -58,7 +55,7 @@ Summary(pl):  Linuksowy sterownik dazuko
 Release:       %{_rel}@%{_kernel_ver_str}
 Group:         Base/Kernel
 Requires(post,postun): /sbin/depmod
-%if %{with dist_kernel}
+%if %{with kernel} && %{with dist_kernel}
 %requires_releq_kernel_up
 Requires(postun):      %releq_kernel_up
 %endif
@@ -77,7 +74,7 @@ Summary(pl):  Sterownik dazuko dla Linuksa SMP
 Release:       %{_rel}@%{_kernel_ver_str}
 Group:         Base/Kernel
 Requires(post,postun): /sbin/depmod
-%if %{with dist_kernel}
+%if %{with kernel} && %{with dist_kernel}
 %requires_releq_kernel_smp
 Requires(postun):      %releq_kernel_smp
 %endif
@@ -92,36 +89,54 @@ Ten pakiet zawiera sterownik dazuko dla Linuksa SMP.
 
 %package examples
 Summary:       Example code for Dazuko
+Summary(pl):   Przyk³adowy kod dla Dazuko
+License:       BSD
 Group:         Development/Libraries
 
 %description examples
 Example code for Dazuko.
 
-%package static
-Summary:       Static libraries for Dazuko
-Group:         Development/Libraries
-
-%description static
-Static libraries for Dazuko.
+%description examples -l pl
+Przyk³adowy kod dla Dazuko.
 
 %package devel
 Summary:       Headers for Dazuko
+Summary(pl):   Pliki nag³ówkowe Dazuko
+License:       BSD
 Group:         Development/Libraries
+Requires:      %{name} = %{version}-%{release}
 
 %description devel
 Headers for Dazuko.
 
+%description devel -l pl
+Pliki nag³ówkowe Dazuko.
+
+%package static
+Summary:       Static libraries for Dazuko
+Summary(pl):   Statyczne biblioteki Dazuko
+License:       BSD
+Group:         Development/Libraries
+Requires:      %{name}-devel = %{version}-%{release}
+
+%description static
+Static libraries for Dazuko.
+
+%description static -l pl
+Statyczne biblioteki Dazuko.
+
 %prep
 %setup -q
 
 %build
-
-%if %{with kernel}
 # NOTE: It's not autoconf configure.
 bash ./configure \
-       --kernelsrcdir=%{_kernelsrcdir}
+       --kernelsrcdir=%{_kernelsrcdir} \
+       --disable-local-dpath \
+       %{!?with_userspace:--without-library} \
+       %{!?with_kernel:--without-module}
 
-# kernel module(s)
+%if %{with kernel}
 for cfg in %{?with_dist_kernel:%{?with_smp:smp} up}%{!?with_dist_kernel:nondist}; do
        if [ ! -r "%{_kernelsrcdir}/config-$cfg" ]; then
                exit 1
@@ -131,6 +146,7 @@ for cfg in %{?with_dist_kernel:%{?with_smp:smp} up}%{!?with_dist_kernel:nondist}
        ln -sf %{_kernelsrcdir}/config-$cfg .config
        ln -sf %{_kernelsrcdir}/include/linux/autoconf-$cfg.h include/linux/autoconf.h
        ln -sf %{_kernelsrcdir}/include/asm-%{_target_base_arch} include/asm
+       ln -sf %{_kernelsrcdir}/Module.symvers-$cfg Module.symvers
        touch include/config/MARKER
 #
 #      patching/creating makefile(s) (optional)
@@ -150,8 +166,10 @@ done
 
 %if %{with userspace}
 cd library
-make CFLAGS=-fPIC
-gcc -shared -Wl,-soname,libdazuko.so.0 -o libdazuko.so.0.0.0 *.o
+%{__make} \
+       CC="%{__cc}" \
+       CFLAGS="%{rpmcflags} -fPIC"
+%{__cc} -shared -Wl,-soname,libdazuko.so.0 -o libdazuko.so.0.0.0 *.o
 ln -s libdazuko.so.0.0.0 libdazuko.so.0
 ln -s libdazuko.so.0.0.0 libdazuko.so
 cd ..
@@ -165,8 +183,8 @@ install -d $RPM_BUILD_ROOT{%{_examplesdir}/%{name}-%{version},%{_libdir},%{_incl
 
 cp -a example* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
 
-install library/libdazuko.* $RPM_BUILD_ROOT/%{_libdir}
-install dazukoio.h $RPM_BUILD_ROOT/%{_includedir}
+cp -af library/libdazuko.* $RPM_BUILD_ROOT%{_libdir}
+install dazukoio.h $RPM_BUILD_ROOT%{_includedir}
 %endif
 
 %if %{with kernel}
@@ -182,6 +200,9 @@ install dazuko-smp.ko \
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%post  -p /sbin/ldconfig
+%postun        -p /sbin/ldconfig
+
 %post  -n kernel-misc-dazuko
 %depmod %{_kernel_ver}
 
@@ -208,17 +229,20 @@ rm -rf $RPM_BUILD_ROOT
 
 %if %{with userspace}
 %files
-%attr(755,root,root) /usr/lib/libdazuko.so.*
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libdazuko.so.*.*.*
 
 %files examples
-%doc README
 %defattr(644,root,root,755)
+%doc README
 %{_examplesdir}/%{name}-%{version}
 
 %files devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libdazuko.so
 %{_includedir}/dazukoio.h
-%{_libdir}/*.so
 
 %files static
-%{_libdir}/*.a
+%defattr(644,root,root,755)
+%{_libdir}/lib*.a
 %endif
This page took 0.049158 seconds and 4 git commands to generate.