summaryrefslogtreecommitdiff
path: root/net-dialup/freeradius
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /net-dialup/freeradius
reinit the tree, so we can have metadata
Diffstat (limited to 'net-dialup/freeradius')
-rw-r--r--net-dialup/freeradius/Manifest11
-rw-r--r--net-dialup/freeradius/files/freeradius.service15
-rw-r--r--net-dialup/freeradius/files/freeradius.tmpfiles1
-rw-r--r--net-dialup/freeradius/files/radius.conf-r416
-rw-r--r--net-dialup/freeradius/files/radius.init-r331
-rw-r--r--net-dialup/freeradius/freeradius-3.0.14.ebuild225
-rw-r--r--net-dialup/freeradius/freeradius-3.0.15.ebuild225
-rw-r--r--net-dialup/freeradius/metadata.xml10
8 files changed, 534 insertions, 0 deletions
diff --git a/net-dialup/freeradius/Manifest b/net-dialup/freeradius/Manifest
new file mode 100644
index 000000000000..8eaef42de2a6
--- /dev/null
+++ b/net-dialup/freeradius/Manifest
@@ -0,0 +1,11 @@
+AUX freeradius.service 392 SHA256 046224fcc38c2c11ca93f19aee9121f205f5d9ee227daa8c6a63d0fc570a6b2a SHA512 c2e153f0e8543758dff81835b17c6221ca031fc66f17828b6380d40501c8b6f6ed7e33096218e44326f731245c24386427bb3c9eda48ac185b67104fc878b692 WHIRLPOOL e8e003333df3da12e02af694898e7202d9a4e8d01bf8a2b6e2f7ce0413defe48eb6c807face2f6ab737080585efea3f5b70be2f0be809493676e13a482641838
+AUX freeradius.tmpfiles 36 SHA256 26abcb6b7ad588ca7dfb1dabc40eb921873094fd67bdbecfddbcfe93e810be4a SHA512 cf364cd860588318d49089946739bb30a6259a5aa7977c768155449fbb495473fe24c1ddccc75dc822e25b1f0d404589d7606590fd2018cc6503dd2767463a7c WHIRLPOOL 5945a06d8415016e970201d53d82cb500587916ac21d8ee77e09c71c6799ab3f949345ca0b91f2f02a5b19110ccda6656afc5391e4d4d1af56de2e0deaa2039e
+AUX radius.conf-r4 465 SHA256 5090c25d84dc1f6bb8176d421c2acc600e9e42bf28707cc96607ca9429953180 SHA512 4142869fb61b2938232002c9cb5b843590785560da7db4f2b2a9c9d55c76d0e2d4a6cb946a5347dfa505cd82f5e86c7315cf71f3443a86632090cf4bd025748a WHIRLPOOL a172ab14fb78ad7b5b2240f0a97c1189ca894ada93703daea6be668ae6353bb051f43aeab40eb2fe803b6144662c08359595abce2a65493cea06ae5029706c20
+AUX radius.init-r3 734 SHA256 4636601eb84a42a159de05664325ce0e92c25e250448cd47108f5f20a5ab7755 SHA512 826fd3fd576b09e7e590095b1ac63dfaec587a3b46ae1ccdec68134264fb689827aea4a446522bc2a253b9885469b6788a3dddc466ad47483dd62ef67262de49 WHIRLPOOL 28f4e6f04b0a88baba36ee97025c1851cddd19ddbdd0e5957670aa25bd220e11c45d88047ab608898d792c9af829e8059d27db70cd6fa2191172ad76ed86ed21
+DIST freeradius-server-3.0.14.tar.gz 4816144 SHA256 fcd6174d986a942db7a0defbccf6ffb6e692264a87915659493abb466c075909 SHA512 5f81f09a843bf59b16ed4c9c311013e3e839911ed926c56151502a00bb86cc3a593906059ec08b994cfbc4c36d1bc6005d62c5d253ddb5cc3894324c4aaeb308 WHIRLPOOL f679bd442ffc43fe6535a29e345290efa46837f2b31e5789920b9844b01a874ccc2bec6466bf99c6f60c587926a58cd537d4817def16fa89411ead9200c4a1e3
+DIST freeradius-server-3.0.15.tar.gz 4818244 SHA256 fd29c5eda3f69f2d823d07745d24a80197df3c1284f2efe6a15f76e16271cfe3 SHA512 9b92045b445032bde9d421499fdc0f6a08d602c501730c31a8d3974b21cc5c12c78abb024ed62a176c7aa7fe260fe1d19386aaf558e0fecfcd3a0ba7aa47499c WHIRLPOOL 102719d62417870bad1c698d3e999cf3829397f8b310c898d7cbb551a44bdbf302dd9e4e2610287c281318930f057446f20b3f994c56ceeadf0864795c92a5d0
+EBUILD freeradius-3.0.14.ebuild 5929 SHA256 cdbdfac23937a26e6132415072277a2038b0aff386007136b575c8cf1fbc2017 SHA512 83bbdab55422dab609dab2d5d1ffc4727655690df7682740b1c4a60362c56ca34a6014ea38a981b4f4359613ad594252ec28fc64ca721028b3ec88e3d64c7ace WHIRLPOOL b31005e14c0e5d423f339fc59b6ece9ae6918b290a1c16688a6f5139985d80096aa2dc27af95a5cb122d69868f54ceda2ebd17df965604d25368d3ed4b9d2556
+EBUILD freeradius-3.0.15.ebuild 5931 SHA256 6e52a774dc2adc1e852cc0934bda6a1cfe20e9ad5d85740258d081a02973ef9e SHA512 ca6c0e8674a5daf1310b7e70c000651826d7472a33c0782e28196ad9835382878f1371c8f37f91be97ff14783aeec5572310a6e122a600d2218169931775e13b WHIRLPOOL 34e10b30ee5cc2c62a51997383eaa774d2a797a303f78ea381c76a2bd4dc7d8b0d3544d0e6a0ce03682d38de2d8ac1cf495863076de573e98509260cb55cf621
+MISC ChangeLog 7183 SHA256 bfaf4489bff01de20397fb8268920d0886182adb0aaf44925783ef4cc58a0454 SHA512 b803848821bdee1908c17c322fff0896e842cdbecb3ba3f7cf6528dab31300e231457afa6027c2d5268dac87b7d29442e73cc81ea462bbe687014cf668390c2c WHIRLPOOL 9a66f729ef07d7b619d31443b7d8bfe36cfd0335e9f0ac2a574ebbb886a2ebad33899fc5dc0ecaf568ea80c3b34def8cb644e93905cd99dd31d21e1d69e89cdd
+MISC ChangeLog-2015 28265 SHA256 bebaacc4b68b52c055ba6d19030606cac47a0aae7328b83acc574fa1250e7223 SHA512 4303e8aa36161e358c4fc4f6c6e4d4e44c33a1ede0810928591319e570f4b95d0190f7c36122f4e28a124bc40802c9c4d88ce03913bba6b4572de0e47ba32812 WHIRLPOOL 6ffa9d991348ca09a98ff5b429e90a6591682624cd74e357965d1bed030290a90725b13ee91e0ac0a7ddab512294eb39462a7ee4edeaac0e7b7609427042ef42
+MISC metadata.xml 295 SHA256 4b4b7537cf0d9c8772a80b4ed187f66343fd0415f8d1bcea0fbe9aae3cdc122e SHA512 4f6cbe1b6931f4d672943e6cbb8e82dc66af63245027d4c1b791697bc492f8a9cc1dfe937fc59fc19f03713293458b27fc721d9b9a6bf43d2938d09a91ca4fbc WHIRLPOOL 58e18dc2c755d8f7fea97600d9e7e1f3b1710c6424d3177b8521eda12a2a70cf2734a4b8ac2ed2d0ccc46cba7d17bc90a7238010799f9987ea7be8fb1a9cdc1f
diff --git a/net-dialup/freeradius/files/freeradius.service b/net-dialup/freeradius/files/freeradius.service
new file mode 100644
index 000000000000..5304f076119b
--- /dev/null
+++ b/net-dialup/freeradius/files/freeradius.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=FreeRADIUS high performance RADIUS server.
+After=syslog.target network.target
+
+[Service]
+Type=simple
+PIDFile=/run/radiusd/radiusd.pid
+ExecStartPre=-/bin/chown -R radius.radius /run/radiusd
+ExecStartPre=/usr/sbin/radiusd -C
+ExecStart=/usr/sbin/radiusd -d /etc/raddb -f
+ExecReload=/usr/sbin/radiusd -C
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-dialup/freeradius/files/freeradius.tmpfiles b/net-dialup/freeradius/files/freeradius.tmpfiles
new file mode 100644
index 000000000000..21620c97706d
--- /dev/null
+++ b/net-dialup/freeradius/files/freeradius.tmpfiles
@@ -0,0 +1 @@
+d /run/radiusd 0755 radius radius -
diff --git a/net-dialup/freeradius/files/radius.conf-r4 b/net-dialup/freeradius/files/radius.conf-r4
new file mode 100644
index 000000000000..a5760d29f7b9
--- /dev/null
+++ b/net-dialup/freeradius/files/radius.conf-r4
@@ -0,0 +1,16 @@
+# Config file for /etc/init.d/radiusd
+
+# see man pages for radiusd run `radiusd -h`
+# for valid cmdline options
+#RADIUSD_OPTS=""
+
+# Change this value if you change it in /etc/raddb/radiusd.conf
+pidfile=/var/run/radiusd/radiusd.pid
+
+# Change these values if you change them in /etc/raddb/radiusd.conf
+RADIUSD_USER=radius
+RADIUSD_GROUP=radius
+
+# If you set up logging to syslog in /etc/raddb/radiusd.conf, you want
+# to uncomment the following line.
+#rc_use="logger"
diff --git a/net-dialup/freeradius/files/radius.init-r3 b/net-dialup/freeradius/files/radius.init-r3
new file mode 100644
index 000000000000..9c16ac59b41e
--- /dev/null
+++ b/net-dialup/freeradius/files/radius.init-r3
@@ -0,0 +1,31 @@
+#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+command=/usr/sbin/radiusd
+command_args="${RADIUSD_OPTS}"
+pidfile="${pidfile:-/run/radiusd/radiusd.pid}"
+extra_started_commands="reload"
+
+depend() {
+ need localmount
+ use dns
+}
+
+start_pre() {
+ if [ ! -f /etc/raddb/radiusd.conf ] ; then
+ eerror "No /etc/raddb/radiusd.conf file exists!"
+ return 1
+ fi
+
+ checkpath -m0750 -o "${RADIUSD_USER:-root}:${RADIUSD_GROUP:-root}" -d \
+ $(dirname ${pidfile}) /var/log/radius
+ checkpath -m0750 -o "${RADIUSD_USER:-root}:${RADIUSD_GROUP:-root}" -d \
+ $(dirname ${pidfile}) /run/radiusd
+}
+
+reload() {
+ ebegin "Reloading radiusd"
+ kill -HUP $(cat ${pidfile})
+ eend $?
+}
diff --git a/net-dialup/freeradius/freeradius-3.0.14.ebuild b/net-dialup/freeradius/freeradius-3.0.14.ebuild
new file mode 100644
index 000000000000..e42fc8e30526
--- /dev/null
+++ b/net-dialup/freeradius/freeradius-3.0.14.ebuild
@@ -0,0 +1,225 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 )
+inherit autotools pam python-single-r1 systemd user
+
+MY_P="${PN}-server-${PV}"
+
+DESCRIPTION="Highly configurable free RADIUS server"
+SRC_URI="
+ ftp://ftp.freeradius.org/pub/radius/${MY_P}.tar.gz
+ ftp://ftp.freeradius.org/pub/radius/old/${MY_P}.tar.gz
+"
+HOMEPAGE="http://www.freeradius.org/"
+
+KEYWORDS="amd64 ~arm ~ppc ~ppc64 ~sparc x86 ~x86-fbsd"
+LICENSE="GPL-2"
+SLOT="0"
+
+IUSE="
+ debug firebird iodbc kerberos ldap mysql odbc oracle pam pcap
+ postgres python readline sqlite ssl
+"
+RESTRICT="test firebird? ( bindist )"
+
+RDEPEND="!net-dialup/cistronradius
+ !net-dialup/gnuradius
+ sys-devel/libtool
+ dev-lang/perl:=
+ sys-libs/gdbm
+ sys-libs/talloc
+ python? ( ${PYTHON_DEPS} )
+ readline? ( sys-libs/readline:0= )
+ pcap? ( net-libs/libpcap )
+ mysql? ( virtual/mysql )
+ postgres? ( dev-db/postgresql:= )
+ firebird? ( dev-db/firebird )
+ pam? ( virtual/pam )
+ ssl? ( dev-libs/openssl:0= )
+ ldap? ( net-nds/openldap )
+ kerberos? ( virtual/krb5 )
+ sqlite? ( dev-db/sqlite:3 )
+ odbc? ( dev-db/unixODBC )
+ iodbc? ( dev-db/libiodbc )
+ oracle? ( dev-db/oracle-instantclient-basic )"
+DEPEND="${RDEPEND}"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+ enewgroup radius
+ enewuser radius -1 -1 /var/log/radius radius
+
+ python-single-r1_pkg_setup
+ export PYTHONBIN="${EPYTHON}"
+}
+
+src_prepare() {
+ # most of the configuration options do not appear as ./configure
+ # switches. Instead it identifies the directories that are available
+ # and run through them. These might check for the presence of
+ # various libraries, in which case they are not built. To avoid
+ # automagic dependencies, we just remove all the modules that we're
+ # not interested in using.
+
+ use ssl || { rm -r src/modules/rlm_eap/types/rlm_eap_{tls,ttls,peap} || die ; }
+ use ldap || { rm -r src/modules/rlm_ldap || die ; }
+ use kerberos || { rm -r src/modules/rlm_krb5 || die ; }
+ use pam || { rm -r src/modules/rlm_pam || die ; }
+ use python || { rm -r src/modules/rlm_python || die ; }
+ # Do not install ruby rlm module, bug #483108
+ rm -r src/modules/rlm_ruby || die
+
+ # these are all things we don't have in portage/I don't want to deal
+ # with myself
+ rm -r src/modules/rlm_eap/types/rlm_eap_tnc || die # requires TNCS library
+ rm -r src/modules/rlm_eap/types/rlm_eap_ikev2 || die # requires libeap-ikev2
+ rm -r src/modules/rlm_opendirectory || die # requires some membership.h
+ rm -r src/modules/rlm_redis{,who} || die # requires redis
+ rm -r src/modules/rlm_sql/drivers/rlm_sql_{db2,freetds} || die
+
+ # sql drivers that are not part of experimental are loaded from a
+ # file, so we have to remove them from the file itself when we
+ # remove them.
+ usesqldriver() {
+ local flag=$1
+ local driver=rlm_sql_${2:-${flag}}
+
+ if ! use ${flag}; then
+ rm -r src/modules/rlm_sql/drivers/${driver} || die
+ sed -i -e /${driver}/d src/modules/rlm_sql/stable || die
+ fi
+ }
+
+ sed -i \
+ -e 's:^#\tuser = :\tuser = :g' \
+ -e 's:^#\tgroup = :\tgroup = :g' \
+ -e 's:/var/run/radiusd:/run/radiusd:g' \
+ -e '/^run_dir/s:${localstatedir}::g' \
+ raddb/radiusd.conf.in || die
+
+ # verbosity
+ # build shared libraries using jlibtool --shared
+ sed -i \
+ -e '/$(LIBTOOL)/s|--quiet ||g' \
+ -e 's:--mode=\(compile\|link\):& --shared:g' \
+ Make.inc.in || die
+
+ sed -i \
+ -e 's|--silent ||g' \
+ -e 's:--mode=\(compile\|link\):& --shared:g' \
+ scripts/libtool.mk || die
+
+ # crude measure to stop jlibtool from running ranlib and ar
+ sed -i \
+ -e '/LIBRARIAN/s|".*"|"true"|g' \
+ -e '/RANLIB/s|".*"|"true"|g' \
+ scripts/jlibtool.c || die
+
+ usesqldriver mysql
+ usesqldriver postgres postgresql
+ usesqldriver firebird
+ usesqldriver iodbc
+ usesqldriver odbc unixodbc
+ usesqldriver oracle
+ usesqldriver sqlite
+
+ default
+
+ eautoreconf
+}
+
+src_configure() {
+ # fix bug #77613
+ local myeconfargs=()
+ if has_version app-crypt/heimdal; then
+ myeconfargs+=( --enable-heimdal-krb5 )
+ fi
+
+ use readline || export ac_cv_lib_readline=no
+ use pcap || export ac_cv_lib_pcap_pcap_open_live=no
+
+ # do not try to enable static with static-libs; upstream is a
+ # massacre of libtool best practices so you also have to make sure
+ # to --enable-shared explicitly.
+ myeconfargs+=(
+ --enable-shared
+ --disable-static
+ --disable-ltdl-install
+ --with-system-libtool
+ --with-system-libltdl
+ --with-ascend-binary
+ --with-udpfromto
+ --with-dhcp
+ --with-iodbc-include-dir=/usr/include/iodbc
+ --with-experimental-modules
+ --with-docdir=/usr/share/doc/${PF}
+ --with-logdir=/var/log/radius
+ $(use_enable debug developer)
+ $(use_with ldap edir)
+ $(use_with ssl openssl)
+ )
+ econf "${myeconfargs[@]}"
+}
+
+src_compile() {
+ # verbose, do not generate certificates
+ emake \
+ Q='' ECHO=true \
+ LOCAL_CERT_PRODUCTS=''
+}
+
+src_install() {
+ dodir /etc
+ diropts -m0750 -o root -g radius
+ dodir /etc/raddb
+ diropts -m0750 -o radius -g radius
+ dodir /var/log/radius
+ keepdir /var/log/radius/radacct
+ diropts
+
+ # verbose, do not install certificates
+ # Parallel install fails (#509498)
+ emake -j1 \
+ Q='' ECHO=true \
+ LOCAL_CERT_PRODUCTS='' \
+ R="${D}" \
+ install
+
+ fowners -R root:radius /etc/raddb
+
+ pamd_mimic_system radiusd auth account password session
+
+ dodoc CREDITS
+
+ rm "${D}/usr/sbin/rc.radiusd" || die
+
+ newinitd "${FILESDIR}/radius.init-r3" radiusd
+ newconfd "${FILESDIR}/radius.conf-r4" radiusd
+
+ systemd_newtmpfilesd "${FILESDIR}"/freeradius.tmpfiles freeradius.conf
+ systemd_dounit "${FILESDIR}"/freeradius.service
+
+ find "${ED}" \( -name "*.a" -o -name "*.la" \) -delete || die
+}
+
+pkg_config() {
+ if use ssl; then
+ cd "${ROOT}"/etc/raddb/certs
+ ./bootstrap
+
+ chown -R root:radius "${ROOT}"/etc/raddb/certs
+ fi
+}
+
+pkg_preinst() {
+ if ! has_version ${CATEGORY}/${PN} && use ssl; then
+ elog "You have to run \`emerge --config =${CATEGORY}/${PF}\` to be able"
+ elog "to start the radiusd service."
+ fi
+}
diff --git a/net-dialup/freeradius/freeradius-3.0.15.ebuild b/net-dialup/freeradius/freeradius-3.0.15.ebuild
new file mode 100644
index 000000000000..e5c5443ca3c3
--- /dev/null
+++ b/net-dialup/freeradius/freeradius-3.0.15.ebuild
@@ -0,0 +1,225 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 )
+inherit autotools pam python-single-r1 systemd user
+
+MY_P="${PN}-server-${PV}"
+
+DESCRIPTION="Highly configurable free RADIUS server"
+SRC_URI="
+ ftp://ftp.freeradius.org/pub/radius/${MY_P}.tar.gz
+ ftp://ftp.freeradius.org/pub/radius/old/${MY_P}.tar.gz
+"
+HOMEPAGE="http://www.freeradius.org/"
+
+KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
+LICENSE="GPL-2"
+SLOT="0"
+
+IUSE="
+ debug firebird iodbc kerberos ldap mysql odbc oracle pam pcap
+ postgres python readline sqlite ssl
+"
+RESTRICT="test firebird? ( bindist )"
+
+RDEPEND="!net-dialup/cistronradius
+ !net-dialup/gnuradius
+ sys-devel/libtool
+ dev-lang/perl:=
+ sys-libs/gdbm
+ sys-libs/talloc
+ python? ( ${PYTHON_DEPS} )
+ readline? ( sys-libs/readline:0= )
+ pcap? ( net-libs/libpcap )
+ mysql? ( virtual/mysql )
+ postgres? ( dev-db/postgresql:= )
+ firebird? ( dev-db/firebird )
+ pam? ( virtual/pam )
+ ssl? ( dev-libs/openssl:0= )
+ ldap? ( net-nds/openldap )
+ kerberos? ( virtual/krb5 )
+ sqlite? ( dev-db/sqlite:3 )
+ odbc? ( dev-db/unixODBC )
+ iodbc? ( dev-db/libiodbc )
+ oracle? ( dev-db/oracle-instantclient-basic )"
+DEPEND="${RDEPEND}"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+ enewgroup radius
+ enewuser radius -1 -1 /var/log/radius radius
+
+ python-single-r1_pkg_setup
+ export PYTHONBIN="${EPYTHON}"
+}
+
+src_prepare() {
+ # most of the configuration options do not appear as ./configure
+ # switches. Instead it identifies the directories that are available
+ # and run through them. These might check for the presence of
+ # various libraries, in which case they are not built. To avoid
+ # automagic dependencies, we just remove all the modules that we're
+ # not interested in using.
+
+ use ssl || { rm -r src/modules/rlm_eap/types/rlm_eap_{tls,ttls,peap} || die ; }
+ use ldap || { rm -r src/modules/rlm_ldap || die ; }
+ use kerberos || { rm -r src/modules/rlm_krb5 || die ; }
+ use pam || { rm -r src/modules/rlm_pam || die ; }
+ use python || { rm -r src/modules/rlm_python || die ; }
+ # Do not install ruby rlm module, bug #483108
+ rm -r src/modules/rlm_ruby || die
+
+ # these are all things we don't have in portage/I don't want to deal
+ # with myself
+ rm -r src/modules/rlm_eap/types/rlm_eap_tnc || die # requires TNCS library
+ rm -r src/modules/rlm_eap/types/rlm_eap_ikev2 || die # requires libeap-ikev2
+ rm -r src/modules/rlm_opendirectory || die # requires some membership.h
+ rm -r src/modules/rlm_redis{,who} || die # requires redis
+ rm -r src/modules/rlm_sql/drivers/rlm_sql_{db2,freetds} || die
+
+ # sql drivers that are not part of experimental are loaded from a
+ # file, so we have to remove them from the file itself when we
+ # remove them.
+ usesqldriver() {
+ local flag=$1
+ local driver=rlm_sql_${2:-${flag}}
+
+ if ! use ${flag}; then
+ rm -r src/modules/rlm_sql/drivers/${driver} || die
+ sed -i -e /${driver}/d src/modules/rlm_sql/stable || die
+ fi
+ }
+
+ sed -i \
+ -e 's:^#\tuser = :\tuser = :g' \
+ -e 's:^#\tgroup = :\tgroup = :g' \
+ -e 's:/var/run/radiusd:/run/radiusd:g' \
+ -e '/^run_dir/s:${localstatedir}::g' \
+ raddb/radiusd.conf.in || die
+
+ # verbosity
+ # build shared libraries using jlibtool --shared
+ sed -i \
+ -e '/$(LIBTOOL)/s|--quiet ||g' \
+ -e 's:--mode=\(compile\|link\):& --shared:g' \
+ Make.inc.in || die
+
+ sed -i \
+ -e 's|--silent ||g' \
+ -e 's:--mode=\(compile\|link\):& --shared:g' \
+ scripts/libtool.mk || die
+
+ # crude measure to stop jlibtool from running ranlib and ar
+ sed -i \
+ -e '/LIBRARIAN/s|".*"|"true"|g' \
+ -e '/RANLIB/s|".*"|"true"|g' \
+ scripts/jlibtool.c || die
+
+ usesqldriver mysql
+ usesqldriver postgres postgresql
+ usesqldriver firebird
+ usesqldriver iodbc
+ usesqldriver odbc unixodbc
+ usesqldriver oracle
+ usesqldriver sqlite
+
+ default
+
+ eautoreconf
+}
+
+src_configure() {
+ # fix bug #77613
+ local myeconfargs=()
+ if has_version app-crypt/heimdal; then
+ myeconfargs+=( --enable-heimdal-krb5 )
+ fi
+
+ use readline || export ac_cv_lib_readline=no
+ use pcap || export ac_cv_lib_pcap_pcap_open_live=no
+
+ # do not try to enable static with static-libs; upstream is a
+ # massacre of libtool best practices so you also have to make sure
+ # to --enable-shared explicitly.
+ myeconfargs+=(
+ --enable-shared
+ --disable-static
+ --disable-ltdl-install
+ --with-system-libtool
+ --with-system-libltdl
+ --with-ascend-binary
+ --with-udpfromto
+ --with-dhcp
+ --with-iodbc-include-dir=/usr/include/iodbc
+ --with-experimental-modules
+ --with-docdir=/usr/share/doc/${PF}
+ --with-logdir=/var/log/radius
+ $(use_enable debug developer)
+ $(use_with ldap edir)
+ $(use_with ssl openssl)
+ )
+ econf "${myeconfargs[@]}"
+}
+
+src_compile() {
+ # verbose, do not generate certificates
+ emake \
+ Q='' ECHO=true \
+ LOCAL_CERT_PRODUCTS=''
+}
+
+src_install() {
+ dodir /etc
+ diropts -m0750 -o root -g radius
+ dodir /etc/raddb
+ diropts -m0750 -o radius -g radius
+ dodir /var/log/radius
+ keepdir /var/log/radius/radacct
+ diropts
+
+ # verbose, do not install certificates
+ # Parallel install fails (#509498)
+ emake -j1 \
+ Q='' ECHO=true \
+ LOCAL_CERT_PRODUCTS='' \
+ R="${D}" \
+ install
+
+ fowners -R root:radius /etc/raddb
+
+ pamd_mimic_system radiusd auth account password session
+
+ dodoc CREDITS
+
+ rm "${D}/usr/sbin/rc.radiusd" || die
+
+ newinitd "${FILESDIR}/radius.init-r3" radiusd
+ newconfd "${FILESDIR}/radius.conf-r4" radiusd
+
+ systemd_newtmpfilesd "${FILESDIR}"/freeradius.tmpfiles freeradius.conf
+ systemd_dounit "${FILESDIR}"/freeradius.service
+
+ find "${ED}" \( -name "*.a" -o -name "*.la" \) -delete || die
+}
+
+pkg_config() {
+ if use ssl; then
+ cd "${ROOT}"/etc/raddb/certs
+ ./bootstrap
+
+ chown -R root:radius "${ROOT}"/etc/raddb/certs
+ fi
+}
+
+pkg_preinst() {
+ if ! has_version ${CATEGORY}/${PN} && use ssl; then
+ elog "You have to run \`emerge --config =${CATEGORY}/${PF}\` to be able"
+ elog "to start the radiusd service."
+ fi
+}
diff --git a/net-dialup/freeradius/metadata.xml b/net-dialup/freeradius/metadata.xml
new file mode 100644
index 000000000000..fa9540c73dc9
--- /dev/null
+++ b/net-dialup/freeradius/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <!-- maintainer-needed -->
+ <use>
+ <flag name="pcap">
+ Build the RADIUS sniffer which requires <pkg>net-libs/libpcap</pkg>.
+ </flag>
+ </use>
+</pkgmetadata>