Changeset 845


Ignore:
Timestamp:
04/28/13 09:00:08 (11 years ago)
Author:
olahaye
Message:

[jobmonarch.spec.in] - Forced web interface ownership in %file section.

  • Use fakeroot for make install as the Makefile is also doing chown.
  • Removed the database creation; it'll be up to the user to create it A helper script will do most of the manual 1st time config. USed condrestart to restart the service upon upgrade.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.0/pkg/rpm/jobmonarch.spec.in

    r842 r845  
    1111%{!?custom_web_prefixdir: %define web_prefixdir /var/www/html/ganglia}
    1212
    13 %define gangliaroot        %{web_prefixdir}/ganglia
     13%define gangliaroot        %{web_prefixdir}
    1414%define gangliatemplatedir %{gangliaroot}/templates
    1515%define gangliaaddonsdir   %{gangliaroot}/addons
     
    2626BuildArch: noarch
    2727BuildRoot: %{_tmppath}/%{name}
     28BuildRequires: fakeroot
    2829Requires: jobmonarch-jobarchived jobmonarch-jobmond jobmonarch-webfrontend
    2930
    30 # Following requires were moved to the config.xml file in order to keep the
    31 # RPM distro-independent
    32 #Requires: mysql-client python-mysql
    33 #%if %suse_version
    34 #Requires: php5-gd >= 2.0 php5-mbstring
    35 #%else
    36 #Requires: php-gd >= 2.0 php-mbstring
    37 #%endif
    38 #AutoReqProv: no
     31AutoReqProv: no
    3932
    4033%description
     
    8780Requires: ganglia-web >= 3.5.7
    8881Requires: jobmonarch-jobmond = 1.0
    89 Requires: php-gd
     82Requires: php >= 5.3.0
    9083Requires: php-pgsql
     84%if 0%{?suse_version}
     85Requires: php5-gd >= 2.0 php5-mbstring
     86%else
     87Requires: php-gd >= 2.0 php-mbstring
     88%endif
    9189
    9290%description -n jobmonarch-webfrontend
     
    109107
    110108# Install files in RPM_BUILD_ROOT
    111 %__make install \
     109fakeroot %__make install \
    112110        PREFIX=/usr \
    113111        GANGLIA_ROOT=%{gangliaroot} \
     112        GANGLIA_USER=ganglia.ganglia \
     113        HTTPD_USER=apache.apache \
    114114        JOBARCHIVE_RRDS=%{_sharedstatedir}/jobarchive \
    115115        DESTDIR=$RPM_BUILD_ROOT
    116 
    117116
    118117%clean
     
    123122if [ "$1" = 1 ]; then
    124123    /sbin/chkconfig --add jobmond
    125     /sbin/service jobmond start
    126124elif [ "$1" = 2 ]; then
    127     /sbin/service jobmond restart
     125    /sbin/service jobmond condrestart
    128126fi
    129127
     
    131129# $1 = 1 => install ($1 = 2 => upgrade)
    132130if [ "$1" = 1 ]; then
    133     if [ -x /usr/sbin/systemctl ]; then
    134         if [ ! -d %{_sharedstatedir}/pgsql/data/base ]; then
    135             %{_bindir}/postgresql-setup initdb
    136         fi
    137         %{_sbindir}/systemctl enable postgresql
    138         %{_sbindir}/systemctl start postgresql
    139     elif [ -x /sbin/chkconfig ]; then
    140         if [ ! -d %{_sharedstatedir}/pgsql/data/base ]; then
    141             /sbin/service postgresql initdb
    142         fi
    143         /sbin/chkconfig --level 235 postgresql on
    144         /sbin/service postgresql start
    145     fi
    146131    # Generate a 8 char password for the database:
    147132    export DB_PASSWD=$(tr -dc A-Za-z0-9_< /dev/urandom |head -c 8 | xargs)
     
    152137    # Set the password in the ganglia conf.php
    153138    sed -i -e "s|^//\$JOB_ARCHIVE_SQL_PASSWORD.*|\$JOB_ARCHIVE_SQL_PASSWORD = \"$DB_PASSWD\"|g" %{gangliaaddonsdir}/job_monarch/conf.php
    154     # Create the database
    155     su -l postgres -c "%{_bindir}/createdb jobarchive"
    156     # Ccreate the tables.
    157     su -l postgres -c "%{_bindir}/psql -f %{_datadir}/jobarchived/job_dbase.sql jobarchive"
     139    # Enable the service
    158140    /sbin/chkconfig --add jobarchived
    159     /sbin/service jobarchived start
    160141elif [ "$1" = 2 ]; then
    161     /sbin/service jobarchived restart
     142    /sbin/service jobarchived condrestart
    162143fi
    163144
     
    298279%{gangliaaddonsdir}/job_monarch/dwoo/plugins/builtin/functions/count_words.php
    299280%{gangliaaddonsdir}/job_monarch/dwoo/plugins/builtin/functions/date_format.php
    300 %dir %{gangliaaddonsdir}/job_monarch/dwoo/compiled
     281%dir %attr(755,apache,apache) %{gangliaaddonsdir}/job_monarch/dwoo/compiled
    301282%dir %{gangliaaddonsdir}/job_monarch/dwoo/cache
    302283%dir %{gangliaaddonsdir}/job_monarch/dwoo/Dwoo
     
    390371- Fix the correct jobarchive rrd file path.
    391372- Generate a password for the database and update config files accordingly.
     373- Set the correct permissions for %{gangliaaddonsdir}/job_monarch/dwoo/compiled
    392374
    393375* Tue Apr 23 2013 Olivier Lahaye <olivier.lahaye@free.fr> 1.0-2
Note: See TracChangeset for help on using the changeset viewer.