liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

default.nix (1117B)


      1 { lib
      2 , stdenv
      3 , fetchFromGitHub
      4 , ppp } :
      5 let
      6 in
      7 stdenv.mkDerivation rec {
      8   pname = "rp-pppoe";
      9   version = "3.15";
     10 
     11   src = fetchFromGitHub {
     12     owner = "dfskoll";
     13     repo = "rp-pppoe";
     14     rev = "7cfd8c0405d14cf1c8d799d41d8207fd707979c1";
     15     hash = "sha256-MFdCwNj8c52blxEuXH5ltT2yYDmKMH5MLUgtddZV25E=";
     16   };
     17 
     18   buildInputs = [ ppp ];
     19 
     20   preConfigure = ''
     21     cd src
     22     export PPPD=${ppp}/sbin/pppd
     23   '';
     24 
     25   configureFlags = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ "rpppoe_cv_pack_bitfields=rev" ];
     26 
     27   postConfigure = ''
     28     sed -i Makefile -e 's@DESTDIR)/etc/ppp@out)/etc/ppp@'
     29     sed -i Makefile -e 's@PPPOESERVER_PPPD_OPTIONS=@&$(out)@'
     30   '';
     31 
     32   installPhase = ''
     33     mkdir -p $out/bin $out/lib
     34     cp pppoe pppoe-server $out/bin # ppoe-relay pppoe-sniff?
     35     test -e rp-pppoe.so && cp rp-pppoe.so $out/lib
     36     true
     37   '';
     38   makeFlags = [ "AR:=$(AR)" ];
     39 
     40   meta = with lib; {
     41     description = "Roaring Penguin Point-to-Point over Ethernet tool";
     42     platforms = platforms.linux;
     43     homepage = "https://www.roaringpenguin.com/products/pppoe";
     44     license = licenses.gpl2Plus;
     45   };
     46 }