6fb6a3
# % define buildid .local
6fb6a3
6fb6a3
Name:		cachefilesd
c5e159
Version:	0.10.9
c5e159
Release:	1%{?dist}%{?buildid}
6fb6a3
Summary:	CacheFiles user-space management daemon
6fb6a3
Group:		System Environment/Daemons
c5e159
License:	GPLv2+
6fb6a3
URL:		http://people.redhat.com/~dhowells/fscache/
6fb6a3
Source0:	http://people.redhat.com/dhowells/fscache/cachefilesd-%{version}.tar.bz2
6fb6a3
6fb6a3
BuildRequires: systemd-units
6fb6a3
Requires(post): systemd-units
6fb6a3
Requires(preun): systemd-units
6fb6a3
Requires(postun): systemd-units
6fb6a3
Requires: selinux-policy-base >= 3.7.19-5
6fb6a3
c5e159
%define _hardened_build 1
c5e159
6fb6a3
%description
6fb6a3
The cachefilesd daemon manages the caching files and directory that are that
6fb6a3
are used by network file systems such a AFS and NFS to do persistent caching to
6fb6a3
the local disk.
6fb6a3
c5e159
%global docdir %{_docdir}/cachefilesd
c5e159
6fb6a3
%prep
6fb6a3
%setup -q
6fb6a3
6fb6a3
%build
c5e159
make all \
c5e159
	ETCDIR=%{_sysconfdir} \
c5e159
	SBINDIR=%{_sbindir} \
c5e159
	MANDIR=%{_mandir} \
c5e159
	CFLAGS="-Wall -Werror $RPM_OPT_FLAGS $RPM_LD_FLAGS $ARCH_OPT_FLAGS"
6fb6a3
6fb6a3
%install
c5e159
mkdir -p %{buildroot}%{_sbindir}
6fb6a3
mkdir -p %{buildroot}%{_unitdir}
6fb6a3
mkdir -p %{buildroot}%{_mandir}/{man5,man8}
6fb6a3
mkdir -p %{buildroot}%{_localstatedir}/cache/fscache
c5e159
make DESTDIR=%{buildroot} install \
c5e159
	ETCDIR=%{_sysconfdir} \
c5e159
	SBINDIR=%{_sbindir} \
c5e159
	MANDIR=%{_mandir} \
c5e159
	CFLAGS="-Wall $RPM_OPT_FLAGS -Werror"
