Home | History | Annotate | Download | only in rpm
      1 #
      2 # spec file for ClearSilver Linux RPM (based on RedHat installs)
      3 #
      4 # Caveats: There is some difficulty getting this file to sync with the
      5 # actual information discovered by configure.  In theory, some of this
      6 # stuff in here could be driven off of configure.. except that configure
      7 # is supposed to be driven off this file...
      8 #
      9 # * PREFIX vs perl/python PREFIX: where the perl/python modules get
     10 # installed is actually defined by the installation of perl/python you
     11 # are using to build the module.  For that reason, we need to use a
     12 # different PREFIX for the python/perl modules.  For python, we just
     13 # override PYTHON_SITE during install, for perl we have to run make
     14 # install again with a new PREFIX.  This means the perl module might be
     15 # installed in two different locations, but we just package the second
     16 # one.
     17 #
     18 # * The perl suggestions for rpms:
     19 # http://archive.develooper.com/perl-dist@perl.org/msg00055.html
     20 # suggest using find to get all of the files for the perl module.  I'm
     21 # currently hard coding them since we're not just building the perl
     22 # module.  In particular, the file path of the ClearSilver.3pm.gz
     23 # manpage is probably wrong on some platforms.
     24 #
     25 # * The apache/java/ruby/csharp packages are not yet finished.  For one,
     26 # all of my machines are redhat 7.3 or earlier, and don't have rpms
     27 # installed for java/ruby/csharp, and my apache installation is Neotonic
     28 # specific and therefore not much help to the rest of you.
     29 
     30 ##########################################################################
     31 ## Edit these settings
     32 %define __prefix        /usr/local
     33 %define __python        /usr/bin/python
     34 %define	with_python_subpackage	1 %{nil}
     35 %define with_perl_subpackage	1 %{nil}
     36 
     37 # These packages aren't tested at all and probably won't build
     38 %define with_apache_subpackage	0
     39 %define with_java_subpackage	0
     40 %define with_ruby_subpackage	0
     41 %define with_csharp_subpackage	0
     42 
     43 ##########################################################################
     44 ## All of the rest of this should work correctly based on the top...
     45 ## maybe
     46 %define python_sitepath %(%{__python} -c "import site; print site.sitedirs[0]")
     47 %define perl_sitearch %(eval "`perl -V:installsitearch`"; echo $installsitearch)
     48 %define perl_prefix %(eval "`perl -V:prefix`"; echo $prefix)
     49 %define ruby_sitepath %(echo "i dunno")
     50 %define ruby_version %(echo "i dunno")
     51 %define ruby_arch %(echo "i dunno")
     52 %define apache_libexec %(eval `/httpd/bin/apxs -q LIBEXECDIR`)
     53 
     54 Summary: Neotonic ClearSilver
     55 Name: clearsilver
     56 Version: 0.10.5
     57 Release: 1
     58 Copyright: Open Source - Neotonic ClearSilver License (Apache 1.1 based)
     59 Group: Development/Libraries
     60 Source: http://www.clearsilver.net/downloads/clearsilver-0.10.5.tar.gz
     61 URL: http://www.clearsilver.net/
     62 Vendor: Neotonic Software Corporation, Inc.
     63 Packager: Brandon Long <blong@neotonic.com>
     64 BuildRequires: zlib-devel
     65 %if %{with_python_subpackage}
     66 BuildRequires: python-devel >= 1.5.2
     67 %endif
     68 %if %{with_perl_subpackage}
     69 BuildRequires: perl >= 0:5.006
     70 %endif
     71 %if %{with_ruby_subpackage}
     72 BuildRequires: ruby >= 1.4.5
     73 %endif
     74 
     75 BuildRoot: %{_tmppath}/%{name}-root
     76 
     77 %description
     78 ClearSilver is a fast, powerful, and language-neutral HTML template system. 
     79 In both static content sites and dynamic HTML applications, it provides a 
     80 separation between presentation code and application logic which makes 
     81 working with your project easier.
     82 
     83 Because it's written as a C-library, and exported to scripting languages 
     84 like Python and Perl via modules, it is extremely fast compared to template 
     85 systems written in a script language. 
     86 
     87 %if %{with_python_subpackage}
     88 %package python
     89 Summary: Neotonic ClearSilver Python Module
     90 Group: Development/Libraries
     91 Requires: clearsilver = %PACKAGE_VERSION
     92 %requires_eq python
     93 
     94 %description python
     95 The clearsilver-python package provides a python interface to the
     96 clearsilver CGI kit and templating system.
     97 %endif
     98 
     99 %if %{with_perl_subpackage}
    100 %package perl
    101 Summary: Neotonic ClearSilver Perl Module
    102 Group: Development/Libraries
    103 Requires: clearsilver = %PACKAGE_VERSION
    104 Requires: perl >= 0:5.006
    105 %requires_eq perl
    106 
    107 %description perl
    108 The clearsilver-perl package provides a perl interface to the
    109 clearsilver templating system.
    110 %endif
    111 
    112 %if %{with_ruby_subpackage}
    113 %package ruby
    114 Summary: Neotonic ClearSilver Ruby Module
    115 Group: Development/Libraries
    116 Requires: clearsilver = %PACKAGE_VERSION
    117 Requires: ruby >= 1.4.5
    118 
    119 %description ruby
    120 The clearsilver-ruby package provides a ruby interface to the
    121 clearsilver templating system.
    122 %endif
    123 
    124 %if %{with_apache_subpackage}
    125 %package apache
    126 Summary: Neotonic ClearSilver Apache Module
    127 Group: Development/Libraries
    128 Requires: clearsilver = %PACKAGE_VERSION
    129 Requires: apache >= 1.3.0
    130 Requires: apache < 1.4
    131 
    132 %description apache
    133 The clearsilver-apache package provides an Apache 1.3.x module for
    134 loading ClearSilver CGI's as shared libraries.
    135 %endif
    136 
    137 %if %{with_java_subpackage}
    138 %package java
    139 Group: Development/Libraries
    140 Requires: clearsilver = %PACKAGE_VERSION
    141 
    142 %description java
    143 The clearsilver-java package provides a java jni interface to the
    144 clearsilver templating system.
    145 %endif
    146 
    147 %prep
    148 %setup 
    149 
    150 %build
    151 ./configure --prefix=%{__prefix} --with-python=%{__python}
    152 make
    153 
    154 %install
    155 make PREFIX="$RPM_BUILD_ROOT%{__prefix}" prefix="$RPM_BUILD_ROOT%{__prefix}" PYTHON_SITE="$RPM_BUILD_ROOT%{python_sitepath}" install
    156 cd perl
    157 make PREFIX="$RPM_BUILD_ROOT%{perl_prefix}" install
    158 cd ..
    159 
    160 %files 
    161 %{__prefix}/include/ClearSilver/ClearSilver.h
    162 %{__prefix}/include/ClearSilver/cs_config.h
    163 %{__prefix}/include/ClearSilver/cgi/cgi.h
    164 %{__prefix}/include/ClearSilver/cgi/cgiwrap.h
    165 %{__prefix}/include/ClearSilver/cgi/date.h
    166 %{__prefix}/include/ClearSilver/cgi/html.h
    167 %{__prefix}/include/ClearSilver/cs/cs.h
    168 %{__prefix}/include/ClearSilver/util/dict.h
    169 %{__prefix}/include/ClearSilver/util/filter.h
    170 %{__prefix}/include/ClearSilver/util/neo_date.h
    171 %{__prefix}/include/ClearSilver/util/neo_err.h
    172 %{__prefix}/include/ClearSilver/util/neo_files.h
    173 %{__prefix}/include/ClearSilver/util/neo_hash.h
    174 %{__prefix}/include/ClearSilver/util/neo_hdf.h
    175 %{__prefix}/include/ClearSilver/util/neo_misc.h
    176 %{__prefix}/include/ClearSilver/util/neo_net.h
    177 %{__prefix}/include/ClearSilver/util/neo_rand.h
    178 %{__prefix}/include/ClearSilver/util/neo_server.h
    179 %{__prefix}/include/ClearSilver/util/neo_str.h
    180 %{__prefix}/include/ClearSilver/util/rcfs.h
    181 %{__prefix}/include/ClearSilver/util/skiplist.h
    182 %{__prefix}/include/ClearSilver/util/ulist.h
    183 %{__prefix}/include/ClearSilver/util/ulocks.h
    184 %{__prefix}/include/ClearSilver/util/wdb.h
    185 %{__prefix}/include/ClearSilver/util/wildmat.h
    186 %{__prefix}/lib/libneo_cgi.a
    187 %{__prefix}/lib/libneo_cs.a
    188 %{__prefix}/lib/libneo_utl.a
    189 %{__prefix}/bin/static.cgi
    190 %{__prefix}/bin/cstest
    191 %{__prefix}/man/man3
    192 
    193 %if %{with_python_subpackage}
    194 %files python
    195 %{python_sitepath}/neo_cgi.so
    196 %endif
    197 
    198 %if %{with_perl_subpackage}
    199 %files perl
    200 %{perl_sitearch}/ClearSilver.pm
    201 %{perl_sitearch}/auto/ClearSilver/ClearSilver.so
    202 %{perl_sitearch}/auto/ClearSilver/ClearSilver.bs
    203 %{perl_prefix}/share/man/man3/ClearSilver.3pm.gz
    204 %endif
    205 
    206 %if %{with_ruby_subpackage}
    207 %files ruby
    208 %{ruby_sitepath}/%(ruby_version}/neo.rb
    209 %{ruby_sitepath}/%(ruby_version}/$(ruby_arch}/hdf.so
    210 %endif
    211 
    212 %if %{with_apache_subpackage}
    213 %files apache
    214 %{apache_libexec}/mod_ecs.so
    215 %endif
    216 
    217 %if %{with_java_subpackage}
    218 %files java
    219 %{__prefix}/lib/clearsilver.jar
    220 %{__prefix}/lib/libclearsilver-jni.so
    221 %endif
    222