2021-01-11 08:54:33 +01:00
|
|
|
{ lib, stdenv, fetchurl, autoreconfHook, makeWrapper
|
2016-08-24 21:35:08 +02:00
|
|
|
, gnugrep, openssl }:
|
2016-01-25 10:13:10 +01:00
|
|
|
|
2019-08-13 23:52:01 +02:00
|
|
|
stdenv.mkDerivation {
|
2016-01-25 10:13:10 +01:00
|
|
|
name = "easyrsa-2.2.0";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/OpenVPN/easy-rsa/archive/v2.2.0.tar.gz";
|
|
|
|
sha256 = "1xq4by5frb6ikn53ss3y8v7ss639dccxfq8jfrbk07ynkmk668qk";
|
|
|
|
};
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
mkdir -p $out/share/easy-rsa
|
|
|
|
'';
|
|
|
|
|
2016-08-24 21:35:08 +02:00
|
|
|
nativeBuildInputs = [ autoreconfHook makeWrapper ];
|
|
|
|
buildInputs = [ gnugrep openssl ];
|
2016-01-25 10:13:10 +01:00
|
|
|
|
|
|
|
# Make sane defaults and patch default config vars
|
|
|
|
postInstall = ''
|
|
|
|
cp $out/share/easy-rsa/openssl-1.0.0.cnf $out/share/easy-rsa/openssl.cnf
|
|
|
|
for prog in $(find "$out/share/easy-rsa" -executable -type f); do
|
|
|
|
makeWrapper "$prog" "$out/bin/$(basename $prog)" \
|
|
|
|
--set EASY_RSA "$out/share/easy-rsa" \
|
2016-04-10 21:51:13 +02:00
|
|
|
--set OPENSSL "${openssl.bin}/bin/openssl" \
|
2016-01-25 10:13:10 +01:00
|
|
|
--set GREP "${gnugrep}/bin/grep"
|
|
|
|
done
|
|
|
|
sed -i "/EASY_RSA=\|OPENSSL=\|GREP=/d" $out/share/easy-rsa/vars
|
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2016-01-25 10:13:10 +01:00
|
|
|
description = "Simple shell based CA utility";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://openvpn.net/";
|
2016-01-25 10:13:10 +01:00
|
|
|
license = licenses.gpl2;
|
|
|
|
maintainers = [ maintainers.offline ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|