2010-03-02 13:34:48 +00:00
|
|
|
%define selinux_variants mls strict targeted
|
|
|
|
%define selinux_policyver %(sed -e 's,.*selinux-policy-\\([^/]*\\)/.*,\\1,' /usr/share/selinux/devel/policyhelp)
|
|
|
|
|
2006-04-22 12:19:27 +00:00
|
|
|
Name: cachefilesd
|
2010-03-02 13:34:48 +00:00
|
|
|
Version: 0.10
|
|
|
|
Release: 1%{?dist}
|
2006-04-22 12:19:27 +00:00
|
|
|
Summary: CacheFiles userspace management daemon
|
|
|
|
Group: System Environment/Daemons
|
2010-03-02 13:34:48 +00:00
|
|
|
License: GPL
|
2008-07-15 14:12:23 +00:00
|
|
|
URL: http://people.redhat.com/~dhowells/fscache/
|
2006-09-22 17:22:53 +00:00
|
|
|
Source0: http://people.redhat.com/dhowells/fscache/cachefilesd-%{version}.tar.bz2
|
2006-08-02 01:58:30 +00:00
|
|
|
|
2010-03-02 13:34:48 +00:00
|
|
|
Patch00: cachefilesd-0.10-security-contexts.patch
|
|
|
|
|
2006-07-28 16:37:41 +00:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-root-%(%{__id_u} -n)
|
2010-03-02 13:34:48 +00:00
|
|
|
BuildRequires: automake, autoconf, selinux-policy-doc
|
2006-08-08 21:44:29 +00:00
|
|
|
Requires(post): /sbin/chkconfig, /sbin/service
|
|
|
|
Requires(preun): /sbin/chkconfig, /sbin/service
|
2010-03-02 13:34:48 +00:00
|
|
|
Requires: %{name}-selinux = %{version}-%{release}
|
2006-04-22 12:19:27 +00:00
|
|
|
|
|
|
|
%description
|
|
|
|
The cachefilesd daemon manages the caching files and directory that are
|
2010-03-02 13:34:48 +00:00
|
|
|
that are used by network filesystems such a AFS and NFS to
|
2006-04-22 12:19:27 +00:00
|
|
|
do persistent caching to the local disk.
|
|
|
|
|
2010-03-02 13:34:48 +00:00
|
|
|
%package selinux
|
|
|
|
Summary: SELinux policy module supporting cachefilesd
|
|
|
|
Group: System Environment/Base
|
|
|
|
BuildRequires: checkpolicy, selinux-policy-devel, hardlink
|
|
|
|
%if "%{selinux_policyver}" != ""
|
|
|
|
Requires: selinux-policy >= %{selinux_policyver}
|
|
|
|
%endif
|
|
|
|
Requires(post): /usr/sbin/semodule, /sbin/restorecon
|
|
|
|
Requires(postun): /usr/sbin/semodule, /sbin/restorecon
|
|
|
|
|
|
|
|
%description selinux
|
|
|
|
SELinux policy module supporting cachefilesd
|
|
|
|
|
2006-04-22 12:19:27 +00:00
|
|
|
%prep
|
|
|
|
%setup -q
|
|
|
|
|
2010-03-02 13:34:48 +00:00
|
|
|
%patch00 -p1
|
|
|
|
|
2006-04-22 12:19:27 +00:00
|
|
|
%build
|
2010-03-02 13:34:48 +00:00
|
|
|
%ifarch s390 s390x
|
2006-04-22 12:19:27 +00:00
|
|
|
PIE="-fPIE"
|
|
|
|
%else
|
|
|
|
PIE="-fpie"
|
|
|
|
%endif
|
|
|
|
export PIE
|
|
|
|
CFLAGS="`echo $RPM_OPT_FLAGS $ARCH_OPT_FLAGS $PIE`"
|
|
|
|
|
|
|
|
make all
|
|
|
|
|
2010-03-02 13:34:48 +00:00
|
|
|
# Build SELinux policy modules
|
|
|
|
cd selinux
|
|
|
|
for selinuxvariant in %{selinux_variants}
|
|
|
|
do
|
|
|
|
make NAME=${selinuxvariant} -f /usr/share/selinux/devel/Makefile
|
|
|
|
mkdir ${selinuxvariant}
|
|
|
|
mv cachefilesd.pp ${selinuxvariant}/cachefilesd.pp
|
|
|
|
bzip2 -9 ${selinuxvariant}/cachefilesd.pp
|
|
|
|
make NAME=${selinuxvariant} -f /usr/share/selinux/devel/Makefile clean
|
|
|
|
done
|
|
|
|
cd -
|
2006-04-22 12:19:27 +00:00
|
|
|
|
|
|
|
%install
|
|
|
|
rm -rf %{buildroot}
|
|
|
|
mkdir -p %{buildroot}/sbin
|
|
|
|
mkdir -p %{buildroot}%{_sysconfdir}/rc.d/init.d
|
|
|
|
mkdir -p %{buildroot}%{_mandir}/{man5,man8}
|
2006-09-22 17:22:53 +00:00
|
|
|
mkdir -p %{buildroot}/usr/share/doc/%{name}-%{version}
|
2010-03-02 13:34:48 +00:00
|
|
|
mkdir -p %{buildroot}/usr/share/doc/%{name}-selinux-%{version}
|
|
|
|
mkdir -p %{buildroot}%{_localstatedir}/fscache
|
2006-04-22 12:19:27 +00:00
|
|
|
make DESTDIR=%{buildroot} install
|
2006-07-28 16:37:41 +00:00
|
|
|
|
2006-08-07 13:47:33 +00:00
|
|
|
install -m 644 cachefilesd.conf %{buildroot}%{_sysconfdir}
|
|
|
|
install -m 755 cachefilesd.initd %{buildroot}%{_sysconfdir}/rc.d/init.d/cachefilesd
|
2010-03-02 13:34:48 +00:00
|
|
|
install -m 644 selinux/move-cache.txt %{buildroot}/usr/share/doc/%{name}-selinux-%{version}/
|
|
|
|
|
|
|
|
# Install SELinux policy modules
|
|
|
|
cd selinux
|
|
|
|
for selinuxvariant in %{selinux_variants}
|
|
|
|
do
|
|
|
|
install -d %{buildroot}%{_datadir}/selinux/${selinuxvariant}
|
|
|
|
install -p -m 644 ${selinuxvariant}/cachefilesd.pp.bz2 \
|
|
|
|
%{buildroot}%{_datadir}/selinux/${selinuxvariant}
|
|
|
|
done
|
|
|
|
cd -
|
|
|
|
|
|
|
|
# Hardlink identical policy module packages together
|
|
|
|
/usr/sbin/hardlink -cv %{buildroot}%{_datadir}/selinux
|
2006-04-22 12:19:27 +00:00
|
|
|
|
|
|
|
%clean
|
2006-08-02 01:58:30 +00:00
|
|
|
rm -rf $RPM_BUILD_ROOT
|
2006-04-22 12:19:27 +00:00
|
|
|
|
2010-03-02 13:34:48 +00:00
|
|
|
%post
|
2006-07-28 18:17:18 +00:00
|
|
|
/sbin/chkconfig --add %{name}
|
2006-04-22 12:19:27 +00:00
|
|
|
|
2010-03-02 13:34:48 +00:00
|
|
|
if [ "$1" -ge 1 ]; then
|
|
|
|
/sbin/service cachefilesd condrestart > /dev/null
|
|
|
|
fi
|
|
|
|
|
|
|
|
%post selinux
|
|
|
|
# Install SELinux policy modules
|
|
|
|
for selinuxvariant in %{selinux_variants}
|
|
|
|
do
|
|
|
|
/usr/sbin/semodule -s ${selinuxvariant} -i \
|
|
|
|
%{_datadir}/selinux/${selinuxvariant}/cachefilesd.pp.bz2 &> /dev/null || :
|
|
|
|
done
|
|
|
|
|
2006-07-28 16:37:41 +00:00
|
|
|
%preun
|
|
|
|
if [ $1 -eq 0 ]; then
|
2006-08-08 21:43:24 +00:00
|
|
|
/sbin/service cachefilesd stop
|
2006-07-28 18:17:18 +00:00
|
|
|
/sbin/chkconfig --del %{name}
|
2006-07-28 16:37:41 +00:00
|
|
|
fi
|
2006-04-22 12:19:27 +00:00
|
|
|
|
2006-08-08 21:43:24 +00:00
|
|
|
%postun
|
2010-03-02 13:34:48 +00:00
|
|
|
if [ $1 -eq 0 ]; then
|
|
|
|
# Fix up non-standard directory context
|
|
|
|
/sbin/restorecon -R %{_localstatedir}/fscache || :
|
2006-08-08 21:43:24 +00:00
|
|
|
fi
|
|
|
|
|
2010-03-02 13:34:48 +00:00
|
|
|
%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 cachefilesd &> /dev/null || :
|
|
|
|
done
|
|
|
|
# Clean up any remaining file contexts (shouldn't be any really)
|
|
|
|
[ -d %{_localstatedir}/fscache ] && \
|
|
|
|
/sbin/restorecon -R %{_localstatedir}/fscache &> /dev/null || :
|
|
|
|
fi
|
2006-04-22 12:19:27 +00:00
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
2006-08-07 13:47:33 +00:00
|
|
|
%doc README
|
2006-10-20 00:36:04 +00:00
|
|
|
%doc howto.txt
|
2006-04-22 12:19:27 +00:00
|
|
|
%config(noreplace) %{_sysconfdir}/cachefilesd.conf
|
2006-08-07 13:47:33 +00:00
|
|
|
%attr(0755,root,root) %{_sysconfdir}/rc.d/init.d/cachefilesd
|
|
|
|
/sbin/*
|
2006-04-22 12:19:27 +00:00
|
|
|
%{_mandir}/*/*
|
2010-03-02 13:34:48 +00:00
|
|
|
%{_localstatedir}/fscache
|
|
|
|
|
|
|
|
%files selinux
|
|
|
|
%defattr(-,root,root,0755)
|
|
|
|
%doc selinux/move-cache.txt
|
|
|
|
%doc selinux/*.fc
|
|
|
|
%doc selinux/*.if
|
|
|
|
%doc selinux/*.te
|
|
|
|
%{_datadir}/selinux/*/cachefilesd.pp.bz2
|
2006-04-22 12:19:27 +00:00
|
|
|
|
|
|
|
%changelog
|
2009-07-24 18:35:23 +00:00
|
|
|
|
2010-03-02 13:34:48 +00:00
|
|
|
* Thu Feb 25 2010 David Howells <dhowells@redhat.com>
|
|
|
|
- Fix the SELinux policies for cachefilesd.
|
|
|
|
- Compress the installed policy files.
|
|
|
|
|
|
|
|
* Tue Feb 23 2010 David Howells <dhowells@redhat.com>
|
|
|
|
- Must include sys/stat.h to use stat() and co. [RH BZ 565135].
|
|
|
|
- Remove tail comments from functions.
|
|
|
|
|
|
|
|
* Thu Aug 9 2007 David Howells <dhowells@redhat.com> 0.9-1
|
|
|
|
- The cachefiles module no longer accepts directory fds on cull and inuse
|
|
|
|
commands, but rather uses current working directory.
|
2009-02-24 06:22:55 +00:00
|
|
|
|
2010-03-02 13:34:48 +00:00
|
|
|
* Mon Jul 2 2007 David Howells <dhowells@redhat.com> 0.8-16
|
|
|
|
- Use stat64/fstatat64 to avoid EOVERFLOW errors from the kernel on large files.
|
2009-01-09 14:36:39 +00:00
|
|
|
|
2010-03-02 13:34:48 +00:00
|
|
|
* Tue Nov 15 2006 David Howells <dhowells@redhat.com> 0.8-15
|
|
|
|
- Made cachefilesd ask the kernel whether cullable objects are in use and omit
|
|
|
|
them from the cull table if they are.
|
|
|
|
- Made the size of cachefilesd's culling tables configurable.
|
|
|
|
- Updated the manual pages.
|
2008-07-15 14:12:23 +00:00
|
|
|
|
2010-03-02 13:34:48 +00:00
|
|
|
* Mon Nov 14 2006 David Howells <dhowells@redhat.com> 0.8-14
|
|
|
|
- Documented SELinux interaction.
|
|
|
|
|
|
|
|
* Fri Nov 10 2006 David Howells <dhowells@redhat.com> 0.8-11
|
|
|
|
- Include SELinux policy for cachefilesd.
|
2008-02-20 03:13:56 +00:00
|
|
|
|
2006-10-20 00:36:04 +00:00
|
|
|
* Thu Oct 19 2006 Steve Dickson <steved@redhat.com> 0.7-3
|
2010-03-02 13:34:48 +00:00
|
|
|
- Fixed typo that was causing the howto.txt not to be installed.
|
|
|
|
|
|
|
|
* Tue Oct 17 2006 David Howells <dhowells@redhat.com> 0.8-1
|
|
|
|
- Use /dev/cachefiles if it present in preference to /proc/fs/cachefiles.
|
|
|
|
- Use poll rather than SIGURG on /dev/cachefilesd.
|
2006-10-20 00:36:04 +00:00
|
|
|
|
2006-10-01 21:15:39 +00:00
|
|
|
* Sun Oct 01 2006 Jesse Keating <jkeating@redhat.com> - 0.7-2
|
|
|
|
- rebuilt for unwind info generation, broken in gcc-4.1.1-21
|
|
|
|
|
2006-09-22 17:22:53 +00:00
|
|
|
* Fri Sep 22 2006 Steve Dickson <steved@redhat.com> 0.7-1
|
|
|
|
- updated to 0.7 which adds the howto.txt
|
|
|
|
|
2006-09-22 12:58:13 +00:00
|
|
|
* Wed Aug 30 2006 Steve Dickson <steved@redhat.com> 0.6-1
|
|
|
|
- Fixed memory corruption problem
|
|
|
|
- Added the fcull/fstop/frun options
|
|
|
|
|
2006-08-11 14:47:49 +00:00
|
|
|
* Fri Aug 11 2006 Steve Dickson <steved@redhat.com> 0.5-1
|
2010-03-02 13:34:48 +00:00
|
|
|
- Upgraded to 0.5 which fixed initial scan problem when
|
2006-08-11 14:47:49 +00:00
|
|
|
started on an empty cache (bz 202184)
|
|
|
|
|
2006-08-08 21:43:24 +00:00
|
|
|
* Tue Aug 8 2006 Steve Dickson <steved@redhat.com> 0.4-3
|
|
|
|
- Updated init.d script to look for cachefilesd in /sbin
|
|
|
|
- Added postun and preun rules so cachefilesd is stopped
|
|
|
|
and started when the rpm is updated or removed.
|
|
|
|
|
2006-08-07 22:05:37 +00:00
|
|
|
* Tue Aug 7 2006 Jesse Keating <jkeating@redhat.com> 0.4-2
|
|
|
|
- require /sbin/chkconfig not /usr/bin/chkconfig
|
|
|
|
|
2006-08-07 13:47:33 +00:00
|
|
|
* Tue Aug 1 2006 David Howells <dhowells@redhat.com> 0.4-1
|
|
|
|
- Discard use of autotools
|
|
|
|
|
2006-08-01 17:43:47 +00:00
|
|
|
* Tue Aug 1 2006 Steve Dickson <steved@redhat.com> 0.3-3
|
|
|
|
- Added URL to source file
|
|
|
|
|
2006-07-28 16:37:41 +00:00
|
|
|
* Fri Jul 28 2006 Steve Dickson <steved@redhat.com> 0.3-2
|
|
|
|
- Added post and preun rules
|
2010-03-02 13:34:48 +00:00
|
|
|
- Changed init.d script to up right before portmapper.
|
2006-07-28 16:37:41 +00:00
|
|
|
|
2006-06-09 14:48:27 +00:00
|
|
|
* Fri Jun 9 2006 Steve Dickson <steved@redhat.com> 0.3-1
|
|
|
|
- Incorporated David Howells manual page updates
|
|
|
|
|
2006-06-08 17:11:51 +00:00
|
|
|
* Thu Jun 8 2006 Steve Dickson <steved@redhat.com> 0.2-1
|
|
|
|
- Made the daemon 64-bit application.
|
|
|
|
- Changed the syslog logging to log the daemon's PID
|
|
|
|
- Changed OS error logging to log errno number as well the string
|
|
|
|
|
2006-04-22 12:19:27 +00:00
|
|
|
* Sat Apr 22 2006 Steve Dickson <steved@redhat.com> 0.1-1
|
|
|
|
- Initial commit
|