import repository from arizona
[raven.git] / rpm_builds / SPECS / stork-nest.spec.template
1 Summary: stork nest package
2 Name: stork-nest
3 Version: @VER@
4 Release: @REL@
5 License: Public Domain
6 Group: stork at U of Arizona
7 URL: http://www.cs.arizona.edu/
8 Source RPM: ftp://quadrus.cs.arizona.edu/PlanetLab/V3/stork-nest-@VER@.tar.gz
9 Vendor: University of Arizona
10 BuildRoot: %{_tmppath}/%{name}-root
11 requires: arizona-lib = @VER@-@REL@ stork-planetlab = @VER@-@REL@ stork-config proper-libs strace
12
13 %description
14 TODO: add description of this library
15
16 %prep
17 %setup -q
18
19 %build
20
21 %install
22 rm -rf %\{buildroot]
23 install -d -o 0 -g 0 %{buildroot}/usr
24 install -d -o 0 -g 0 %{buildroot}/usr/local
25 install -d -o 0 -g 0 %{buildroot}/usr/local/stork
26 install -d -o 0 -g 0 %{buildroot}/usr/local/stork/bin
27 install -d -o 0 -g 0 %{buildroot}/usr/local/stork/bin/package
28 install -d -o 0 -g 0 %{buildroot}/usr/local/stork/bin/prepare
29 install -d -o 0 -g 0 %{buildroot}/usr/local/stork/var/keys
30 install -d -o 0 -g 0 %{buildroot}/etc/init.d
31 install -d -o 0 -g 0 %{buildroot}/share/base
32 install -d -o 0 -g 0 %{buildroot}/usr/lib
33 install stork_nest_comm.init %{buildroot}/etc/init.d
34 install storkupdatedaemon %{buildroot}/etc/init.d
35 install libstorkwrap.so %{buildroot}/usr/lib/libstorkwrap.so
36 #install libproper.so.0 %{buildroot}/usr/lib/libproper.so.0
37 install stork_nest_comm.py %{buildroot}/usr/local/stork/bin
38 install pseprlib2.py %{buildroot}/usr/local/stork/bin
39 install pseprmessages.py %{buildroot}/usr/local/stork/bin
40 install stork_prepare.py %{buildroot}/usr/local/stork/bin
41 install stork_nest_update.py %{buildroot}/usr/local/stork/bin
42 install stork_nest_version.py %{buildroot}/usr/local/stork/bin
43 install arizona_share.py %{buildroot}/usr/local/stork/bin
44 install stork_rpm_prepare.py %{buildroot}/usr/local/stork/bin/prepare
45 install __init__.py %{buildroot}/usr/local/stork/bin/package
46 install __init__.py %{buildroot}/usr/local/stork/bin/prepare
47 install StorkRepository_nr06.publickey %{buildroot}/usr/local/stork/var/keys
48 install arizona_stork2.publickey %{buildroot}/usr/local/stork/var/keys
49
50
51 %clean
52 rm -rf %{buildroot}
53
54
55 %post
56 if [ $1 = 1 ]; then
57   # these actions are executed when a new copy of the nest package has been
58   # installed. Upgrades are handled in the 'else' below.
59   ln -sf /usr/lib/libproper.so.0 /usr/lib/libproper.so
60   /etc/init.d/syslog start
61   /etc/init.d/stork_nest_comm.init start
62   # disabled -- updates now handled on client /etc/init.d/storkupdatedaemon start
63 else
64   # these actions are executed when the nest package is upgraded. The services
65   # are already running, so we need to restart them.
66   /etc/init.d/syslog restart
67   /etc/init.d/stork_nest_comm.init restart
68   # disabled -- updates now handled on client /etc/init.d/storkupdatedaemon restart
69 fi
70 if [ -d /usr/lib/python2.4 ]
71 then
72         if [ -d /usr/lib/python2.4/site-packages/BitTorrent ]
73         then
74                 mv /usr/lib/python2.4/site-packages/BitTorrent /usr/lib/python2.4/site-packages/BitTorrent.bak
75         fi
76         ln -s /usr/lib/python2.3/site-packages/BitTorrent /usr/lib/python2.4/site-packages/BitTorrent 2>/dev/null
77 fi
78
79 %preun
80 if [ $1 = 0 ]; then
81   /etc/init.d/stork_nest_comm.init stop
82   /etc/init.d/storkupdatedaemon stop
83   rm -f /usr/lib/libproper.so
84 fi
85 if [ -d /usr/lib/python2.4 ]
86 then
87         if [ -d /usr/lib/python2.4/site-packages/BitTorrent.bak ]
88         then
89                 rm -f /usr/lib/python2.4/site-packages/BitTorrent 2>/dev/null
90                 mv /usr/lib/python2.4/site-packages/BitTorrent.bak /usr/lib/python2.4/site-packages/BitTorrent
91         fi
92 fi
93
94 %files
95 %defattr(-,root,root)
96 /usr/lib/libstorkwrap.so
97 #/usr/lib/libproper.so.0
98 /etc/init.d/stork_nest_comm.init
99 /etc/init.d/storkupdatedaemon
100 /usr/local/stork/bin/stork_nest_comm.py
101 /usr/local/stork/bin/stork_prepare.py
102 /usr/local/stork/bin/stork_nest_update.py
103 /usr/local/stork/bin/stork_nest_version.py
104 /usr/local/stork/bin/arizona_share.py
105 /usr/local/stork/bin/pseprlib2.py
106 /usr/local/stork/bin/pseprmessages.py
107 /usr/local/stork/bin/prepare/stork_rpm_prepare.py
108 /usr/local/stork/var/keys
109 /share/base
110 /usr/local/stork/bin/package/__init__.py
111 /usr/local/stork/bin/prepare/__init__.py
112