X-Git-Url: http://git.pld-linux.org/?p=packages%2Fcrash.git;a=blobdiff_plain;f=crash.spec;h=8924d764bd08f8b0e1434b6c80fe56991fe4baf7;hp=d6bab0a3f5da48719b119e5d83ee67b00b4aaaf6;hb=HEAD;hpb=61472ea84762509ab3c84ff0774ebe4677a35a32 diff --git a/crash.spec b/crash.spec index d6bab0a..13d064a 100644 --- a/crash.spec +++ b/crash.spec @@ -1,22 +1,53 @@ # 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 kernel # don't build kernel modules +%bcond_without userspace # don't build userspace programs +%bcond_with verbose # verbose kernel module build (V=1) + +# The goal here is to have main, userspace, package built once with +# simple release number, and only rebuild kernel packages with kernel +# version as part of release number, without the need to bump release +# with every kernel change. +%if 0%{?_pld_builder:1} && %{with kernel} && %{with userspace} +%{error:kernel and userspace cannot be built at the same time on PLD builders} +exit 1 +%endif + +%if %{without userspace} +# nothing to be placed to debuginfo package +%define _enable_debug_packages 0 +%endif + +%define rel 1 +%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}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel} +Version: 8.0.4 +Release: %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}} License: GPL v2+ Group: Libraries -Source0: http://people.redhat.com/anderson/%{name}-%{version}.tar.gz -# Source0-md5: b59076aebaced87e9073328cb0a4f50a -URL: http://people.redhat.com/anderson/ +Source0: https://github.com/crash-utility/crash/archive/%{version}/%{pname}-%{version}.tar.gz +# Source0-md5: 5d8513ded5c9517e713a75e712d72e3a +# git clone -b v5.0 https://github.com/lucchouina/eppic +Source1: eppic.tar.xz +# Source1-md5: a04143f6eb0d72c33cd53329dc1b4803 +Source2: https://ftp.gnu.org/gnu/gdb/gdb-10.2.tar.xz +# Source2-md5: c044b7146903ec51c9d2337a29aee93b +Patch0: %{pname}-x32.patch +Patch1: only-patch-gdb.patch +URL: https://github.com/crash-utility/crash +BuildRequires: rpmbuild(macros) >= 1.701 +%{?with_kernel:%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}} +%if %{with userspace} BuildRequires: ncurses-devel BuildRequires: readline-devel BuildRequires: xz-devel BuildRequires: zlib-devel -ExclusiveArch: %{ix86} %{x8664} alpha arm ia64 ppc64 s390 s390x +%endif +ExclusiveArch: %{ix86} %{x8664} x32 alpha arm ia64 ppc64 s390 s390x BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %description @@ -43,39 +74,107 @@ Header files for core analysis suite. %description devel -l pl.UTF-8 Plik nagłówkowy narzędzia do analizy zrzutów pamięci. +%define kernel_pkg()\ +%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\ +%requires_releq_kernel\ +Requires(postun): %releq_kernel\ +\ +%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.\ +\ +%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\ +\ +%post -n kernel%{_alt_kernel}-char-crash\ +%depmod %{_kernel_ver}\ +\ +%postun -n kernel%{_alt_kernel}-char-crash\ +%depmod %{_kernel_ver}\ +%{nil} + +%define build_kernel_pkg()\ +%build_kernel_modules -C memory_driver -m crash\ +%install_kernel_modules -D installed -m memory_driver/crash -d kernel/drivers/char\ +%{nil} + +%{?with_kernel:%{expand:%create_kernel_packages}} + %prep -%setup -q +%setup -q -a1 -a2 -n %{pname}-%{version} +%patch0 -p1 +%patch1 -p1 -# TODO: download sources, disable git pull in eppic.mk -%{__mv} extensions/eppic.c{,.skip} +%{__mv} eppic extensions %build +%{?with_kernel:%{expand:%build_kernel_packages}} + +%if %{with userspace} export CPPFLAGS="%{rpmcppflags} -I/usr/include/ncurses" -%{__make} -j1 all extensions \ +%{__make} \ ARCH="%{_target_cpu}" \ CC="%{__cc}" \ CFLAGS="%{rpmcflags} -I/usr/include/ncurses" +%{__make} -j1 extensions \ + ARCH="%{_target_cpu}" \ + CC="%{__cc}" \ + CFLAGS="%{rpmcflags} -I/usr/include/ncurses" +%endif + %install rm -rf $RPM_BUILD_ROOT -install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man8,%{_includedir}/crash} + +%if %{with kernel} +install -d $RPM_BUILD_ROOT +cp -a installed/* $RPM_BUILD_ROOT +%endif + +%if %{with userspace} +install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man8,%{_libdir}/crash/extensions,%{_includedir}/crash} %{__make} install \ DESTDIR=$RPM_BUILD_ROOT # omitted by make install +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 +%if %{with userspace} %files %defattr(644,root,root,755) %doc README %attr(755,root,root) %{_bindir}/crash +%dir %{_libdir}/crash +%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/snap.so %{_mandir}/man8/crash.8* %files devel %defattr(644,root,root,755) %{_includedir}/crash +%endif