-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcartographer.spec
322 lines (276 loc) · 9.64 KB
/
cartographer.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
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
# $Id: cartographer.spec 149 2011-03-31 14:27:48Z rdk $
# Copyright 2011, Krupczak.org, LLC
#
# 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 2 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, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA
# build package with rpmbuild -bb pkg.spec
# examine scripts with rpm -qp --scripts pkg.rpm
# examine contents with rpm -qpl pkg.rpm
# install with rpm -i --nodeps pkg.rpm
# --nodeps due to the fact we bundle all platform binaries in each package
# dry run of install with rpm -i --test pkg.rpm
# actually install with rpm -iUv pkg.rpm
# remove package with rpm -e -vv pkg.rpm
# we rely on 32-bit libxml2 (yum install libxml2.i386)
# keep RPM from making an empty debug package
%define debug_package %{nil}
# disable the automagic dependency generator from
# finding/requiring a whole bunch of solaris dependencies
# also disable the automatic "provides" calcuations
# this tag does both
AutoReqProv: no
# location definitions so we can build in our development/release directory
%define _rpmdir /krupczak/rdk/tmp/rpmbuild
%define release_location /krupczak/rdk/tmp/agent/release
%define instprefix /opt/cartographer
BuildRoot: /krupczak/rdk/tmp/rpmbuild
Summary: Cartographer agent, plugins, tools, and example XMP PDUs
Name: cartographer
Version: 1.3
Release: 1
Group: Applications/System
URL: http://www.krupczak.org/cartographer
Vendor: The Krupczak Organization
Requires: libxml2
Prefix: %{instprefix}
# Icon: Cartographer.gif
# BuildArch: noarch
License: korg-license.txt
# don't strip binaries
%define __os_install_post %{nil}
%description
Cartographer implements a novel approach to managing distributed
systems by automatically discovering and tracking the relationships
between its component systems and applications. Cartographer does so
via specially designed agents -- residing on clients, servers and
(potentially) network devices -- that detect, identify, and track the
inter and intra-system dependencies or relationships. Dependencies
include network level services like DNS, DHCP, and SMTP as well as
higher-level application abstractions like filesystems, databases,
directory services, telephony, and middleware.
# ----------------------------------------------------------
# no build/prep needed to build the package; before building
# the RPM, you must actually make release on all the
# supported platforms
%prep
%build
# ----------------------------------------------------------
%install
# copy release files to
export RELEASE_LOCATION=%{release_location}
mkdir -p $RPM_BUILD_ROOT%{instprefix}
cp -f ${RELEASE_LOCATION}/* $RPM_BUILD_ROOT%{instprefix}
# ----------------------------------------------------------
%clean
rm -rf $RPM_BUILD_ROOT%{instprefix}
# ----------------------------------------------------------
#
# pre-install commands here
# check for upgrade so we
# can preserve config files, pem files, csr files
#
%pre
if [ "$1" -gt 1 ]; then
cd $RPM_INSTALL_PREFIX0
for file in cartographer.xml cartographer-local.xml connectiondata.xml xmpd.xml appdata.xml *.pem *.csr; do
if [ -f $file ]; then
cp $file $file.preserve
fi
done
fi
# call echo so script does not bomb due to failure of previous
# commands
echo -n
# ----------------------------------------------------------
#
# post install script commands here
# $1 is the count option specifying
# 1 for first time, 2 or higher for upgrades
# 0 for remove last version of package
#
%post
# figure out which linux we are on
# are we an upgrade?
# if we are an upgrade, copy back the preserved configs, pems, csrs
if [ "$1" -gt 1 ]; then
cd $RPM_INSTALL_PREFIX0
for file in *.preserve; do
mv ${file%.*} ${file%.*}.fcs
mv $file ${file%.*}
done
fi
# cp startup script to /etc/init.d/
if [ -x "$RPM_INSTALL_PREFIX0" ]; then
cp -f $RPM_INSTALL_PREFIX0/init.linux /etc/init.d/cartographer
fi
# register; ignore if its already been registered
/sbin/chkconfig --add cartographer
# ldd the binary? start cartographer agent? Not now.
# we should check to see if libxml2.i386 is installed
# its the only 32-bit lib we need that is not commonly installed
# on 64-bit machines; it *should* be installed by default but
# is often not; dont fail the install though if its not present
if [ ! -f /usr/lib/libxml2.so.2 ]; then
echo "32-bit libxml2 may not be installed; please double check."
fi
# call echo so script does not bomb due to failure of previous
# commands
echo -n
# ----------------------------------------------------------
#
# pre-remove script commands here
#
%preun
if [ "$1" = 0 ]; then
/sbin/service cartographer stop > /dev/null 2>&1
/sbin/chkconfig --del cartographer
/usr/bin/pkill -u root xmpd-linux
fi
# call echo 0 so script does not bomb due to failure of previous
# commands
echo -n
# ----------------------------------------------------------
#
# post uninstall script
# do final cleanup
# use RPM_INSTALL_PREFIX0 which should be set because
# we set prefix in original spec file
#
%postun
if [ "$1" = 0 ]; then
if [ -x "$RPM_INSTALL_PREFIX0" ]; then
# remove any .old files
rm -f $RPM_INSTALL_PREFIX0/*.old
# remove any .new files
rm -f $RPM_INSTALL_PREFIX0/*.new
# remove any .csr and .pem files
rm -f $RPM_INSTALL_PREFIX0/*.csr
rm -f $RPM_INSTALL_PREFIX0/*.pem
# remove dir
rmdir $RPM_INSTALL_PREFIX0
fi
# just in case chkconfig did not remove this file
rm -f /etc/init.d/cartographer
fi
# call echo so script does not bomb due to failure of previous
# commands
echo -n
# ----------------------------------------------------------
%files
# -rwxr-xr-x
%defattr(755 root root)
/opt/cartographer/cartographer-linux.so
/opt/cartographer/cartographer-local.xml
/opt/cartographer/cartographer-solaris.so
/opt/cartographer/cartographer-solx86.so
/opt/cartographer/cartographer-win32.dll
/opt/cartographer/cartographertray.exe
/opt/cartographer/iconv.dll
/opt/cartographer/init.linux
/opt/cartographer/init.solaris
/opt/cartographer/libcrypto-linux.so
/opt/cartographer/libcrypto-solx86.so
/opt/cartographer/libcrypto-sparcv9.so
/opt/cartographer/libeay32.dll
/opt/cartographer/libpcre-linux.so
/opt/cartographer/libpcre-solx86.so
/opt/cartographer/libpcre-sparcv9.so
/opt/cartographer/libssl-linux.so
/opt/cartographer/libssl-solx86.so
/opt/cartographer/libssl-sparcv9.so
/opt/cartographer/libxml2.dll
/opt/cartographer/mib2-linux.so
/opt/cartographer/mib2-solaris.so
/opt/cartographer/mib2-solx86.so
/opt/cartographer/mib2-win32.dll
/opt/cartographer/pcre.dll
/opt/cartographer/ntsetup.exe
/opt/cartographer/pthreadVC1.dll
/opt/cartographer/restartxmpd.exe
/opt/cartographer/restartxmpd.sh
/opt/cartographer/ssleay32.dll
/opt/cartographer/testplugin-linux.so
/opt/cartographer/testplugin-solaris.so
/opt/cartographer/testplugin-solx86.so
/opt/cartographer/testplugin-win32.dll
/opt/cartographer/xmpd-linux
/opt/cartographer/xmpd-solaris
/opt/cartographer/xmpd-solx86
/opt/cartographer/xmpd-win32.exe
/opt/cartographer/xmpgetsubgraph-linux
/opt/cartographer/xmpgetsubgraph-win32.exe
/opt/cartographer/xmpgetsubgraph-solaris
/opt/cartographer/xmpgetsubgraph-solx86
/opt/cartographer/xmpquery-linux
/opt/cartographer/xmpquery-solaris
/opt/cartographer/xmpquery-solx86
/opt/cartographer/xmpquery-win32.exe
/opt/cartographer/zlib1.dll
/opt/cartographer/xmptomrtg-linux
/opt/cartographer/xmptomrtg-solaris
/opt/cartographer/xmptomrtg-solx86
/opt/cartographer/xmptomrtg-win32.exe
# -rw-r--r--
%defattr(644 root root 755)
/opt/cartographer/appdata.xml
/opt/cartographer/cartographer.pem
/opt/cartographer/cartographer.xml
/opt/cartographer/connectiondata.xml
/opt/cartographer/xmp-1.0.xsd
/opt/cartographer/xmpcoldstart.xml
/opt/cartographer/xmpd.xml
/opt/cartographer/xmpget.xml
/opt/cartographer/xmpgetaddrtable.xml
/opt/cartographer/xmpgetarptable.xml
/opt/cartographer/xmpgetcartographer.xml
/opt/cartographer/xmpgetcoremib.xml
/opt/cartographer/xmpgetcputable.xml
/opt/cartographer/xmpgetdepends.xml
/opt/cartographer/xmpgetdiskstats.xml
/opt/cartographer/xmpgetendpttable.xml
/opt/cartographer/xmpgetevent.reply.xml
/opt/cartographer/xmpgetevent.xml
/opt/cartographer/xmpgetevents.xml
/opt/cartographer/xmpgetfilesys.xml
/opt/cartographer/xmpgetgraph.xml
/opt/cartographer/xmpgeticmp.xml
/opt/cartographer/xmpgetiftable.xml
/opt/cartographer/xmpgetiftableresp.xml
/opt/cartographer/xmpgetip.xml
/opt/cartographer/xmpgetmodulecontent.xml
/opt/cartographer/xmpgetmodulecontent1.xml
/opt/cartographer/xmpgetmodules.xml
/opt/cartographer/xmpgetparms.xml
/opt/cartographer/xmpgetpeers.xml
/opt/cartographer/xmpgetplugins.xml
/opt/cartographer/xmpgetprocs.xml
/opt/cartographer/xmpgetroutes.xml
/opt/cartographer/xmpgetstatus.xml
/opt/cartographer/xmpgetsysdescr.xml
/opt/cartographer/xmpgetsyserror.xml
/opt/cartographer/xmpgetsysinfometrics.xml
/opt/cartographer/xmpgettcp.xml
/opt/cartographer/xmpgettcptable.xml
/opt/cartographer/xmpgetudptable.xml
/opt/cartographer/xmpgetxmpdproc.xml
/opt/cartographer/xmpgetxmpstats.xml
/opt/cartographer/xmplongresponse.xml
/opt/cartographer/xmpprune.xml
/opt/cartographer/xmpresponse.xml
/opt/cartographer/xmpsetparms.xml
/opt/cartographer/xmptypes-1.0.xsd
/opt/cartographer/korg-license.txt
/opt/cartographer/Cartographer.gif
%changelog