summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/po/postfixadmin/package.nix
blob: baea81c99de4061385257d536aca3fda06d78251 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{
  fetchFromGitHub,
  lib,
  php84,
}:

let
  php = php84;
in
php.buildComposerProject2 (finalAttrs: {
  pname = "postfixadmin";
  version = "4.0.1";

  src = fetchFromGitHub {
    owner = "postfixadmin";
    repo = "postfixadmin";
    tag = "postfixadmin-${finalAttrs.version}";
    hash = "sha256-mr5FBURTGP2J3JMlcexXjz4GFJNqPR4rZyqHVN7+6iM=";
  };

  # Upstream does not ship a lock file, we have to maintain our own for now.
  # https://github.com/postfixadmin/postfixadmin/issues/948
  composerLock = ./composer.lock;
  vendorHash = "sha256-uyHEfWCC6V4d+ez7FbqBKrh4IfbQ2pgD4UvbdGEfobI=";

  postInstall = ''
    out_dir="$out"/share/php/postfixadmin/

    ln -sf /etc/postfixadmin/config.local.php "$out_dir"
    ln -sf /var/cache/postfixadmin/templates_c "$out_dir"
  '';

  passthru.phpPackage = php;

  meta = {
    changelog = "https://github.com/postfixadmin/postfixadmin/releases/tag/${finalAttrs.src.tag}";
    description = "Web based virtual user administration interface for Postfix mail servers";
    homepage = "https://postfixadmin.sourceforge.io/";
    maintainers = with lib.maintainers; [ yayayayaka ];
    license = lib.licenses.gpl2Plus;
    platforms = lib.platforms.all;
  };
})