summary refs log tree commit diff
path: root/pkgs/servers/rt/default.nix
diff options
context:
space:
mode:
authorGraham Christensen <graham@grahamc.com>2017-04-22 16:21:45 -0400
committerGraham Christensen <graham@grahamc.com>2017-04-22 16:24:33 -0400
commit55d4d50cd32afa2304327b379adc93f93663a31e (patch)
tree9fab15e4ebfe122b5887276f9b7c4a0a8b1499a9 /pkgs/servers/rt/default.nix
parent46f952371ee587cb820095e2662ad0a4cb10d170 (diff)
downloadnixlib-55d4d50cd32afa2304327b379adc93f93663a31e.tar
nixlib-55d4d50cd32afa2304327b379adc93f93663a31e.tar.gz
nixlib-55d4d50cd32afa2304327b379adc93f93663a31e.tar.bz2
nixlib-55d4d50cd32afa2304327b379adc93f93663a31e.tar.lz
nixlib-55d4d50cd32afa2304327b379adc93f93663a31e.tar.xz
nixlib-55d4d50cd32afa2304327b379adc93f93663a31e.tar.zst
nixlib-55d4d50cd32afa2304327b379adc93f93663a31e.zip
rt: improve packaging, with a progress note
Diffstat (limited to 'pkgs/servers/rt/default.nix')
-rw-r--r--pkgs/servers/rt/default.nix88
1 files changed, 81 insertions, 7 deletions
diff --git a/pkgs/servers/rt/default.nix b/pkgs/servers/rt/default.nix
index deec6589dbb2..82818037072a 100644
--- a/pkgs/servers/rt/default.nix
+++ b/pkgs/servers/rt/default.nix
@@ -1,5 +1,35 @@
-{ stdenv, fetchurl, perl }:
+{ stdenv, buildEnv, fetchurl, perl, perlPackages, makeWrapper }:
 
+# This package isn't extremely useful as it is, but is getting close.
+# After running:
+#
+#   nix-build . -A rt
+#
+# I created a config file named myconfig.pm with:
+#
+#   use utf8;
+#   Set($rtname, '127.0.0.1');
+#   # These dirs need to be pre-created:
+#   Set($MasonSessionDir, '/home/grahamc/foo/sessiondir/');
+#   Set($MasonDataDir, '/home/grahamc/foo/localstate/');
+#   Set($WebPort, 8080);
+#
+#   Set($DatabaseType, "SQLite");
+#   Set( $DatabaseName, '/home/grahamc/projects/foo/my.db' );
+#
+#   1;
+#
+# and ran
+#
+#  RT_SITE_CONFIG=$(pwd)/myconfig.pm ./result/bin/rt-setup-database --action init
+#
+# Then:
+#
+#   RT_SITE_CONFIG=$(pwd)/myconfig.pm ./result/bin/rt-server
+#
+# Make sure to check out result/etc/RT_Config.pm
+#
+# Good luck.
 stdenv.mkDerivation rec {
   name = "rt-${version}";
 
@@ -12,14 +42,58 @@ stdenv.mkDerivation rec {
 
   patches = [ ./override-generated.patch ];
 
-  buildInputs = [ perl ];
+  buildInputs = [
+    makeWrapper
+    perl
+    (buildEnv {
+      name = "rt-perl-deps";
+      paths = (with perlPackages; [
+        ApacheSession BusinessHours CGIEmulatePSGI CGIPSGI
+        CSSMinifierXP CSSSquish ConvertColor CryptEksblowfish
+        CryptSSLeay DBDSQLite DBDmysql DBIxSearchBuilder DataGUID
+        DataICal DataPagePageset DateExtract DateManip
+        DateTimeFormatNatural DevelGlobalDestruction EmailAddress
+        EmailAddressList FCGI FCGIProcManager FileShareDir FileWhich
+        GD GDGraph GnuPGInterface GraphViz HTMLFormatTextWithLinks
+        HTMLFormatTextWithLinksAndTables HTMLMason
+        HTMLMasonPSGIHandler HTMLQuoted HTMLRewriteAttributes
+        HTMLScrubber IPCRun IPCRun3 JSON JavaScriptMinifierXS LWP
+        LWPProtocolHttps LocaleMaketextFuzzy LocaleMaketextLexicon
+        LogDispatch MIMETools MIMETypes MailTools ModuleRefresh
+        ModuleVersionsReport MozillaCA NetCIDR NetIP PerlIOeol Plack
+        RegexpCommon RegexpCommonnetCIDR RegexpIPv6 RoleBasic
+        ScopeUpper Starlet SymbolGlobalName TermReadKey
+        TextPasswordPronounceable TextQuoted TextTemplate
+        TextWikiFormat TextWrapper TimeParseDate TreeSimple
+        UNIVERSALrequire XMLRSS
+      ]);
+    })
+  ];
 
-  dontBuild = true;
+  preConfigure = ''
+    configureFlags="$configureFlags --with-web-user=$UID"
+    configureFlags="$configureFlags --with-web-group=$(id -g)"
+    configureFlags="$configureFlags --with-rt-group=$(id -g)"
+    configureFlags="$configureFlags --with-bin-owner=$UID"
+    configureFlags="$configureFlags --with-libs-owner=$UID"
+    configureFlags="$configureFlags --with-libs-group=$(id -g)"
+  '';
+  configureFlags = [
+    "--enable-graphviz"
+    "--enable-gd"
+    "--enable-gpg"
+    "--with-db-type=SQLite"
+  ];
+
+  buildPhase = ''
+    make testdeps | grep -i missing | sort
+  '';
 
-  installPhase = ''
-    mkdir $out
-    cp -a {bin,docs,etc,lib,sbin,share} $out
-    find $out -name '*.in' -exec rm '{}' \;
+  preFixup = ''
+    for i in $(find $out/bin -type f; find $out/sbin -type f); do
+      wrapProgram $i \
+          --prefix PERL5LIB ':' $PERL5LIB
+    done
   '';
 
   meta = {