forked from comoonics/comoonics-initrd-ng
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcomoonics-bootimage-initscripts-fedora.spec
290 lines (267 loc) · 11.3 KB
/
comoonics-bootimage-initscripts-fedora.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
#****h* comoonics-bootimage/comoonics-bootimage.spec
# NAME
# comoonics-bootimage-initscripts.spec
# $id$
# DESCRIPTION
# initscripts for the Comoonics bootimage
# AUTHOR
# Mark Hlawatschek
#
#*******
# @(#)$File:$
#
# Copyright (c) 2001 ATIX GmbH, 2007 ATIX AG.
# Einsteinstrasse 10, 85716 Unterschleissheim, Germany
# All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# $Id: comoonics-bootimage-initscripts-el5.spec,v 1.14 2008/12/05 16:12:58 marc Exp $
#
##
##
%define _user root
%define CONFIGDIR /%{_sysconfdir}/comoonics
%define APPDIR /opt/atix/comoonics-bootimage
%define SBINDIR /sbin
%define ENVDIR /etc/profile.d
%define ENVFILE %{ENVDIR}/%{name}.sh
%define INITDIR /etc/rc.d/init.d
%define SYSCONFIGDIR /%{_sysconfdir}/sysconfig
%define RELEASENAME Gumpn
%define PRODUCTNAME OpenSharedRoot
%define PRODUCTVERSION 5.0 pre
%define DISTRIBUTIONNAME %{PRODUCTNAME} %{PRODUCTVERSION} (%{RELEASENAME})
%define DISTRIBUTIONBASE %{DISTRIBUTIONNAME} Base
%define DISTRIBUTIONEXTRAS %{DISTRIBUTIONNAME} Extras
%define GROUPPARENT System Environment
%define GROUPCHILDEXTRAS Extras
%define GROUPCHILDBASE Base
%define GROUPCHILDSLES SLES
%define GROUPCHILDSLES10 SLES10
%define GROUPCHILDSLES11 SLES11
%define GROUPCHILDRHEL RHEL
%define GROUPCHILDRHEL4 RHEL4
%define GROUPCHILDRHEL5 RHEL5
%define GROUPCHILDRHEL6 RHEL6
%define GROUPCHILDFEDORA Fedora
Name: comoonics-bootimage-initscripts
Summary: Initscripts used by the OSR cluster environment.
Version: 1.4
BuildArch: noarch
Requires: comoonics-bootimage >= 1.4-82
# Requires: SysVinit-comoonics
Requires: comoonics-bootimage-listfiles-all
Requires: comoonics-bootimage-listfiles-fedora
#Conflicts:
Release: 19.fedora
Vendor: ATIX AG
Packager: ATIX AG <http://bugzilla.atix.de>
ExclusiveArch: noarch
URL: http://www.atix.de/
Source: http://www.atix.de/software/downloads/comoonics/comoonics-bootimage-initscripts-%{version}.tar.gz
License: GPL
Group: %{GROUPPARENT}/%{GROUPCHILDBASE}/%{GROUPCHILDFEDORA}
Distribution: %{DISTRIBUTIONBASE}
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
%description
Initscripts used by the OSR cluster environment.
%prep
%setup -n comoonics-bootimage-%{version}
%build
%install
# Files for compat
install -d -m 755 $RPM_BUILD_ROOT/%{INITDIR}
install -m755 initscripts/bootsr $RPM_BUILD_ROOT/%{INITDIR}/bootsr
install -m755 initscripts/mountcdsls $RPM_BUILD_ROOT/%{INITDIR}/mountcdsls
install -d -m 755 $RPM_BUILD_ROOT/%{APPDIR}/patches
install -m600 initscripts/fedora/halt-xtab.patch $RPM_BUILD_ROOT/%{APPDIR}/patches/halt-xtab.patch
#install -m600 initscripts/fedora/halt-local.patch $RPM_BUILD_ROOT/%{APPDIR}/patches/halt-local.patch
install -m600 initscripts/fedora/halt-killall.patch $RPM_BUILD_ROOT/%{APPDIR}/patches/halt-killall.patch
install -m600 initscripts/fedora/halt-comoonics.patch $RPM_BUILD_ROOT/%{APPDIR}/patches/halt-comoonics.patch
install -m600 initscripts/fedora/netfs-xtab.patch $RPM_BUILD_ROOT/%{APPDIR}/patches/netfs-xtab.patch
install -m600 initscripts/fedora/netfs-comoonics.patch $RPM_BUILD_ROOT/%{APPDIR}/patches/netfs-comoonics.patch
install -m600 initscripts/fedora/network-xrootfs.patch $RPM_BUILD_ROOT/%{APPDIR}/patches/network-xrootfs.patch
install -m600 initscripts/fedora/network-comoonics.patch $RPM_BUILD_ROOT/%{APPDIR}/patches/network-comoonics.patch
#install -m600 initscripts/fedora/halt.orig $RPM_BUILD_ROOT/%{APPDIR}/patches/halt.orig
install -m600 initscripts/fedora/network.orig $RPM_BUILD_ROOT/%{APPDIR}/patches/network.orig
install -m600 initscripts/fedora/netfs.orig $RPM_BUILD_ROOT/%{APPDIR}/patches/netfs.orig
install -d $RPM_BUILD_ROOT/%{SBINDIR}
#install -m755 initscripts/fedora/halt.local $RPM_BUILD_ROOT/%{SBINDIR}/halt.local
install -m755 initscripts/halt.local $RPM_BUILD_ROOT/%{SBINDIR}/halt.local
#%preun
#if [ "$1" -eq 0 ]; then
# echo "Preuninstalling comoonics-bootimage-initscripts"
# /sbin/chkconfig --del bootsr
# # we patch all versions here
# for initscript in halt network netfs; do
# if grep "comoonics patch " /etc/init.d/$initscript > /dev/null; then
# # the old way
# if [ -e /opt/atix/comoonics-bootimage/patches/${initscript}.patch ]; then
# patchfile="/opt/atix/comoonics-bootimage/patches/${initscript}.patch"
# echo -n "Unpatching initscript($patchfile)"
# cd /etc/init.d/ && patch -R -f -r /tmp/$(basename ${patchfile}).patch.rej > /dev/null < $patchfile
# if [ $? -ne 0 ]; then
# echo >&2
# echo >&2
# echo "FAILURE!!!!" >&2
# echo "Patching $initscript with patch $patchfile" >&2
# echo "You might want to consider restoring the original initscript and the patch again by:" >&2
# echo "cp /opt/atix/comoonics-bootimage/patches/${initscript}.orig /etc/init.d/${initscript}"
# echo "/opt/atix/comoonics-bootimage/manage_chroot.sh -a patch_files ${initscript}"
# echo >&2
# fi
# echo
# else
# echo -n "Unpatching $initscript ("
# for patchfile in $(ls -1 /opt/atix/comoonics-bootimage/patches/${initscript}-*.patch | sort -r); do
# echo -n $(basename $patchfile)", "
# cd /etc/init.d/ && patch -R -f -r /tmp/$(basename ${patchfile}).patch.rej > /dev/null < $patchfile
# if [ $? -ne 0 ]; then
# echo >&2
# echo >&2
# echo "FAILURE!!!!" >&2
# echo "Patching $initscript with patch $patchfile" >&2
# echo "You might want to consider restoring the original initscript and the patch again by:" >&2
# echo "cp /opt/atix/comoonics-bootimage/patches/${initscript}.orig /etc/init.d/${initscript}"
# echo "/opt/atix/comoonics-bootimage/manage_chroot.sh -a patch_files ${initscript}"
# echo >&2
# fi
# done
# echo ")"
# fi
# fi
# done
#fi
#%pre
#if this is an upgrade we need to unpatch all files
#if [ "$1" -eq 2 ]; then
# # we patch all versions here
# for initscript in halt network netfs; do
# if grep "comoonics patch " /etc/init.d/$initscript > /dev/null; then
# # the old way
# if [ -e /opt/atix/comoonics-bootimage/patches/${initscript}.patch ]; then
# patchfile="/opt/atix/comoonics-bootimage/patches/${initscript}.patch"
# echo -n "Unpatching initscript($patchfile)"
# cd /etc/init.d/ && patch -R -f -r /tmp/$(basename ${patchfile}).patch.rej > /dev/null < $patchfile
# if [ $? -ne 0 ]; then
# echo >&2
# echo >&2
# echo "FAILURE!!!!" >&2
# echo "Patching $initscript with patch $patchfile" >&2
# echo "You might want to consider restoring the original initscript and the patch again by:" >&2
# echo "cp /opt/atix/comoonics-bootimage/patches/${initscript}.orig /etc/init.d/${initscript}"
# echo "/opt/atix/comoonics-bootimage/manage_chroot.sh -a patch_files ${initscript}"
# echo >&2
# fi
# echo
# else
# echo -n "Unpatching $initscript ("
# for patchfile in $(ls -1 /opt/atix/comoonics-bootimage/patches/${initscript}-*.patch | sort -r); do
# echo -n $(basename $patchfile)", "
# cd /etc/init.d/ && patch -R -f -r /tmp/$(basename ${patchfile}).patch.rej > /dev/null < $patchfile
# if [ $? -ne 0 ]; then
# echo >&2
# echo >&2
# echo "FAILURE!!!!" >&2
# echo "Patching $initscript with patch $patchfile" >&2
# echo "You might want to consider restoring the original initscript and the patch again by:" >&2
# echo "cp /opt/atix/comoonics-bootimage/patches/${initscript}.orig /etc/init.d/${initscript}"
# echo "/opt/atix/comoonics-bootimage/manage_chroot.sh -a patch_files ${initscript}"
# echo >&2
# fi
# done
# echo ")"
# fi
# fi
# done
#fi
%post
echo "Starting postinstall.."
services="bootsr mountcdsls"
echo "Resetting services ($services)"
for service in $services; do
/sbin/chkconfig --del $service &>/dev/null
/sbin/chkconfig --add $service
/sbin/chkconfig $service on
/sbin/chkconfig --list $service
done
services=""
echo "Disabling services ($services)"
for service in $services; do
/sbin/chkconfig --del $service &> /dev/null
done
/bin/true
%postun
if [ -L %{SBINDIR}/halt.local ]; then
rm %{SBINDIR}/halt.local
fi
%files
%attr(755, root, root) %{INITDIR}/bootsr
%attr(755, root, root) %{INITDIR}/mountcdsls
%attr(644, root, root) %{APPDIR}/patches/halt-comoonics.patch
%attr(644, root, root) %{APPDIR}/patches/halt-killall.patch
#%attr(644, root, root) %{APPDIR}/patches/halt-local.patch
%attr(644, root, root) %{APPDIR}/patches/halt-xtab.patch
%attr(644, root, root) %{APPDIR}/patches/netfs-comoonics.patch
%attr(644, root, root) %{APPDIR}/patches/netfs-xtab.patch
%attr(644, root, root) %{APPDIR}/patches/network-comoonics.patch
%attr(644, root, root) %{APPDIR}/patches/network-xrootfs.patch
#%attr(755, root, root) %{APPDIR}/patches/halt.orig
%attr(755, root, root) %{APPDIR}/patches/network.orig
%attr(755, root, root) %{APPDIR}/patches/netfs.orig
%attr(755, root, root) %{SBINDIR}/halt.local
%clean
rm -rf %{buildroot}
%changelog
* Tue Oct 25 2011 Marc Grimme <grimme( at )atix.de> 1.4-19.fedora
- take bootsr from upstream.
* Tue Mar 22 2011 Marc Grimme <[email protected]> 1.4-18.fedora
- Rebase
* Mon Feb 28 2011 Marc Grimme <[email protected]> 1.4-17.fedora
- halt.local will now be a file being installed instead of a symbolic link.
* Tue Feb 22 2011 Marc Grimme <[email protected]> 1.4-16fedora
- initscripts/rhel4,rhel5,fedora,sles10,sles11/bootsr
- would work without cdsl tools being available
* Wed Aug 18 2010 Marc Grimme <[email protected]> 1.4-15fedora
- initscripts/rhel4,rhel5,fedora,sles10,sles11/bootsr
- fixed bug #382 where the cdsl.local was not remounted in /etc/mtab on locally installed systems
* Thu Jul 08 2010 Marc Grimme <[email protected]> 1.4-14fedora
- bootsr uses bash as shell
* Thu Jun 08 2010 Marc Grimme <[email protected]> 1.4-13fedora
- introduced mountcdsls
* Fri Oct 09 2009 Marc Grimme <[email protected]> 1.4-12fedora
- removed halt patches as the are not needed with /sbin/halt.local
* Tue Jul 07 2009 Marc Grimme <[email protected]> 1.4-11fedora
- Removed the patches to be applied automatically
* Mon Apr 20 2009 Marc Grimme <[email protected]> 1.4-10fedora
- RC1
* Tue Apr 16 2009 Marc Grimme <[email protected]> 1.4-9.fedora
- Syncronized bootsr and fixed calling of _init
* Wed Apr 15 2009 Marc Grimme <[email protected]> 1.4-8.fedora
- Backport of bugfixes from rhel5
* Tue Apr 14 2009 Marc Grimme <[email protected]> 1.4-7.fedora
- Multipatches and rework on building of chroot
* Wed Apr 08 2009 Marc Grimme <[email protected]> 1.4-4.fedora
- First final of multi-patches and halt.local
* Mon Apr 06 2009 Marc Grimme <[email protected]> 1.4-3.fedora
- New patch concept (only small patches)
* Tue Feb 27 2009 Marc Grimme <[email protected]> 1.4-2.fedora
- Upstream from RHEL5
* Mon Feb 02 2009 Marc Grimme <[email protected]> 1.3-3.fedora
- Bugfix in support for other filesystems
* Tue Jan 29 2009 Marc Grimme <[email protected]> 1.3.2-fedora
- first revision
# ------
# $Log: comoonics-bootimage-initscripts-el5.spec,v $