/[packages]/cauldron/tmpwatch/current/SPECS/tmpwatch.spec
ViewVC logotype

Contents of /cauldron/tmpwatch/current/SPECS/tmpwatch.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6707 - (show annotations) (download)
Tue Jan 11 23:59:01 2011 UTC (13 years, 3 months ago) by blino
File size: 2668 byte(s)
imported package tmpwatch
1 Summary: Utility for removing files based on when they were last accessed
2 Name: tmpwatch
3 Version: 2.10.1
4 Release: %mkrel 1
5 Group: File tools
6 License: GPLv2
7 URL: https://fedorahosted.org/tmpwatch/
8 Source0: https://fedorahosted.org/releases/t/m/tmpwatch/%{name}-%{version}.tar.bz2
9 Requires: psmisc
10 # configure is looking for /sbin/fuser
11 BuildRequires: psmisc
12 Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
13
14 %description
15 The tmpwatch utility recursively searches through specified directories and
16 removes files which have not been accessed in a specified period of time.
17 Tmpwatch is normally used to clean up directories which are used for
18 temporarily holding files (for example, /tmp). Tmpwatch ignores symlinks,
19 won't switch filesystems and only removes empty directories and regular files.
20
21 %prep
22
23 %setup -q
24
25 %build
26 %configure2_5x
27 %make
28
29 %install
30 rm -rf %{buildroot}
31
32 %makeinstall ROOT=%{buildroot} MANDIR=%{_mandir} SBINDIR=%{_sbindir}
33
34 install -d %{buildroot}%{_sysconfdir}/cron.daily
35 install -d %{buildroot}%{_sysconfdir}/sysconfig
36
37 cat > tmpwatch.cron << EOF
38 #!/bin/sh
39
40 [ -f %{_sysconfdir}/sysconfig/tmpwatch ] && . %{_sysconfdir}/sysconfig/tmpwatch
41
42 %{_sbindir}/tmpwatch \$TMPWATCH_OPTIONS \$TMPWATCH_EXCLUDES 10d /tmp
43
44 %{_sbindir}/tmpwatch \$TMPWATCH_OPTIONS \$TMPWATCH_EXCLUDES 30d /var/tmp
45
46 [ -f %{_sysconfdir}/sysconfig/i18n ] && . %{_sysconfdir}/sysconfig/i18n
47
48 for d in /var/{cache/man,catman}/{cat?,X11R6/cat?,local/cat?,\$LANG/cat?}; do
49 if [ -d "\$d" ]; then
50 %{_sbindir}/tmpwatch \$TMPWATCH_OPTIONS -f 30d "\$d"
51 fi
52 done
53 EOF
54
55 cat > tmpwatch.sysconfig << EOF
56 #TMPWATCH_OPTIONS="-umc"
57 # (oe) define files/directories/sockets tmpwatch should ignore (#18488)
58 TMPWATCH_EXCLUDES="-x /tmp/.ICE-unix -x /tmp/.X*-unix -x /tmp/.font-unix -x /tmp/.Test-unix"
59 EOF
60
61 install -m0755 tmpwatch.cron %{buildroot}%{_sysconfdir}/cron.daily/tmpwatch
62 install -m0644 tmpwatch.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/tmpwatch
63
64 cat > README.urpmi << EOF
65 The %{_sysconfdir}/cron.daily/tmpwatch script has been changed to use the %{_sysconfdir}/sysconfig/tmpwatch
66 file to exclude certain files/directories/sockets from being processed. It should be safe to make your changes
67 there instead. Per default these are not touched by tmpwatch:
68
69 /tmp/.ICE-unix /tmp/.X*-unix /tmp/.font-unix /tmp/.Test-unix
70 EOF
71
72 %clean
73 rm -rf %{buildroot}
74
75 %files
76 %defattr(-,root,root)
77 %doc README.urpmi ChangeLog NEWS README
78 %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/sysconfig/tmpwatch
79 %attr(0755,root,root) %{_sysconfdir}/cron.daily/tmpwatch
80 %{_sbindir}/tmpwatch
81 %{_mandir}/man8/tmpwatch.8*
82
83

  ViewVC Help
Powered by ViewVC 1.1.30