# Detect the distribution in use %global __despace head -n 1 | tr -d '[:space:]' | sed -e 's/[(].*[)]//g' %global __lower4 cut -c 1-4 | tr '[:upper:]' '[:lower:]' %global __distfile %([ -f /etc/SuSE-release ] && echo /etc/SuSE-release || echo /etc/redhat-release) %global __distinit %(sed -e 's/ release .*//' -e 's/\\([A-Za-z]\\)[^ ]*/\\1/g' %{__distfile} | %{__despace} | %{__lower4}) %global __distvers %(sed -e 's/.* release \\([^. ]*\\).*/\\1/' %{__distfile} | %{__despace}) # Identify CentOS Linux and Scientific Linux as rhel %if "%{__distinit}" == "c" || "%{__distinit}" == "cl" || "%{__distinit}" == "sl" || "%{__distinit}" == "sls" %global __distinit rhel %endif # Dist tag for Fedora is still "fc" %if "%{__distinit}" == "f" %global __distinit fc %endif %global pythonver %(python -c "import sys; print sys.version[:3]" 2>/dev/null || echo none) %{!?python_sitelib: %global python_sitelib %{_prefix}/lib/python%{pythonver}/site-packages} Summary: The "virtensys" theme for the moin wiki engine Name: moin-theme-virtensys Version: 0.3 Release: 2.%{__distinit}%{__distvers} Url: http://moinmo.in/ThemeMarket Source0: virtensys-%{version}.tar.bz2 License: GPLv2+ Group: Applications/Internet BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -nu) BuildArch: noarch Requires: moin >= 1.9.0 Requires: python(abi) = %{pythonver} BuildRequires: python >= 2.4 %description The virtensys theme is based on Hypermodern but tweaked to give more of the look and feel of the original VirtenSys website (http://www.virtensys.com/). %prep %setup -q -n virtensys-%{version} cat << EOF > README.rpm After installing this package, any newly-created wiki instances should automatically have the virtensys theme available. To make the virtensys theme available to an existing wiki instance, copy %{_datadir}/moin/data/plugin/theme/virtensys.py* to the data/plugin/theme directory of the wiki instance and do: chown apache:apache /path/to/wiki/data/plugin/theme/virtensys.py* EOF %build # Generate normal (.pyc) byte-compiled files. python -c 'import compileall; compileall.compile_dir(".", 1, "/", 1)' # Generate optimized (.pyo) byte-compiled files. python -O -c 'import compileall; compileall.compile_dir(".", 1, "/", 1)' %install rm -rf %{buildroot} install -d -m 755 %{buildroot}%{python_sitelib}/MoinMoin/web/static/htdocs/virtensys/{css,img} install -d -m 755 %{buildroot}%{_datadir}/moin/data/plugin/theme install -p -m 644 css/*.css %{buildroot}%{python_sitelib}/MoinMoin/web/static/htdocs/virtensys/css install -p -m 644 img/*.png %{buildroot}%{python_sitelib}/MoinMoin/web/static/htdocs/virtensys/img install -p -m 644 virtensys.py* %{buildroot}%{_datadir}/moin/data/plugin/theme %clean rm -rf %{buildroot} %files %defattr(-,root,root,-) %doc README.rpm %{_datadir}/moin/data/plugin/theme/virtensys.py* %{python_sitelib}/MoinMoin/web/static/htdocs/virtensys/ %changelog * Thu Aug 25 2011 Paul Howarth 0.3-2 - Preserve timestamps of files where possible - Nobody else likes macros for commands - Fix dist tag for CentOS 6 and Scientific Linux * Thu Jan 14 2010 Paul Howarth 0.3-1 - Completely new upstream theme 0.3 based on modernized_cms from moin 1.9.0 - Require moin >= 1.9.0 and hence python >= 2.4 - Get rid of compat stuff for older moin versions * Wed Jan 13 2010 Paul Howarth 0.2-3 - Add compat symlink to static content from %%{python_sitelib}/MoinMoin/web/static/htdocs for moin >= 1.9.0 - BR: symlinks - Dist tag for Rawhide no longer needs special-casing - Define RPM macros in global scope * Thu Oct 9 2008 Paul Howarth 0.2-2 - Add style for strikethrough (patch from Chris Lawther) * Thu Feb 21 2008 Paul Howarth 0.2-1 - Update to 0.2 (updated icon set from moin 1.6.1) * Mon Feb 4 2008 Paul Howarth 0.1-2 - Fix python-abi dep for python 2.3 - Fix mock build where python is not in the initial buildroot - Fix dist tag for development builds - Define %%{__id_u} in a more portable way - Don't ghost .pyo files - Buildreq python, not python-devel - Clarify license as GPL version 2 or later * Tue Feb 28 2006 Paul Howarth 0.1-1 - Initial package build