summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Iooss2014-05-12 19:14:44 +0200
committerNicolas Iooss2015-06-27 11:44:56 +0800
commit8d4bf368f01b7f4bcd2e71563937a8043e940ebd (patch)
treedf28c5ac21908ea62a4c18c1934afb79385e39ff
downloadaur-8d4bf368f01b7f4bcd2e71563937a8043e940ebd.tar.gz
logrotate-selinux 3.8.7-1 update
selinux-logrotate AUR package has not been renamed logrotate-selinux yet but still needs to be compiled with SELinux support.
-rw-r--r--.SRCINFO32
-rw-r--r--PKGBUILD54
-rw-r--r--logrotate.conf38
-rw-r--r--logrotate.service9
-rw-r--r--logrotate.timer7
-rw-r--r--paths.patch25
6 files changed, 165 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..44ee19dfc26
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,32 @@
+pkgbase = logrotate-selinux
+ pkgdesc = Rotates system logs automatically with SELinux support
+ pkgver = 3.8.7
+ pkgrel = 1
+ url = https://fedorahosted.org/logrotate/
+ arch = i686
+ arch = x86_64
+ groups = selinux
+ license = GPL
+ depends = popt
+ depends = gzip
+ depends = acl
+ depends = libselinux
+ optdepends = cron: scheduled log rotation
+ provides = logrotate=3.8.7-1
+ provides = selinux-logrotate=3.8.7-1
+ conflicts = logrotate
+ conflicts = selinux-logrotate
+ backup = etc/logrotate.conf
+ source = https://fedorahosted.org/releases/l/o/logrotate/logrotate-3.8.7.tar.gz
+ source = paths.patch
+ source = logrotate.conf
+ source = logrotate.timer
+ source = logrotate.service
+ md5sums = 99e08503ef24c3e2e3ff74cc5f3be213
+ md5sums = e76526bcd6fc33c9d921e1cb1eff1ffb
+ md5sums = 94dae4d3eded2fab9ae879533d3680db
+ md5sums = 287c2ad9b074cb5478db7692f385827c
+ md5sums = 85560be5272ed68a88bb77a0a2293369
+
+pkgname = logrotate-selinux
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..8a18f47d150
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,54 @@
+# $Id:$
+# Maintainer: Pierre Schmitz <pierre@archlinux.de>
+# SELinux Contributor: Nicolas Iooss (nicolas <dot> iooss <at> m4x <dot> org)
+
+pkgname=logrotate-selinux
+pkgver=3.8.7
+pkgrel=1
+pkgdesc="Rotates system logs automatically with SELinux support"
+arch=('i686' 'x86_64')
+url="https://fedorahosted.org/logrotate/"
+license=('GPL')
+groups=('selinux')
+depends=('popt' 'gzip' 'acl' 'libselinux')
+optdepends=('cron: scheduled log rotation')
+conflicts=("${pkgname/-selinux}" "selinux-${pkgname/-selinux}")
+provides=("${pkgname/-selinux}=${pkgver}-${pkgrel}"
+ "selinux-${pkgname/-selinux}=${pkgver}-${pkgrel}")
+backup=('etc/logrotate.conf')
+source=("https://fedorahosted.org/releases/l/o/logrotate/logrotate-${pkgver}.tar.gz"
+ 'paths.patch'
+ 'logrotate.conf'
+ logrotate.{timer,service})
+md5sums=('99e08503ef24c3e2e3ff74cc5f3be213'
+ 'e76526bcd6fc33c9d921e1cb1eff1ffb'
+ '94dae4d3eded2fab9ae879533d3680db'
+ '287c2ad9b074cb5478db7692f385827c'
+ '85560be5272ed68a88bb77a0a2293369')
+
+build() {
+ cd "$srcdir/${pkgname/-selinux}-${pkgver}"
+
+ patch -p0 -i "$srcdir/paths.patch"
+
+ make WITH_ACL=yes WITH_SELINUX=yes RPM_OPT_FLAGS="$CFLAGS" EXTRA_LDFLAGS="$LDFLAGS"
+}
+
+check() {
+ cd "$srcdir/${pkgname/-selinux}-${pkgver}"
+ make test
+}
+
+package() {
+ cd "$srcdir/${pkgname/-selinux}-${pkgver}"
+ make PREFIX="$pkgdir" MANDIR="/usr/share/man" install
+ mv ${pkgdir}/usr/sbin ${pkgdir}/usr/bin
+
+ install -dm755 "$pkgdir/etc/logrotate.d"
+ install -Dm644 "$srcdir/logrotate.conf" "$pkgdir/etc/logrotate.conf"
+
+ install -D -m644 ${srcdir}/logrotate.timer ${pkgdir}/usr/lib/systemd/system/logrotate.timer
+ install -D -m644 ${srcdir}/logrotate.service ${pkgdir}/usr/lib/systemd/system/logrotate.service
+ install -d -m755 ${pkgdir}/usr/lib/systemd/system/multi-user.target.wants
+ ln -s ../logrotate.timer ${pkgdir}//usr/lib/systemd/system/multi-user.target.wants/logrotate.timer
+}
diff --git a/logrotate.conf b/logrotate.conf
new file mode 100644
index 00000000000..4193a3a7f13
--- /dev/null
+++ b/logrotate.conf
@@ -0,0 +1,38 @@
+# see "man logrotate" for details
+# rotate log files weekly
+weekly
+
+# keep 4 weeks worth of backlogs
+rotate 4
+
+# restrict maximum size of log files
+#size 20M
+
+# create new (empty) log files after rotating old ones
+create
+
+# uncomment this if you want your log files compressed
+#compress
+
+# Logs are moved into directory for rotation
+# olddir /var/log/archive
+
+# Ignore pacman saved files
+tabooext + .pacorig .pacnew .pacsave
+
+# Arch packages drop log rotation information into this directory
+include /etc/logrotate.d
+
+/var/log/wtmp {
+ monthly
+ create 0664 root utmp
+ minsize 1M
+ rotate 1
+}
+
+/var/log/btmp {
+ missingok
+ monthly
+ create 0600 root utmp
+ rotate 1
+}
diff --git a/logrotate.service b/logrotate.service
new file mode 100644
index 00000000000..3a483c3a38e
--- /dev/null
+++ b/logrotate.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Rotate log files
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/logrotate /etc/logrotate.conf
+Nice=19
+IOSchedulingClass=best-effort
+IOSchedulingPriority=7
diff --git a/logrotate.timer b/logrotate.timer
new file mode 100644
index 00000000000..a92ba1ecc68
--- /dev/null
+++ b/logrotate.timer
@@ -0,0 +1,7 @@
+[Unit]
+Description=Daily rotation of log files
+
+[Timer]
+OnCalendar=daily
+AccuracySec=12h
+Persistent=true
diff --git a/paths.patch b/paths.patch
new file mode 100644
index 00000000000..83166b09593
--- /dev/null
+++ b/paths.patch
@@ -0,0 +1,25 @@
+--- config.h 2012-08-01 12:56:47.000000000 +0200
++++ config.h 2012-08-03 09:53:05.025039199 +0200
+@@ -27,11 +27,11 @@
+ * Default settings for Linux - leave these last.
+ */
+ #ifndef DEFAULT_MAIL_COMMAND
+-#define DEFAULT_MAIL_COMMAND "/bin/mail"
++#define DEFAULT_MAIL_COMMAND "/usr/bin/mail"
+ #endif
+
+ #ifndef COMPRESS_COMMAND
+-#define COMPRESS_COMMAND "/bin/gzip"
++#define COMPRESS_COMMAND "/usr/bin/gzip"
+ #endif
+
+ #ifndef COMPRESS_EXT
+@@ -39,7 +39,7 @@
+ #endif
+
+ #ifndef UNCOMPRESS_COMMAND
+-#define UNCOMPRESS_COMMAND "/bin/gunzip"
++#define UNCOMPRESS_COMMAND "/usr/bin/gunzip"
+ #endif
+
+ #ifndef STATEFILE