- logrotate for history
authorJan Kupec <jkupec@suse.cz>
Wed, 24 Sep 2008 16:10:37 +0000 (16:10 +0000)
committerJan Kupec <jkupec@suse.cz>
Wed, 24 Sep 2008 16:10:37 +0000 (16:10 +0000)
CMakeLists.txt
libzypp.spec.cmake
zypp-history.lr [new file with mode: 0644]

index 88b8b2a..3710e97 100644 (file)
@@ -146,6 +146,9 @@ INSTALL( FILES ${CMAKE_SOURCE_DIR}/zypp.conf DESTINATION ${SYSCONFDIR}/zypp )
 MESSAGE(STATUS "systemCheck will be installed in ${SYSCONFDIR}/zypp")
 INSTALL( FILES ${CMAKE_SOURCE_DIR}/systemCheck DESTINATION ${SYSCONFDIR}/zypp )
 
+# logrotate config file
+INSTALL( FILES ${CMAKE_SOURCE_DIR}/zypp-history.lr DESTINATION ${SYSCONFDIR}/logrotate.d )
+
 ####################################################################
 # SUBDIRECTORIES                                                   #
 ####################################################################
index 7089461..a0c99e3 100644 (file)
@@ -72,6 +72,7 @@ Requires:       libzypp == @VERSION@
 Requires:       libxml2-devel curl-devel openssl-devel rpm-devel glibc-devel zlib-devel
 Requires:       bzip2 popt-devel dbus-1-devel glib2-devel hal-devel boost-devel libstdc++-devel
 Requires:       cmake libsatsolver-devel
+Recommends:     logrotate
 Summary:        Package, Patch, Pattern, and Product Management - developers files
 Group:          System/Packages
 Provides:       yast2-packagemanager-devel
@@ -234,5 +235,10 @@ rm -rf "$RPM_BUILD_ROOT"
 %{prefix}/include/zypp/*
 %{prefix}/share/cmake/Modules/*
 %{_libdir}/pkgconfig/libzypp.pc
+%dir %{_var}/log/zypp
+# declare ownership of the log file but prevent
+# it from being erased by rpm -e
+%ghost %config(noreplace) %{_var}/log/zypp/history
+%{_sysconfdir}/logrotate.d/zypp-history.lr
 
 %changelog
diff --git a/zypp-history.lr b/zypp-history.lr
new file mode 100644 (file)
index 0000000..86002d8
--- /dev/null
@@ -0,0 +1,11 @@
+/var/log/zypp/history {
+    compress
+    dateext
+    notifempty
+    missingok
+    nocreate
+
+    maxage 1827
+    rotate 99
+    size 10M
+}