crashplan: [new-package] an online/offline backup solution

+116
+37
pkgs/applications/backup/crashplan/CrashPlanEngine.patch
···
··· 1 + --- ./scripts/CrashPlanEngine 2014-02-19 23:17:19.000000000 +0000 2 + +++ ./scripts/CrashPlanEngine.1 2014-07-24 17:36:37.330333581 +0100 3 + @@ -11,7 +11,7 @@ 4 + 5 + cd $TARGETDIR 6 + 7 + - nice -n 19 $JAVACOMMON $SRV_JAVA_OPTS -classpath $FULL_CP com.backup42.service.CPService > $TARGETDIR/log/engine_output.log 2> $TARGETDIR/log/engine_error.log & 8 + + nice -n 19 $JAVACOMMON $SRV_JAVA_OPTS -classpath $FULL_CP com.backup42.service.CPService > $VARDIR/log/engine_output.log 2> $VARDIR/log/engine_error.log & 9 + 10 + if [[ $! -gt 0 ]]; then 11 + echo $! > $PIDFILE 12 + @@ -26,7 +26,7 @@ 13 + 14 + echo "Using Ubuntu 9.04 startup" 15 + 16 + - start-stop-daemon -v --pidfile $PIDFILE --make-pidfile --background --chdir $TARGETDIR --start --nicelevel 19 --exec $JAVACOMMON -- $SRV_JAVA_OPTS -classpath $FULL_CP com.backup42.service.CPService > $TARGETDIR/log/engine_output.log 2> $TARGETDIR/log/engine_error.log 17 + + start-stop-daemon -v --pidfile $PIDFILE --make-pidfile --background --chdir $TARGETDIR --start --nicelevel 19 --exec $JAVACOMMON -- $SRV_JAVA_OPTS -classpath $FULL_CP com.backup42.service.CPService > $VARDIR/log/engine_output.log 2> $VARDIR/log/engine_error.log 18 + 19 + # This test isn't as useful as one might like; start-stop-daemon can't accurately report the state of child processes when --background is used. 20 + # We use this mainly to report the specific error value returned by start-stop-daemon if something goes wrong, but be aware that a return value 21 + @@ -91,7 +91,6 @@ 22 + DESC="CrashPlan Engine" 23 + NAME=CrashPlanEngine 24 + DAEMON=$TARGETDIR/lib/com.backup42.desktop.jar 25 + -PIDFILE="$TARGETDIR/${NAME}.pid" 26 + 27 + if [[ -f $TARGETDIR/install.vars ]]; then 28 + . $TARGETDIR/install.vars 29 + @@ -100,6 +99,8 @@ 30 + exit 1 31 + fi 32 + 33 + +PIDFILE="$VARDIR/${NAME}.pid" 34 + + 35 + if [[ ! -f $DAEMON ]]; then 36 + echo "Could not find JAR file $DAEMON" 37 + exit 0
+77
pkgs/applications/backup/crashplan/default.nix
···
··· 1 + { stdenv, fetchurl, makeWrapper, jre, cpio, gawk, gnugrep, gnused, procps, swt, gtk2, glib, libXtst }: 2 + 3 + let version = "3.6.3"; 4 + 5 + in stdenv.mkDerivation rec { 6 + name = "crashplan-${version}"; 7 + 8 + crashPlanArchive = fetchurl { 9 + url = "http://download.crashplan.com/installs/linux/install/CrashPlan/CrashPlan_${version}_Linux.tgz"; 10 + sha256 = "0v01fzc62bxr6lpamnxg1nb7vh4a8ky6mahbq76kmjxfqv7q0mb0"; 11 + }; 12 + 13 + srcs = [ crashPlanArchive ]; 14 + 15 + meta = { 16 + description = "An online/offline backup solution"; 17 + homepage = "http://www.crashplan.org"; 18 + license = stdenv.lib.licenses.unfree; 19 + }; 20 + 21 + buildInputs = [ makeWrapper cpio ]; 22 + 23 + vardir = "/var/lib/crashplan"; 24 + 25 + manifestdir = "${vardir}/manifest"; 26 + 27 + patches = [ ./CrashPlanEngine.patch ]; 28 + 29 + installPhase = '' 30 + mkdir $out 31 + zcat -v CrashPlan_${version}.cpi | (cd $out; cpio -i -d -v --no-preserve-owner) 32 + 33 + # sed -i "s|<manifestPath>manifest</manifestPath>|<manifestPath>${manifestdir}</manifestPath>|g" $out/conf/default.service.xml 34 + 35 + # Fix for encoding troubles (CrashPlan ticket 178827) 36 + # Make sure the daemon is running using the same localization as 37 + # the (installing) user 38 + echo "" >> run.conf 39 + echo "export LC_ALL=en_US.UTF-8" >> run.conf 40 + 41 + install -d -m 755 unpacked $out 42 + 43 + install -D -m 644 EULA.txt $out/EULA.txt 44 + install -D -m 644 run.conf $out/bin/run.conf 45 + install -D -m 755 scripts/CrashPlanDesktop $out/bin/CrashPlanDesktop 46 + install -D -m 755 scripts/CrashPlanEngine $out/bin/CrashPlanEngine 47 + 48 + rm -r $out/log 49 + ln -s $vardir/log $out/log 50 + ln -s $vardir/cache $out/cache 51 + ln -s $vardir/backupArchives $out/backupArchives 52 + ln -s $vardir/conf/service.model $out/conf/service.model 53 + ln -s $vardir/conf/my.service.xml $out/conf/my.service.xml 54 + 55 + echo "JAVACOMMON=${jre}/bin/java" > $out/install.vars 56 + echo "APP_BASENAME=CrashPlan" >> $out/install.vars 57 + echo "TARGETDIR=$out" >> $out/install.vars 58 + echo "BINSDIR=$out/bin" >> $out/install.vars 59 + echo "MANIFESTDIR=${manifestdir}" >> $out/install.vars 60 + echo "VARDIR=${vardir}" >> $out/install.vars 61 + echo "INITDIR=" >> $out/install.vars 62 + echo "RUNLVLDIR=" >> $out/install.vars 63 + echo "INSTALLDATE=" >> $out/install.vars 64 + ''; 65 + 66 + postFixup = '' 67 + for f in $out/bin/CrashPlanDesktop $out/bin/CrashPlanEngine; do 68 + echo "substitutions in $f" 69 + substituteInPlace $f --replace /bin/ps ${procps}/bin/ps 70 + substituteInPlace $f --replace awk ${gawk}/bin/awk 71 + substituteInPlace $f --replace sed ${gnused}/bin/sed 72 + substituteInPlace $f --replace grep ${gnugrep}/bin/grep 73 + done 74 + 75 + wrapProgram $out/bin/CrashPlanDesktop --prefix LD_LIBRARY_PATH ":" "${gtk2}/lib:${glib}/lib:${libXtst}/lib" 76 + ''; 77 + }
+2
pkgs/top-level/all-packages.nix
··· 11625 11626 cups_pdf_filter = callPackage ../misc/cups/pdf-filter.nix { }; 11627 11628 gutenprint = callPackage ../misc/drivers/gutenprint { }; 11629 11630 gutenprintBin = callPackage ../misc/drivers/gutenprint/bin.nix { };
··· 11625 11626 cups_pdf_filter = callPackage ../misc/cups/pdf-filter.nix { }; 11627 11628 + crashplan = callPackage ../applications/backup/crashplan { }; 11629 + 11630 gutenprint = callPackage ../misc/drivers/gutenprint { }; 11631 11632 gutenprintBin = callPackage ../misc/drivers/gutenprint/bin.nix { };