1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
|
%define plugin authhttpd
%{!?release:%define release 1}
Summary: httpd external authentication plugin for FusionForge
Name: gforge-plugin-%{plugin}
Version: 4.1
Release: %{release}
BuildArch: noarch
License: GPL
Group: Development/Tools
Source0: %{name}-%{version}.tar.bz2
AutoReqProv: off
Requires: gforge >= 4.0
URL: http://www.gforge.org
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%define gfuser gforge
%define gfgroup gforge
%if "%{_vendor}" == "suse"
%define httpduser wwwrun
%define httpdgroup www
Requires: php5-cas
%else
%define httpduser apache
%define httpdgroup apache
Requires: php-cas
%endif
#Globals defines for gforge
%define GFORGE_DIR %{_datadir}/gforge
%define GFORGE_CONF_DIR %{_sysconfdir}/gforge
%define GFORGE_LANG_DIR %{GFORGE_CONF_DIR}/languages-local
%define GFORGE_SBIN_DIR %{_sbindir}
%define GFORGE_LIB_DIR %{_libdir}/gforge/lib
%define GFORGE_DB_DIR %{_libdir}/gforge/db
%define GFORGE_BIN_DIR %{_libdir}/gforge/bin
%define PLUGINS_LIB_DIR %{_libdir}/gforge/plugins
%define PLUGINS_CONF_DIR %{GFORGE_CONF_DIR}/plugins
%define CROND_DIR %{_sysconfdir}/cron.d
#specific define for plugins
%define PLUGIN_LIB_DIR %{PLUGINS_LIB_DIR}/%{plugin}
%define PLUGIN_CONF_DIR %{PLUGINS_CONF_DIR}/%{plugin}
%description
FusionForge is a web-based Collaborative Development Environment offering
easy access to CVS, mailing lists, bug tracking, message
boards/forums, task management, permanent file archival, and total
web-based administration.
This RPM installs CAS external authentication plugin for FusionForge.
%prep
%setup
%build
%install
# cleaning build environment
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
# copying all needed stuff to %{PLUGIN_LIB_DIR}
install -m 755 -d $RPM_BUILD_ROOT/%{PLUGIN_LIB_DIR}
for dir in bin include rpm-specific ; do
cp -rp $dir $RPM_BUILD_ROOT/%{PLUGIN_LIB_DIR}/
done;
chmod 755 $RPM_BUILD_ROOT/%{PLUGIN_LIB_DIR}/bin/db-*.pl
# installing configuration file
install -m 755 -d $RPM_BUILD_ROOT/%{PLUGIN_CONF_DIR}
cp -p etc/plugins/%{plugin}/* $RPM_BUILD_ROOT/%{PLUGIN_CONF_DIR}/
%pre
%post
if [ "$1" = "1" ] ; then
# register plugin in database
%{GFORGE_BIN_DIR}/register-plugin %{plugin} "CAS external authentication" &> /dev/null
# su -l %{gfuser} -c "%{PLUGIN_LIB_DIR}/bin/db-upgrade.pl 2>&1" | grep -v ^NOTICE
else
# upgrade
#su -l %{gfuser} -c "%{PLUGIN_LIB_DIR}/bin/db-upgrade.pl 2>&1" | grep -v ^NOTICE
:
fi
%postun
if [ "$1" = "0" ] ; then
# unregister plugin in database
%{GFORGE_BIN_DIR}/unregister-plugin %{plugin}
#su -l %{gfuser} -c "%{PLUGIN_LIB_DIR}/bin/db-delete.pl 2>&1" | grep -v ^NOTICE
else
# upgrade
:
fi
%clean
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
%files
%defattr(-, root, root)
%doc README
%attr(0660, %{httpduser}, %{gfgroup}) %config(noreplace) %{PLUGIN_CONF_DIR}/config.php
%attr(0660, %{httpduser}, %{gfgroup}) %config(noreplace) %{PLUGIN_CONF_DIR}/mapping.php
%{PLUGIN_LIB_DIR}/bin
%{PLUGIN_LIB_DIR}/include
%{PLUGIN_LIB_DIR}/rpm-specific
%changelog
* Fri Apr 29 2005 Xavier Rameau <xrameau@gmail.com>
- Added support for SuSE
* Thu Mar 03 2005 Guillaume Smet <guillaume-gforge@smet.org>
- config files have moved
* Sat Feb 19 2005 Guillaume Smet <guillaume-gforge@smet.org>
- 4.1
- redirects register-plugin output to /dev/null
* Fri Nov 26 2004 Dassault Aviation <guillaume.smet@openwide.fr>
Initial RPM packaging
|