Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tomcat cleanup && update #18419

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/maintainers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
cwoac = "Oliver Matthews <[email protected]>";
DamienCassou = "Damien Cassou <[email protected]>";
dasuxullebt = "Christoph-Simon Senjak <[email protected]>";
danbst = "Danylo Hlynskyi <[email protected]>";
davidak = "David Kleuker <[email protected]>";
davidrusu = "David Rusu <[email protected]>";
dbohdan = "Danyil Bohdan <[email protected]>";
Expand Down
16 changes: 10 additions & 6 deletions nixos/modules/services/web-servers/tomcat.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ in

{

meta = {
maintainers = with maintainers; [ danbst ];
};

###### interface

options = {
Expand All @@ -23,9 +27,9 @@ in

package = mkOption {
type = types.package;
default = pkgs.tomcat7;
defaultText = "pkgs.tomcat7";
example = lib.literalExample "pkgs.tomcat8";
default = pkgs.tomcat85;
defaultText = "pkgs.tomcat85";
example = lib.literalExample "pkgs.tomcatUnstable";
description = ''
Which tomcat package to use.
'';
Expand Down Expand Up @@ -74,8 +78,8 @@ in

webapps = mkOption {
type = types.listOf types.package;
default = [ tomcat ];
defaultText = "[ tomcat ]";
default = [ tomcat.webapps ];
defaultText = "[ tomcat.webapps ]";
description = "List containing WAR files or directories with WAR files which are web applications to be deployed on Tomcat";
};

Expand Down Expand Up @@ -352,7 +356,7 @@ in
${pkgs.su}/bin/su -s ${pkgs.bash}/bin/sh ${cfg.user} -c 'CATALINA_BASE=${cfg.baseDir} JAVA_HOME=${cfg.jdk} JAVA_OPTS="${cfg.javaOpts}" CATALINA_OPTS="${cfg.catalinaOpts}" ${tomcat}/bin/startup.sh'
'';

postStop = ''
preStop = ''
echo "Stopping tomcat..."
CATALINA_BASE=${cfg.baseDir} JAVA_HOME=${cfg.jdk} ${pkgs.su}/bin/su -s ${pkgs.bash}/bin/sh ${cfg.user} -c ${tomcat}/bin/shutdown.sh
'';
Expand Down
6 changes: 0 additions & 6 deletions pkgs/servers/http/tomcat/6.0.nix

This file was deleted.

6 changes: 0 additions & 6 deletions pkgs/servers/http/tomcat/7.0.nix

This file was deleted.

6 changes: 0 additions & 6 deletions pkgs/servers/http/tomcat/8.0.nix

This file was deleted.

20 changes: 0 additions & 20 deletions pkgs/servers/http/tomcat/builder.sh

This file was deleted.

64 changes: 64 additions & 0 deletions pkgs/servers/http/tomcat/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{ stdenv, lib, fetchurl }:

let

common = { versionMajor, versionMinor, sha256 } @ args: stdenv.mkDerivation (rec {
name = "apache-tomcat-${version}";
version = "${versionMajor}.${versionMinor}";

src = fetchurl {
url = "mirror://apache/tomcat/tomcat-${versionMajor}/v${version}/bin/${name}.tar.gz";
inherit sha256;
};

outputs = [ "out" "webapps" ];
installPhase =
''
mkdir $out
mv * $out
mkdir -p $webapps/webapps
mv $out/webapps $webapps/
'';

meta = {
homepage = https://tomcat.apache.org/;
description = "An implementation of the Java Servlet and JavaServer Pages technologies";
platforms = with lib.platforms; all;
maintainers = with lib.maintainers; [ danbst ];
license = [ lib.licenses.asl20 ];
};
});

in {

tomcat6 = common {
versionMajor = "6";
versionMinor = "0.45";
sha256 = "0ba8h86padpk23xmscp7sg70g0v8ji2jbwwriz59hxqy5zhd76wg";
};

tomcat7 = common {
versionMajor = "7";
versionMinor = "0.70";
sha256 = "0x4chqb7kkmadmhf2hlank856hw2vpgjl14fak74ybimlcb3dwqk";
};

tomcat8 = common {
versionMajor = "8";
versionMinor = "0.37";
sha256 = "0f9d4yxjzwdrayj5l3jyiclnmpb5lffvmsnp54qpf6m3gm7cj5i6";
};

tomcat85 = common {
versionMajor = "8";
versionMinor = "5.5";
sha256 = "0idfxjrw5q45f531gyjnv6xjkbj9nhy2v1w4z7558z96230a0fqj";
};

tomcatUnstable = common {
versionMajor = "9";
versionMinor = "0.0.M10";
sha256 = "0p3pqwz9zjvr9w73divsyaa53mbazf0icxfs06wvgxsvkbgj5gq9";
};

}
25 changes: 0 additions & 25 deletions pkgs/servers/http/tomcat/recent.nix

This file was deleted.

11 changes: 6 additions & 5 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10742,11 +10742,12 @@ in

slurm-llnl-full = appendToName "full" (callPackage ../servers/computing/slurm { });

tomcat6 = callPackage ../servers/http/tomcat/6.0.nix { };

tomcat7 = callPackage ../servers/http/tomcat/7.0.nix { };

tomcat8 = callPackage ../servers/http/tomcat/8.0.nix { };
inherit (callPackages ../servers/http/tomcat { })
tomcat6
tomcat7
tomcat8
tomcat85
tomcatUnstable;

tomcat_mysql_jdbc = callPackage ../servers/http/tomcat/jdbc/mysql { };

Expand Down