#%{__sed} -i -e "s!gforge.company.com!$HOSTNAME!g" %{FORGE_CONF_DIR}/local.inc
#%{__sed} -i -e "s!gforge.company.com!$HOSTNAME!g" /etc/httpd/conf.d/gforge.conf
+# ====================
+ # Installation from scratch, let's generate initial config files
+ if [ ! -e %{FORGE_CONF_DIR}/config.ini.d ] ; then
+ mkdir -p %{FORGE_CONF_DIR}/config.ini.d
+ fi
+ if [ ! -e %{FORGE_CONF_DIR}/config.ini.d/rpm-install.ini ] ; then
+ cat > %{FORGE_CONF_DIR}/config.ini.d/rpm-install.ini <<EOF
+; This file was generated by the RPM installation system.
+; You can edit the values here or move them to other files.
+
+[core]
+forge_name=FusionForge
+web_host=$HOSTNAME
+EOF
+ fi
+ if [ ! -e %{FORGE_CONF_DIR}/config.ini.d/rpm-install-secrets.ini ] ; then
+ t=$(mktemp %{FORGE_CONF_DIR}/config.ini.d/rpm-install-secrets.ini.XXXXXX)
+ if [ "$pw" = "" ] ; then
+ if [ -c /dev/urandom ]; then # ...using /dev/urandom when possible
+ pw=$(dd if=/dev/urandom count=1 bs=16 2> /dev/null | md5sum | cut -c-32)
+ else # ...or something else if need be.
+ pw=$(date +"%s:%N" | md5sum | cut -c-32)
+ fi
+ fi
+
+ cat > $t <<EOF
+; This file was generated by the RPM installation system.
+; You can edit the values here or move them to other files.
+; These values should not go into world-readable files!
+
+[core]
+database_host=""
+database_name=%{dbname}
+database_user=%{dbuser}
+database_port=5432
+#database_password=$pw
+EOF
+ mv $t %{FORGE_CONF_DIR}/config.ini.d/rpm-install-secrets.ini
+ fi
+# ====================
+
/usr/bin/php %{FORGE_DIR}/fusionforge-install-4-config.php >>/var/log/%{name}-install.log 2>&1
/etc/init.d/httpd restart >/dev/null 2>&1
# Directories under %{FORGE_DIR}
%{FORGE_DIR}/backend
%{FORGE_DIR}/common
-%{FORGE_DIR}/contrib
+#%{FORGE_DIR}/contrib
%{FORGE_DIR}/cronjobs
%{FORGE_DIR}/db
%{FORGE_DIR}/docs