6fb6a3
6fb6a3
install -m 644 cachefilesd.conf %{buildroot}%{_sysconfdir}
6fb6a3
install -m 644 cachefilesd.service %{buildroot}%{_unitdir}/cachefilesd.service
6fb6a3
6fb6a3
%post
c5e159
%systemd_post cachefilesd.service
6fb6a3
6fb6a3
%preun
c5e159
%systemd_preun cachefilesd.service
6fb6a3
6fb6a3
%postun
c5e159
%systemd_postun_with_restart cachefilesd.service
6fb6a3
6fb6a3
%files
6fb6a3
%doc README
6fb6a3
%doc howto.txt
6fb6a3
%doc selinux/move-cache.txt
6fb6a3
%doc selinux/*.fc
6fb6a3
%doc selinux/*.if
6fb6a3
%doc selinux/*.te
6fb6a3
%config(noreplace) %{_sysconfdir}/cachefilesd.conf
c5e159
%{_sbindir}/*
6fb6a3
%{_unitdir}/*
6fb6a3
%{_mandir}/*/*
6fb6a3
%{_localstatedir}/cache/fscache
6fb6a3
6fb6a3
%changelog
c5e159
* Wed Feb 17 2016 David Howells <dhowells@redhat.com> 0.10.9-1
c5e159
- Fix name of directory in Makefile-generated tarball.
078fb0
c5e159
* Wed Feb 17 2016 David Howells <dhowells@redhat.com> 0.10.8-1
c5e159
- Use systemd interaction macros in specfile installation sections [RH BZ 850053].
c5e159
- Fix the service file to use /usr/sbin/ rather than /sbin/.
c5e159
- Turn on RELRO and PIE build hardening in RPM builds (#1092561).
6fb6a3
c5e159
* Wed Feb 3 2016 David Howells <dhowells@redhat.com> 0.10.7-1
c5e159
- Call setgroups() before calling setuid() (caught by rpmlint).
6fb6a3
c5e159
* Wed Feb 3 2016 David Howells <dhowells@redhat.com> 0.10.6-1
c5e159
- Note the correct licence.
c5e159
- Handle malformed kernel status correctly.
c5e159
- Permit culling to be disabled on the command line with the -N flag.
c5e159
- Suspend culling when cache space is short and cache objects are pinned.
6fb6a3
6fb6a3
* Tue Dec 6 2011 David Howells <dhowells@redhat.com> 0.10.5-1
6fb6a3
- Fix systemd service data according to review comments [RH BZ 754811].
6fb6a3
6fb6a3
* Tue Dec 6 2011 Dan HorĂ¡k <dan[at]danny.cz>
6fb6a3
- use Fedora CFLAGS in build (fixes build on s390)
6fb6a3
6fb6a3
* Wed Nov 30 2011 David Howells <dhowells@redhat.com> 0.10.4-1
6fb6a3
- Fix packaging of systemd service file [RH BZ 754811].
6fb6a3
- Fix rpmlint complaints.
6fb6a3
6fb6a3
* Tue Nov 22 2011 David Howells <dhowells@redhat.com> 0.10.3-1
6fb6a3
- Move to native systemd management [RH BZ 754811].
6fb6a3
6fb6a3
* Fri Jul 15 2011 David Howells <dhowells@redhat.com> 0.10.2-1
6fb6a3
- Downgrade all the culling messages to debug level [RH BZ 660347].
6fb6a3
6fb6a3
* Fri Jun 18 2010 David Howells <dhowells@redhat.com>
6fb6a3
- Fix the initscript to have the appropriate parseable description and exit codes.
6fb6a3
6fb6a3
* Wed Apr 28 2010 David Howells <dhowells@redhat.com>
6fb6a3
- Fix the Requires line on selinux-policy-base to be >=, not =.
6fb6a3
6fb6a3
* Fri Apr 23 2010 David Howells <dhowells@redhat.com> 0.10.1-1
6fb6a3
- The SELinux policies for cachefilesd now live in the selinux-policy RPM, so
6fb6a3
  the cachefilesd-selinux RPM is now redundant.
6fb6a3
- Move the default cache dir to /var/cache/fscache.
6fb6a3
- Make the initscript do a restorecon when starting the cache to make sure the
6fb6a3
  labels are correct.
6fb6a3
- Fix a wildchar that should be a literal dot in the SELinux policy.
6fb6a3
6fb6a3
* Thu Feb 25 2010 David Howells <dhowells@redhat.com> 0.10-1
6fb6a3
- Fix the SELinux policies for cachefilesd.
6fb6a3
- Compress the installed policy files.
6fb6a3
6fb6a3
* Tue Feb 23 2010 David Howells <dhowells@redhat.com>
6fb6a3
- Must include sys/stat.h to use stat() and co. [RH BZ 565135].
6fb6a3
- Remove tail comments from functions.
6fb6a3
6fb6a3
* Thu Aug 9 2007 David Howells <dhowells@redhat.com> 0.9-1
6fb6a3
- The cachefiles module no longer accepts directory fds on cull and inuse
6fb6a3
  commands, but rather uses current working directory.
6fb6a3
6fb6a3
* Mon Jul 2 2007 David Howells <dhowells@redhat.com> 0.8-16
6fb6a3
- Use stat64/fstatat64 to avoid EOVERFLOW errors from the kernel on large files.
6fb6a3
c5e159
* Tue Nov 14 2006 David Howells <dhowells@redhat.com> 0.8-15
6fb6a3
- Made cachefilesd ask the kernel whether cullable objects are in use and omit
6fb6a3
  them from the cull table if they are.
6fb6a3
- Made the size of cachefilesd's culling tables configurable.
6fb6a3
- Updated the manual pages.
6fb6a3
c5e159
* Mon Nov 13 2006 David Howells <dhowells@redhat.com> 0.8-14
6fb6a3
- Documented SELinux interaction.
6fb6a3
6fb6a3
* Fri Nov 10 2006 David Howells <dhowells@redhat.com> 0.8-11
6fb6a3
- Include SELinux policy for cachefilesd.
6fb6a3
6fb6a3
* Thu Oct 19 2006 Steve Dickson <steved@redhat.com> 0.7-3
6fb6a3
- Fixed typo that was causing the howto.txt not to be installed.
6fb6a3
6fb6a3
* Tue Oct 17 2006 David Howells <dhowells@redhat.com> 0.8-1
6fb6a3
- Use /dev/cachefiles if it present in preference to /proc/fs/cachefiles.
6fb6a3
- Use poll rather than SIGURG on /dev/cachefilesd.
6fb6a3
6fb6a3
* Sun Oct 01 2006 Jesse Keating <jkeating@redhat.com> - 0.7-2
6fb6a3
- rebuilt for unwind info generation, broken in gcc-4.1.1-21
6fb6a3
6fb6a3
* Fri Sep 22 2006 Steve Dickson <steved@redhat.com> 0.7-1
6fb6a3
- updated to 0.7 which adds the howto.txt
6fb6a3
6fb6a3
* Wed Aug 30 2006 Steve Dickson <steved@redhat.com> 0.6-1
6fb6a3
- Fixed memory corruption problem
6fb6a3
- Added the fcull/fstop/frun options
6fb6a3
6fb6a3
* Fri Aug 11 2006 Steve Dickson <steved@redhat.com> 0.5-1
6fb6a3
- Upgraded to 0.5 which fixed initial scan problem when
6fb6a3
  started on an empty cache (bz 202184)
6fb6a3
6fb6a3
* Tue Aug  8 2006 Steve Dickson <steved@redhat.com> 0.4-3
6fb6a3
- Updated init.d script to look for cachefilesd in /sbin
6fb6a3
- Added postun and preun rules so cachefilesd is stopped
6fb6a3
  and started when the rpm is updated or removed.
6fb6a3
c5e159
* Tue Aug  8 2006 Jesse Keating <jkeating@redhat.com> 0.4-2
6fb6a3
- require /sbin/chkconfig not /usr/bin/chkconfig
6fb6a3
6fb6a3
* Tue Aug  1 2006 David Howells <dhowells@redhat.com> 0.4-1
6fb6a3
- Discard use of autotools
6fb6a3
6fb6a3
* Tue Aug  1 2006 Steve Dickson <steved@redhat.com> 0.3-3
6fb6a3
- Added URL to source file
6fb6a3
6fb6a3
* Fri Jul 28 2006 Steve Dickson <steved@redhat.com> 0.3-2
6fb6a3
- Added post and preun rules
6fb6a3
- Changed init.d script to up right before portmapper.
6fb6a3
6fb6a3
* Fri Jun  9 2006 Steve Dickson <steved@redhat.com> 0.3-1
6fb6a3
- Incorporated David Howells manual page updates
6fb6a3
6fb6a3
* Thu Jun  8 2006 Steve Dickson <steved@redhat.com> 0.2-1
6fb6a3
- Made the daemon 64-bit application.
6fb6a3
- Changed the syslog logging to log the daemon's PID
6fb6a3
- Changed OS error logging to log errno number as well the string
6fb6a3
6fb6a3
* Sat Apr 22 2006 Steve Dickson <steved@redhat.com> 0.1-1
6fb6a3
- Initial commit