Package mod_python: Specfile
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 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | %setup_python_subpackage mod_python Name: mod_python%__python_package_version Version: 2.7.11 Release: alt6.2.1.1 Summary: Python module for Apache Group: System/Servers License: Free Url: http://www.modpython.org Packager: Alexey Morsov <swi@altlinux.ru> Source: %modulename-%version.tgz Patch: mod_python-dynamic.patch Patch1: mod_python-alt-python_bin.patch BuildRequires(pre): rpm-build-python >= 0.21-alt1 apache-devel python-dev >= 2.4 Requires: apache >= %apache_version PreReq: python >= %__python_version Requires: python = %__python_version Provides: mod_python%__python_version Conflicts: apache2-mod_python %add_python_req_skip _apache %define apache_ctl %_sbindir/apachectl %define apache_libdir %(%apache_apxs -q LIBEXECDIR) %define apache_modconfdir %apache_confdir/addon-modules %define apache_moddocdir %apache_htdocsdir/addon-modules %define apache_addonconfdir_d %apache_addonconfdir.d %define python_bindir %apache_htdocsdir/python %description mod_python is an Apache module that embeds the Python interpreter within the server. With mod_python you can write web-based applications in Python that will run many times faster than traditional CGI and will have access to advanced features such as ability to retain database connections and other data between hits and access to Apache internals. %prep %setup -q -n %modulename-%version %patch %patch1 -p1 %build %__autoconf %configure --with-apxs=%apache_apxs --prefix=%prefix --with-python-bin=%__python %make OPT="-fPIC $RPM_OPT_FLAGS -DEAPI" dso %install %__mkdir_p %buildroot{%_libdir/apache,%apache_moduledir,%apache_moddocdir,%apache_addonconfdir_d,\ %python_sitelibdir/%modulename,%_docdir/%modulename-%version/icons,%python_bindir} %__install -c src/mod_python.so %buildroot%_libdir/apache/ for i in `ls lib/python/mod_python/*.py`; do %__install -m 0644 $i %buildroot%python_sitelibdir/%modulename; done # docs for i in `ls doc-html/*.html doc-html/*.css`; do %__install -m 0644 $i %buildroot%_docdir/%modulename-%version; done for i in `ls doc-html/icons/*.gif`; do %__install -m 0644 $i %buildroot%_docdir/%modulename-%version/icons; done %__ln_s %_docdir/%modulename-%version %buildroot%apache_moddocdir/%modulename ### Creating %modulename.conf %__cat <<EOF >%modulename.conf ### %modulename.conf - configuration directives for the Python Apache module. ### See %apache_moddocdir/%modulename/docs/index.html for details. ## To configure Apache to handle files with the specified extension(s) ## as Python applications: # LoadModule python_module modules/mod_python.so # AddHandler python-program .py # Sample configuration for Python directory <IfModule mod_python.c> <Directory "%python_bindir"> AddHandler python-program .py .pyc .pyo PythonHandler mptest PythonDebug on </Directory> </IfModule> EOF ### Creating mptest.py %__cat <<EOF >mptest.py from mod_python import apache def handler(req): req.send_http_header() req.write("Hello World!") return apache.OK EOF %__install -m 0644 %modulename.conf %buildroot%apache_addonconfdir_d %__install -m 0644 mptest.py %buildroot%python_bindir %post [ -x %apache_ctl ] && %apache_ctl update ||: %postun [ -x %apache_ctl ] && %apache_ctl update ||: %files %python_sitelibdir/%modulename/* %_libdir/apache/%modulename.so %dir %attr(0775,root,%apache_webmaster) %python_bindir %attr(0664,root,%apache_webmaster) %python_bindir/mptest.py* %config(noreplace) %apache_addonconfdir_d/%modulename.conf %apache_moddocdir/* %doc %_docdir/%modulename-%version %changelog * Sat Oct 29 2011 Vitaly Kuznetsov <vitty@altlinux.ru> 2.7.11-alt6.2.1.1 - Rebuild with Python-2.7 * Thu Dec 03 2009 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 2.7.11-alt6.2.1 - Rebuilt with python 2.6 * Tue May 13 2008 Alexey Morsov <swi@altlinux.ru> 2.7.11-alt6.2 - remove XFree86 from req * Sat Jan 26 2008 Grigory Batalov <bga@altlinux.ru> 2.7.11-alt6.1 - Rebuilt with python-2.5. * Tue Jan 22 2008 Alexey Morsov <swi@altlinux.ru> 2.7.11-alt6 - fix package (own doc dir.) * Wed Jan 10 2007 Alexey Morsov <swi@altlinux.ru> 2.7.11-alt5 - add Conflicts to apache2-mod_python * Fri Dec 08 2006 Alexey Morsov <swi@altlinux.ru> 2.7.11-alt4 - Change Packager to "Alexey Morsov <swi@altlinux.ru> * Thu Nov 23 2006 Alexey Morsov <swi@altlinux.ru> 2.7.11-alt3 - changed spec for policy compliance - remove apacheversion macro * Sat Mar 12 2005 Ivan Fedorov <ns@altlinux.ru> 2.7.11-alt2 - rebuild with python 2.4 * Sun Feb 20 2005 Ivan Fedorov <ns@altlinux.ru> 2.7.11-alt1 - 2.7.11 - changed spec for apache policy compliance * Sat Feb 12 2005 Alexey Morozov <morozov@altlinux.org> 2.7.10-alt5 - changed spec for policy compliance * Mon Nov 22 2004 Ivan Fedorov <ns@altlinux.ru> 2.7.10-alt4 - Dynamic linking with python. * Thu Oct 14 2004 Ivan Fedorov <ns@altlinux.ru> 2.7.10-alt3 - Rebuild with -DEAPI switch for support Apache Extended API. * Mon Jun 28 2004 Ivan Fedorov <ns@altlinux.ru> 2.7.10-alt2 - Rebuild with new rpm/python macros. * Sat May 15 2004 Ivan Fedorov <ns@altlinux.ru> 2.7.10-alt1 - First build for Sisyphus. |