Package apache2-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 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 | %setup_python_subpackage apache2_mod_python %define modname mod_python %define module_name python %ifarch %ix86 %define parch i686 %else %define parch %_arch %endif %define a2_version 2.4.18-alt1 %define python_bindir %apache2_htdocsdir/%module_name Name: apache2-mod_python%__python_package_version Version: 3.5.0 Release: alt1 Summary: Python module for Apache2 Group: System/Servers License: Free Url: http://www.modpython.org Packager: Alexey Morsov <swi@altlinux.ru> Source: %modname-%version.tgz Source1: python.load Source2: python.conf Source3: python.start Patch0: nogit.patch BuildPreReq: rpm-build-apache2 >= %a2_version BuildRequires: flex python-dev python-modules-encodings BuildRequires: apache2-devel >= %a2_version BuildRequires: rpm-build-python >= 0.21-alt1 BuildRequires: python-base >= 2.4.4 Requires: python = %__python_version Requires: apache2 >= %a2_version Conflicts: mod_python Provides: mod_python%__python_version %add_python_req_skip _apache %add_python_req_skip _psp %description mod_python is an Apache2 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 %modname-%version %patch0 -p2 sed -i "s/!(b == APR_BRIGADE_SENTINEL(b) ||/!(b == APR_BRIGADE_SENTINEL(bb) ||/g" src/connobject.c %build %configure --with-apxs=%apache2_apxs --prefix=%prefix --with-python-bin=%__python %make OPT="-fPIC $RPM_OPT_FLAGS -DEAPI" dso %install install -d -m 755 -- $RPM_BUILD_ROOT%apache2_mods_available install -d -m 755 -- $RPM_BUILD_ROOT%apache2_mods_start install -d -m 755 -- $RPM_BUILD_ROOT%apache2_libexecdir install -d -m 755 -- $RPM_BUILD_ROOT%apache2_htdocsaddondir/%modname install -p -m 644 -- %SOURCE1 $RPM_BUILD_ROOT%apache2_mods_available/%module_name.load install -p -m 644 -- %SOURCE2 $RPM_BUILD_ROOT%apache2_mods_available/%module_name.conf subst 's,@a_libexecdir@,%apache2_libexecdir,g' $RPM_BUILD_ROOT%apache2_mods_available/%module_name.load subst 's,@python_bindir@,%python_bindir,g' $RPM_BUILD_ROOT%apache2_mods_available/%module_name.conf install -p -m 644 -- %SOURCE3 $RPM_BUILD_ROOT%apache2_mods_start/100-%module_name.conf mkdir -p %buildroot{%python_sitelibdir/%modname,%_docdir/%modname-%version/icons,%python_bindir,\ %apache2_cgibindir} install -c src/%modname.so %buildroot%apache2_libexecdir install -c dist/build/lib.%{_os}-%{parch}-%{__python_version}/%modname/*.so %buildroot%python_sitelibdir/%modname for i in `ls lib/python/%modname/*.py`; do install -m 0644 $i %buildroot%python_sitelibdir/%modname; done # docs for i in `ls doc-html/*.html doc-html/*.css`; do install -m 0644 $i %buildroot%_docdir/%modname-%version; done for i in `ls doc-html/icons/*.gif`; do install -m 0644 $i %buildroot%_docdir/%modname-%version/icons; done ln -s %_docdir/%modname-%version %buildroot%apache2_htdocsaddondir/%modname ### 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 mptest.py %buildroot%python_bindir/ %post # Reconfigure Apache2: %apache2_sbindir/a2chkconfig ||: if [ -e %apache2_mods_enabled/%module_name.load ]; then CONF_OK=0 %apache2_sbindir/apachectl2 configtest && CONF_OK=1 ||: if [ "$CONF_OK" = "1" ]; then service %apache2_dname condrestart ||: else echo "Some errors detected in Apache2 configuration!" echo "To use %modname check configuration and start %apache2_dname service." echo fi else echo "Apache2 %modname module had been installed, but does't enabled." echo "Check %apache2_mods_start directory for files with '%module_name=no' lines." echo fi %preun if [ "$1" = "0" ] ; then # last uninstall [ -e %apache2_mods_enabled/%module_name.load ] && %apache2_sbindir/a2dismod %module_name 2>&1 >/dev/null ||: fi %postun # Reconfigure Apache2: %apache2_sbindir/a2chkconfig ||: if [ "$1" = "0" ] ; then # last uninstall CONF_OK=0 %apache2_sbindir/apachectl2 configtest && CONF_OK=1 ||: if [ "$CONF_OK" = "1" ]; then service %apache2_dname condrestart ||: else echo "Some errors detected in Apache2 configuration!" echo "To complete %module_name uninstalling check configuration and restart %apache2_dname service." echo fi fi %files %python_sitelibdir/%modname/* %apache2_libexecdir/%modname.so %dir %attr(0775,root,%apache2_webmaster) %python_bindir %attr(0664,root,%apache2_webmaster) %python_bindir/mptest.py* %config(noreplace) %apache2_mods_available/%module_name.conf %config %apache2_mods_available/%module_name.load %config %apache2_mods_start/100-%module_name.conf %apache2_htdocsaddondir/* %_docdir/%modname-%version %changelog * Wed Apr 06 2016 Sergey Alembekov <rt@altlinux.ru> 3.5.0-alt1 - new version - rebuild with apache 2.4 * Sat Oct 22 2011 Vitaly Kuznetsov <vitty@altlinux.ru> 3.3.1-alt2.5.2.1.1 - Rebuild with Python-2.7 * Mon Nov 16 2009 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 3.3.1-alt2.5.2.1 - Rebuilt with python 2.6 * Tue Feb 10 2009 Alexey Morsov <swi@altlinux.ru> 3.3.1-alt2.5.2 - put _psp.so into package - clean spec * Thu Oct 30 2008 Alexey Morsov <swi@altlinux.ru> 3.3.1-alt2.5.1 - fix comments in .load file * Wed Oct 29 2008 Alexey Morsov <swi@altlinux.org> 3.3.1-alt2.5 - fix build + fix macros + apply tip from gentoo (http://bugs.gentoo.org/show_bug.cgi?id=230211) * Fri Jan 25 2008 Grigory Batalov <bga@altlinux.ru> 3.3.1-alt2.4.1 - Rebuilt with python-2.5. * Mon Jan 21 2008 Alexey Morsov <swi@altlinux.ru> 3.3.1-alt2.4 - fix package: now own _docdir/modname-version * Mon Apr 09 2007 Alexey Morsov <swi@altlinux.ru> 3.3.1-alt2.3 - fix version requires for apache2 * Wed Apr 04 2007 Alexey Morsov <swi@altlinux.ru> 3.3.1-alt2.2 - fix build requires for new python policy * Mon Apr 02 2007 Alexey Morsov <swi@altlinux.ru> 3.3.1-alt2.1 - fix uninstall, config * Mon Apr 02 2007 Alexey Morsov <swi@altlinux.ru> 3.3.1-alt2 - Switch to the new Apache2 configuration scheme - Spec file cleanup * Tue Mar 06 2007 Alexey Morsov <swi@altlinux.ru> 3.3.1-alt1 - new version (bugfixed, improvements, new features) * Wed Jan 10 2007 Alexey Morsov <swi@altlinux.ru> 3.2.10-alt2 - make this mod_python conflicts with mod_python for apache1.3 otherwise not possible to start any apps without patching them for s/mod_python/apache2_mod_python/ * Wed Dec 20 2006 Alexey Morsov <swi@altlinux.ru> 3.2.10-alt1.1 - fix spec * Thu Dec 07 2006 Alexey Morsov <swi@altlinux.ru> 3.2.10-alt1 - Initial build for Sisyphus - patch for separate apache2-mod_python from mod_python for apache1 |