%define cherokee_uid 64300 %define cherokee_gid 64300 Name: cherokee Version: 1.0.18 Release: 1 Summary: Flexible and Fast Webserver Group: Applications/Internet License: GPLv2 URL: http://www.cherokee-project.com/ Source0: http://www.cherokee-project.com/download/%{name}/%{version}/%{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root Source1: %{name}.init Source2: %{name}.logrotate Patch0: %{name}-%{version}-aix.patch # Drop privileges to cherokee:cherokee after startup Patch1: 01-drop-privileges.patch BuildRequires: gettext, make, patch, sed BuildRequires: openssl-devel >= 0.9.8, pcre-devel >= 7.9 BuildRequires: GeoIP-devel >= 1.4.7-0.1.20090931cvs Requires: openssl >= 0.9.8, pcre >= 7.9, gettext Requires: GeoIP >= 1.4.7-0.1.20090931cvs # as under AIX a "kill -TERM " does not work we require at least # AIX 5.2 or higher Requires: AIX-rpm >= 5.2.0.0 Provides: webserver %description Cherokee is a very fast, flexible and easy to configure Web Server. It supports the widespread technologies nowadays: FastCGI, SCGI, PHP, CGI, TLS and SSL encrypted connections, Virtual hosts, Authentication, on the fly encoding, Apache compatible log files, and much more. %package devel Group: Development/Libraries Summary: Development files of cherokee Requires: %{name} = %{version} %description devel Cherokee is a very fast, flexible and easy to configure Web Server. It supports the widespread technologies nowadays: FastCGI, SCGI, PHP, CGI, TLS and SSL encrypted connections, Virtual hosts, Authentication, on the fly encoding, Apache compatible log files, and much more. This package holds the development files for cherokee. %prep %setup -q export PATH=/opt/freeware/bin:$PATH %patch0 %patch1 -p1 -b .privs %build export CONFIG_SHELL=/usr/bin/ksh export CONFIG_ENV_ARGS=/usr/bin/ksh export CC="xlc_r -D_LINUX_SOURCE_COMPAT -D_LARGE_FILES" export LDFLAGS="-L/opt/freeware/lib -Wl,-bmaxdata:0x80000000 -Wl,-brtl" ./configure \ --prefix=%{_prefix} \ --localstatedir=/var\ --mandir=%{_mandir} \ --enable-trace \ --enable-shared --disable-static \ --with-libssl=%{_prefix} \ --enable-pthread \ --with-wwwroot=/var/www/%{name} \ --with-wwwuser=%{name} \ --with-wwwgroup=%{name} gmake %{?_smp_mflags} %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} gmake install DESTDIR=${RPM_BUILD_ROOT} /usr/bin/strip ${RPM_BUILD_ROOT}%{_bindir}/* || : /usr/bin/strip ${RPM_BUILD_ROOT}%{_sbindir}/* || : # create the /etc/rc.d/init.d/ scripts and symlinks mkdir -p ${RPM_BUILD_ROOT}/etc/rc.d/init.d chmod 0755 ${RPM_BUILD_ROOT}/etc/rc.d/init.d cp %{SOURCE1} ${RPM_BUILD_ROOT}/etc/rc.d/init.d/%{name} chmod 0755 ${RPM_BUILD_ROOT}/etc/rc.d/init.d/%{name} mkdir -p ${RPM_BUILD_ROOT}/etc/rc.d/rc2.d/ mkdir -p ${RPM_BUILD_ROOT}/etc/rc.d/rc3.d/ ln -sf '../init.d/cherokee' ${RPM_BUILD_ROOT}/etc/rc.d/rc2.d/S%{name} ln -sf '../init.d/cherokee' ${RPM_BUILD_ROOT}/etc/rc.d/rc2.d/K%{name} ln -sf '../init.d/cherokee' ${RPM_BUILD_ROOT}/etc/rc.d/rc3.d/S%{name} ln -sf '../init.d/cherokee' ${RPM_BUILD_ROOT}/etc/rc.d/rc3.d/K%{name} mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d chmod 0755 ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d/ cp %{SOURCE2} ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d/%{name} chmod 0644 %{SOURCE2} ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d/%{name} mkdir -p ${RPM_BUILD_ROOT}/var/log/%{name}/ chmod 0755 ${RPM_BUILD_ROOT}/var/log/%{name}/ mkdir -p ${RPM_BUILD_ROOT}/var/lib/%{name}/ chmod 0755 ${RPM_BUILD_ROOT}/var/lib/%{name}/ /opt/freeware/bin/sed -i -e 's#log/%{name}\.access#log/%{name}/access_log#' \ -e 's#log/%{name}\.error#log/%{name}/error_log#' \ ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/%{name}.conf /opt/freeware/bin/sed -i -e 's#log/%{name}\.access#log/%{name}/access_log#' \ -e 's#log/%{name}\.error#log/%{name}/error_log#' \ ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/%{name}.conf.perf_sample touch ${RPM_BUILD_ROOT}/var/log/%{name}/access_log touch ${RPM_BUILD_ROOT}/var/log/%{name}/error_log ( cd ${RPM_BUILD_ROOT} for dir in bin include lib do mkdir -p usr/${dir} cd usr/${dir} ln -sf ../..%{_prefix}/${dir}/* . cd - done ) %pre # add the "cherokee" group /usr/bin/mkgroup -A id=%{cherokee_gid} %{name} 2> /dev/null || : # add the "cherokee" user /usr/bin/mkuser id=%{cherokee_uid} pgrp="%{name}" gecos='Cherokee User' \ login='false' rlogin='false' %{name} 2> /dev/null || : %preun if [ $1 = 0 ] ; then /etc/rc.d/init.d/%{name} stop > /dev/null 2>&1 fi # remove "cherokee" user and group /usr/sbin/rmuser -p %{name} || : /usr/sbin/rmgroup %{name} || : %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc AUTHORS ChangeLog COPYING INSTALL README %doc %{_datadir}/doc/%{name} %dir %{_sysconfdir}/%{name} %config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf %config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf.perf_sample %config(noreplace) %{_sysconfdir}/logrotate.d/%{name} %{_bindir}/cget %{_bindir}/cherokee-panic %{_bindir}/cherokee-tweak %{_sbindir}/cherokee %{_sbindir}/cherokee-admin %{_sbindir}/cherokee-worker %{_mandir}/man1/cget.1 %{_mandir}/man1/cherokee-admin.1 %{_mandir}/man1/cherokee-tweak.1 %{_mandir}/man1/cherokee-worker.1 %{_mandir}/man1/cherokee.1 %{_libdir}/%{name} %{_libdir}/*.so* %{_datadir}/%{name} %{_datadir}/locale/*/LC_MESSAGES/%{name}.mo %dir /var/log/%{name}/ # Since we drop privileges to cherokee:cherokee, change permissions on these # log files. %attr (-,%{name},%{name}) /var/log/%{name}/error_log %attr (-,%{name},%{name}) /var/log/%{name}/access_log %dir %attr(-,%{name},%{name}) /var/lib/%{name}/ %dir /var/www/ %dir /var/www/%{name}/ %dir /var/www/%{name}/images/ %config(noreplace) /var/www/%{name}/images/cherokee-logo.png %config(noreplace) /var/www/%{name}/images/default-bg.png %config(noreplace) /var/www/%{name}/images/powered_by_cherokee.png %config(noreplace) /var/www/%{name}/images/favicon.ico %config(noreplace) /var/www/%{name}/index.html /etc/rc.d/init.d/%{name} /etc/rc.d/rc?.d/?%{name} %files devel %defattr(-,root,system,-) %{_bindir}/cherokee-config %{_mandir}/man1/cherokee-config.1 %{_includedir}/* %{_libdir}/*.la %{_libdir}/pkgconfig/%{name}.pc %{_datadir}/aclocal/%{name}.m4 %changelog * Thu Jan 19 2011 Michael Perzl - 1.0.18-1 - updated to version 1.0.18 * Thu Dec 30 2010 Michael Perzl - 1.0.15-1 - updated to version 1.0.15 * Tue Dec 14 2010 Michael Perzl - 1.0.14-1 - updated to version 1.0.14 * Thu Dec 09 2010 Michael Perzl - 1.0.13-1 - updated to version 1.0.13 * Thu Dec 02 2010 Michael Perzl - 1.0.12-1 - updated to version 1.0.12 * Wed Nov 24 2010 Michael Perzl - 1.0.10-1 - updated to version 1.0.10 * Thu Nov 18 2010 Michael Perzl - 1.0.9-1 - first version for AIX V5.1 and higher