# RPM spec file for FusionForge
#
# Initial work for 4.8 by JL Bond Consulting
-# Reworked for 5.1 by Alain Peyrat <aljeux@free.fr>
+# Reworked for 5.x by Alain Peyrat <aljeux@free.fr>
#
-# Copyright (C) 2010 Alain Peyrat
+# Copyright (C) 2010-2012 Alain Peyrat
#
# Global Definitions
# BuildRequires: sed, perl
+%define INSTALL_LOG %{_var}/log/gforge/install-%{version}.log
+%define UPGRADE_LOG %{_var}/log/gforge/upgrade-%{version}.log
+
Provides: gforge = %{version}
%description
%description plugin-fckeditor
FCKEditor is a WYSIWYG text editor that displays within a web browser.
+%package plugin-foafprofiles
+Summary: FOAF profile for forge users
+Group: Development/Tools
+Requires: %{name} >= %{version}, php
+%description plugin-foafprofiles
+The foafprofile plugin manages the generation of a FOAF profile for forge users.
+
%package plugin-gravatar
Summary: Gravatar plugin for FusionForge
Group: Development/Tools
%description plugin-gravatar
This plugin adds faces images to FusionForge users using the gravatar service.
+%package plugin-headermenu
+Summary: Headermenu plugin for FusionForge
+Group: Development/Tools
+Requires: %{name} >= %{version}, php
+%description plugin-headermenu
+This plugin adds capability to add links right to login/logout.
+
%package plugin-hudson
Summary: Hudson continous integration plugin for FusionForge
Group: Development/Tools
%package plugin-moinmoin
Summary: MoinMoinWiki plugin for FusionForge
Group: Development/Tools
-Requires: %{name} >= %{version}, php, postgresql
+Requires: %{name} >= %{version}, php, postgresql, moin
%description plugin-moinmoin
-This is a plugin to integrate MediaWiki within FusionForge.
+This is a plugin to integrate MoinMoin wiki within FusionForge.
%package plugin-message
Summary: Global Information Message plugin for FusionForge
Requires: %{name} >= %{version}, php
%description plugin-message
This is a plugin to add a global announce message for FusionForge.
-It can be use to warn users for planned or current outage.
+It can be used to warn users for planned or current outage.
%package plugin-online_help
Summary: online_help plugin for FusionForge
%package plugin-scmsvn
Summary: Subversion plugin for FusionForge
Group: Development/Tools
-Requires: %{name} >= %{version}, php, subversion
+Requires: %{name} >= %{version}, php, subversion, viewvc
%description plugin-scmsvn
This RPM installs SCM SVN plugin for FusionForge and provides svn support
to FusionForge.
# %description plugin-oauthprovider
# oauthprovider plugin for FusionForge.
+%package plugin-webanalytics
+Summary: webanalytics plugin for FusionForge
+Group: Development/Tools
+Requires: %{name} >= %{version}, php, postgresql
+%description plugin-webanalytics
+webanalytics plugin for FusionForge.
+
%prep
%setup -q
%{__install} -m 755 -d $RPM_BUILD_ROOT%{FORGE_VAR_LIB}/chroot/scmrepos/cvs
%{__install} -m 755 -d $RPM_BUILD_ROOT%{FORGE_VAR_LIB}/plugins/mediawiki
%{__install} -m 755 -d $RPM_BUILD_ROOT/home/groups
-%{__install} -m 755 -d $RPM_BUILD_ROOT/var/log/gforge
+%{__install} -m 755 -d $RPM_BUILD_ROOT%{_var}/log/gforge
# mock mediawiki directory because we symlink GForge skin to Monobook
%{__install} -m 755 -d $RPM_BUILD_ROOT/usr/share/mediawiki/skins
# Apache configuration file
%{__cp} -a etc/httpd.conf.d-fhs/* $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/httpd.conf.d/
%{__cp} -a etc/config.ini.d/defaults.ini $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/config.ini.d/
-%{__cp} -a etc/config.ini.d/debug.ini $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/config.ini.d/
%{__cp} -a etc/config.ini-fhs $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/config.ini
-%{__cp} -a etc/httpd.conf-fhs $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
-
-%{__sed} -i -e "s!www-data!apache!g" $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/config.ini.d/defaults.ini
-%{__sed} -i -e "s!use_shell = yes!use_shell = no!g" $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/config.ini.d/defaults.ini
-%{__sed} -i -e "s!use_webdav = no!use_webdav = yes!g" $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/config.ini.d/defaults.ini
+%{__cp} -a etc/httpd.conf-fhs $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/z-gforge.conf
+#%{__cp} -a etc/gforge-httpd.conf.example $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/z-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/z-gforge.conf
+
+%{__sed} -i -e 's!www-data!apache!g' $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/config.ini.d/defaults.ini
+%{__sed} -i -e 's!/usr/share/jpgraph!/var/www/jpgraph-1.19!g' $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/config.ini.d/defaults.ini
+%{__sed} -i -e 's!lists.$core/web_host!$core/web_host!g' $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/config.ini.d/defaults.ini
+%{__sed} -i -e 's!scm.$core/web_host!$core/web_host!g' $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/config.ini.d/defaults.ini
+%{__sed} -i -e 's!users.$core/web_host!$core/web_host!g' $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/config.ini.d/defaults.ini
+%{__sed} -i -e 's!use_webdav = no!use_webdav = yes!g' $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/config.ini.d/defaults.ini
+%{__sed} -i -e 's!use_shell = yes!use_shell = no!g' $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/config.ini.d/defaults.ini
+%{__sed} -i -e 's!use_ftp = yes!use_ftp = no!g' $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/config.ini.d/defaults.ini
+%{__sed} -i -e 's!use_people = yes!use_people = no!g' $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/config.ini.d/defaults.ini
+%{__sed} -i -e 's!use_project_vhost = yes!use_project_vhost = no!g' $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/config.ini.d/defaults.ini
+%{__sed} -i -e 's!use_snippet = yes!use_snippet = no!g' $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/config.ini.d/defaults.ini
# install fusionforge crontab
-%{__install} -m 644 packaging/cron.d/cron.fusionforge $RPM_BUILD_ROOT%{_sysconfdir}/cron.d/%{name}
+%{__sed} -e 's/\$FFUSER/%{gfuser}/g' packaging/cron.d/cron.fusionforge > $RPM_BUILD_ROOT%{_sysconfdir}/cron.d/%{name}
%{__install} -m 644 deb-specific/sqlhelper.pm $RPM_BUILD_ROOT%{FORGE_DIR}/lib/sqlhelper.pm
%{__rm} -fr $RPM_BUILD_ROOT/%{FORGE_DIR}/rpm-specific
%{__rm} -fr $RPM_BUILD_ROOT/%{FORGE_DIR}/plugins/*/packaging
%{__rm} -fr $RPM_BUILD_ROOT/%{FORGE_DIR}/plugins/*/*.spec
-%{__rm} -fr $RPM_BUILD_ROOT/%{FORGE_DIR}/plugins/foafprofiles
+
### Plugin setup ###
for i in $(utils/list-enabled-plugins.sh --disabled) ; do
%{__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%{FORGE_CONF_DIR}/httpd.d/
+%{__cp} $RPM_BUILD_ROOT%{FORGE_DIR}/plugins/*/etc/httpd.conf.d/* $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/httpd.conf.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
# plugin: forumml
# %{__ln_s} ../../plugins/forumml/www $RPM_BUILD_ROOT%{FORGE_DIR}/www/plugins/forumml
+# plugin: headermenu
+%{__ln_s} ../../plugins/headermenu/www $RPM_BUILD_ROOT%{FORGE_DIR}/www/plugins/headermenu
+
# plugin: hudson
%{__ln_s} ../../plugins/hudson/www $RPM_BUILD_ROOT%{FORGE_DIR}/www/plugins/hudson
# plugin: oauthprovider
#%{__ln_s} ../../plugins/oauthprovider/www $RPM_BUILD_ROOT%{FORGE_DIR}/www/plugins/oauthprovider
+# plugin: webanalytics
+%{__ln_s} ../../plugins/webanalytics/www $RPM_BUILD_ROOT%{FORGE_DIR}/www/plugins/webanalytics
### END OF PLUGIN SETUP ###
%pre
+[ -d %{_var}/log/gforge ] || mkdir -p %{_var}/log/gforge
+
if [ ! -d "/var/lib/pgsql/data/base" ]; then
- /sbin/service postgresql initdb >>/var/log/%{name}-install.log 2>&1
+ /sbin/service postgresql initdb >>%{INSTALL_LOG} 2>&1
fi
# we will need postgresql to be running. we start it, even if it already is running
# this won't hurt anything, just ensure we have a running database
-/sbin/service postgresql start >>/var/log/%{name}-install.log 2>&1
+/sbin/service postgresql start >>%{INSTALL_LOG} 2>&1
if [ "$1" -eq "1" ]; then
# setup user/group for gforge
if [ `/usr/bin/getent passwd | /bin/cut -d: -f1 | /bin/grep -c %{gfuser}` -eq 0 ] ; then
- echo "Did not find existing fusionforge user. Adding fusionforge group and user..." >>/var/log/%{name}-install.log 2>&1
/usr/sbin/groupadd -r %{gfgroup}
/usr/sbin/useradd -r -g %{gfgroup} -d %{FORGE_DIR} -s /bin/bash -c "FusionForge User" %{gfuser}
fi
FFORGE_ADMIN_PASSWORD=$(/bin/dd if=/dev/urandom bs=32 count=1 2>/dev/null | /usr/bin/sha1sum | cut -c1-8)
fi
export FFORGE_DB FFORGE_USER FFORGE_ADMIN_USER FFORGE_ADMIN_PASSWORD
- /bin/sh %{FORGE_DIR}/install-ng --database >>/var/log/%{name}-install.log 2>&1
+ %{FORGE_DIR}/install-ng --config --database >>%{INSTALL_LOG} 2>&1
else
- echo "Database %{dbname} already exists. Will not proceed with database setup." >>/var/log/%{name}-install.log 2>&1
- echo "Please see %{FORGE_DIR}/install-ng --database and run it manually" >>/var/log/%{name}-install.log 2>&1
- echo "if deemed necessary." >>/var/log/%{name}-install.log 2>&1
+ echo "Database %{dbname} already exists. Will not proceed with database setup." >>%{INSTALL_LOG} 2>&1
+ echo "Please see %{FORGE_DIR}/install-ng --database and run it manually" >>%{INSTALL_LOG} 2>&1
+ echo "if deemed necessary." >>%{INSTALL_LOG} 2>&1
+ %{FORGE_DIR}/install-ng --config >>%{INSTALL_LOG} 2>&1
fi
- /usr/bin/php %{FORGE_DIR}/db/upgrade-db.php >>/var/log/%{name}-install.log 2>&1
- /usr/bin/php %{FORGE_DIR}/utils/normalize_roles.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" /etc/httpd/conf.d/z-gforge.conf
[ -d %{FORGE_VAR_LIB}/etc ] || mkdir %{FORGE_VAR_LIB}/etc
touch %{FORGE_VAR_LIB}/etc/httpd.vhosts
- /bin/sh %{FORGE_DIR}/install-ng --config >>/var/log/%{name}-install.log 2>&1
+ %{__sed} -i -e "s/^#ServerName (.*):80/ServerName $HOSTNAME:80/" /etc/httpd/conf/httpd.conf
+ %{__sed} -i -e "s/^Include/#Include/" %{FORGE_CONF_DIR}/httpd.conf.d/ssl-on.inc
- /etc/init.d/httpd restart >/dev/null 2>&1
+ %{__sed} -i -e "s/^#ServerName (.*):80/ServerName $HOSTNAME:80/" /etc/httpd/conf/httpd.conf
+ %{__sed} -i -e "s/^Include/#Include/" %{FORGE_CONF_DIR}/httpd.conf.d/ssl-on.inc
- chkconfig postgresql on >/dev/null 2>&1
+ /etc/init.d/httpd restart >>%{INSTALL_LOG} 2>&1
+
+ chkconfig postgresql on >>%{INSTALL_LOG} 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
+ # Mailman initial setup
+ /usr/lib/mailman/bin/newlist -q mailman $FFORGE_ADMIN_USER@$HOSTNAME $FFORGE_ADMIN_PASSWORD >>%{INSTALL_LOG} 2>&1
+ chkconfig mailman on >>%{INSTALL_LOG} 2>&1
+ /etc/init.d/mailman start >>%{INSTALL_LOG} 2>&1
+
# add noreply mail alias
echo "noreply: /dev/null" >> /etc/aliases
- /usr/bin/newaliases >/dev/null 2>&1
+ /usr/bin/newaliases >>%{INSTALL_LOG} 2>&1
+
+ /usr/bin/php %{FORGE_DIR}/db/upgrade-db.php >>%{INSTALL_LOG} 2>&1
+ /usr/bin/php %{FORGE_DIR}/utils/normalize_roles.php >>%{INSTALL_LOG} 2>&1
if [ $ret -ne 0 ] ; then
# display message about default admin account
sleep 10
fi
else
- /usr/bin/php %{FORGE_DIR}/db/upgrade-db.php >>/var/log/%{name}-upgrade.log 2>&1
+ /usr/bin/php %{FORGE_DIR}/db/upgrade-db.php >>%{UPGRADE_LOG} 2>&1
+ /usr/bin/php %{FORGE_DIR}/utils/normalize_roles.php >>%{UPGRADE_LOG} 2>&1
fi
%preun
%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(0640, %{httpduser}, %{httpdgroup}) %config(noreplace) %{_sysconfdir}/httpd/conf.d/z-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}
%dir %{FORGE_CONF_DIR}/httpd.d
%dir %{FORGE_CONF_DIR}/httpd.conf.d
%{FORGE_CONF_DIR}/httpd.conf.d/*
-%{_sysconfdir}/httpd/conf.d/gforge.conf
+%{_sysconfdir}/httpd/conf.d/z-gforge.conf
%{FORGE_CONF_DIR}/config.ini.d/defaults.ini
-%{FORGE_CONF_DIR}/config.ini.d/debug.ini
%{FORGE_CONF_DIR}/config.ini
%dir %attr(0775,root,%{httpdgroup}) %{FORGE_CONF_DIR}/plugins
%dir %{FORGE_VAR_LIB}/scmtarballs
%dir %{FORGE_VAR_LIB}/scmsnapshots
%dir %{FORGE_VAR_LIB}/dumps
%{FORGE_VAR_LIB}/homedirs
+%dir %{_var}/log/gforge
/home/groups
-/var/log/gforge
/bin/cvssh.pl
%config(noreplace) %{FORGE_CONF_DIR}/config.ini.d/authbuiltin.ini
%{FORGE_DIR}/plugins/authbuiltin
%config(noreplace) %{FORGE_CONF_DIR}/config.ini.d/compactpreview.ini
%{FORGE_DIR}/plugins/compactpreview
-%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
-
%files plugin-doaprdf
%config(noreplace) %{FORGE_CONF_DIR}/config.ini.d/doaprdf.ini
%{FORGE_DIR}/plugins/doaprdf
%{FORGE_DIR}/plugins/fckeditor
%{FORGE_DIR}/www/plugins/fckeditor
+%files plugin-foafprofiles
+%config(noreplace) %{FORGE_CONF_DIR}/config.ini.d/foafprofiles.ini
+%{FORGE_DIR}/plugins/foafprofiles
+
# %files plugin-forumml
# %config(noreplace) %{FORGE_CONF_DIR}/config.ini.d/forumml.ini
# %{FORGE_DIR}/plugins/forumml
%config(noreplace) %{FORGE_CONF_DIR}/config.ini.d/gravatar.ini
%{FORGE_DIR}/plugins/gravatar
+%files plugin-headermenu
+%config(noreplace) %{FORGE_CONF_DIR}/config.ini.d/headermenu.ini
+%{FORGE_DIR}/plugins/headermenu
+%{FORGE_DIR}/www/plugins/headermenu
+
%files plugin-hudson
%config(noreplace) %{FORGE_CONF_DIR}/plugins/hudson/
%config(noreplace) %{FORGE_CONF_DIR}/config.ini.d/hudson.ini
%files plugin-scmgit
%config(noreplace) %{FORGE_CONF_DIR}/config.ini.d/scmgit.ini
+%{FORGE_CONF_DIR}/httpd.conf.d/plugin-scmgit-dav.inc
%{FORGE_DIR}/plugins/scmgit
%{FORGE_DIR}/www/plugins/scmgit
%files plugin-wiki
%config(noreplace) %{FORGE_CONF_DIR}/plugins/wiki/
%{_sysconfdir}/cron.d/cron.wiki
-%{FORGE_CONF_DIR}/httpd.d/03wiki.conf
+%{FORGE_CONF_DIR}/httpd.conf.d/plugin-wiki.inc
%{FORGE_DIR}/plugins/wiki
%{FORGE_DIR}/www/wiki
# %{FORGE_CONF_DIR}/httpd.d/62plugin-oauthprovider
# %{FORGE_DIR}/plugins/oauthprovider
+%files plugin-webanalytics
+%config(noreplace) %{FORGE_CONF_DIR}/config.ini.d/webanalytics.ini
+%{FORGE_DIR}/plugins/webanalytics
+%{FORGE_DIR}/www/plugins/webanalytics
+
%changelog
+* Thu Jun 07 2012 - Alain Peyrat <aljeux@free.fr> - 5.1.90-1
+- Adapted for 5.2 with new install scripts.
+
* Tue May 17 2011 - Thorsten Glaser <t.glaser@tarent.de> - 5.0.50-2
- Adapted for versioning of the forge via the packaging