root/trunk/unxsvz.spec

Revision 1582, 9.1 KB (checked in by Gary, 19 months ago)

unxsVZ preparing tools for new unxsVZ yum release.

Line 
1Summary: unxsVZ (CentOS5 yum version) is a multiple datacenter and hardware node, OpenVZ manager with autonomics.
2Name: unxsvz
3Version: 3.4
4Release: 2
5License: GPL
6Group: System Environment/Applications
7Source: http://unixservice.com/source/unxsvz-3.4.tar.gz
8URL: http://openisp.net/openisp/unxsVZ
9Distribution: unxsVZ
10Vendor: Unixservice, LLC.
11Packager: Unixservice Support Group <supportgrp@unixservice.com>
12Requires: mysql >= 5.0.45, mysql-server >= 5.0.45, httpd, mod_ssl, ovzkernel, vzctl, cstream, unxsadmin, rrdtool, vzdump
13
14%description
15unxsVZ is a multiple datacenter, multiple hardware node, OpenVZ
16container manager with autonomics, failover, auto rsync'd clones, and advanced migration.
17
18unxsVZ has internally managed rrdtool traffic graphics per datacenter, node and container.
19
20unxsVZ supports and will support more and more HA and load balancing
21functions across your private internet cloud.
22
23unxsVZ is already in commercial production and has proven itself very stable
24and extensible.
25
26unxsVZ solves numerous internet infrastructure provisioning problems including
27cost, maintenance and monitoring.
28
29
30%prep
31%setup
32
33%build
34make
35cd agents/ubc
36make
37cd $RPM_BUILD_DIR
38
39%install
40#mkdir section
41mkdir -p /var/www/unxs/html/traffic/
42mkdir -p /usr/local/share/unxsVZ/data/
43mkdir -p /usr/local/share/unxsVZ/setup/
44mkdir -p /var/lib/rrd/
45#make section
46make install
47cd agents/ubc
48make install
49#cp files section
50cd ../../data
51cp *.txt /usr/local/share/unxsVZ/data/
52cd ../tools/rrdtool/
53install README /usr/local/share/unxsVZ/README.rrdtool
54install -m 500 vz_traffic_log.sh /usr/local/sbin/vz_traffic_log.sh
55install -m 500 node_traffic_log.sh /usr/local/sbin/node_traffic_log.sh
56install -m 500 datacenter_traffic_log.sh /usr/local/sbin/datacenter_traffic_log.sh
57install -m 500 datacenter_week_graph.sh /usr/local/sbin/datacenter_week_graph.sh
58install -m 500 datacenter_month_graph.sh /usr/local/sbin/datacenter_month_graph.sh
59install -m 500 datacenter_year_graph.sh /usr/local/sbin/datacenter_year_graph.sh
60install datacenter.html /var/www/unxs/html/traffic/datacenter.html
61cp -u DejaVuSansMono-Roman.ttf /usr/share/fonts/
62cd ../datacenter/
63install -m 500 allnodescp.sh /usr/sbin/allnodescp.sh
64install -m 500 allnodecmd.sh /usr/sbin/allnodecmd.sh
65install -m 500 nodescmd.sh /usr/sbin/nodescmd.sh
66install -m 500 repclusterchk.sh /usr/sbin/repclusterchk.sh
67install -m 500 reppurge.sh /usr/sbin/reppurge.sh
68install -m 500 vzAllContainerCmd.sh /usr/sbin/vzAllContainerCmd.sh
69install -m 500 vzAllContainerInstall.sh /usr/sbin/vzAllContainerInstall.sh
70cd ../cron/
71cp root-crontab /usr/local/share/unxsVZ/setup/root-crontab
72cd ../openvz/
73cd $RPM_BUILD_DIR
74
75%post
76#todo this can be improved upon for version comparison. Also mainfunc.h UpdateSchema
77#       can be made smarter.
78if [ "$1" = "1" ]; then
79        #echo "post: Initial install";
80
81        if [ -x /sbin/chkconfig ];then
82                if [ -x /etc/init.d/httpd ];then
83                        /sbin/chkconfig --level 3 httpd on
84                        /etc/init.d/httpd restart > /dev/null 2>&1
85                        if [ $? == 0 ];then
86                                cHttpdStart="1"
87                        fi
88                fi
89                if [ -x /etc/init.d/mysqld ];then
90                        /sbin/chkconfig --level 3 mysqld on
91                        /etc/init.d/mysqld restart > /dev/null 2>&1
92                        if [ $? == 0 ];then
93                                cMySQLStart="1"
94                        fi
95                fi
96        fi
97        #if mysqld has no root passwd and we started it then we will set it and finish the data initialize
98        if [ -x /usr/bin/mysql ];then
99                if [ "$cMySQLStart" == "1" ];then
100                        echo "quit" | /usr/bin/mysql  > /dev/null 2>&1
101                        if [ $? == 0 ];then
102                                /usr/bin/mysqladmin -u root password 'ultrasecret' > /dev/null 2>&1
103                                if [ $? == 0 ];then
104                                        echo "mysqld root password set to 'ultrasecret' change ASAP!"
105                                        export ISMROOT=/usr/local/share
106                                        /var/www/unxs/cgi-bin/unxsVZ.cgi Initialize ultrasecret > /dev/null 2>&1
107                                        if [ $? == 0 ];then
108                                                cInitialize="1"
109                                        fi
110                                fi
111                        fi
112                fi
113        fi
114        #let installer know what was done.
115        if [ "$cHttpdStart" == "1" ] && [ "$cMySQLStart" == "1" ] \
116                                && [ "$cInitialize" == "1" ];then
117                echo "unxsVZ has been installed, initialized and, httpd and mysqld have been started.";
118                echo "You can proceed to login to your unxsVZ interfaces with your browser.";   
119        else
120                echo "It appears that one or more manual operations may be needed to finish";
121                echo "your unxsVZ installation.";
122                if [ "$cHttpdStart" != "1" ]; then
123                        echo "";
124                        echo "WARNING: Your httpd server was not started, run:";
125                        echo "/etc/init.d/httpd configtest";
126                        echo "Then check your httpd configuration and then:";
127                        echo "/etc/init.d/httpd start";
128                fi
129                if [ "$cMySQLStart" != "1" ]; then
130                        echo "";
131                        echo "WARNING: Your mysqld server was not started, run:";
132                        echo "/etc/init.d/mysqld start";
133                        echo "Debug any problems, then, if you do not already know your MySQL root password:";
134                        echo "/usr/bin/mysqladmin -u root password '<mysql-root-passwd>'";     
135                fi
136                if [ "$cInitialize" != "1" ]; then
137                        echo "";
138                        echo "WARNING: Your unxsVZ database was not initialized, run:";
139                        echo "export ISMROOT=/usr/local/share";
140                        echo "/var/www/unxs/cgi-bin/unxsVZ.cgi Initialize <mysql-root-passwd>";
141                        echo "Debug any problems, check via the mysql CLI, then if needed try again.";
142                fi
143        fi
144        #cat unxsVZ crontab into root crontab
145        if [ -f /usr/local/share/unxsVZ/setup/root-crontab ] && [ -d /var/spool/cron ];then
146                #do not add again
147                #this section has to be changed as well as the install system
148                #see unxsBind unxsbind.spec and /etc/cron.d/unxsbind
149                grep "unxsVZ" /var/spool/cron/root > /dev/null 2>&1
150                if [ $? != 0 ] ;then
151                        cat /usr/local/share/unxsVZ/setup/root-crontab >> /var/spool/cron/root;
152                fi
153        fi
154        #new version of rrdtool needs fontconfig ttf font, it was installed
155        #but we need to load into cache
156        if [ -x /usr/bin/fc-cache ];then
157                /usr/bin/fc-cache > /dev/null 2>&1
158        fi
159
160elif [ "$1" = "2" ]; then
161        #echo "post: Update";
162        #update schema
163        if [ -x /var/www/unxs/cgi-bin/unxsVZ.cgi ];then
164                /var/www/unxs/cgi-bin/unxsVZ.cgi UpdateSchema > /dev/null 2>&1
165        fi
166        echo "unxsVZ has been upgraded.";       
167fi
168
169%clean
170
171%files
172%doc INSTALL LICENSE
173/usr/sbin/unxsUBC
174/var/www/unxs/cgi-bin/unxsVZ.cgi
175%dir /usr/local/share/unxsVZ
176%config(noreplace) /usr/local/sbin/vz_traffic_log.sh
177%config(noreplace) /usr/local/sbin/node_traffic_log.sh
178%config(noreplace) /usr/local/sbin/datacenter_traffic_log.sh
179%config(noreplace) /usr/local/sbin/datacenter_week_graph.sh
180%config(noreplace) /usr/local/sbin/datacenter_month_graph.sh
181%config(noreplace) /usr/local/sbin/datacenter_year_graph.sh
182%config(noreplace) /var/www/unxs/html/traffic/datacenter.html
183%config(noreplace) /usr/sbin/allnodescp.sh
184%config(noreplace) /usr/sbin/allnodecmd.sh
185%config(noreplace) /usr/sbin/repclusterchk.sh
186%config(noreplace) /usr/sbin/reppurge.sh
187%config(noreplace) /usr/sbin/nodescmd.sh
188%config(noreplace) /usr/sbin/vzAllContainerCmd.sh
189%config(noreplace) /usr/sbin/vzAllContainerInstall.sh
190%dir /var/www/unxs/html/traffic/
191%dir /usr/local/share/unxsVZ/data/
192/usr/local/share/unxsVZ/data/tAuthorize.txt
193/usr/local/share/unxsVZ/data/tClient.txt
194/usr/local/share/unxsVZ/data/tConfig.txt
195/usr/local/share/unxsVZ/data/tConfiguration.txt
196/usr/local/share/unxsVZ/data/tGlossary.txt
197/usr/local/share/unxsVZ/data/tGroupType.txt
198/usr/local/share/unxsVZ/data/tJobStatus.txt
199/usr/local/share/unxsVZ/data/tLogType.txt
200/usr/local/share/unxsVZ/data/tNameserver.txt
201/usr/local/share/unxsVZ/data/tOSTemplate.txt
202/usr/local/share/unxsVZ/data/tSearchdomain.txt
203/usr/local/share/unxsVZ/data/tStatus.txt
204/usr/local/share/unxsVZ/data/tTemplate.txt
205/usr/local/share/unxsVZ/data/tTemplateSet.txt
206/usr/local/share/unxsVZ/data/tTemplateType.txt
207/usr/local/share/unxsVZ/data/tType.txt
208%dir /usr/local/share/unxsVZ/setup/
209%dir /var/lib/rrd
210/usr/local/share/unxsVZ/setup/root-crontab
211/usr/share/fonts/DejaVuSansMono-Roman.ttf
212
213
214%changelog
215* Wed Oct 26 2010 Gary Wallis <supportgrp@unixservice.com>
216- New more datacenter centric model.
217* Wed Jun 2 2010 Gary Wallis <supportgrp@unixservice.com>
218- Changed post section to use update or install conditions.
219* Fri May 28 2010 Gary Wallis <supportgrp@unixservice.com>
220- Many small changes for ease of use, especially group operations. Some new scripts.
221* Wed Sep 25 2009 Gary Wallis <supportgrp@unixservice.com>
222- Many small changes for new/mod/del and localization
223* Wed Sep 23 2009 Gary Wallis <supportgrp@unixservice.com>
224- tOSTemplate schema update for cLabel to 100 chars.
225* Tue Sep 22 2009 Gary Wallis <supportgrp@unixservice.com>
226- Several updates
227* Fri Sep 18 2009 Hugo Urquiza <support2@unixservice.com>
228- Updated file list to include more datacenter scripts
229* Thu Aug 27 2009 Gary Wallis <supportgrp@unixservice.com>
230- Bug fix and vzdump vzmigrate enhancements
231* Tue Aug 26 2009 Hugo Urquiza <support2@unixservice.com>
232- Minor spec file updates.
233* Mon Aug 24 2009 Gary Wallis <supportgrp@unixservice.com>
234- Major spec file update, based on unxsbind.spec file
235* Fri Jul 24 2009 Hugo Urquiza <support2@unixservice.com>
236- Updated spec file for correct rpm package building
237* Fri Jul 24 2009 Hugo Urquiza <support2@unixservice.com>
238- Updated spec file for correct rpm package building
239* Mon Apr 11 2009 Gary Wallis <support@unixservice.com>
240- Fixed perm install error for vz_traffic_log.sh
241* Mon Apr 11 2009 Gary Wallis <support@unixservice.com>
242- Added rrdtool traffic graph script install
243* Sun Apr 10 2009 Dilva Garmendia <support@unixservice.com>
244- Initial RPM release
245
Note: See TracBrowser for help on using the browser.