Whamcloud - gitweb
LU-4943 obdclass: detach MGC dev on error
[fs/lustre-release.git] / contrib / rdac_spec
1 %{!?kernel_obj: %define kernel_obj /lib/modules/$(uname -r)/build}
2 # legal values are REDHAT and SUSE.  default to REDHAT
3 %{!?dist: %define dist REDHAT}
4
5 %define version 09.03.0C02.0013
6
7 Name: rdac
8 License: GPL
9 Group: System/Kernel
10 Summary: Multipathing tools
11 Version: %{version}
12 Release: 1
13 Source: http://codeman.central.sun.com/LSI/USR-SDLC/RDAC-Linux/rdac-LINUX-%{version}-source.tar.gz
14 #?? BuildRequires: kernel-source kernel-syms
15 BuildRoot: %{_tmppath}/rdac-%{version}-root
16
17 %description
18 This package provides the mppUtil (multipathing command line utilities).
19
20 %package modules
21 Summary: Multipathing driver for disk subsystems.
22 Group: System/Kernel
23
24 %description modules
25 This package provides the multipathing kernel modules.
26
27 %prep
28 if true; then
29 #exit 0
30 %setup -n linuxrdac-%{version}
31 else
32 cd linuxrdac-%{version}
33 fi
34 find_linux_release() {
35     local SRCDIR="$1"
36
37     local LINUXRELEASEHEADER=$SRCDIR/include/linux/version.h
38     if [ -s $SRCDIR/include/linux/utsrelease.h ]; then
39         LINUXRELEASEHEADER=$SRCDIR/include/linux/utsrelease.h
40     fi
41
42     sed -ne 's/#define UTS_RELEASE "\(.*\)"$/\1/p' $LINUXRELEASEHEADER
43
44 }
45
46 # need to fix up silly Makefile madness
47 chmod u+w Makefile
48 ed Makefile << EOF
49 /^GCC_CHK_FLAG :=/c
50 GCC_CHK_FLAG := 1
51 .
52 /^DIST :=/c
53 DIST := %{dist}
54 .
55 /^%{dist}_KERNEL_CHECK :=/c
56 %{dist}_KERNEL_CHECK := 1
57 .
58 /^OS_VER :=/c
59 OS_VER := $(find_linux_release %{kernel_obj})
60 .
61 g/install -o root -g root -m [0-9]\{4,4\}/s//install/
62 wq
63 EOF
64
65 # and other silliness
66 #ed genfileattributes << "EOF"
67 #EOF
68 sed -i -e 's/\/bin\/\(basename\)/\1/g' -e 's/\/bin\/\(awk\)/\1/g' genfileattributes
69
70 #sed -i -e 's/install -o root -g root/install/g Makefile
71
72 %build
73 #exit 0
74 export KERNEL_OBJ=%{kernel_obj}
75 make all
76
77 %install
78 rm -rf $RPM_BUILD_ROOT
79 export KERNEL_OBJ=%{kernel_obj}
80 DIST=%{dist}
81 make DEST_DIR=$RPM_BUILD_ROOT copyfiles copyrpmfiles
82 install -m 0755 -D mpp_rcscript.$DIST $RPM_BUILD_ROOT/etc/init.d/mpp
83 gzip $RPM_BUILD_ROOT/usr/share/man/man9/RDAC.9
84 gzip $RPM_BUILD_ROOT/usr/share/man/man1/mppBusRescan.1
85 ln -s mppBusRescan $RPM_BUILD_ROOT/usr/sbin/hot_add
86 ln -s mppBusRescan.1.gz $RPM_BUILD_ROOT/usr/share/man/man1/hot_add.1.gz
87 gzip $RPM_BUILD_ROOT/usr/share/man/man1/mppUpdate.1
88 gzip $RPM_BUILD_ROOT/usr/share/man/man1/mppUtil.1
89 install -m 0444 -D mpp.conf $RPM_BUILD_ROOT/etc/mpp.conf
90 touch devicemapping
91 install -m 0755 -d $RPM_BUILD_ROOT/var/mpp
92 install -m 0644 -D devicemapping $RPM_BUILD_ROOT/var/mpp/devicemapping
93 rm devicemapping
94 rm -rf $RPM_BUILD_ROOT/opt/mpp/.mppLnx_rpm_helpers
95
96 %post modules
97 depmod -a
98
99 %files
100 %defattr (-,root,root)
101 /usr/sbin/hot_add
102 /usr/share/man/man1/hot_add.1.gz
103 %attr (755,root,root) /etc/init.d/mpp
104 %attr (444,root,root) %config(noreplace) /etc/mpp.conf
105 %attr (755,root,root) %dir /var/mpp
106 %attr (644,root,root) %config(noreplace) /var/mpp/devicemapping
107 %attr (755,root,root) %dir /opt/mpp
108 %defattr (0500,root,root)
109 /opt/mpp/genuniqueid
110 /opt/mpp/mppSupport
111 /opt/mpp/lsvdev
112 /opt/mpp/mppiscsi_umountall
113 /usr/sbin/mppBusRescan
114 /opt/mpp/mppMkInitrdHelper
115 /usr/sbin/mppUpdate
116 /usr/sbin/mppUtil
117 %defattr (0644,root,root)
118 /usr/share/man/man1/mppBusRescan.1.gz
119 /usr/share/man/man1/mppUpdate.1.gz
120 /usr/share/man/man1/mppUtil.1.gz
121 /usr/share/man/man9/RDAC.9.gz
122
123 %files modules
124 %defattr (0644,root,root)
125 /lib/modules
126
127
128 %changelog
129 * Fri Oct 23 2009 - brian@sun.com 09.03.0C02.0013-1
130   - initial packaging