%global real_name limesurvey %global limedir %{_datadir}/limesurvey Name: limesurvey Version: 2.00 Release: 0.7%{?dist} Summary: The limesurvey RPM Group: System Environment/Base License: GPLv2+ URL: http://www.limesurvey.org/ ## Download via web app http://www.limesurvey.org Source0: http://download.limesurvey.org/Unstable_releases/limesurvey200RC4-build120622.tar.bz2 Source1: limesurvey-httpd-conf BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch Requires: httpd, php >= 5.3 Requires: php-gd, php-mbstring, php-mysql Requires: php-gettext, php-mbstring, php-php-gettext %description Limesurvey is an open source, web-based survey application that is easy to setup and use. %prep %setup -q -n %{real_name} %build %install rm -rf ${RPM_BUILD_ROOT} mkdir -p ${RPM_BUILD_ROOT}%{limedir} mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/limesurvey # These directories need to be writable, so cannot be under limedir mkdir -p ${RPM_BUILD_ROOT}/var/lib/limesurvey/tmp mkdir -p ${RPM_BUILD_ROOT}/var/lib/limesurvey/application/config mkdir -p ${RPM_BUILD_ROOT}/var/lib/limesurvey/templates mkdir -p ${RPM_BUILD_ROOT}/var/lib/limesurvey/upload # This is needed to point apache to the right places to run the application. install -m 0644 -D -p %{SOURCE1} ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf.d/limesurvey.conf # Install files under build root. mv ./* ${RPM_BUILD_ROOT}%{limedir} mv ${RPM_BUILD_ROOT}%{limedir}/templates/* ${RPM_BUILD_ROOT}/var/lib/limesurvey/templates/ mv ${RPM_BUILD_ROOT}%{limedir}/application/config/* ${RPM_BUILD_ROOT}/var/lib/limesurvey/application/config/ mv ${RPM_BUILD_ROOT}%{limedir}/tmp/* ${RPM_BUILD_ROOT}/var/lib/limesurvey/tmp/ mv ${RPM_BUILD_ROOT}%{limedir}/upload/* ${RPM_BUILD_ROOT}/var/lib/limesurvey/upload/ cat index.php | sed -e "s|dirname(__FILE__).'/'|'/usr/share/limesurvey/'|g" > \ ${RPM_BUILD_ROOT}%{_sysconfdir}/limesurvey/ls-config.php /bin/ln -sf ../../../etc/limesurvey/ls-config.php ${RPM_BUILD_ROOT}%{limedir}/ls-config.php # Remove directories we no longer need under buildroot/limedir rm -rf ${RPM_BUILD_ROOT}%{limedir}/templates rm -rf ${RPM_BUILD_ROOT}%{limedir}/application/config rm -rf ${RPM_BUILD_ROOT}%{limedir}/tmp rm -rf ${RPM_BUILD_ROOT}%{limedir}/upload # Link them to the var lib versions of those directories. ln -s ../../../var/lib/limesurvey/templates ${RPM_BUILD_ROOT}%limedir/templates ln -s ../../../../var/lib/limesurvey/application/config ${RPM_BUILD_ROOT}%limedir/application/config ln -s ../../../var/lib/limesurvey/tmp ${RPM_BUILD_ROOT}%limedir/tmp ln -s ../../../var/lib/limesurvey/upload ${RPM_BUILD_ROOT}%limedir/upload rm -rf ${RPM_BUILD_ROOT}%{limedir}/fonts # Remove bundled libraries. rm -rf ${RPM_BUILD_ROOT}%{limedir}/application/third_party/ mkdir -p ${RPM_BUILD_ROOT}%{limedir}/application/third_party/ # link system php-gettext so it's found by limesurvey ln -s ../../../../../usr/share/php/gettext ${RPM_BUILD_ROOT}%{limedir}/application/third_party/php-gettext %clean %{__rm} -rf %{buildroot} %files %defattr(-, root, root, -) %config(noreplace) %{_sysconfdir}/limesurvey %config(noreplace) %{_sysconfdir}/httpd/conf.d/*.conf %attr(0555,apache,apache) /var/lib/limesurvey/tmp %attr(0775,apache,apache) /var/lib/limesurvey/application/config %attr(0775,apache,apache) /var/lib/limesurvey/templates %attr(0775,apache,apache) /var/lib/limesurvey/upload %{limedir} %changelog * Sun Jul 08 2012 Kevin Fenzi - 2.00-0.7 - Updated to RC4. - Cleaned up requres. mysql shouldn't be required. httpd was in twice. - Adjusted httpd conf: fixed paths, added FollowSymLinks. - Fixed link to application/config (was missing another ../) * Sat Jun 16 2012 srineth - 2.00-0.6 - Changed define to global - Updated to RC2 * Thu Jun 14 2012 Stephen Smoogen - 2.00-0.5 - Try to get this to work in a limited environment. * Thu May 10 2012 srineth - 2.00-0.3 - Fix double file listing issue * Tue May 8 2012 smooge - 2.00-0.2 - Move writable files to /var/www/limesurvey * Thu Jul 07 2011 The Coon of Ty - 2.7-1 - Initial version of the package