[freeside-commits] freeside/install/rpm freeside.spec, 1.1.4.31, 1.1.4.32
Richard Siddall
rsiddall at wavetail.420.am
Fri Jun 12 16:35:52 PDT 2009
Update of /home/cvs/cvsroot/freeside/install/rpm
In directory wavetail.420.am:/tmp/cvs-serv3655/install/rpm
Modified Files:
Tag: FREESIDE_1_7_BRANCH
freeside.spec
Log Message:
Since Freeside uses the absence of configuration files to turn off config options,
don't reinstall the data source-dependent config directory every time the RPM is
installed or upgraded. Instead, keep the configuration in a default folder and
copy that to the data source-dependent folder only if that folder does not exist.
Index: freeside.spec
===================================================================
RCS file: /home/cvs/cvsroot/freeside/install/rpm/Attic/freeside.spec,v
retrieving revision 1.1.4.31
retrieving revision 1.1.4.32
diff -u -d -r1.1.4.31 -r1.1.4.32
--- freeside.spec 20 Apr 2009 20:55:57 -0000 1.1.4.31
+++ freeside.spec 12 Jun 2009 23:35:50 -0000 1.1.4.32
@@ -208,16 +208,18 @@
touch install-perl-modules perl-modules
%{__mkdir_p} $RPM_BUILD_ROOT%{freeside_cache}
%{__mkdir_p} $RPM_BUILD_ROOT%{freeside_conf}
-#%{__mkdir_p} $RPM_BUILD_ROOT%{freeside_export}
+%{__mkdir_p} $RPM_BUILD_ROOT%{freeside_export}
%{__mkdir_p} $RPM_BUILD_ROOT%{freeside_lock}
%{__mkdir_p} $RPM_BUILD_ROOT%{freeside_log}
for DBTYPE in %{db_types}; do
%{__mkdir_p} $RPM_BUILD_ROOT/tmp
+ [ -d $RPM_BUILD_ROOT%{freeside_conf}/default_conf ] && %{__rm} -rf $RPM_BUILD_ROOT%{freeside_conf}/default_conf
%{__make} create-config DB_TYPE=$DBTYPE DATASOURCE=DBI:$DBTYPE:dbname=%{name} RT_ENABLED=%{rt_enabled} FREESIDE_CACHE=$RPM_BUILD_ROOT%{freeside_cache} FREESIDE_CONF=$RPM_BUILD_ROOT/tmp FREESIDE_EXPORT=$RPM_BUILD_ROOT%{freeside_export} FREESIDE_LOCK=$RPM_BUILD_ROOT%{freeside_lock} FREESIDE_LOG=$RPM_BUILD_ROOT%{freeside_log}
- %{__mv} $RPM_BUILD_ROOT/tmp/* $RPM_BUILD_ROOT%{freeside_conf}
- /bin/rmdir $RPM_BUILD_ROOT/tmp
+ %{__mv} $RPM_BUILD_ROOT/tmp/secrets $RPM_BUILD_ROOT%{freeside_conf}
+ %{__mv} $RPM_BUILD_ROOT/tmp/conf* $RPM_BUILD_ROOT%{freeside_conf}/default_conf
+ %{__rm} -rf $RPM_BUILD_ROOT/tmp
done
-%{__rm} install-perl-modules perl-modules $RPM_BUILD_ROOT%{freeside_conf}/conf*/ticket_system
+%{__rm} install-perl-modules perl-modules $RPM_BUILD_ROOT%{freeside_conf}/default_conf/ticket_system
touch docs
%{__perl} -pi -e "s|%%%%%%FREESIDE_DOCUMENT_ROOT%%%%%%|%{freeside_document_root}|g" htetc/handler.pl
@@ -374,11 +376,35 @@
perl -p -i.fsbackup -e 's/^DBI:.*?:/DBI:Pg:/' %{freeside_conf}/secrets
fi
+%triggerin postgresql -- %{name}
+if [ ! -d %{freeside_conf}/conf.DBI:Pg:dbname=%{name} ]; then
+ mkdir %{freeside_conf}/conf.DBI:Pg:dbname=%{name}
+ cp -pr %{freeside_conf}/default_conf/* %{freeside_conf}/conf.DBI:Pg:dbname=%{name}
+fi
+
+%triggerin -- %{name}-postgresql
+if [ ! -d %{freeside_conf}/conf.DBI:Pg:dbname=%{name} ]; then
+ mkdir %{freeside_conf}/conf.DBI:Pg:dbname=%{name}
+ cp -pr %{freeside_conf}/default_conf/* %{freeside_conf}/conf.DBI:Pg:dbname=%{name}
+fi
+
%post mysql
if [ -f %{freeside_conf}/secrets ]; then
perl -p -i.fsbackup -e 's/^DBI:.*?:/DBI:mysql:/' %{freeside_conf}/secrets
fi
+%triggerin mysql -- %{name}
+if [ ! -d %{freeside_conf}/conf.DBI:mysql:dbname=%{name} ]; then
+ mkdir %{freeside_conf}/conf.DBI:mysql:dbname=%{name}
+ cp -pr %{freeside_conf}/default_conf/* %{freeside_conf}/conf.DBI:mysql:dbname=%{name}
+fi
+
+%triggerin -- %{name}-mysql
+if [ ! -d %{freeside_conf}/conf.DBI:mysql:dbname=%{name} ]; then
+ mkdir %{freeside_conf}/conf.DBI:mysql:dbname=%{name}
+ cp -pr %{freeside_conf}/default_conf/* %{freeside_conf}/conf.DBI:mysql:dbname=%{name}
+fi
+
%post mason
# Make local httpd run with User/Group = freeside
if [ -f %{apache_conffile} ]; then
@@ -409,6 +435,7 @@
%attr(-,freeside,freeside) %dir %{freeside_conf}
%attr(-,freeside,freeside) %dir %{freeside_lock}
%attr(-,freeside,freeside) %dir %{freeside_log}
+%attr(0711,freeside,freeside) %config(noreplace) %{freeside_conf}/default_conf
%files mason -f %{name}-%{version}-%{release}-mason-filelist
%defattr(-, freeside, freeside, 0755)
More information about the freeside-commits
mailing list