@@ -0,0 +1,48 @@
1+{ stdenv, fetchFromGitHub, makeWrapper, perl, perlPackages }: stdenv.mkDerivation rec {
2+ name = "sieve-connect-${version}";
3+ version = "0.89";
4+
5+ src = fetchFromGitHub {
6+ owner = "philpennock";
7+ repo = "sieve-connect";
8+ rev = "v${version}";
9+ sha256 = "0g7cv29wd5673inl4c87xb802k86bj6gcwh131xrbbg0a0g1c8fp";
10+ };
11+
12+ buildInputs = [ perl ];
13+ nativeBuildInputs = [ makeWrapper ];
14+
15+ preBuild = ''
16+ # Fixes failing build when not building in git repo
17+ mkdir .git
18+ touch .git/HEAD
19+ echo "${version}" > versionfile
20+ echo "$(date +%Y-%m-%d)" > datefile
21+ '';
22+
23+ buildFlags = [ "PERL5LIB=${stdenv.lib.makePerlPath [ perlPackages.FileSlurp ]}" "bin" "man" ];
24+
25+ installPhase = ''
26+ mkdir -p $out/bin $out/share/man/man1
27+ install -m 755 sieve-connect $out/bin
28+ gzip -c sieve-connect.1 > $out/share/man/man1/sieve-connect.1.gz
29+
30+ wrapProgram $out/bin/sieve-connect \
31+ --prefix PERL5LIB : "${stdenv.lib.makePerlPath (with perlPackages; [
32+ AuthenSASL Socket6 IOSocketInet6 IOSocketSSL NetSSLeay NetDNS PodUsage
33+ TermReadKey TermReadLineGnu ])}"
34+ '';
35+
36+ meta = with stdenv.lib; {
37+ description = "A client for the MANAGESIEVE Protocol";
38+ longDescription = ''
39+ This is sieve-connect. A client for the ManageSieve protocol,
40+ as specifed in RFC 5804. Historically, this was MANAGESIEVE as
41+ implemented by timsieved in Cyrus IMAP.
42+ '';
43+ homepage = https://github.com/philpennock/sieve-connect;
44+ license = licenses.bsd3;
45+ platforms = platforms.unix;
46+ maintainers = with maintainers; [ das_j ];
47+ };
48+}