# Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/net-firewall/ufw/ufw-0.31.1-r2.ebuild,v 1.2 2013/05/20 09:05:50 lxnay Exp $ EAPI=4 PYTHON_DEPEND="2:2.5" SUPPORT_PYTHON_ABIS="1" RESTRICT_PYTHON_ABIS="3.* *-jython" inherit versionator bash-completion-r1 eutils linux-info distutils systemd 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 ipv6" DEPEND="sys-devel/gettext" RDEPEND=">=net-firewall/iptables-1.4[ipv6?] ! /dev/null || die local lang for lang in *.po; do if ! has "${lang%.po}" ${LINGUAS}; then rm "${lang}" || die else _EMPTY_LOCALE_LIST="no" fi done popd > /dev/null || die else _EMPTY_LOCALE_LIST="no" fi } src_install() { newconfd "${FILESDIR}"/ufw.confd ufw newinitd "${FILESDIR}"/ufw-2.initd ufw systemd_dounit "${FILESDIR}/ufw.service" exeinto /usr/share/${PN} doexe tests/check-requirements # users normally would want it insinto /usr/share/doc/${PF}/logging/syslog-ng doins "${FILESDIR}"/syslog-ng/* insinto /usr/share/doc/${PF}/logging/rsyslog doins "${FILESDIR}"/rsyslog/* doins doc/rsyslog.example if use examples; then insinto /usr/share/doc/${PF}/examples doins examples/* fi distutils_src_install [[ $_EMPTY_LOCALE_LIST != yes ]] && domo locales/mo/*.mo newbashcomp shell-completion/bash ${PN} } pkg_postinst() { distutils_pkg_postinst if [[ -z ${REPLACING_VERSIONS} ]]; then echo elog "To enable ufw, add it to boot sequence and activate it:" elog "-- # rc-update add ufw boot" elog "-- # /etc/init.d/ufw start" echo elog "If you want to keep ufw logs in a separate file, take a look at" elog "/usr/share/doc/${PF}/logging." fi # Make sure it gets displayed also when one downgrades from >= 0.33*, # because this message isn't displayed for 0.33* (and possibly newer # ones in the future) as it's not relevant there. if [[ -z ${REPLACING_VERSIONS} ]] \ || [[ ${REPLACING_VERSIONS} = 0.33 ]] \ || [[ ${REPLACING_VERSIONS} > 0.33 ]] \ || [[ ${REPLACING_VERSIONS} < 0.31.1-r2 ]] then echo elog "Starting from ufw-0.31.1-r2, /usr/share/ufw/check-requirements" elog "script is installed. It is useful for debugging problems with" elog "ufw. However one should keep in mind that the script assumes" elog "IPv6 is enabled on kernel and net-firewall/iptables," elog "and fails when it's not." fi echo ewarn "Note: once enabled, ufw blocks also incoming SSH connections by" ewarn "default. See README, Remote Management section for more information." }