# FC5 and later include SELinux policy module packages %if 0%{?fedora} < 5 %define selinux_module 0 %define selinux_variants %{nil} %define selinux_buildreqs %{nil} %else %define selinux_module 1 %define selinux_variants mls strict targeted %define selinux_buildreqs checkpolicy, selinux-policy-devel, hardlink %endif Name: mod_fcgid Version: 1.10 Release: 7%{?dist} Summary: Apache2 module for high-performance server-side scripting Group: System Environment/Daemons License: GPL URL: http://fastcgi.coremail.cn/ Source0: http://fastcgi.coremail.cn/mod_fcgid.%{version}.tar.gz Source1: fcgid.conf Source2: fastcgi.te Source3: fastcgi.fc Source4: README.Fedora Source5: http://fastcgi.coremail.cn/doc.htm Source6: http://fastcgi.coremail.cn/configuration.htm Source7: README.SELinux Patch0: mod_fcgid.1.09-docurls.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: httpd-devel >= 2.0 Requires: httpd-mmn = %([ -a %{_includedir}/httpd/.mmn ] && %{__cat} %{_includedir}/httpd/.mmn || echo missing) %description mod_fcgid is a binary-compatible alternative to the Apache module mod_fastcgi. mod_fcgid has a new process management strategy, which concentrates on reducing the number of fastcgi servers, and kicking out corrupt fastcgi servers as soon as possible. %if %{selinux_module} %define selinux_policyver %(sed -e 's,.*selinux-policy-\\([^/]*\\)/.*,\\1,' /usr/share/selinux/devel/policyhelp) %package selinux Summary: SELinux policy module supporting FastCGI applications with mod_fcgid Group: System Environment/Base BuildRequires: %{selinux_buildreqs} # selinux-policy is required for directory ownership of %{_datadir}/selinux/* # Modules built against one version of a policy may not work with older policy # versions, as noted on fedora-selinux-list: # http://www.redhat.com/archives/fedora-selinux-list/2006-May/msg00102.html # Hence the versioned dependency. The versioning will hopefully be replaced by # an ABI version requirement or something similar in the future %if "%{selinux_policyver}" != "" Requires: selinux-policy >= %{selinux_policyver} %endif Requires: %{name} = %{version}-%{release} Requires(post): /usr/sbin/semodule, /sbin/restorecon Requires(postun): /usr/sbin/semodule, /sbin/restorecon %description selinux SELinux policy module supporting FastCGI applications with mod_fcgid. %endif %prep %setup -q -n mod_fcgid.%{version} %{__cp} -p %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE6} %{SOURCE7} . %{__cp} -p %{SOURCE5} directives.htm %patch0 -p1 %{__sed} -i -e 's/\r$//' directives.htm configuration.htm %build topdir=$(/usr/bin/dirname $(/usr/sbin/apxs -q exp_installbuilddir)) %{__make} top_dir=${topdir} %if %{selinux_module} for selinuxvariant in %{selinux_variants} do %{__make} NAME=${selinuxvariant} -f /usr/share/selinux/devel/Makefile %{__mv} fastcgi.pp fastcgi.pp.${selinuxvariant} %{__make} NAME=${selinuxvariant} -f /usr/share/selinux/devel/Makefile clean done %endif %install %{__rm} -rf %{buildroot} topdir=$(/usr/bin/dirname $(/usr/sbin/apxs -q exp_installbuilddir)) %{__make} \ top_dir=${topdir} \ DESTDIR=%{buildroot} \ MKINSTALLDIRS="%{__mkdir_p}" \ install %{__install} -D -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/httpd/conf.d/fcgid.conf %{__install} -d -m 755 %{buildroot}%{_localstatedir}/run/mod_fcgid # Install SELinux policy modules %if %{selinux_module} for selinuxvariant in %{selinux_variants} do %{__install} -d %{buildroot}%{_datadir}/selinux/${selinuxvariant} %{__install} -p -m 644 fastcgi.pp.${selinuxvariant} \ %{buildroot}%{_datadir}/selinux/${selinuxvariant}/fastcgi.pp done # Hardlink identical policy module packages together /usr/sbin/hardlink -cv %{buildroot}%{_datadir}/selinux %endif %clean %{__rm} -rf %{buildroot} %if %{selinux_module} %post selinux # Install SELinux policy modules for selinuxvariant in %{selinux_variants} do /usr/sbin/semodule -s ${selinuxvariant} -i \ %{_datadir}/selinux/${selinuxvariant}/fastcgi.pp &> /dev/null || : done # Fix up non-standard directory context /sbin/restorecon %{_localstatedir}/run/mod_fcgid || : %postun selinux # Clean up after package removal if [ $1 -eq 0 ]; then # Remove SELinux policy modules for selinuxvariant in %{selinux_variants} do /usr/sbin/semodule -s ${selinuxvariant} -r fastcgi &> /dev/null || : done # Clean up any remaining file contexts (shouldn't be any really) [ -d %{_localstatedir}/run/mod_fcgid ] && \ /sbin/restorecon -R %{_localstatedir}/run/mod_fcgid &> /dev/null || : fi %endif %files %defattr(-,root,root,0755) %doc ChangeLog AUTHOR COPYING configuration.htm directives.htm %doc README.Fedora %{_libdir}/httpd/modules/mod_fcgid.so %config(noreplace) %{_sysconfdir}/httpd/conf.d/fcgid.conf %dir %attr(0755,apache,apache) %{_localstatedir}/run/mod_fcgid %if %{selinux_module} %files selinux %defattr(-,root,root,0755) %doc fastcgi.fc fastcgi.te README.SELinux %{_datadir}/selinux/*/fastcgi.pp %endif %changelog * Wed Sep 6 2006 Paul Howarth 1.10-7 - Include the right README* files * Tue Aug 29 2006 Paul Howarth 1.10-6 - Buildreqs for FC5 now identical to buildreqs for FC6 onwards * Fri Jul 28 2006 Paul Howarth 1.10-5 - Split off SELinux module into separate subpackage to avoid dependency on the selinux-policy package for the main package * Fri Jul 28 2006 Paul Howarth 1.10-4 - SELinux policy packages moved from %%{_datadir}/selinux/packages/POLICYNAME to %%{_datadir}/selinux/POLICYNAME - hardlink identical policy module packages together to avoid duplicate files * Thu Jul 20 2006 Paul Howarth 1.10-3 - Adjust buildreqs for FC6 onwards - Figure out where top_dir is dynamically since the /etc/httpd/build symlink is gone in FC6 * Wed Jul 5 2006 Paul Howarth 1.10-2 - SELinux policy update: allow FastCGI apps to do DNS lookups * Tue Jul 4 2006 Paul Howarth 1.10-1 - Update to 1.10 - Expand tabs to shut rpmlint up * Tue Jul 4 2006 Paul Howarth 1.09-10 - SELinux policy update: * allow httpd to read httpd_fastcgi_content_t without having the httpd_builtin_scripting boolean set * allow httpd_fastcgi_script_t to read /etc/resolv.conf without having the httpd_can_network_connect boolean set * Sun Jun 18 2006 Paul Howarth 1.09-9 - Discard output of semodule in %%postun - Include some documentation from upstream * Fri Jun 9 2006 Paul Howarth 1.09-8 - Change default context type for socket directory from var_run_t to httpd_fastcgi_sock_t for better separation * Thu Jun 8 2006 Paul Howarth 1.09-7 - Add SELinux policy module and README.Fedora - Conflict with selinux-policy versions older than what we're built on * Mon May 15 2006 Paul Howarth 1.09-6 - Instead of conflicting with mod_fastcgi, don't add the handler for .fcg etc. if mod_fastcgi is present * Fri May 12 2006 Paul Howarth 1.09-5 - Use correct handler name in fcgid.conf - Conflict with mod_fastcgi - Create directory %%{_localstatedir}/run/mod_fcgid for sockets * Thu May 11 2006 Paul Howarth 1.09-4 - Cosmetic tweaks (personal preferences) - Don't include INSTALL.TXT, nothing of use to end users * Wed May 10 2006 Thomas Antony 1.09-3 - Initial release