BuildRoot: %{_tmppath}/%{name}-%{version}-root
Packager: Alain Peyrat <aljeux@free.fr>
-# requirements as derived from fusionforge-install-1-deps.php script
Requires: httpd, mod_dav_svn, mod_ssl, php, php-pgsql, php-gd, php-mbstring, mailman
Requires: postgresql, postgresql-libs, postgresql-server, postgresql-contrib
Requires: postfix, openssh, inetd, which
Requires: /bin/sh, /bin/bash
Requires: perl, perl-DBI, perl-HTML-Parser, perl-Text-Autoformat, perl-Mail-Sendmail, perl-Sort-Versions
Requires: cronolog
-Requires: php-jpgraph php-gd
+Requires: php-jpgraph
Requires: /var/www/jpgraph-1.19/jpgraph.php
#Requires: libnss-pgsql >= 1.4
-Requires: mailman
Requires: gettext
-Requires: htmlpurifier >= 4.0.0
+Requires: php-htmlpurifier >= 4.0.0
Requires: sed
Requires: coreutils
Requires: /usr/bin/newaliases
Requires: php-pear-HTTP_WebDAV_Server
+Requires: php-pecl-zip
# BuildRequires: sed, perl
%package plugin-ldapextauth
Summary: external LDAP authentication for FusionForge plugin
Group: Development/Tools
-Requires: %{name} >= %{version}, php
+Requires: %{name} >= %{version}, php, php-ldap
%description plugin-ldapextauth
This plugin provides LDAP authentication capability for FusionForge.
%{__cp} -a plugins/scmcvs/bin/cvssh.pl $RPM_BUILD_ROOT/bin/
# Fix configuration files entries (various sys_* variables)
-%{__cp} -a etc/local.inc.example $RPM_BUILD_ROOT/%{FORGE_CONF_DIR}/local.inc
-%{__sed} -i -e "s!/path/to/gforge!%{FORGE_DIR}!g" $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/local.inc
-%{__sed} -i -e "s!/path/to/jpgraph!/var/www/jpgraph-1.19!g" $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/local.inc
-%{__sed} -i -e "s/\$sys_dbname=.*/\$sys_dbname='%{dbname}';/g" $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/local.inc
-%{__sed} -i -e "s/\$sys_dbuser=.*/\$sys_dbuser='%{dbuser}';/g" $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/local.inc
-%{__sed} -i -e "s/\$sys_apache_user=.*/\$sys_apache_user='%{httpduser}';/g" $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/local.inc
-%{__sed} -i -e "s/\$sys_apache_group=.*/\$sys_apache_group='%{httpdgroup}';/g" $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/local.inc
-%{__sed} -i -e "s|\$sys_plugins_path=.*|\$sys_plugins_path=\"%{FORGE_DIR}/plugins\";|g" $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/local.inc
-%{__sed} -i -e "s|\$sys_upload_dir=.*|\$sys_upload_dir=\"\$sys_var_path/upload\";|g" $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/local.inc
-%{__sed} -i -e "s|\$sys_urlroot=.*|\$sys_urlroot=\"%{FORGE_DIR}/www\";|g" $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/local.inc
+#%{__cp} -a etc/local.inc.example $RPM_BUILD_ROOT/%{FORGE_CONF_DIR}/local.inc
+#%{__sed} -i -e "s!/path/to/gforge!%{FORGE_DIR}!g" $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/local.inc
+#%{__sed} -i -e "s!/path/to/jpgraph!/var/www/jpgraph-1.19!g" $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/local.inc
+#%{__sed} -i -e "s/\$sys_dbname=.*/\$sys_dbname='%{dbname}';/g" $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/local.inc
+#%{__sed} -i -e "s/\$sys_dbuser=.*/\$sys_dbuser='%{dbuser}';/g" $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/local.inc
+#%{__sed} -i -e "s/\$sys_apache_user=.*/\$sys_apache_user='%{httpduser}';/g" $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/local.inc
+#%{__sed} -i -e "s/\$sys_apache_group=.*/\$sys_apache_group='%{httpdgroup}';/g" $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/local.inc
+#%{__sed} -i -e "s|\$sys_plugins_path=.*|\$sys_plugins_path=\"%{FORGE_DIR}/plugins\";|g" $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/local.inc
+#%{__sed} -i -e "s|\$sys_upload_dir=.*|\$sys_upload_dir=\"\$sys_var_path/upload\";|g" $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/local.inc
+#%{__sed} -i -e "s|\$sys_urlroot=.*|\$sys_urlroot=\"%{FORGE_DIR}/www\";|g" $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/local.inc
# Replace sys_localinc, sys_gfdbname, sys_gfdbuser
-%{__cp} -a etc/httpd.secrets.example $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/httpd.secrets
-%{__sed} -i -e "s|sys_localinc.*$|sys_localinc %{FORGE_CONF_DIR}/local.inc|g" $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/httpd.secrets
-%{__sed} -i -e "s|sys_gfdbname.*$|sys_gfdbname %{dbname}|g" $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/httpd.secrets
-%{__sed} -i -e "s|sys_gfdbuser.*$|sys_gfdbname %{dbuser}|g" $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/httpd.secrets
+#%{__cp} -a etc/httpd.secrets.example $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/httpd.secrets
+#%{__sed} -i -e "s|sys_localinc.*$|sys_localinc %{FORGE_CONF_DIR}/local.inc|g" $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/httpd.secrets
+#%{__sed} -i -e "s|sys_gfdbname.*$|sys_gfdbname %{dbname}|g" $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/httpd.secrets
+#%{__sed} -i -e "s|sys_gfdbuser.*$|sys_gfdbname %{dbuser}|g" $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/httpd.secrets
# Apache configuration file
-%{__cp} -a etc/gforge-httpd.conf.example $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/gforge.conf
-%{__sed} -i -e 's|.*php_value[[:space:]]*include_path.*$|\tphp_value\tinclude_path ".:/usr/share/gforge/www/include:/usr/share/gforge:/etc/gforge:/usr/share/gforge/common:/usr/share/gforge/www:/usr/share/gforge/plugins"|' $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/gforge.conf
+#%{__cp} -a etc/gforge-httpd.conf.example $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/gforge.conf
+#%{__sed} -i -e 's|.*php_value[[:space:]]*include_path.*$|\tphp_value\tinclude_path ".:/usr/share/gforge/www/include:/usr/share/gforge:/etc/gforge:/usr/share/gforge/common:/usr/share/gforge/www:/usr/share/gforge/plugins"|' $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/gforge.conf
# install fusionforge crontab
%{__install} -m 644 packaging/cron.d/cron.fusionforge $RPM_BUILD_ROOT%{_sysconfdir}/cron.d/%{name}
### Plugin setup ###
%{__cp} $RPM_BUILD_ROOT%{FORGE_DIR}/plugins/*/etc/*.ini $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/config.ini.d/
%{__cp} $RPM_BUILD_ROOT%{FORGE_DIR}/plugins/*/etc/cron.d/* $RPM_BUILD_ROOT%{_sysconfdir}/cron.d/
-%{__cp} $RPM_BUILD_ROOT%{FORGE_DIR}/plugins/*/etc/httpd.d/* $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/
+%{__cp} $RPM_BUILD_ROOT%{FORGE_DIR}/plugins/*/etc/httpd.d/* $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/httpd.d/
%{__cp} -rp $RPM_BUILD_ROOT%{FORGE_DIR}/plugins/*/etc/plugins/* $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/plugins/
%{__rm} -f $RPM_BUILD_ROOT%{FORGE_DIR}/plugins/README
fi
/usr/bin/php %{FORGE_DIR}/db/upgrade-db.php >>/var/log/%{name}-install.log 2>&1
- /usr/bin/php %{FORGE_DIR}/fusionforge-install-4-config.php >>/var/log/%{name}-install.log 2>&1
HOSTNAME=`hostname -f`
- %{__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
+ #%{__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
# generate random hash for session_key
HASH=$(/bin/dd if=/dev/urandom bs=32 count=1 2>/dev/null | /usr/bin/sha1sum | cut -c1-40)
- %{__sed} -i -e "s/sys_session_key = 'foobar'/sys_session_key = '$HASH'/g" %{FORGE_CONF_DIR}/local.inc
+ #%{__sed} -i -e "s/sys_session_key = 'foobar'/sys_session_key = '$HASH'/g" %{FORGE_CONF_DIR}/local.inc
# add noreply mail alias
echo "noreply: /dev/null" >> /etc/aliases
%defattr(-, root, root)
%doc AUTHORS* CHANGES COPYING INSTALL* NEWS README*
%doc docs/*
-%attr(0660, %{httpduser}, gforge) %config(noreplace) %{FORGE_CONF_DIR}/local.inc
-%attr(0640, %{httpduser}, %{httpdgroup}) %config(noreplace) %{_sysconfdir}/httpd/conf.d/gforge.conf
+#%attr(0660, %{httpduser}, gforge) %config(noreplace) %{FORGE_CONF_DIR}/local.inc
+#%attr(0640, %{httpduser}, %{httpdgroup}) %config(noreplace) %{_sysconfdir}/httpd/conf.d/gforge.conf
%attr(0644, root, root) %{_sysconfdir}/cron.d/%{name}
%attr(0775, %{httpduser}, %{httpdgroup}) %dir %{FORGE_VAR_LIB}/upload
%attr(755, root, %{httpdgroup}) %dir %{FORGE_DIR}
# 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
%{FORGE_DIR}/monitor
%{FORGE_DIR}/translations
%{FORGE_DIR}/utils
-%{FORGE_DIR}/setup
+#%{FORGE_DIR}/setup
%dir %{FORGE_DIR}/www
# files under %{FORGE_DIR}/www
%{FORGE_DIR}/www/*.php
#%{FORGE_DIR}/plugins/quota_management
%{FORGE_LANG_DIR}
%dir %{FORGE_CONF_DIR}
-%config(noreplace) %{FORGE_CONF_DIR}/httpd.secrets
+#%config(noreplace) %{FORGE_CONF_DIR}/httpd.secrets
%dir %{FORGE_CONF_DIR}/httpd.d
%dir %attr(0775,root,%{httpdgroup}) %{FORGE_CONF_DIR}/plugins
%dir %{FORGE_VAR_LIB}/scmtarballs
/bin/cvssh.pl
%files plugin-aselectextauth
+%config(noreplace) %{FORGE_CONF_DIR}/config.ini.d/aselectextauth.ini
%{FORGE_DIR}/plugins/aselectextauth
%files plugin-cvssyncmail
+%config(noreplace) %{FORGE_CONF_DIR}/config.ini.d/cvssyncmail.ini
%{FORGE_DIR}/plugins/cvssyncmail
%files plugin-cvstracker
+%config(noreplace) %{FORGE_CONF_DIR}/config.ini.d/cvstracker.ini
%{FORGE_DIR}/plugins/cvstracker
%{FORGE_DIR}/www/plugins/cvstracker
%attr(-,%{httpduser},%{httpdgroup}) %{FORGE_CONF_DIR}/plugins/cvstracker
%{FORGE_DIR}/plugins/externalsearch
%files plugin-fckeditor
+%config(noreplace) %{FORGE_CONF_DIR}/config.ini.d/fckeditor.ini
%{FORGE_DIR}/plugins/fckeditor
%{FORGE_DIR}/www/plugins/fckeditor
%files plugin-forumml
+%config(noreplace) %{FORGE_CONF_DIR}/config.ini.d/forumml.ini
%{FORGE_DIR}/plugins/forumml
%{FORGE_DIR}/www/plugins/forumml
%files plugin-gravatar
+%config(noreplace) %{FORGE_CONF_DIR}/config.ini.d/gravatar.ini
%{FORGE_DIR}/plugins/gravatar
%files plugin-hudson
%config(noreplace) %{FORGE_CONF_DIR}/plugins/hudson/
-%{_sysconfdir}/httpd/conf.d/62plugin-hudson
+%config(noreplace) %{FORGE_CONF_DIR}/config.ini.d/hudson.ini
+%{FORGE_CONF_DIR}/httpd.d/62plugin-hudson
%{FORGE_DIR}/plugins/hudson
%{FORGE_DIR}/www/plugins/hudson
%files plugin-ldapextauth
%config(noreplace) %{FORGE_CONF_DIR}/plugins/ldapextauth/
+%config(noreplace) %{FORGE_CONF_DIR}/config.ini.d/ldapextauth.ini
%{FORGE_DIR}/plugins/ldapextauth
%files plugin-mantis
%files plugin-mediawiki
%config(noreplace) %{FORGE_CONF_DIR}/config.ini.d/mediawiki.ini
%config(noreplace) %{FORGE_CONF_DIR}/httpd.d/03mediawiki.conf
-%{_sysconfdir}/httpd/conf.d/61plugin-mediawiki
+%{FORGE_CONF_DIR}/httpd.d/61plugin-mediawiki
%{FORGE_DIR}/plugins/mediawiki/
%{FORGE_DIR}/www/plugins/mediawiki
/usr/share/mediawiki/skins/gforge
/usr/share/mediawiki/skins/GForge.php
%files plugin-online_help
+%config(noreplace) %{FORGE_CONF_DIR}/config.ini.d/online_help.ini
%{FORGE_DIR}/plugins/online_help
%{FORGE_DIR}/www/plugins/online_help
%files plugin-oslc
%config(noreplace) %{FORGE_CONF_DIR}/plugins/oslc/
-%{_sysconfdir}/httpd/conf.d/plugin-oslc.inc
+%config(noreplace) %{FORGE_CONF_DIR}/config.ini.d/oslc.ini
+%{FORGE_CONF_DIR}/httpd.d/plugin-oslc.inc
%{FORGE_DIR}/plugins/oslc
%{FORGE_DIR}/www/plugins/oslc
%files plugin-projects_hierarchy
+%config(noreplace) %{FORGE_CONF_DIR}/config.ini.d/projects_hierarchy.ini
%{FORGE_DIR}/plugins/projects_hierarchy
%{FORGE_DIR}/www/plugins/projects_hierarchy
%files plugin-quota_management
+%config(noreplace) %{FORGE_CONF_DIR}/config.ini.d/quota_management.ini
%{FORGE_DIR}/plugins/quota_management
%{FORGE_DIR}/www/plugins/quota_management
%config(noreplace) %{FORGE_CONF_DIR}/plugins/scmcvs/
%config(noreplace) %{FORGE_CONF_DIR}/config.ini.d/scmcvs.ini
%{_sysconfdir}/cron.d/%{name}-plugin-scmcvs
-%{_sysconfdir}/httpd/conf.d/30virtualcvs
-%{_sysconfdir}/httpd/conf.d/31virtualcvs.ssl
+%{FORGE_CONF_DIR}/httpd.d/30virtualcvs
+%{FORGE_CONF_DIR}/httpd.d/31virtualcvs.ssl
%{FORGE_DIR}/plugins/scmcvs
%{FORGE_DIR}/www/plugins/scmcvs
%{FORGE_VAR_LIB}/chroot/scmrepos/cvs
%{FORGE_VAR_LIB}/chroot/scmrepos/svn
%files plugin-svncommitemail
+%config(noreplace) %{FORGE_CONF_DIR}/config.ini.d/svncommitemail.ini
%{FORGE_DIR}/plugins/svncommitemail
%files plugin-svntracker
%config(noreplace) %{FORGE_CONF_DIR}/plugins/svntracker/
+%config(noreplace) %{FORGE_CONF_DIR}/config.ini.d/svntracker.ini
%{_sysconfdir}/cron.d/gforge-plugin-svntracker
%{FORGE_DIR}/plugins/svntracker
%{FORGE_DIR}/www/plugins/svntracker
%{FORGE_DIR}/www/plugins/blocks
%files plugin-extratabs
+%config(noreplace) %{FORGE_CONF_DIR}/config.ini.d/extratabs.ini
%{FORGE_DIR}/plugins/extratabs
%{FORGE_DIR}/www/plugins/extratabs
%files plugin-wiki
%config(noreplace) %{FORGE_CONF_DIR}/plugins/wiki/
%{_sysconfdir}/cron.d/cron.wiki
-%{_sysconfdir}/httpd/conf.d/03wiki.conf
+%{FORGE_CONF_DIR}/httpd.d/03wiki.conf
%{FORGE_DIR}/plugins/wiki
%{FORGE_DIR}/www/wiki
%files plugin-projectlabels
+%config(noreplace) %{FORGE_CONF_DIR}/config.ini.d/projectlabels.ini
%{FORGE_DIR}/plugins/projectlabels
%{FORGE_DIR}/www/plugins/projectlabels
%files plugin-contribtracker
+%config(noreplace) %{FORGE_CONF_DIR}/config.ini.d/contribtracker.ini
%{FORGE_DIR}/plugins/contribtracker
%{FORGE_DIR}/www/plugins/contribtracker
%files plugin-globalsearch
+%config(noreplace) %{FORGE_CONF_DIR}/config.ini.d/globalsearch.ini
%{FORGE_DIR}/plugins/globalsearch
%{FORGE_DIR}/www/plugins/globalsearch
%files plugin-mailman
%config(noreplace) %{FORGE_CONF_DIR}/plugins/mailman/
-%{_sysconfdir}/httpd/conf.d/62plugin-list-mailman
-%{_sysconfdir}/httpd/conf.d/200list.vhost
-%{_sysconfdir}/httpd/conf.d/20list
-%{_sysconfdir}/httpd/conf.d/20zlist.vhost
-%{_sysconfdir}/httpd/conf.d/21list.vhost.ssl
+%config(noreplace) %{FORGE_CONF_DIR}/config.ini.d/mailman.ini
+%{FORGE_CONF_DIR}/httpd.d/plugin-oslc.inc
+%{FORGE_CONF_DIR}/httpd.d/62plugin-list-mailman
+%{FORGE_CONF_DIR}/httpd.d/200list.vhost
+%{FORGE_CONF_DIR}/httpd.d/20list
+%{FORGE_CONF_DIR}/httpd.d/20zlist.vhost
+%{FORGE_CONF_DIR}/httpd.d/21list.vhost.ssl
%{FORGE_DIR}/plugins/mailman
%{FORGE_DIR}/www/plugins/mailman
%files plugin-mantisbt
%config(noreplace) %{FORGE_CONF_DIR}/plugins/mantisbt/
+%config(noreplace) %{FORGE_CONF_DIR}/config.ini.d/mantisbt.ini
%{FORGE_DIR}/plugins/mantisbt
%{FORGE_DIR}/www/plugins/mantisbt