]> git.pld-linux.org Git - packages/crash.git/blobdiff - crash.spec
- rebuild for kernel-3.10.15-1
[packages/crash.git] / crash.spec
index 4a600f1397eaaad6167eb2bfeab6051ab155b612..b044deab3ed5225da2a5187ca32ac3d1c69bed6e 100644 (file)
@@ -1,21 +1,40 @@
 # TODO:
-# - memory_driver kernel module
-# - eppic extension (wants to git pull from code.google.com)
+# - libeppic if anything else (but crash extension) wants to use it
 #
+# Conditional build:
+%bcond_without dist_kernel     # allow non-distribution kernel
+%bcond_without kernel          # don't build kernel modules
+%bcond_without userspace       # don't build userspace programs
+%bcond_with    verbose         # verbose kernel module build (V=1)
+#
+%if "%{_alt_kernel}" != "%{nil}"
+%undefine      with_userspace
+%endif
+
+%define                rel             4
+%define                pname           crash
 Summary:       Core Analysis Suite
 Summary(pl.UTF-8):     Zestaw narzędzi do analizy zrzutów pamięci
-Name:          crash
-Version:       7.0.1
-Release:       1
+Name:          %{pname}%{_alt_kernel}
+Version:       7.0.2
+Release:       %{rel}
 License:       GPL v2+
 Group:         Libraries
-Source0:       http://people.redhat.com/anderson/%{name}-%{version}.tar.gz
-# Source0-md5: b59076aebaced87e9073328cb0a4f50a
+Source0:       http://people.redhat.com/anderson/%{pname}-%{version}.tar.gz
+# Source0-md5: b32a437eda92c25ee1c88aa846a2e044
+# git clone https://code.google.com/p/eppic
+Source1:       eppic.tar.xz
+# Source1-md5: a9f80ad71de9d6f5b77534a7ebdbed8e
 URL:           http://people.redhat.com/anderson/
+%if %{with kernel} && %{with dist_kernel}
+BuildRequires: kernel-module-build >= 2.6
+%endif
+%if %{with userspace}
 BuildRequires: ncurses-devel
 BuildRequires: readline-devel
 BuildRequires: xz-devel
 BuildRequires: zlib-devel
+%endif
 ExclusiveArch: %{ix86} %{x8664} alpha arm ia64 ppc64 s390 s390x
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -43,21 +62,53 @@ Header files for core analysis suite.
 %description devel -l pl.UTF-8
 Plik nagłówkowy narzędzia do analizy zrzutów pamięci.
 
+%package -n kernel%{_alt_kernel}-char-crash
+Summary:       Memory driver for live system crash sessions
+Summary(pl.UTF-8):     Sterownik pamięci dla sesji crash na żywym systemie
+Release:       %{rel}@%{_kernel_ver_str}
+Group:         Base/Kernel
+Requires(post,postun): /sbin/depmod
+%if %{with dist_kernel}
+%requires_releq_kernel
+Requires(postun):      %releq_kernel
+%endif
+
+%description -n kernel%{_alt_kernel}-char-crash
+This package contains /dev/crash memory driver for live system crash
+sessions, which may be used when /dev/mem and /proc/kcore are
+unavailable.
+
+%description -n kernel%{_alt_kernel}-char-crash -l pl.UTF-8
+Ten pakiet zawiera sterownik pamięci /dev/crash do sesji crash na
+żywym systemie. Może być używany do analizy, kiedy /dev/mem i
+/proc/kcore nie są dostępne.
+
 %prep
-%setup -q
+%setup -q -a1 -n %{pname}-%{version}
 
-# TODO: download sources, disable git pull in eppic.mk
-%{__mv} extensions/eppic.c{,.skip}
+%{__mv} eppic extensions
 
 %build
+%if %{with kernel}
+%build_kernel_modules -C memory_driver -m crash
+%endif
+
+%if %{with userspace}
 export CPPFLAGS="%{rpmcppflags} -I/usr/include/ncurses"
 %{__make} -j1 all extensions \
        ARCH="%{_target_cpu}" \
        CC="%{__cc}" \
        CFLAGS="%{rpmcflags} -I/usr/include/ncurses"
+%endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
+
+%if %{with kernel}
+%install_kernel_modules -m memory_driver/crash -d kernel/drivers/char
+%endif
+
+%if %{with userspace}
 install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man8,%{_libdir}/crash/extensions,%{_includedir}/crash}
 
 %{__make} install \
@@ -67,10 +118,18 @@ install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man8,%{_libdir}/crash/extension
 install extensions/*.so $RPM_BUILD_ROOT%{_libdir}/crash/extensions
 cp -p crash.8 $RPM_BUILD_ROOT%{_mandir}/man8
 cp -p defs.h $RPM_BUILD_ROOT%{_includedir}/crash
+%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%post  -n kernel%{_alt_kernel}-char-crash
+%depmod %{_kernel_ver}
+
+%postun        -n kernel%{_alt_kernel}-char-crash
+%depmod %{_kernel_ver}
+
+%if %{with userspace}
 %files
 %defattr(644,root,root,755)
 %doc README
@@ -79,7 +138,7 @@ rm -rf $RPM_BUILD_ROOT
 %dir %{_libdir}/crash/extensions
 %attr(755,root,root) %{_libdir}/crash/extensions/dminfo.so
 %attr(755,root,root) %{_libdir}/crash/extensions/echo.so
-#%attr(755,root,root) %{_libdir}/crash/extensions/eppic.so
+%attr(755,root,root) %{_libdir}/crash/extensions/eppic.so
 %attr(755,root,root) %{_libdir}/crash/extensions/snap.so
 %attr(755,root,root) %{_libdir}/crash/extensions/trace.so
 %{_mandir}/man8/crash.8*
@@ -87,3 +146,11 @@ rm -rf $RPM_BUILD_ROOT
 %files devel
 %defattr(644,root,root,755)
 %{_includedir}/crash
+%endif
+
+%if %{with kernel}
+%files -n kernel%{_alt_kernel}-char-crash
+%defattr(644,root,root,755)
+%doc memory_driver/README
+/lib/modules/%{_kernel_ver}/kernel/drivers/char/crash.ko*
+%endif
This page took 0.066197 seconds and 4 git commands to generate.