attempt to automate drupal post install
[plewww.git] / PLCWWW.spec
1 #
2 # $Id$
3 #
4 %define name PLCWWW
5 %define version PLE.5.0
6 %define taglevel 0
7
8 # no need to mention pldistro as this module differs in both distros
9 #%define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
10 %define release %{taglevel}%{?date:.%{date}}
11
12 Summary: PlanetLab Europe (PLC) Web Pages
13 Name: %{name}
14 Version: %{version}
15 Release: %{release}
16 License: PlanetLab
17 Group: Applications/Systems
18 Source0: %{name}-%{version}.tar.gz
19 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
20 BuildArch: noarch
21
22 Vendor: OneLab
23 Packager: OneLab <support@one-lab.org>
24 Distribution: PlanetLab %{version}
25 URL: http://svn.one-lab.org/svn/new_plc_www/
26
27 # We use set everywhere
28 #Requires: httpd >= 2.0
29 Requires: php >= 5.0
30 Requires: postgresql >= 8.0
31 Requires: PLCAPI >= 5.0
32 Requires: drupal >= 6.7
33
34 # on centos5, when rebuilding the full monty, we get:
35 # Error: Missing Dependency: perl(GD) is needed by package PLCWWW
36 # and the perl-GD rpm is nowhere to be found
37 AutoReqProv: no
38
39 %description
40 The PLCWWW package is made of the web pages that run on top of the 
41 PLCAPI component to provide the Web Interface to MyPLC users.
42
43 %prep
44 %setup -q
45
46 %build
47 echo "There is no build stage for this component"
48 echo "All files just need to be installed as is from the codebase"
49
50 %install
51 rm -rf $RPM_BUILD_ROOT
52
53 #
54 # plcwww
55 #
56
57 echo "* PLEWWW: Installing web pages"
58 mkdir -p $RPM_BUILD_ROOT/var/www/html
59 # let's be conservative and exclude codebase files, though there should not be any
60 rsync -a --exclude \*.spec --exclude .svn --exclude CVS ./ $RPM_BUILD_ROOT/var/www/html/
61
62 echo "* PLEWWW: Installing config for httpd"
63 install -D -m 644 planetlab.conf $RPM_BUILD_ROOT/etc/httpd/conf.d/planetlab.conf
64
65 %post
66 # attempt to perform most of the drupal post-install stuff - assuming version 6.x
67 drupal_settings_dir=/var/www/html/sites/default
68 if [ ! -d $drupal_settings_dir ] ; then
69     echo "Could not find directory $drupal_settings_dir"
70     echo "This suggests that you do not have a planetlab-custom drupal installed"
71     exit 1
72 fi
73 pushd $drupal_settings_dir
74 if [ ! -f settings.php ] ; then
75     sed -e 's|^[ \t]*\$db_url|$db_url="pgsql://" . PLC_DB_USER . ":" . PLC_DB_PASSWORD . "@" . PLC_DB_HOST . ":" PLC_DB_PORT . "/drupal";|' \
76         default.settings.php > settings.php
77     chown apache:apache settings.php
78     chmod 444 settings.php
79 fi
80 popd
81 drupal_files_dir=/var/www/html/files
82 if [ ! -d $drupal_files_dir ] ; then
83     mkdir -p $drupal_files_dir
84     chown apache:apache $drupal_files_dir
85 fi
86
87 %clean
88 rm -rf $RPM_BUILD_ROOT
89
90 %files
91 %defattr(-,root,root,-)
92 /var/www/html
93 /etc/httpd/conf.d/planetlab.conf
94
95 %changelog
96 * Fri Apr 25 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCWWW-onelab.4.2-11
97 - everyone is welcome to add nodes
98
99 * Thu Apr 24 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCWWW-onelab.4.2-10
100 - node-specific bootcd images to include arch in their name
101
102 * Wed Apr 23 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCWWW-onelab.4.2-9
103 - remove explicit dep to bootcd as the rpm name has changed
104
105 * Mon Mar 03 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCWWW-4.2-7 PLCWWW-4.2-8
106 - noarch
107
108 * Fri Feb 15 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCWWW-4.2-6 PLCWWW-4.2-7
109 - should fix yum.conf on nodes after install
110
111 * Thu Feb 14 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCWWW-4.2-5 PLCWWW-4.2-6
112 - uses different path for getbootmedium results - should be safer
113
114 * Sun Feb 10 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCWWW-4.2-4 PLCWWW-4.2-5
115 - comon icon replaced with the one from the comon website
116
117 * Fri Feb 08 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCWWW-4.2-3 PLCWWW-4.2-4
118 - displays rpms in the about page
119
120 * Thu Feb 07 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCWWW-4.2-2 PLCWWW-4.2-3
121 - safer, reference-less, way to implement layout mechnism - see
122 - settings.php for details
123 - setting types properly displayed according to user's role
124 - setting deletion : fixed (was still using code from slice attribute)
125 - more comon buttons : in the nodes and peers index pages
126 - comon_button knows about peer_id
127
128 * Tue Jan 22 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCWWW-4.2-1 PLCWWW-4.2-2
129 - merged the PlanetLabConf from Princeton's tag PLCWWW-4.1-1
130
131 * Mon Apr 16 2007 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> -
132 - Initial build.