1 #%define dbhost localhost
5 %{!?release:%define release 1}
7 Summary: collaborative development tool - shell accounts (using PostgreSQL)
8 Name: fusionforge-shell-postgresql
13 Group: Development/Tools
14 Source: %{name}-%{version}.tar.bz2
16 Requires: fusionforge >= 4.8
17 Requires: libnss-pgsql >= 1.4
19 #Requires: perl perl-URI
21 URL: http://www.fusionforge.org/
22 BuildRoot: %{_tmppath}/%{name}-%{version}-root
24 #%define gfuser gforge
25 #%define gfgroup gforge
27 #Requires: perl-IPC-Run
29 #Globals defines for gforge
30 %define GFORGE_DIR %{_datadir}/gforge
31 %define SBIN_DIR %{_sbindir}
32 %define CROND_DIR %{_sysconfdir}/cron.d
33 %define GFORGE_CONF_DIR %{_sysconfdir}/gforge
35 %define startnscd() service nscd status | grep '(pid' >/dev/null 2>&1 || service nscd start
36 %define nscdonstart() chkconfig nscd on
39 GForge provides many tools to aid collaboration in a
40 development project, such as bug-tracking, task management,
41 mailing-lists, SCM repository, forums, support request helper,
42 web/FTP hosting, release management, etc. All these services are
43 integrated into one web site and managed through a web interface.
45 This package provides shell accounts authenticated via the PostGreSQL
46 database to GForge users.
54 # cleaning build environment
55 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
57 # creating required directories
58 install -m 755 -d $RPM_BUILD_ROOT/%{GFORGE_DIR}/utils
59 install -m 755 install-nsspgsql.sh $RPM_BUILD_ROOT/%{GFORGE_DIR}/utils/install-nsspgsql.sh
61 # installing configuration file
67 if [ "$1" = "1" ] ; then
71 s/^sys_account_manager_type=.*/sys_account_manager_type=pgsql/g" %{GFORGE_CONF_DIR}/gforge.conf
73 # creating gforge database user
74 #GFORGEDATABASE_PASSWORD=$(grep ^db_password= %{GFORGE_CONF_DIR}/gforge.conf | cut -d= -f2-)
75 #su -l postgres -c "psql -c \"CREATE USER gforge_nss WITH PASSWORD '$GFORGEDATABASE_PASSWORD' NOCREATEUSER\" %{dbname} >/dev/null 2>&1"
77 # updating PostgreSQL configuration
78 #if ! grep -i '^ *host.*gforge_nss.*' /var/lib/pgsql/data/pg_hba.conf >/dev/null 2>&1; then
79 # echo 'host %{dbname} gforge_nss 127.0.0.1 255.255.255.255 trust' >> /var/lib/pgsql/data/pg_hba.conf
83 #Configuration de libnss-pgsql
84 ln -s %{GFORGE_DIR}/utils/install-nsspgsql.sh %{SBIN_DIR}/
85 install-nsspgsql.sh setup
90 #if plugin scmcvs is installed, comment the cron usergroup.php
91 if [ ! "$(rpm -qa fusionforge-plugin-scmcvs)" = "" ]; then
92 #echo "plugin scmcvs installed"
93 if [ "$(grep 'usergroup.php' %{CROND_DIR}/fusionforge-plugin-scmcvs | grep '#')" = "" ]; then
94 #echo "I comment the cron if it is un comment"
95 sed -i "s/^\(.*usergroup.php.*\)/#\1/" %{CROND_DIR}/fusionforge-plugin-scmcvs
104 if [ "$1" = "0" ] ; then
105 #reconfiguration de gforge
106 #suppression des fichiers de conf créés par install-nsspgsql.sh
107 #suppression du user gforge_nss
108 #suppression de gforge_nss 127.0.0.1 255.255.255.255 trust dans /var/lib/pgsql/data/pg_hba.conf
109 #activation du cron usergroup.php
116 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
119 %defattr(-, root, root)
120 #%doc AUTHORS COPYING README
121 %{GFORGE_DIR}/utils/install-nsspgsql.sh
124 * Mon Feb 13 2009 Alexandre NEYMANN <alexandre.neymann@dgfip.finances.gouv.fr>
126 Initial RPM packaging