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