unitas/www-apps/privacyidea/privacyidea-3.0.2.ebuild

116 lines
3.2 KiB
Bash

# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI=6
PYTHON_COMPAT=( python2_7 python3_{5,6,7} )
inherit distutils-r1 user
VRADIUS="3.1"
DESCRIPTION="privacyIDEA is a modular authentication system"
HOMEPAGE="https://www.privacyidea.org/"
SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
https://github.com/${PN}/FreeRADIUS/archive/v${VRADIUS}.tar.gz -> ${PN}-FreeRADIUS-${VRADIUS}.tar.gz"
LICENSE="GPL-3"
SLOT="0"
KEYWORDS="amd64 x86"
IUSE="+mysql postgres sqlite -translation"
DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]
translation? ( net-libs/nodejs[npm]
app-i18n/poedit )"
RDEPEND="
mysql? ( dev-python/mysql-python[${PYTHON_USEDEP}]
dev-python/pymysql[${PYTHON_USEDEP}]
>=virtual/mysql-5.0 )
postgres? ( dev-python/psycopg[${PYTHON_USEDEP}] )
sqlite? ( dev-python/sqlalchemy[${PYTHON_USEDEP}] )
dev-perl/Config-IniFiles
dev-perl/Crypt-SSLeay
dev-perl/Data-Dump
dev-perl/JSON
dev-perl/Net-SSLeay
dev-perl/Try-Tiny
dev-perl/libwww-perl
dev-python/bcrypt[${PYTHON_USEDEP}]
dev-python/beautifulsoup:4[${PYTHON_USEDEP}]
dev-python/configobj[${PYTHON_USEDEP}]
dev-python/croniter[${PYTHON_USEDEP}]
dev-python/defusedxml[${PYTHON_USEDEP}]
dev-python/ecdsa[${PYTHON_USEDEP}]
dev-python/flask-babel[${PYTHON_USEDEP}]
dev-python/flask-migrate[${PYTHON_USEDEP}]
dev-python/funcparserlib[${PYTHON_USEDEP}]
dev-python/huey[${PYTHON_USEDEP}]
dev-python/itsdangerous[${PYTHON_USEDEP}]
dev-python/ldap3[${PYTHON_USEDEP}]
dev-python/netaddr[${PYTHON_USEDEP}]
dev-python/oauth2client[${PYTHON_USEDEP}]
dev-python/passlib[${PYTHON_USEDEP}]
dev-python/pyjwt[${PYTHON_USEDEP}]
dev-python/pyrad[${PYTHON_USEDEP}]
dev-python/python-gnupg[${PYTHON_USEDEP}]
dev-python/pyusb[${PYTHON_USEDEP}]
dev-python/pyyaml[${PYTHON_USEDEP}]
dev-python/qrcode[${PYTHON_USEDEP}]
dev-python/requests[${PYTHON_USEDEP}]
dev-python/smpplib[${PYTHON_USEDEP}]
dev-python/sqlsoup[${PYTHON_USEDEP}]
dev-python/urllib3[${PYTHON_USEDEP}]
dev-python/werkzeug[${PYTHON_USEDEP}]
www-apache/mod_wsgi
www-servers/gunicorn
"
REQUIRED_USE="|| ( mysql postgres sqlite )"
python_prepare_all() {
rm -rf tests
rmdir authmodules/FreeRADIUS
ln -s ../../FreeRADIUS-${VRADIUS} authmodules/FreeRADIUS
if use translation; then
npm install grunt --save-dev
npm install grunt-angular-gettext --save-dev
make translate
fi
distutils-r1_python_prepare_all
}
pkg_setup() {
enewgroup ${PN}
enewuser ${PN} -1 -1 /var/lib/${PN}/home ${PN}
}
python_install_all() {
distutils-r1_python_install_all
mv ${D}/usr/etc ${D}/etc
insinto /etc/privacyidea
doins deploy/pi.cfg
doins deploy/logging.cfg
doins deploy/privacyidea/NetKnights.pem
doins deploy/privacyidea/enckey
doins deploy/privacyidea/private.pem
doins deploy/privacyidea/public.pem
doins authmodules/FreeRADIUS/rlm_perl.ini
## insinto /etc/privacyidea/CA
## doins deploy/debian/openssl.cnf
fowners -R ${PN}:root /etc/privacyidea
fperms 600 /etc/privacyidea/enckey \
/etc/privacyidea/private.pem
## insinto /etc/logrotate.d
## newins "${FILESDIR}/${PN}.logrotate" ${PN}
diropts -o privacyidea -g root
keepdir /var/log/privacyidea
}