Logoj0ke.net Open Build Service > Projects > home:jg:playground > heartbeat > Changes
Sign Up | Log In

Changes of Revision 11

[-] Added heartbeat.spec
x
 
1
@@ -0,0 +1,1408 @@
2
+%define           ENABLE_SNMP_SUBAGENT 0
3
+%define           ENABLE_MGMT 1
4
+%define           uid 24
5
+%define           gname haclient
6
+%define           uname hacluster
7
+Summary:          Heartbeat subsystem for High-Availability Linux
8
+Name:             heartbeat
9
+Version:          2.1.2
10
+Release:          2%{?dist}
11
+License:          GPLv2 and LGPLv2+
12
+URL:              http://linux-ha.org/
13
+Group:            System Environment/Daemons
14
+Source0:          http://linux-ha.org/download/%{name}-%{version}.tar.gz
15
+Patch0:           heartbeat-fedora-pam.patch
16
+Patch1:           heartbeat-fedora-chkconfig.patch
17
+Patch2:           heartbeat-2.1.2-open.patch
18
+BuildRoot:        %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) 
19
+BuildRequires:    glib2-devel
20
+BuildRequires:    iputils
21
+BuildRequires:    libnet-devel
22
+BuildRequires:    libtool-ltdl-devel
23
+BuildRequires:    net-snmp-devel >= 5.4
24
+BuildRequires:    bzip2-devel 
25
+BuildRequires:    ncurses-devel
26
+BuildRequires:    openssl-devel
27
+BuildRequires:    libtool
28
+BuildRequires:    libxml2-devel
29
+BuildRequires:    gettext
30
+%if %{ENABLE_MGMT}
31
+BuildRequires:    gnutls-devel 
32
+BuildRequires:    pam-devel
33
+BuildRequires:    python-devel
34
+BuildRequires:    swig
35
+%endif
36
+Requires:         ldirectord = %{version}-%{release}
37
+Requires:         pygtk2 >= 2.4
38
+Requires(pre):    fedora-usermgmt
39
+Requires(postun): fedora-usermgmt
40
+Requires(post):   /sbin/chkconfig
41
+Requires(preun):  /sbin/chkconfig
42
+%if %{ENABLE_MGMT}
43
+Requires:         gettext
44
+%endif
45
+
46
+%description
47
+heartbeat is a basic high-availability subsystem for Linux-HA.
48
+It will run scripts at initialization, and when machines go up or down.
49
+This version will also perform IP address takeover using gratuitous ARPs.
50
+It supports "n-node" clusters with significant capabilities for managing
51
+resources and dependencies.
52
+
53
+In addition it continues to support the older release 1 style of
54
+2-node clustering.
55
+
56
+It implements the following kinds of heartbeats:
57
+        - Serial ports
58
+        - UDP/IP multicast (ethernet, etc)
59
+        - UDP/IP broadcast (ethernet, etc)
60
+        - UDP/IP heartbeats
61
+        - "ping" heartbeats (for routers, switches, etc.)
62
+           (to be used for breaking ties in 2-node systems)
63
+
64
+%package -n ldirectord
65
+Summary:          Monitor daemon for maintaining high availability resources
66
+Group:            System Environment/Daemons
67
+Requires:         ipvsadm
68
+Requires(post):   /sbin/chkconfig
69
+Requires(preun):  /sbin/chkconfig
70
+
71
+%description -n ldirectord
72
+ldirectord is a stand-alone daemon to monitor services of real 
73
+for virtual services provided by The Linux Virtual Server
74
+(http://www.linuxvirtualserver.org/). It is simple to install 
75
+and works with the heartbeat code (http://www.linux-ha.org/).
76
+
77
+%package -n stonith
78
+Requires:       net-snmp-libs
79
+Summary:        Provides an interface to Shoot The Other Node In The Head 
80
+Group:          System Environment/Daemons
81
+
82
+%description -n stonith
83
+The STONITH module (a.k.a. STONITH) provides an extensible interface
84
+for remotely powering down a node in the cluster.  The idea is quite simple:
85
+When the software running on one machine wants to make sure another
86
+machine in the cluster is not using a resource, pull the plug on the other 
87
+machine. It's simple and reliable, albeit admittedly brutal.
88
+
89
+%package -n pils
90
+Summary:        Provides a general plugin and interface loading library
91
+Group:          System Environment/Daemons
92
+
93
+%description -n pils
94
+PILS is an generalized and portable open source Plugin and Interface Loading 
95
+System. PILS was developed as part of the Open Cluster Framework reference 
96
+implementation, and is designed to be directly usable by a wide variety of 
97
+other applications.
98
+PILS manages both plugins (loadable objects), and the interfaces these plugins 
99
+implement. PILS is designed to support any number of plugins implementing any 
100
+number of interfaces.
101
+
102
+%package devel 
103
+Summary:        Heartbeat development package 
104
+Group:          System Environment/Daemons
105
+Requires:       heartbeat = %{version}-%{release}
106
+
107
+%description devel
108
+Heartbeat development package
109
+
110
+%prep
111
+%setup -q
112
+%patch0 -p1
113
+%patch1 -p1
114
+%patch2 -p1
115
+ 
116
+%build
117
+# disable-fatal-warnings flag used to disable gcc4.x warnings of 'difference in signedness'
118
+CFLAGS=${RPM_OPT_FLAGS} \
119
+%configure \
120
+  --with-ocf-root=%{_datadir}/ocf \
121
+  --disable-fatal-warnings \
122
+  --disable-static \
123
+%if %{ENABLE_MGMT}
124
+  --enable-mgmt
125
+%else
126
+  --disable-mgmt
127
+%endif
128
+
129
+# get rid of rpath
130
+sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
131
+sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
132
+
133
+make %{?_smp_mflags}
134
+
135
+%install
136
+rm -rf $RPM_BUILD_ROOT
137
+mkdir -p $RPM_BUILD_ROOT
138
+make DESTDIR=$RPM_BUILD_ROOT install
139
+(
140
+  cd $RPM_BUILD_ROOT/etc/ha.d/resource.d
141
+  ln -s /usr/sbin/ldirectord ldirectord
142
+)
143
+
144
+# cleanup
145
+[ -d $RPM_BUILD_ROOT/usr/man ] && rm -rf $RPM_BUILD_ROOT/usr/man
146
+[ -d $RPM_BUILD_ROOT/usr/share/libtool ] && rm -rf $RPM_BUILD_ROOT/usr/share/libtool
147
+find $RPM_BUILD_ROOT -type f -name *.la -exec rm -f {} ';'
148
+
149
+sed -i -e '1i# -*-Shell-script-*-' $RPM_BUILD_ROOT/%{_libdir}/heartbeat/ocf-shellfuncs 
150
+sed -i -e '1i# -*-Shell-script-*-' $RPM_BUILD_ROOT/%{_sysconfdir}/ha.d/shellfuncs
151
+chmod -x $RPM_BUILD_ROOT/%{_libdir}/heartbeat/ocf-shellfuncs
152
+chmod -x $RPM_BUILD_ROOT/%{_sysconfdir}/ha.d/shellfuncs
153
+chmod -x $RPM_BUILD_ROOT/%{_libdir}/heartbeat-gui/pymgmt.py
154
+
155
+# fix some wrong line endings issues
156
+sed -i 's/\r//' $RPM_BUILD_ROOT/%{_datadir}/ocf/resource.d/heartbeat/SAPDatabase
157
+sed -i 's/\r//' $RPM_BUILD_ROOT/%{_datadir}/ocf/resource.d/heartbeat/SAPInstance
158
+
159
+%find_lang haclient
160
+
161
+%clean
162
+rm -rf $RPM_BUILD_ROOT
163
+
164
+%pre
165
+/usr/sbin/fedora-groupadd %{uid} -r %{gname} &>/dev/null || :
166
+/usr/sbin/fedora-useradd %{uid} -r -s /sbin/nologin -d /var/lib/heartbeat/cores/hacluster -M \
167
+        -c 'heartbeat user' -g %{gname} %{uname} &>/dev/null || :
168
+
169
+%post
170
+/sbin/ldconfig
171
+/sbin/chkconfig --add heartbeat
172
+
173
+%postun -p /sbin/ldconfig
174
+
175
+%preun
176
+if [ $1 = 0 ] ; then
177
+    /sbin/service heartbeat stop
178
+    /sbin/chkconfig --del heartbeat
179
+fi
180
+
181
+/sbin/ldconfig
182
+test "$1" != 0 || /usr/sbin/fedora-userdel  %{uname} &>/dev/null || :
183
+test "$1" != 0 || /usr/sbin/fedora-groupdel %{gname} &>/dev/null || :
184
+
185
+%post -n ldirectord
186
+/sbin/chkconfig --add ldirectord
187
+
188
+%postun -n ldirectord -p /sbin/ldconfig
189
+
190
+%preun -n ldirectord
191
+/sbin/chkconfig --del ldirectord
192
+
193
+%post -n stonith -p /sbin/ldconfig
194
+
195
+%postun -n stonith -p /sbin/ldconfig
196
+
197
+%post -n pils -p /sbin/ldconfig
198
+
199
+%postun -n pils -p /sbin/ldconfig
200
+
201
[+] Added heartbeat-2.1.2-open.patch ^
[+] Added heartbeat-fedora-chkconfig.patch ^
[+] Added heartbeat-fedora-pam.patch ^
Added heartbeat-2.1.2-2.fc8.src.rpm ^
Added heartbeat-2.1.2.tar.gz ^