home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2011 January / maximum-cd-2011-01.iso / DiscContents / xbmc-9.11.exe / system / python / spyce / spyce.spec.in < prev    next >
Encoding:
RPM Spec  |  2009-12-23  |  2.4 KB  |  75 lines

  1. %define name spyce
  2. %define version __VERSION__
  3. %define release __RELEASE__
  4.  
  5. %define httpd_conf /etc/httpd/conf/httpd.conf
  6. %define httpd_conf_beginline ### BEGIN SPYCE CONFIG MARKER
  7. %define httpd_conf_endline ### END SPYCE CONFIG MARKER
  8. %define html_dir /var/www/html
  9.  
  10. Summary:       SPYCE - Python Server Pages, Python-based HTML scripting engine
  11. Name:          %{name}
  12. Version:       %{version}
  13. Release:       %{release}
  14. Group:         System/Servers
  15. Packager:      Rimon Barr <rimon AT acm DOT org>
  16. URL:           http://spyce.sourceforge.net
  17. License:       Refer to LICENCE.TXT
  18. BuildArchitectures: noarch
  19. BuildRoot:     %{_builddir}/%{name}-root
  20. #BuildRequires: python >= 2.2
  21. Requires:      python >= 2.2
  22. Requires:      httpd >= 2.0
  23. Source0:       %{name}-%{version}-%{release}.tgz
  24.  
  25. %description
  26. SPYCE is a server-side engine that supports simple and efficient Python-based
  27. dynamic HTML generation. Those who like Python and are familiar with JSP, or
  28. PHP, or ASP, should have a look at this engine. It allows one to generate
  29. dynamic HTML content just as easily, using Python for the dynamic parts. Its
  30. modular design makes it very flexible and extensible. It can also be used as a
  31. command-line utility for HTML pre-processing.
  32.  
  33. %prep
  34. %setup -q
  35.  
  36. %build
  37. make all
  38.  
  39. %install
  40. rm -rf ${RPM_BUILD_ROOT}
  41. make DESTDIR=${RPM_BUILD_ROOT} install
  42.  
  43. %clean
  44. rm -rf $RPM_BUILD_ROOT
  45.  
  46. %files
  47. %defattr(-,root,root)
  48. /usr/share/spyce
  49.  
  50. %post
  51. ln -sf /usr/share/spyce/run_spyceCmd.py /usr/bin/spyce
  52. ln -sf /usr/share/spyce/docs /usr/share/doc/spyce
  53. echo -n "Adding Spyce config to httpd.conf..."
  54. cp %httpd_conf %httpd_conf.spyce-install.bak
  55. sed -e "/%httpd_conf_beginline/,/%httpd_conf_endline/d" \
  56.   < %httpd_conf.spyce-install.bak > %httpd_conf
  57. echo "%httpd_conf_beginline"                                 >> %httpd_conf
  58. cat /usr/share/spyce/spyceApache.conf | sed -e "s+XXX+/usr/share/spyce+g"                             >> %httpd_conf
  59. echo "%httpd_conf_endline"                                   >> %httpd_conf
  60. echo " done."
  61. /usr/sbin/apachectl graceful
  62.  
  63. %postun
  64. if [ $1 == 0 ]; then 
  65.   rm -f /usr/bin/spyce
  66.   rm -f /usr/share/doc/spyce
  67.   rm -f %html_dir/spyce
  68.   echo -n "Removing Spyce config from httpd.conf..."
  69.   cp %httpd_conf %httpd_conf.spyce-uninstall.bak
  70.   sed -e "/%httpd_conf_beginline/,/%httpd_conf_endline/d" \
  71.     < %httpd_conf.spyce-uninstall.bak > %httpd_conf
  72.   echo " done."
  73.   /usr/sbin/apachectl graceful
  74. fi
  75.