]> git.pld-linux.org Git - packages/bootchart.git/blobdiff - bootchart.spec
- use %banner when no grubby present
[packages/bootchart.git] / bootchart.spec
index 6c6ba5a38e875467ce845a0bebfa1aaeae81285c..34c8be9f520b700ff749e56e98953606257ca1fc 100644 (file)
@@ -2,13 +2,14 @@ Summary:      Boot Process Performance Visualization
 Summary(pl):   Wizualizacja wydajno¶ci procesu startu systemu
 Name:          bootchart
 Version:       0.9
-Release:       1.2
+Release:       1.9
 Epoch:         0
 License:       GPL
 Group:         Base
 Source0:       http://dl.sourceforge.net/bootchart/%{name}-%{version}.tar.bz2
 # Source0-md5: 4be91177d19069e21beeb106f2f77dff
 Patch0:                %{name}-bash.patch
+Patch1:                %{name}-initscript.patch
 URL:           http://www.bootchart.org/
 BuildRequires: ant
 BuildRequires: jakarta-commons-cli >= 0:1.0
@@ -38,6 +39,7 @@ w formacie PNG, SVG lub EPS.
 Summary:       Javadoc for %{name}
 Summary(pl):   Dokumentacja Javadoc dla bootcharta
 Group:         Documentation
+Requires:      jpackage-utils
 
 %description javadoc
 Javadoc for %{name}.
@@ -51,9 +53,11 @@ Summary(pl): Skrypt loguj
 Group:         Base
 Requires:      coreutils
 Requires:      grep
+Requires:      gzip
 Requires:      mktemp
 Requires:      mount
 Requires:      sed
+Requires:      tar
 
 %description logger
 Boot logging script for %{name}.
@@ -64,6 +68,7 @@ Skrypt loguj
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 
 %build
 # Remove the bundled commons-cli
@@ -108,16 +113,26 @@ fi
 # Add a new grub/lilo entry
 if [ -x /sbin/grubby ]; then
        kernel=$(/sbin/grubby --default-kernel)
-       initrd=$(/sbin/grubby --info=$kernel | sed -n '/^initrd=/{s/^initrd=//;p;q;}')
-       [ ! -z $initrd ] && initrd="--initrd=$initrd"
+       info=$(/sbin/grubby --info=$kernel)
+       initrd=$(echo "$info" | sed -n '/^initrd=/{s/^initrd=//;p;q;}')
+       init=$(echo "$info" |sed -n '/^args=.*init=/{s/^args=.*init=//;s/"$//;p;q;}')
+       [ -n "$initrd" ] && initrd="--initrd=$initrd"
+       [ -n "$init" ] && init="bootchart_init=$init"
        /sbin/grubby --remove-kernel TITLE=%{boottitle}
-       /sbin/grubby --copy-default --add-kernel=$kernel $initrd --args="init=/sbin/bootchartd" --title=%{boottitle} || :
+       /sbin/grubby --copy-default --add-kernel=$kernel $initrd --args="init=/sbin/bootchartd $init" --title=%{boottitle} || :
+else
+       %banner -e %{name}-logger <<-EOF
+You should adjust your bootloader to boot with
+ init=/sbin/bootchartd
+EOF
 fi
 
 %preun logger
-# Remove the grub/lilo entry
-if [ -x /sbin/grubby ]; then
-       /sbin/grubby --remove-kernel TITLE=%{boottitle} || :
+if [ "$1" = 0 ]; then
+       # Remove the grub/lilo entry
+       if [ -x /sbin/grubby ]; then
+               /sbin/grubby --remove-kernel TITLE=%{boottitle} || :
+       fi
 fi
 
 %files
This page took 0.06666 seconds and 4 git commands to generate.