Changeset 841 for branches/1.0/pkg
- Timestamp:
- 04/25/13 16:54:27 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.0/pkg/rpm/jobmonarch.spec.in
r840 r841 52 52 Requires: postgresql >= 8.1.22 53 53 Requires: postgresql-server >= 8.1.22 54 Requires: ganglia-gmond 54 55 Requires: python >= 2.5 55 Requires: python-rrdtool56 56 Requires: python-psycopg2 57 Requires: rrdtool-python rrdtool 57 58 58 59 %description -n jobmonarch-jobarchived … … 67 68 Requires: python >= 2.5 68 69 Requires: pbs_python 70 Requires: ganglia-gmetad 69 71 # Requires: lsf_python 70 72 … … 75 77 %package -n jobmonarch-webfrontend 76 78 Summary: webfrontend is the ganglia webfrontend for jobmonarch. 77 Requires: ganglia- gmetad >= 3.5.0 ganglia-web >= 3.5.779 Requires: ganglia-web >= 3.5.7 78 80 Requires: jobmonarch-jobmond = 1.0 81 Requires: php-gd 82 Requires: php-pgsql 79 83 80 84 %description -n jobmonarch-webfrontend … … 92 96 rm -rf $RPM_BUILD_ROOT 93 97 94 # Set the correct GANGLIA_PATH.95 sed -i -e 's|/var/www/ganglia/|%{gangliaroot}/|g' web/addons/job_monarch/conf.php96 98 97 99 # Fix rrdtool web link in footer: 98 sed -i -e 's|http:/www.rrdtool.com/|http:/oss.oetiker.ch/rrdtool/|g' ./web/addons/job_monarch/templates/footer.tpl 99 100 %__make install DESTDIR=$RPM_BUILD_ROOT 101 102 # Create the directory structure. 103 #install -m 0755 -d $RPM_BUILD_ROOT/%{_sbindir} 104 #install -m 0755 -d $RPM_BUILD_ROOT%{_initrddir} 105 #install -m 0755 -d $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig 106 #install -m 0755 -d $RPM_BUILD_ROOT%{gangliatemplatedir} 107 #install -m 0755 -d $RPM_BUILD_ROOT%{gangliaaddonsdir} 108 #install -m 0755 -d $RPM_BUILD_ROOT%{_datadir}/jobarchived/ 109 #install -m 0755 -d $RPM_BUILD_ROOT%{_sharedstatedir}/jobarchived/ 110 111 # Install jobmond files 112 #install -m 0644 jobmond/jobmond.conf $RPM_BUILD_ROOT%{_sysconfdir}/ 113 #install -m 0755 jobmond/jobmond.py $RPM_BUILD_ROOT/%{_sbindir}/ 114 #install -m 0755 pkg/rpm/init.d/jobmond $RPM_BUILD_ROOT%{_initrddir}/ 115 #install -m 0755 pkg/rpm/sysconfig/jobmond $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/ 116 #(cd $RPM_BUILD_ROOT/%{_sbindir}/; ln -s jobmond.py jobmond) 117 118 # Install jobarchived files 119 #install -m 0644 jobarchived/jobarchived.conf $RPM_BUILD_ROOT%{_sysconfdir}/ 120 #install -m 0755 jobarchived/jobarchived.py $RPM_BUILD_ROOT/%{_sbindir}/ 121 #install -m 0755 pkg/rpm/init.d/jobarchived $RPM_BUILD_ROOT%{_initrddir}/ 122 #install -m 0755 pkg/rpm/sysconfig/jobarchived $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/ 123 #install -m 0755 jobarchived/job_dbase.sql $RPM_BUILD_ROOT%{_datadir}/jobarchived/ 124 #(cd $RPM_BUILD_ROOT/%{_sbindir}/; ln -s jobarchived.py jobarchived) 125 126 # Install gangliaweb interface 127 #cp %{gangliatemplatedir}/default/images/logo.jpg web/templates/job_monarch/images 128 #cp -r web/templates/job_monarch $RPM_BUILD_ROOT%{gangliatemplatedir}/job_monarch 129 #cp -r web/addons/job_monarch $RPM_BUILD_ROOT%{gangliaaddonsdir}/job_monarch 100 #sed -i -e 's|http:/www.rrdtool.com/|http:/oss.oetiker.ch/rrdtool/|g' ./web/addons/job_monarch/templates/footer.tpl 101 102 # Install files in RPM_BUILD_ROOT 103 %__make install \ 104 PREFIX=/usr \ 105 GANGLIA_ROOT=%{gangliaroot} \ 106 JOBARCHIVE_RRDS=%{_sharedstatedir}/jobarchive \ 107 DESTDIR=$RPM_BUILD_ROOT 108 130 109 131 110 %clean … … 133 112 134 113 %post -n jobmonarch-jobmond 135 if [ -x /sbin/chkconfig ]; then 114 # $1 = 1 => install ($1 = 2 => upgrade) 115 if [ "$1" = 1 ]; then 136 116 /sbin/chkconfig --add jobmond 117 /sbin/service jobmond start 118 elif [ "$1" = 2 ]; then 119 /sbin/service jobmond restart 137 120 fi 138 121 139 122 %post -n jobmonarch-jobarchived 140 if [ -x /sbin/chkconfig ]; then 141 if [ ! -d /var/lib/pgsql/data/base ]; then 142 /sbin/service postgresql initdb 123 # $1 = 1 => install ($1 = 2 => upgrade) 124 if [ "$1" = 1 ]; then 125 if [ -x /usr/sbin/systemctl ]; then 126 if [ ! -d %{_sharedstatedir}/pgsql/data/base ]; then 127 %{_bindir}/postgresql-setup initdb 128 fi 129 %{_sbindir}/systemctl enable postgresql 130 %{_sbindir}/systemctl start postgresql 131 elif [ -x /sbin/chkconfig ]; then 132 if [ ! -d %{_sharedstatedir}/pgsql/data/base ]; then 133 /sbin/service postgresql initdb 134 fi 135 /sbin/chkconfig --level 235 postgresql on 136 /sbin/service postgresql start 143 137 fi 144 /sbin/service postgresql start 145 su -l postgres -c "/usr/bin/createdb jobarchive" 146 su -l postgres -c "/usr/bin/psql -f /usr/share/jobarchived/job_dbase.sql jobarchive" 138 # Generate a 8 char password for the database: 139 export DB_PASSWD=$(tr -dc A-Za-z0-9_< /dev/urandom |head -c 8 | xargs) 140 # Set the password in the SQL script 141 sed -i -e '/^.*modify me:.*$/d' -e 's/^#CREATE/CREATE/g' -e "s/'';/'$DB_PASSWD';/g" %{_datadir}/jobarchived/job_dbase.sql 142 # Set the password in the jobarchived config. 143 sed -i -s "s/^#JOB_SQL_PASSWORD.*$/JOB_SQL_PASSWORD\t\t: $DB_PASSWD/g" %{_sysconfdir}/jobarchived.conf 144 # Create the database 145 su -l postgres -c "%{_bindir}/createdb jobarchive" 146 # Ccreate the tables. 147 su -l postgres -c "%{_bindir}/psql -f %{_datadir}/jobarchived/job_dbase.sql jobarchive" 147 148 /sbin/chkconfig --add jobarchived 149 /sbin/service jobarchived start 150 elif [ "$1" = 2 ]; then 151 /sbin/service jobarchived restart 148 152 fi 149 153 … … 174 178 echo "Make sure to set your Ganglia template to previous config now" 175 179 echo "" 176 echo "In your Ganglia conf.php, re move this line:"177 echo "\$template_name = \" job_monarch\";"180 echo "In your Ganglia conf.php, restore your previous template:" 181 echo "\$template_name = \"default\";" 178 182 fi 179 183 … … 183 187 %files -n jobmonarch-jobmond 184 188 %doc jobmond/examples 185 %config %{_sysconfdir}/jobmond.conf189 %config(noreplace) %{_sysconfdir}/jobmond.conf 186 190 %{_sysconfdir}/sysconfig/jobmond 187 191 %{_initrddir}/jobmond … … 191 195 %files -n jobmonarch-jobarchived 192 196 %doc jobarchived/examples 193 %config %{_sysconfdir}/jobarchived.conf197 %config(noreplace) %{_sysconfdir}/jobarchived.conf 194 198 %{_sysconfdir}/sysconfig/jobarchived 195 199 %{_initrddir}/jobarchived … … 207 211 %dir %{gangliatemplatedir}/job_monarch/images 208 212 %{gangliatemplatedir}/job_monarch/images/logo.jpg 209 %config %{gangliaaddonsdir}/job_monarch/conf.php213 %config(noreplace) %{gangliaaddonsdir}/job_monarch/conf.php 210 214 %{gangliaaddonsdir}/job_monarch/ajax-loader.gif 211 215 %{gangliaaddonsdir}/job_monarch/cal.gif … … 375 379 - Fix the correct gangliaroot path 376 380 - Fix the correct jobarchive rrd file path. 381 - Generate a password for the database and update config files accordingly. 377 382 378 383 * Tue Apr 23 2013 Olivier Lahaye <olivier.lahaye@free.fr> 1.0-2
Note: See TracChangeset
for help on using the changeset viewer.