[freeside-commits] freeside/install/rpm freeside.spec, 1.1.4.11, 1.1.4.12
Richard Siddall
rsiddall at wavetail.420.am
Wed Nov 7 19:04:32 PST 2007
Update of /home/cvs/cvsroot/freeside/install/rpm
In directory wavetail:/tmp/cvs-serv20029
Modified Files:
Tag: FREESIDE_1_7_BRANCH
freeside.spec
Log Message:
Added %post scriptlet to change User/Group in the local Apache instance
configuration file to freeside. (Code from Debian install script.)
Index: freeside.spec
===================================================================
RCS file: /home/cvs/cvsroot/freeside/install/rpm/Attic/freeside.spec,v
retrieving revision 1.1.4.11
retrieving revision 1.1.4.12
diff -u -d -r1.1.4.11 -r1.1.4.12
--- freeside.spec 8 Nov 2007 02:15:47 -0000 1.1.4.11
+++ freeside.spec 8 Nov 2007 03:04:29 -0000 1.1.4.12
@@ -25,7 +25,8 @@
%define freeside_lock /var/lock/freeside
%define freeside_log /var/log/freeside
%define rt_enabled 0
-%define apache_conf /etc/httpd/conf.d
+%define apache_conffile /etc/httpd/conf/httpd.conf
+%define apache_confdir /etc/httpd/conf.d
%define apache_version 2
%define fs_queue_user fs_queue
%define fs_selfservice_user fs_selfservice
@@ -147,13 +148,13 @@
" $RPM_BUILD_ROOT%{_initrddir}/%{name}
# Install the HTTPD configuration snippet for HTML::Mason
-%{__mkdir_p} $RPM_BUILD_ROOT%{apache_conf}
-%{__make} install-apache FREESIDE_DOCUMENT_ROOT=%{freeside_document_root} RT_ENABLED=%{rt_enabled} APACHE_CONF=$RPM_BUILD_ROOT%{apache_conf} APACHE_VERSION=%{apache_version} MASON_HANDLER=%{freeside_conf}/handler.pl
-%{__perl} -pi -e "s|%%%%%%FREESIDE_DOCUMENT_ROOT%%%%%%|%{freeside_document_root}|g" $RPM_BUILD_ROOT%{apache_conf}/freeside-*.conf
-%{__perl} -pi -e "s|%%%%%%MASON_HANDLER%%%%%%|%{freeside_conf}/handler.pl|g" $RPM_BUILD_ROOT%{apache_conf}/freeside-*.conf
-%{__perl} -pi -e "s|/usr/local/etc/freeside|%{freeside_conf}|g" $RPM_BUILD_ROOT%{apache_conf}/freeside-*.conf
-%{__perl} -pi -e 'print "Alias /%{name} %{freeside_document_root}\n\n" if /^<Directory/;' $RPM_BUILD_ROOT%{apache_conf}/freeside-*.conf
-%{__perl} -pi -e 'print "SSLRequireSSL\n" if /^AuthName/i;' $RPM_BUILD_ROOT%{apache_conf}/freeside-*.conf
+%{__mkdir_p} $RPM_BUILD_ROOT%{apache_confdir}
+%{__make} install-apache FREESIDE_DOCUMENT_ROOT=%{freeside_document_root} RT_ENABLED=%{rt_enabled} APACHE_CONF=$RPM_BUILD_ROOT%{apache_confdir} APACHE_VERSION=%{apache_version} MASON_HANDLER=%{freeside_conf}/handler.pl
+%{__perl} -pi -e "s|%%%%%%FREESIDE_DOCUMENT_ROOT%%%%%%|%{freeside_document_root}|g" $RPM_BUILD_ROOT%{apache_confdir}/freeside-*.conf
+%{__perl} -pi -e "s|%%%%%%MASON_HANDLER%%%%%%|%{freeside_conf}/handler.pl|g" $RPM_BUILD_ROOT%{apache_confdir}/freeside-*.conf
+%{__perl} -pi -e "s|/usr/local/etc/freeside|%{freeside_conf}|g" $RPM_BUILD_ROOT%{apache_confdir}/freeside-*.conf
+%{__perl} -pi -e 'print "Alias /%{name} %{freeside_document_root}\n\n" if /^<Directory/;' $RPM_BUILD_ROOT%{apache_confdir}/freeside-*.conf
+%{__perl} -pi -e 'print "SSLRequireSSL\n" if /^AuthName/i;' $RPM_BUILD_ROOT%{apache_confdir}/freeside-*.conf
# Make a list of the Mason files before adding self-service, etc.
find $RPM_BUILD_ROOT%{freeside_document_root} -type f -print | \
@@ -229,6 +230,10 @@
/usr/sbin/useradd freeside
fi
+%post mason
+# Make local httpd run with User/Group = freeside
+perl -p -i.fsbackup -e 's/^(User|Group) .*/$1 freeside/' %{apache_conffile}
+
%clean
%{__rm} -rf %{buildroot}
@@ -250,7 +255,7 @@
%defattr(-, freeside, freeside, 0755)
%attr(-,freeside,freeside) %{freeside_conf}/handler.pl
%attr(-,freeside,freeside) %{freeside_cache}/masondata
-%attr(0644,root,root) %config(noreplace) %{apache_conf}/%{name}-base%{apache_version}.conf
+%attr(0644,root,root) %config(noreplace) %{apache_confdir}/%{name}-base%{apache_version}.conf
%files postgresql
More information about the freeside-commits
mailing list