CA_VERIFY_CLT = 0 #to check PEER/server remote certificate
#------------------------------------------------
#Configured for Postgresql database
-#DB_TYPE can be either POSTGRES,MYSQL, default POSTGRES
-#DB_TYPE = MYSQL
-DB_TYPE = POSTGRES
+#DB_TYPE can be either POSTGRES,MYSQL
+DB_TYPE = DB_TO_BE_DEFINED
DB_NAME = mailleur
DB_HOST = localhost
DB_PORT = 5432
%files postgresql
%defattr(-,root,root,-)
+%post
+if [ "$1" = 1 ]; then
+ sed -i \
+ -e "s/DB_TO_BE_DEFINED/POSTGRES/" \
+ %{_sysconfdir}/%{name}/%{name}.conf
+ fi
+
#=============================================================================
%package mysql
Summary : mailleur using mysql/mariadb as Data-base
%files mysql
%defattr(-,root,root,-)
+%post
+if [ "$1" = 1 ]; then
+ sed -i \
+ -e "s/DB_TO_BE_DEFINED/MYSQL/" \
+ %{_sysconfdir}/%{name}/%{name}.conf
+ fi
#=============================================================================
%prep
%setup -q
#! /usr/bin/bash
#---------------------------------------------------------------
-#empty scrript for now
+#program to check everything is ready to start clement
+#$1 is either "sysvinit", "systemd" or "osukiss
+#===============================================================
+OS=$1 #set the OS Type
+#Hard coded variables
+APPNAME=mailleur
+#===============================================================
+#procedure to check if the config is properly done
+#you MUST AT LEAST, specify the Data Base type to be used by clement.
+#----------------------------------------------------------------------
+chk_config()
+
+{
+if [ -z "$DB_TYPE" -o "$DB_TYPE" = "DB_TO_BE_DEFINED" ] ; then
+ echo -n "Checking file /etc/$APPNAME/$APPNAME.conf"
+ sh_failure $1 $" ->> not configured"
+ echo -e "\tPlease set DB_TYPE within /etc/$APPNAME/$APPNAME.conf"
+ echo -e "\tAborting start, Exiting at once"
+ exit -1;
+ fi
+}
+
+#===============================================================
+#main script
+chk_config $1;
+exit 0;
#---------------------------------------------------------------
-exit 0