2014-09-26 16:33:17 +02:00
|
|
|
{ stdenv, fetchurl, makeWrapper, jre, cpio, gawk, gnugrep, gnused, procps, swt, gtk2, glib, libXtst }:
|
|
|
|
|
2016-04-02 22:37:54 +02:00
|
|
|
let
|
2016-11-13 20:04:43 +01:00
|
|
|
version = "4.8.0";
|
|
|
|
rev = "1"; #tracks unversioned changes that occur on download.code42.com from time to time
|
2014-09-26 16:33:17 +02:00
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
2016-04-02 22:37:54 +02:00
|
|
|
name = "crashplan-${version}-r${rev}";
|
2014-09-26 16:33:17 +02:00
|
|
|
|
|
|
|
crashPlanArchive = fetchurl {
|
2016-03-19 01:53:37 +01:00
|
|
|
url = "https://download.code42.com/installs/linux/install/CrashPlan/CrashPlan_${version}_Linux.tgz";
|
2016-11-13 20:04:43 +01:00
|
|
|
sha256 = "117k9yx10n4lc0hkx0j48f19km0jrdgfq6xmbmhv3v73zbx21axs";
|
2014-09-26 16:33:17 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
srcs = [ crashPlanArchive ];
|
|
|
|
|
2014-09-27 14:04:41 +02:00
|
|
|
meta = with stdenv.lib; {
|
2014-09-26 16:33:17 +02:00
|
|
|
description = "An online/offline backup solution";
|
|
|
|
homepage = "http://www.crashplan.org";
|
2014-09-27 14:04:41 +02:00
|
|
|
license = licenses.unfree;
|
2016-11-13 20:41:57 +01:00
|
|
|
maintainers = with maintainers; [ sztupi domenkozar jerith666 ];
|
2014-09-26 16:33:17 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ makeWrapper cpio ];
|
|
|
|
|
|
|
|
vardir = "/var/lib/crashplan";
|
|
|
|
|
|
|
|
manifestdir = "${vardir}/manifest";
|
|
|
|
|
2014-12-18 10:12:37 +01:00
|
|
|
patches = [ ./CrashPlanEngine.patch ./CrashPlanDesktop.patch ];
|
2014-09-26 16:33:17 +02:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir $out
|
|
|
|
zcat -v CrashPlan_${version}.cpi | (cd $out; cpio -i -d -v --no-preserve-owner)
|
|
|
|
|
|
|
|
# sed -i "s|<manifestPath>manifest</manifestPath>|<manifestPath>${manifestdir}</manifestPath>|g" $out/conf/default.service.xml
|
|
|
|
|
|
|
|
# Fix for encoding troubles (CrashPlan ticket 178827)
|
|
|
|
# Make sure the daemon is running using the same localization as
|
|
|
|
# the (installing) user
|
|
|
|
echo "" >> run.conf
|
2016-03-19 01:53:37 +01:00
|
|
|
echo "LC_ALL=en_US.UTF-8" >> run.conf
|
2014-09-26 16:33:17 +02:00
|
|
|
|
|
|
|
install -d -m 755 unpacked $out
|
|
|
|
|
|
|
|
install -D -m 644 run.conf $out/bin/run.conf
|
|
|
|
install -D -m 755 scripts/CrashPlanDesktop $out/bin/CrashPlanDesktop
|
|
|
|
install -D -m 755 scripts/CrashPlanEngine $out/bin/CrashPlanEngine
|
2014-12-19 23:25:19 +01:00
|
|
|
install -D -m 644 scripts/CrashPlan.desktop $out/share/applications/CrashPlan.desktop
|
2014-09-26 16:33:17 +02:00
|
|
|
|
|
|
|
rm -r $out/log
|
2016-03-19 01:53:37 +01:00
|
|
|
mv -v $out/conf $out/conf.template
|
2014-09-26 16:33:17 +02:00
|
|
|
ln -s $vardir/log $out/log
|
|
|
|
ln -s $vardir/cache $out/cache
|
|
|
|
ln -s $vardir/backupArchives $out/backupArchives
|
2016-03-19 01:53:37 +01:00
|
|
|
ln -s $vardir/conf $out/conf
|
2014-09-26 16:33:17 +02:00
|
|
|
|
|
|
|
echo "JAVACOMMON=${jre}/bin/java" > $out/install.vars
|
|
|
|
echo "APP_BASENAME=CrashPlan" >> $out/install.vars
|
2016-03-19 01:53:37 +01:00
|
|
|
echo "TARGETDIR=${vardir}" >> $out/install.vars
|
2014-09-26 16:33:17 +02:00
|
|
|
echo "BINSDIR=$out/bin" >> $out/install.vars
|
|
|
|
echo "MANIFESTDIR=${manifestdir}" >> $out/install.vars
|
|
|
|
echo "VARDIR=${vardir}" >> $out/install.vars
|
|
|
|
echo "INITDIR=" >> $out/install.vars
|
|
|
|
echo "RUNLVLDIR=" >> $out/install.vars
|
|
|
|
echo "INSTALLDATE=" >> $out/install.vars
|
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
for f in $out/bin/CrashPlanDesktop $out/bin/CrashPlanEngine; do
|
|
|
|
echo "substitutions in $f"
|
|
|
|
substituteInPlace $f --replace /bin/ps ${procps}/bin/ps
|
|
|
|
substituteInPlace $f --replace awk ${gawk}/bin/awk
|
|
|
|
substituteInPlace $f --replace sed ${gnused}/bin/sed
|
|
|
|
substituteInPlace $f --replace grep ${gnugrep}/bin/grep
|
|
|
|
done
|
2014-12-19 23:25:19 +01:00
|
|
|
|
|
|
|
substituteInPlace $out/share/applications/CrashPlan.desktop \
|
|
|
|
--replace /usr/local $out \
|
2016-03-19 01:53:37 +01:00
|
|
|
--replace crashplan/skin skin \
|
|
|
|
--replace bin/CrashPlanDesktop CrashPlanDesktop
|
2014-09-26 16:33:17 +02:00
|
|
|
|
2016-05-11 16:11:45 +02:00
|
|
|
wrapProgram $out/bin/CrashPlanDesktop --prefix LD_LIBRARY_PATH ":" "${stdenv.lib.makeLibraryPath [ gtk2 glib libXtst ]}"
|
2014-09-26 16:33:17 +02:00
|
|
|
'';
|
|
|
|
}
|