Changeset 841
- Timestamp:
- 04/25/13 16:54:27 (10 years ago)
- Location:
- branches/1.0
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.0/Makefile
r840 r841 2 2 # 3 3 TMPDIR = /tmp 4 DESTDIR = /usr/local 4 5 # Where to install 6 DESTDIR = 7 8 # Install prefix 9 PREFIX = /usr/local 10 11 # What is the location of the Ganglia web frontend 12 # i.e.: where to we install Job Monarch's web frontend addon 13 # 14 GANGLIA_ROOT = $(PREFIX)/ganglia 15 16 # Where jobarchived RRDS are stored 17 JOBARCHIVE_RRDS = $(PREFIX)/jobmonarch 5 18 6 19 # Clear this if you don't want to use ${FAKEROOT} 7 20 # 8 21 FAKEROOT = fakeroot 9 10 # What is the location of the Ganglia web frontend11 # i.e.: where to we install Job Monarch's web frontend addon12 #13 WEBDIR = /var/www/ganglia14 22 15 23 VERSION = 1.0 … … 25 33 tarball: tarball-gzip tarball-bzip 26 34 27 tarball-gzip: ${REQUIRED} rpmspec35 tarball-gzip: ${REQUIRED} ./pkg/rpm/jobmonarch.spec 28 36 mkdir -p ${TMPDIR}/.monarch_buildroot/ganglia_jobmonarch-${VERSION} 29 37 ( rsync -a --exclude=.svn --exclude=*_test* --exclude=*-example.php \ … … 32 40 mv ${TMPDIR}/.monarch_buildroot/ganglia_jobmonarch-${VERSION}.tar.gz .. 33 41 34 tarball-bzip: ${REQUIRED} rpmspec42 tarball-bzip: ${REQUIRED} ./pkg/rpm/jobmonarch.spec 35 43 mkdir -p ${TMPDIR}/.monarch_buildroot/ganglia_jobmonarch-${VERSION} 36 44 ( rsync -a --exclude=.svn --exclude=*_test* --exclude=*-example.php \ … … 39 47 mv ${TMPDIR}/.monarch_buildroot/ganglia_jobmonarch-${VERSION}.tar.bz2 .. 40 48 41 rpmspec: pkg/rpm/jobmonarch.spec.in 42 sed -e 's/__VERSION__/$(VERSION)/g' -e 's/__RELEASE__/$(RELEASE)/g' ./pkg/rpm/jobmonarch.spec.in > jobmonarch.spec 49 rpmspec: ./pkg/rpm/jobmonarch.spec 43 50 44 debpkgdir: pkg/deb/debian 45 rsync -a --exclude=.svn pkg/deb/debian debian 51 ./pkg/rpm/jobmonarch.spec: pkg/rpm/jobmonarch.spec.in 52 sed -e 's/__VERSION__/$(VERSION)/g' -e 's/__RELEASE__/$(RELEASE)/g' ./pkg/rpm/jobmonarch.spec.in > ./pkg/rpm/jobmonarch.spec 53 54 debian: pkg/deb/debian 55 rsync -a --exclude=.svn pkg/deb/debian ./ 46 56 sed -i -e 's/^Version:.*$//Version: $(VERSION)-$(RELEASE)/g' ./debian/control 47 57 … … 49 59 rpmbuild -tb ../ganglia_jobmonarch-${VERSION}.tar.bz2 50 60 51 deb: deb pkgdir61 deb: debian 52 62 dpkg-buildpackage -b 53 63 54 64 install: 55 # Files in SBIN_DIR 56 install -m 0755 -d $(DESTDIR)/usr/sbin 57 install -m 0755 jobmond/jobmond.py $(DESTDIR)/usr/sbin/ 58 install -m 0755 jobarchived/jobarchived.py $(DESTDIR)/usr/sbin/ 59 (cd $(DESTDIR)/usr/sbin/; ln -s jobmond.py jobmond; ln -s jobarchived.py jobarchived) 60 # 61 # Files specific to distros if /etc/sysconfig => rpm else (/etc/default => debian) 62 if test -d /etc/sysconfig; then \ 65 @# 66 @# Set the correct GANGLIA_PATH. 67 @# 68 @echo "\nUsing $(GANGLIA_ROOT) as Ganglia root installation path. If it's not what" 69 @echo "you want, use make GANGLIA_ROOT=/path/to/your/ganglia/root ." 70 @sed -i -e 's|/var/www/ganglia/|$(GANGLIA_ROOT)/|g' web/addons/job_monarch/conf.php 71 @# 72 @# Set the correct JOBARCHIVE_RRDS in jobarchve.conf and ganglia conf.php 73 @# 74 @echo "\nUsing $(JOBARCHIVE_RRDS) as jobarchive path to store rrds files. If it's not what" 75 @echo "you want, use make JOBARCHIVE_RRDS=/path/to/you/jobarchived/rrdsfiles ." 76 @sed -i -e 's|/var/lib/jobarchive|$(JOBARCHIVE_RRDS)|g' jobarchived/jobarchived.conf web/addons/job_monarch/conf.php 77 @# 78 @# Files in SBIN_DIR 79 @# 80 @echo "\nInstalling jobmond.py and jobarchived.py to $(PREFIX)/sbin" 81 @install -m 0755 -d $(DESTDIR)$(PREFIX)/sbin 82 @install -m 0755 jobmond/jobmond.py $(DESTDIR)$(PREFIX)/sbin/ 83 @install -m 0755 jobarchived/jobarchived.py $(DESTDIR)$(PREFIX)/sbin/ 84 @(cd $(DESTDIR)$(PREFIX)/sbin/; ln -s jobmond.py jobmond; ln -s jobarchived.py jobarchived) 85 @# 86 @# Files specific to distros if /etc/sysconfig => rpm else (/etc/default => debian) 87 @# 88 @echo "\nInstalling service files in $(DESTDIR)/etc" 89 @if test -d /etc/sysconfig; then \ 63 90 install -m 0755 -d $(DESTDIR)/etc/rc.d/init.d; \ 64 91 install -m 0755 pkg/rpm/init.d/jobmond $(DESTDIR)/etc/rc.d/init.d/; \ … … 75 102 install -m 0755 pkg/deb/default/jobarchived $(DESTDIR)/etc/default; \ 76 103 fi 77 # 78 # Files in /etc 79 # 80 install -m 0644 jobmond/jobmond.conf $(DESTDIR)/etc; \ 81 install -m 0644 jobarchived/jobarchived.conf $(DESTDIR)/etc; \ 82 # 83 # Files in /usr/share 84 # 85 install -m 0755 -d $(DESTDIR)/usr/share/jobarchived/ 86 install -m 0755 jobarchived/job_dbase.sql $(DESTDIR)/usr/share/jobarchived/ 87 # 88 # Create the /var/lib/jobarchive directory where rrds are stored. 89 # 90 install -m 0755 -d $(DESTDIR)/var/lib/jobarchive/ 91 # 92 # Files for ganglia (adapt to rpm or deb or unknown ganglia packaging) 93 # 94 if test -d /etc/sysconfig; then \ 95 install -m 0755 -d $(DESTDIR)/usr/share/ganglia; \ 96 (cd web; rsync -a --exclude=.svn --exclude=*_test* --exclude=*-example.php . $(DESTDIR)/usr/share/ganglia); \ 97 elif test -d /etc/default; then \ 98 install -m 0755 -d $(DESTDIR)/usr/share/ganglia-webfrontend; \ 99 (cd web; rsync -a --exclude=.svn --exclude=*_test* --exclude=*-example.php . $(DESTDIR)/usr/share/ganglia-webfrontend); \ 100 else \ 101 install -m 0755 -d $(DESTDIR)/$(WEBDIR); \ 102 (cd web; rsync -a --exclude=.svn --exclude=*_test* --exclude=*-example.php . $(DESTDIR)/$(WEBDIR)); \ 103 fi 104 104 @# 105 @# Files in /etc 106 @# 107 @echo "\nInstalling config files jobmond.conf jobarchived.conf in $(DESTDIR)/etc" 108 @install -m 0644 jobmond/jobmond.conf $(DESTDIR)/etc 109 @install -m 0644 jobarchived/jobarchived.conf $(DESTDIR)/etc 110 @# 111 @# Files in /usr/share 112 @# 113 @echo "\nInstalling job_dbase.sql in $(PREFIX)/share/jobarchived" 114 @install -m 0755 -d $(DESTDIR)$(PREFIX)/share/jobarchived 115 @install -m 0755 jobarchived/job_dbase.sql $(DESTDIR)$(PREFIX)/share/jobarchived/ 116 @# 117 @# Create the /var/lib/jobarchive directory where rrds are stored. 118 @# 119 @echo "\nCreating the directory where RRDs will be stored: $(JOBARCHIVE_RRDS)" 120 @install -m 0755 -d $(DESTDIR)$(JOBARCHIVE_RRDS) 121 @# 122 @# Files for ganglia (adapt to rpm or deb or unknown ganglia packaging) 123 @# 124 @echo "\nInstalling Ganglia web interface to $(GANGLIA_ROOT) ." 125 @install -m 0755 -d $(DESTDIR)$(GANGLIA_ROOT) 126 @(cd web; rsync -a --exclude=.svn --exclude=*_test* --exclude=*-example.php . $(DESTDIR)$(GANGLIA_ROOT)/) 127 @# 128 @echo "\nInstallation complete.\n" 105 129 106 130 deb-webfrontend: ${REQUIRED} 107 131 mkdir -p ${TMPDIR}/.monarch_buildroot/jobmonarch-webfrontend_${VERSION}-${RELEASE}/DEBIAN >/dev/null 108 mkdir -p ${TMPDIR}/.monarch_buildroot/jobmonarch-webfrontend_${VERSION}-${RELEASE}/${ WEBDIR} >/dev/null132 mkdir -p ${TMPDIR}/.monarch_buildroot/jobmonarch-webfrontend_${VERSION}-${RELEASE}/${GANGLIA_ROOT} >/dev/null 109 133 ( cd web; rsync -a --exclude=.svn --exclude=*_test* --exclude=*-example.php \ 110 . ${TMPDIR}/.monarch_buildroot/jobmonarch-webfrontend_${VERSION}-${RELEASE}/${ WEBDIR} )134 . ${TMPDIR}/.monarch_buildroot/jobmonarch-webfrontend_${VERSION}-${RELEASE}/${GANGLIA_ROOT} ) 111 135 ( cd pkg/deb/web/DEBIAN; \ 112 136 rsync -a --exclude=.svn --exclude=*_test* --exclude=*-example.php \ … … 165 189 clean: 166 190 rm -rf ${TMPDIR}/.monarch_buildroot 167 rm -rf ./ jobmonarch.spec191 rm -rf ./pkg/rpm/jobmonarch.spec 168 192 rm -rf ./debian -
branches/1.0/jobarchived/jobarchived.conf
r839 r841 76 76 # 77 77 JOB_SQL_DBASE : localhost/jobarchive 78 JOB_SQL_USER : jobarchive78 JOB_SQL_USER : jobarchive 79 79 80 80 #JOB_SQL_PASSWORD : -
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.