]> git.pld-linux.org Git - packages/heartbeat.git/blob - heartbeat.spec
- Prereq: /sbin/chkconfig; large part of spec (at least scripts) should be rewritten
[packages/heartbeat.git] / heartbeat.spec
1 Summary:        heartbeat - heartbeat subsystem for High-Availability Linux
2 Summary(pl):    podsystem heartbeat dla systemów o podwy¿szonej niezawodno¶ci
3 Name:           heartbeat
4 Version:        0.4.9
5 Release:        3
6 License:        GPL
7 URL:            http://linux-ha.org/
8 Group:          Applications
9 Source0:        http://linux-ha.org/download/%{name}-%{version}.tar.gz
10 Patch0:         %{name}.dirty.time.h.patch
11 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
12 BuildPreReq:    links
13 Requires:       sysklogd
14 Prereq:         /sbin/chkconfig
15
16 #%package stonith
17 #Summary: Provides an interface to Shoot The Other Node In The Head 
18 #Group: Utilities
19
20 %description
21 heartbeat is a basic heartbeat subsystem for Linux-HA. It will run
22 scripts at initialization, and when machines go up or down. This
23 version will also perform IP address takeover using gratuitous ARPs.
24 It works correctly for a 2-node configuration, and is extensible to
25 larger configurations.
26
27 It implements the following kinds of heartbeats:
28  - Bidirectional Serial Rings ("raw" serial ports)
29
30 %description(pl)
31 heartbeat jest podstawowym podsystemem dla systemów o podwy¿szonej
32 dostêpno¶ci budowanych w oparciu o Linuxa. Zajmuje siê uruchamianiem
33 skryptów podczas startu i zamykania systemu. Ta wersja pakietu pozwala
34 na przejmowanie adresów IP. Oprogramowanie dzia³a poprawnie dla
35 konfiguracji sk³adaj±cej siê z 2 hostów, mo¿na je równie¿ stosowaæ do
36 bardziej skomplikowanych konfiguracji.
37
38 %prep
39 %setup -q
40 %patch0 -p0
41
42 %build
43
44 #zmienic to:
45 sed -e 's/MAKE=gmake/MAKE=make/g' < Makefile > aqq
46 mv -f aqq Makefile
47 cd doc
48 sed -e 's/lynx/links/' > aqq < Makefile
49 mv -f aqq Makefile
50 cd ..
51 %{__make}
52 ###########################################################
53 %install
54 ###########################################################
55 rm -rf $RPM_BUILD_ROOT
56 if
57   [ -z "${RPM_BUILD_ROOT}"  -a "${RPM_BUILD_ROOT}" != "/" ]
58 then
59   rm -rf $RPM_BUILD_ROOT
60 fi
61 RPM_BUILD=yes BUILD_ROOT=$RPM_BUILD_ROOT make install
62 (
63 cd $RPM_BUILD_ROOT%{_sysconfdir}/ha.d/resource.d
64   rm -f ldirectord
65 ln -sf %{_sbindir}/ldirectord ldirectord
66 )
67
68 TEMPL=$RPM_BUILD_ROOT/var/adm/fillup-templates
69 if
70   [ ! -d $TEMPL ]
71 then
72   install -d $TEMPL
73 fi
74 install rc.config.heartbeat $TEMPL
75
76 ###########################################################
77 %files
78 %defattr(644,root,root,755)
79 ###########################################################
80 %defattr(-,root,root)
81 %dir %{_sysconfdir}/ha.d
82 %{_sysconfdir}/ha.d/harc
83 %{_sysconfdir}/ha.d/shellfuncs
84 %{_sysconfdir}/ha.d/rc.d
85 %{_sysconfdir}/ha.d/README.config
86 %{_sysconfdir}/ha.d/conf
87 %{_libdir}/heartbeat
88 %{_libdir}/libhbclient.so
89 %{_libdir}/libhbclient.a
90 %{_sysconfdir}/ha.d/resource.d/
91 %{_sysconfdir}/init.d/heartbeat
92 /etc/logrotate.d/heartbeat
93 /var/adm/fillup-templates/rc.config.heartbeat
94 %dir /var/lib/heartbeat
95 %attr (600, root, root)       /var/lib/heartbeat/fifo
96 %attr (750, root, haclient) /var/lib/heartbeat/api
97 %attr (620, root, haclient) /var/lib/heartbeat/register
98 %attr (1770, root, haclient) /var/lib/heartbeat/casual
99 %{_mandir}/man8/heartbeat.8*
100 %doc doc/*
101
102
103 ###########################################################
104 %clean
105 ###########################################################
106 rm -rf $RPM_BUILD_ROOT
107 rm -rf $RPM_BUILD_DIR/heartbeat-0.4.9
108
109 ###########################################################
110 %pre
111 ###########################################################
112 #
113 #       This isn't perfect.  But getting every distribution
114 #       to agree on group id's seems hard to me :-(
115 #
116 if
117   grep '^haclient:' etc/group >/dev/null
118 then
119   : OK group haclient already present
120 else
121   GROUPOPT="-g 60"
122   if
123     usr/sbin/groupadd $GROUPOPT haclient 2>/dev/null
124   then
125     : OK we were able to add group haclient
126   else
127     usr/sbin/groupadd haclient
128   fi
129 fi
130 #
131 #  Multi-distribution kludge for init scripts...
132 #
133 if
134   [ ! -d etc/init.d ]
135 then
136   if
137     [ -d sbin/init.d  -a ! -L sbin/init.d ]
138   then
139     ln -s ../sbin/init.d etc/init.d
140   elif
141     [ -d etc/rc.d/init.d ]
142   then
143     ln -s rc.d/init.d etc/init.d
144   else
145     # I give up!
146     echo "Warning: making directory /etc/init.d"
147     mkdir -p etc/init.d
148   fi
149 fi
150 ###########################################################
151 #
152 #  Multi-distribution kludge for init scripts...
153 #
154 if
155   [ ! -d etc/init.d ]
156 then
157   if
158     [ -d sbin/init.d  -a ! -L sbin/init.d ]
159   then
160     ln -s ../sbin/init.d etc/init.d
161   elif
162     [ -d etc/rc.d/init.d ]
163   then
164     ln -s rc.d/init.d etc/init.d
165   else
166     # I give up!
167     echo "Warning: making directory /etc/init.d"
168     mkdir -p etc/init.d
169   fi
170 fi
171 ###########################################################
172 %post
173 ###########################################################
174
175 # Run heartbeat on startup
176 if
177   [ -f etc/SuSE-release ]
178 then
179   for d in etc/rc.d/init.d/rc[23].d
180   do
181     rm -f $d/S10heartbeat
182     rm -f $d/S99heartbeat; ln -s ../heartbeat $d/S99heartbeat 
183     rm -f $d/K35heartbeat; ln -s ../heartbeat $d/K35heartbeat
184   done
185   FILLUP=/bin/fillup
186   if 
187     $FILLUP -q -d = etc/rc.config var/adm/fillup-templates/rc.config.heartbeat
188   then
189     : fillup returned OK
190   else
191     echo "ERROR: $FILLUP failed. This should not happen. Please compare"
192     echo "/etc/rc.config and /var/adm/fillup-templates/rc.config.heartbeat"
193     echo "and update by hand."
194   fi
195 elif
196   [ -x sbin/chkconfig ]
197 then
198   sbin/chkconfig --add heartbeat
199 fi
200 true
201
202 ###########################################################
203 %preun
204 ###########################################################
205
206 Uninstall_PPP_hack() {
207   file2hack=etc/ppp/ip-up.local
208   echo "NOTE: Restoring /$file2hack"
209   MARKER="Heartbeat"
210   ed -s $file2hack <<-!EOF  2>/dev/null
211 H
212 g/ $MARKER\$/d
213 w
214 !EOF
215 }
216
217 if
218   [ $1 = 0 ]
219 then
220   [ -x sbin/chkconfig ] && sbin/chkconfig --del heartbeat
221   if
222     [ ! -x etc/ppp/ip-up.heart ]
223   then
224     Uninstall_PPP_hack
225   fi
226 fi
227 if
228    [ -r etc/SuSE-release ]
229 then
230   rm -f sbin/init.d/rc[23]/*heartbeat
231 fi
232 true
This page took 0.074996 seconds and 4 git commands to generate.