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