]> git.pld-linux.org Git - packages/logrotate.git/blob - logrotate.spec
f4294d77c0c9bf831078a005b472963ac541f25e
[packages/logrotate.git] / logrotate.spec
1 # TODO
2 # - bug: when logrotate.status is written truncated (due disk getting full) and
3 #   the line is partial, it will complain erronously that the line is too long
4 #   while it just doesn't have the second DATE column. and that error should be
5 #   ignored as warning not fatal as error.
6 #
7 # Conditional build:
8 %bcond_without  acl             # build without ACLs support
9 %bcond_without  selinux         # build without SELinux support
10 %bcond_without  tests           # do not perform "make test"
11
12 Summary:        Rotates, compresses, removes and mails system log files
13 Summary(de.UTF-8):      Rotiert, komprimiert und verschickt Systemlogs
14 Summary(es.UTF-8):      Hace el rutado, comprime y envía mail de logs del sistema
15 Summary(fr.UTF-8):      Fait tourner, compresse, et envoie par mail les connexions au système
16 Summary(pl.UTF-8):      System rotacji i kompresowania logów
17 Summary(pt_BR.UTF-8):   Rotaciona, comprime e envia mail de logs do sistema
18 Summary(ru.UTF-8):      Ротирует, компрессирует, удаляет и отправляет по почте лог-файлы
19 Summary(tr.UTF-8):      Sistem günlüklerini yönlendirir, sıkıştırır ve mektup olarak yollar
20 Summary(uk.UTF-8):      Ротує, компресує, видаляє та відправляє поштою лог-файли
21 Name:           logrotate
22 Version:        3.14.0
23 Release:        1
24 License:        GPL v2+
25 Group:          Applications/System
26 Source0:        https://github.com/logrotate/logrotate/releases/download/%{version}/%{name}-%{version}.tar.xz
27 # Source0-md5:  1c0f6e6e490c4bcac0a1e77ad1310683
28 Source1:        %{name}.conf
29 Source2:        %{name}.sysconfig
30 Source3:        %{name}.cron
31 Source4:        %{name}.crontab
32 Source5:        cronjob-%{name}.timer
33 Source6:        cronjob-%{name}.service
34 Patch0:         tabooext.patch
35 Patch1:         %{name}-man.patch
36 URL:            https://github.com/logrotate/logrotate
37 %{?with_acl:BuildRequires:      acl-devel}
38 BuildRequires:  autoconf >= 2.50
39 BuildRequires:  automake >= 1:1.13
40 %if %{with selinux}
41 BuildRequires:  libselinux-devel
42 %{?with_tests:BuildRequires:    libselinux-utils}
43 %endif
44 BuildRequires:  popt-devel >= 1.3
45 BuildRequires:  rpmbuild(macros) >= 1.644
46 BuildRequires:  tar >= 1:1.22
47 BuildRequires:  xz
48 Requires(post): coreutils
49 Requires:       coreutils
50 Requires:       cronjobs
51 Requires:       filesystem >= 4.0-4
52 Requires:       gzip
53 Requires:       setup >= 2.4.6
54 Requires:       systemd-units >= 38
55 Suggests:       /bin/mail
56 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
57
58 %define         statdir         /var/lib/misc
59 %define         _libexecdir     %{_prefix}/lib
60
61 %description
62 The logrotate utility is designed to simplify the administration of
63 log files on a system which generates a lot of log files. Logrotate
64 allows for the automatic rotation compression, removal and mailing of
65 log files. Logrotate can be set to handle a log file daily, weekly,
66 monthly or when the log file gets to a certain size. Normally,
67 logrotate runs as a daily cron job.
68
69 %description -l de.UTF-8
70 Logrotate vereinfacht die Verwaltung von Systemen, die sehr viele
71 Log-Dateien erzeugen, indem es das automatische Rotieren,
72 Komprimieren, Entfernen, und Senden von Log-Dateien ermöglicht. Jede
73 Log-Datei kann täglich, wöchentlich oder monatlich verarbeitet werden,
74 wenn sie zu groß wird.
75
76 %description -l es.UTF-8
77 Logrotate fue proyectado para facilitar la administración de sistemas
78 que generan gran número de archivos de log. Permite automatización en
79 la rotación, compresión, remoción y envío de mail de archivos de logs.
80 Cada archivo de log puede ser tratado diariamente, semanalmente,
81 mensualmente o cuanto crezca demasiado.
82
83 %description -l fr.UTF-8
84 Logrotate est conçu pour faciliter l'administration de systèmes qui
85 générent un grand nombre de fichiers de \"log\". Il permet le
86 roulement, la suppréssion la compression et l'envoi automatiques de
87 ces fichiers. Chaque fichier de \"log\" peut être pris en charge de
88 manière quotidienne, hebdomadaire, mensuelle, ou quand il devient trop
89 volumineux.
90
91 %description -l pl.UTF-8
92 Logrotate jest przeznaczony do łatwej administracji plikami logów.
93 Program ten pozwala na automatyczną kompresję logów. Może kontrolować
94 logi raz dziennie, raz na miesiąc, raz na tydzień lub wtedy kiedy
95 pliki z logami systemowymi są już duże.
96
97 %description -l pt_BR.UTF-8
98 Logrotate foi projetado para facilitar a administração de sistemas que
99 geram grande número de arquivos de log. Permite automatização na
100 rotação, compressão, remoção e envio de mail de arquivos de logs. Cada
101 arquivo de log pode ser tratado diariamente, semanalmente, mensalmente
102 ou quanto crescer demais.
103
104 %description -l ru.UTF-8
105 Logrotate предназначен для облегчения администрирования системы,
106 которая генерирует большое количество файлов с логами. Он позволяет
107 автоматически ротировать, компрессировать, удалять и посылать файлы с
108 логами по e-mail. Каждый лог может обрабатываться ежедневно,
109 еженедельно, ежемесячно или по достижении определенного размера.
110
111 %description -l tr.UTF-8
112 logrotate çok fazla sayıda günlük dosyası üreten sistemlerin
113 yönetimini kolaylaştırmak için tasarlanmıştır. Kayıt dosyalarının
114 otomatik olarak yönlendirilmesini, sıkıştırılmasını, silinmesinı ve
115 mektup olarak yollanmasını sağlar. Her dosya günlük, haftalık, aylık
116 olarak ya da çok büyük boyutlara ulaştığında işlenebilir.
117
118 %description -l uk.UTF-8
119 Logrotate призначений для полегшення адміністрування системи, яка
120 генерує велику кількість файлів з логами. Він дозволяє автоматично
121 ротувати, компресувати, видаляти та посилати поштою лог-файли. Кожен
122 лог може оброблятися щоденно, щотижня, щомісяця або по досягненні
123 визначеного розміру.
124
125 %prep
126 %setup -q
127 %patch0 -p1
128 %patch1 -p1
129
130 %build
131 %{__aclocal}
132 %{__autoconf}
133 %{__automake}
134
135 %configure \
136         --disable-silent-rules \
137         --with%{!?with_acl:out}-acl \
138         --with%{!?with_selinux:out}-selinux \
139         --with-default-mail-command=/bin/mail \
140         --with-compress-command=/bin/gzip \
141         --with-uncompress-command=/bin/gunzip \
142         --with-state-file-path=%{statdir}/logrotate.status
143
144 %{__make}
145
146 %if %{with tests}
147 %{__make} test
148 %endif
149
150 %install
151 rm -rf $RPM_BUILD_ROOT
152 install -d $RPM_BUILD_ROOT/etc/{cron.d,logrotate.d,sysconfig} \
153         $RPM_BUILD_ROOT{%{_libexecdir},%{_mandir},%{statdir}} \
154         $RPM_BUILD_ROOT%{systemdunitdir}
155
156 %{__make} install \
157         DESTDIR=$RPM_BUILD_ROOT
158
159 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.conf
160 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
161 install -p %{SOURCE3} $RPM_BUILD_ROOT%{_libexecdir}/%{name}
162 cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/cron.d/%{name}
163 cp -p %{SOURCE5} $RPM_BUILD_ROOT%{systemdunitdir}
164 cp -p %{SOURCE6} $RPM_BUILD_ROOT%{systemdunitdir}
165 > $RPM_BUILD_ROOT%{statdir}/%{name}.status
166
167 %clean
168 rm -rf $RPM_BUILD_ROOT
169
170 %triggerun -- %{name} < 3.8.6-1
171 # if previous install had /etc/cron.daily/* files removed (missingok), disable the cronjob
172 if [ ! -e /etc/cron.daily/%{name} ]; then
173         echo DISABLE_LOGROTATE_CRON=yes >> /etc/sysconfig/%{name}
174 fi
175
176 %triggerpostun -- %{name} < 3.7.8-4
177 %{__sed} -i -e 's,olddir /var/log/archiv$,olddir /var/log/archive,' %{_sysconfdir}/%{name}.conf %{_sysconfdir}/logrotate.d/* || :
178
179 %triggerpostun -- %{name} < 3.11.0-3
180 %systemd_service_enable cronjob-%{name}.timer
181
182 %post
183 if [ -f /var/lib/logrotate.status ]; then
184         mv -f /var/lib/logrotate.status %{statdir}/logrotate.status
185 else
186         touch %{statdir}/logrotate.status
187         chmod 000 %{statdir}/logrotate.status
188         chown root:root %{statdir}/logrotate.status
189         chmod 640 %{statdir}/logrotate.status
190 fi
191 %systemd_post cronjob-logrotate.timer
192
193 %preun
194 %systemd_preun cronjob-logrotate.timer
195
196 %postun
197 %systemd_reload
198
199 %files
200 %defattr(644,root,root,755)
201 %doc README.md ChangeLog.md
202 %attr(755,root,root) %{_sbindir}/logrotate
203 %attr(755,root,root) %{_libexecdir}/logrotate
204 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.conf
205 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
206 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}
207 %attr(640,root,root) %ghost %{statdir}/logrotate.status
208 %{_mandir}/man5/logrotate.conf.5*
209 %{_mandir}/man8/logrotate.8*
210 %{systemdunitdir}/cronjob-logrotate.service
211 %{systemdunitdir}/cronjob-logrotate.timer
This page took 0.068777 seconds and 2 git commands to generate.