summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Volkov <pva@gentoo.org>2011-09-03 12:17:52 +0000
committerPeter Volkov <pva@gentoo.org>2011-09-03 12:17:52 +0000
commitd8c678e17815f4738e241f080220f59f6ffce303 (patch)
treed78e02adf1ae4f029fc96eae16ffc6ef4a71e79f /net-firewall/ufw
parentDepend on split libreoffice-l10n package instead of installing the languages ... (diff)
downloadgentoo-2-d8c678e17815f4738e241f080220f59f6ffce303.tar.gz
gentoo-2-d8c678e17815f4738e241f080220f59f6ffce303.tar.bz2
gentoo-2-d8c678e17815f4738e241f080220f59f6ffce303.zip
Add example syslog configurations for rsyslog and syslog-ng, bug #380461, thank Emmanuel Andry for report and Sławomir Nizio for this job.
(Portage version: 2.1.10.11/cvs/Linux x86_64)
Diffstat (limited to 'net-firewall/ufw')
-rw-r--r--net-firewall/ufw/ChangeLog10
-rw-r--r--net-firewall/ufw/files/rsyslog/ufw.logrotate13
-rw-r--r--net-firewall/ufw/files/syslog-ng/syslog-ng.example13
-rw-r--r--net-firewall/ufw/files/syslog-ng/ufw.logrotate12
-rw-r--r--net-firewall/ufw/ufw-0.30.1-r3.ebuild91
5 files changed, 138 insertions, 1 deletions
diff --git a/net-firewall/ufw/ChangeLog b/net-firewall/ufw/ChangeLog
index e676f675ec3c..68bb93381ea3 100644
--- a/net-firewall/ufw/ChangeLog
+++ b/net-firewall/ufw/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for net-firewall/ufw
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-firewall/ufw/ChangeLog,v 1.2 2011/07/28 07:22:42 pva Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-firewall/ufw/ChangeLog,v 1.3 2011/09/03 12:17:52 pva Exp $
+
+*ufw-0.30.1-r3 (03 Sep 2011)
+
+ 03 Sep 2011; Peter Volkov <pva@gentoo.org> +ufw-0.30.1-r3.ebuild,
+ +files/rsyslog/ufw.logrotate, +files/syslog-ng/syslog-ng.example,
+ +files/syslog-ng/ufw.logrotate:
+ Add example syslog configurations for rsyslog and syslog-ng, bug #380461,
+ thank Emmanuel Andry for report and Sławomir Nizio for this job.
28 Jul 2011; Peter Volkov <pva@gentoo.org> ufw-0.30.1-r2.ebuild,
metadata.xml:
diff --git a/net-firewall/ufw/files/rsyslog/ufw.logrotate b/net-firewall/ufw/files/rsyslog/ufw.logrotate
new file mode 100644
index 000000000000..f88ca8265bea
--- /dev/null
+++ b/net-firewall/ufw/files/rsyslog/ufw.logrotate
@@ -0,0 +1,13 @@
+/var/log/ufw.log
+{
+ rotate 5
+ weekly
+ missingok
+ notifempty
+ compress
+ delaycompress
+ sharedscripts
+ postrotate
+ /etc/init.d/rsyslog reload >/dev/null 2>&1 || true
+ endscript
+}
diff --git a/net-firewall/ufw/files/syslog-ng/syslog-ng.example b/net-firewall/ufw/files/syslog-ng/syslog-ng.example
new file mode 100644
index 000000000000..41f7ce39cef7
--- /dev/null
+++ b/net-firewall/ufw/files/syslog-ng/syslog-ng.example
@@ -0,0 +1,13 @@
+# This is an example rule for app-admin/syslog-ng to separate ufw logs
+# from /var/log/messages.
+# Place those lines before "log" entries in /etc/syslog-ng/syslog-ng.conf.
+
+filter f_ufw { match("\\[UFW " value("MESSAGE")); };
+destination ufwfile { file("/var/log/ufw.log"); };
+log {
+ source(src);
+ filter(f_ufw);
+ destination(ufwfile);
+ destination(console_all);
+ flags(final);
+};
diff --git a/net-firewall/ufw/files/syslog-ng/ufw.logrotate b/net-firewall/ufw/files/syslog-ng/ufw.logrotate
new file mode 100644
index 000000000000..5080aa1bfa38
--- /dev/null
+++ b/net-firewall/ufw/files/syslog-ng/ufw.logrotate
@@ -0,0 +1,12 @@
+# logrotate snippet for ufw
+# requires app-admin/syslog-ng
+# copy the file into /etc/logrotate.d
+/var/log/ufw.log {
+ missingok
+ rotate 5
+ notifempty
+ sharedscripts
+ postrotate
+ /etc/init.d/syslog-ng reload > /dev/null 2>&1 || true
+ endscript
+}
diff --git a/net-firewall/ufw/ufw-0.30.1-r3.ebuild b/net-firewall/ufw/ufw-0.30.1-r3.ebuild
new file mode 100644
index 000000000000..3c8607fe2a6d
--- /dev/null
+++ b/net-firewall/ufw/ufw-0.30.1-r3.ebuild
@@ -0,0 +1,91 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-firewall/ufw/ufw-0.30.1-r3.ebuild,v 1.1 2011/09/03 12:17:52 pva Exp $
+
+EAPI=3
+PYTHON_DEPEND="2:2.5"
+
+inherit versionator bash-completion eutils linux-info distutils
+
+MY_PV_12=$(get_version_component_range 1-2)
+DESCRIPTION="A program used to manage a netfilter firewall"
+HOMEPAGE="http://launchpad.net/ufw"
+SRC_URI="http://launchpad.net/ufw/${MY_PV_12}/${PV}/+download/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="examples"
+
+DEPEND=""
+RDEPEND=">=net-firewall/iptables-1.4"
+
+# tests fail; upstream bug: https://bugs.launchpad.net/ufw/+bug/815982
+RESTRICT="test"
+
+pkg_setup() {
+ local CONFIG_CHECK="~PROC_FS ~NETFILTER_XT_MATCH_COMMENT ~IP6_NF_MATCH_HL \
+ ~NETFILTER_XT_MATCH_LIMIT ~NETFILTER_XT_MATCH_MULTIPORT \
+ ~NETFILTER_XT_MATCH_RECENT ~NETFILTER_XT_MATCH_STATE"
+
+ if kernel_is -ge 2 6 39; then
+ CONFIG_CHECK+=" ~NETFILTER_XT_MATCH_ADDRTYPE"
+ else
+ CONFIG_CHECK+=" ~IP_NF_MATCH_ADDRTYPE"
+ fi
+
+ check_extra_config
+ python_set_active_version 2
+ python_pkg_setup
+}
+
+src_prepare() {
+ # Allow to remove unnecessary build time dependency
+ # on net-firewall/iptables.
+ epatch "${FILESDIR}"/${PN}-dont-check-iptables.patch
+ # Move files away from /lib/ufw.
+ epatch "${FILESDIR}"/${PN}-move-path.patch
+ # Set as enabled by default. User can enable or disable
+ # the service by adding or removing it to/from a runlevel.
+ sed -i 's/^ENABLED=no/ENABLED=yes/' conf/ufw.conf \
+ || die "sed failed (ufw.conf)"
+}
+
+src_install() {
+ newconfd "${FILESDIR}"/ufw.confd ufw || die "inserting a file to conf.d failed"
+ newinitd "${FILESDIR}"/ufw-2.initd ufw || die "inserting a file to init.d failed"
+
+ # users normally would want it
+ insinto /usr/share/doc/${PF}/logging
+ doins -r "${FILESDIR}"/syslog-ng || die "inserting syslog-ng configuration failed"
+
+ insinto /usr/share/doc/${PF}/logging/rsyslog
+ doins "${FILESDIR}"/rsyslog/* || die "inserting rsyslog configuration failed"
+ doins doc/rsyslog.example || die "inserting rsyslog.example failed"
+
+ if use examples; then
+ insinto /usr/share/doc/${PF}/examples
+ doins examples/* || die "inserting example files failed"
+ fi
+ distutils_src_install
+ dobashcompletion shell-completion/bash
+}
+
+pkg_postinst() {
+ distutils_pkg_postinst
+ if path_exists -o "${EROOT}"lib/ufw/user{,6}.rules; then
+ ewarn "Attention!"
+ ewarn "User configuration from /lib/ufw is now placed in /etc/ufw/user."
+ ewarn "Please stop ufw, copy .rules files from ${EROOT}lib/ufw"
+ ewarn "to ${EROOT}etc/ufw/user/ and start ufw again."
+ fi
+ echo
+ elog "Remember to enable ufw add it to your boot sequence:"
+ elog "-- # ufw enable"
+ elog "-- # rc-update add ufw boot"
+ echo
+ bash-completion_pkg_postinst
+ echo
+ elog "If you want to keep ufw logs in a separate file, take a look at"
+ elog "/usr/share/doc/${PF}/logging."
+}