2 %{!?release:%define release 1}
4 Summary: CVS Plugin for FusionForge
5 Name: fusionforge-plugin-%{plugin}
10 Group: Development/Tools
11 Source: %{name}-%{version}.tar.bz2
13 Requires: fusionforge >= 4.7
14 Requires: perl perl-URI
16 #update etc/plugins/scmcvs/config.php $cvs_binary_version before updating cvs to 1.12
19 URL: http://www.gforge.org/
20 BuildRoot: %{_tmppath}/%{name}-%{version}-root
23 %define gfgroup gforge
25 %if "%{_vendor}" == "suse"
26 %define httpduser wwwrun
27 %define httpdgroup www
28 #Requires: perl-IPC-Run
30 %define httpduser apache
31 %define httpdgroup apache
32 Requires: perl-IPC-Run
35 #Globals defines for gforge
36 %define GFORGE_DIR %{_datadir}/gforge
37 %define GFORGE_CONF_DIR %{_sysconfdir}/gforge
38 %define GFORGE_SBIN_DIR %{_sbindir}
39 %define GFORGE_BIN_DIR %{GFORGE_DIR}/bin
40 %define PLUGINS_LIB_DIR %{GFORGE_DIR}/plugins
41 %define PLUGINS_CONF_DIR %{GFORGE_CONF_DIR}/plugins
42 %define CROND_DIR %{_sysconfdir}/cron.d
43 %define SBIN_DIR %{_sbindir}
45 #specific define for plugins
46 %define PLUGIN_LIB %{PLUGINS_LIB_DIR}/%{plugin}
47 %define PLUGIN_CONF %{PLUGINS_CONF_DIR}/%{plugin}
51 FusionForge is a web-based Collaborative Development Environment offering
52 easy access to CVS, mailing lists, bug tracking, message
53 boards/forums, task management, permanent file archival, and total
54 web-based administration.
56 This RPM installs SCM CVS plugin for FusionForge and provides CVS support
59 It also provides a specific version of CVSWeb wrapped in FusionForge.
67 # cleaning build environment
68 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
71 install -m 755 -d $RPM_BUILD_ROOT/%{CROND_DIR}/
72 install -m 644 cron.d/%{name} $RPM_BUILD_ROOT/%{CROND_DIR}/
74 # copying all needed stuff to %{PLUGIN_LIB}
75 install -m 755 -d $RPM_BUILD_ROOT/%{PLUGIN_LIB}
76 for dir in bin common www cronjobs; do
77 cp -rp $dir $RPM_BUILD_ROOT/%{PLUGIN_LIB}/
79 chmod 755 $RPM_BUILD_ROOT/%{PLUGIN_LIB}/bin/*
80 chmod 755 $RPM_BUILD_ROOT/%{PLUGIN_LIB}/cronjobs/cvscreate.sh
82 # installing executable for pserver
83 install -m 755 -d $RPM_BUILD_ROOT/%{GFORGE_BIN_DIR}/
84 cp -rp sbin/cvs-pserver $RPM_BUILD_ROOT/%{GFORGE_BIN_DIR}/
85 chmod 755 $RPM_BUILD_ROOT/%{GFORGE_BIN_DIR}/cvs-pserver
87 # installing configuration file
88 install -m 755 -d $RPM_BUILD_ROOT/%{GFORGE_CONF_DIR}/
89 cp -rp etc/* $RPM_BUILD_ROOT/%{GFORGE_CONF_DIR}/
90 install -m 755 -d $RPM_BUILD_ROOT/%{PLUGIN_CONF}
91 install -m 664 etc/plugins/%{plugin}/config.php $RPM_BUILD_ROOT/%{PLUGIN_CONF}/
92 install -m 664 etc/plugins/%{plugin}/cvsweb.conf $RPM_BUILD_ROOT/%{PLUGIN_CONF}/
98 if [ "$1" = "1" ] ; then
99 # link the plugin www rep to be accessed by web
100 ln -s %{PLUGIN_LIB}/www %{GFORGE_DIR}/www/plugins/%{plugin}
102 [ ! -f /bin/cvssh ] && ln -s %{PLUGIN_LIB}/bin/cvssh.pl /bin/cvssh
104 #GF_DOMAIN=$(grep ^domain_name= %{GFORGE_CONF_DIR}/gforge.conf | cut -d= -f2-)
106 # s#^\\\$sys_plugins_path=.*#\\\$sys_plugins_path='"%{PLUGINS_LIB_DIR}"';#;
107 # s#^\\\$sys_default_domain=.*#\\\$sys_default_domain='$GF_DOMAIN';#" %{PLUGIN_CONF}/config.php
109 # register plugin in database
110 %{GFORGE_BIN_DIR}/register-plugin %{plugin} CVS &> /dev/null
113 s/sys_use_scm=false/sys_use_scm=true/g" %{GFORGE_CONF_DIR}/gforge.conf
115 # initializing configuration
116 %{SBIN_DIR}/fusionforge-config
118 CHROOT=`grep '^gforge_chroot=' %{GFORGE_CONF_DIR}/gforge.conf | sed 's/.*=\s*\(.*\)/\1/'`
119 if [ ! -d $CHROOT/cvsroot ] ; then
120 mkdir -p $CHROOT/cvsroot
122 ln -s $CHROOT/cvsroot /cvsroot
124 #if sys_account_manager_type=pgsql, comment the cron usergroup.php
125 SYS_ACCOUNT_MANAGER_TYPE=`grep '^sys_account_manager_type=' %{GFORGE_CONF_DIR}/gforge.conf | sed 's/.*=\s*\(.*\)/\1/'`
126 if [ $SYS_ACCOUNT_MANAGER_TYPE = "pgsql" ]; then
127 #echo "plugin scmcvs installed"
128 if [ "$(grep 'usergroup.php' %{CROND_DIR}/fusionforge-plugin-scmcvs | grep '#')" = "" ]; then
129 #echo "I comment the cron if it is un comment"
130 sed -i "s/^\(.*usergroup.php.*\)/#\1/" %{CROND_DIR}/fusionforge-plugin-scmcvs
139 if [ "$1" = "0" ] ; then
140 # unregister plugin in database
141 %{GFORGE_BIN_DIR}/unregister-plugin %{plugin}
143 [ -L /bin/cvssh ] && rm -f /bin/cvssh
150 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
153 %defattr(-, root, root)
154 %doc AUTHORS COPYING README
155 %attr(0664, %{httpduser}, %{gfgroup}) %config(noreplace) %{PLUGIN_CONF}/config.php
156 %attr(0660, %{httpduser}, %{gfgroup}) %config(noreplace) %{PLUGIN_CONF}/cvsweb.conf
157 %{GFORGE_CONF_DIR}/httpd.d
158 %{PLUGIN_CONF}/config.pl
162 %{PLUGIN_LIB}/cronjobs
164 %{GFORGE_BIN_DIR}/cvs-pserver
167 * Mon Jan 09 2006 Nicolas Quienot <nquienot@linagora.com>
169 * Fri Apr 29 2005 Xavier Rameau <xrameau@gmail.com>
170 - Added support for SuSE
171 * Sat Feb 19 2005 Guillaume Smet <guillaume-gforge@smet.org>
173 - replaced -f test with ls
174 - redirects register-plugin output to /dev/null
175 * Mon Jan 03 2005 Guillaume Smet <guillaume-gforge@smet.org>
176 - it's now possible to add specific language files in the RPM
177 * Sun Sep 26 2004 Guillaume Smet <guillaume-gforge@smet.org>
178 Initial RPM packaging