updated on Mon Jan 16 00:01:41 UTC 2012
[aur-mirror.git] / crashplan / PKGBUILD
blobf817fe5f3dd004c0fe413f38ca47aa5ffe3f02a1
1 # Maintainer: Bill Durr <billyburly [at] gmail [dot] com>
2 pkgname=crashplan  
3 pkgver=3.0.3
4 pkgrel=1 
5 pkgdesc="an online/offsite backup solution"
6 url="http://www.crashplan.com"
7 arch=('i686' 'x86_64')
8 license=('custom')
9 depends=('java-runtime')
10 makedepends=('grep' 'cpio' 'gzip')
11 backup=()
12 install=crashplan.install
13 source=(http://download.crashplan.com/installs/linux/install/CrashPlan/CrashPlan_${pkgver}_Linux.tgz
14         crashplan)
15 md5sums=('0260aafd45577be89281eb436aefce39'
16          '809855c6b043dfa4bada58e522fe61e5')
18 build() {
19   cd $srcdir/CrashPlan-install
21   echo ""
22   echo "You must review and agree to the EULA before installation."
23   echo ""
24   echo -n "Press enter to read the EULA. "
25   read ENTER
27   more EULA.txt
29   agreed=0
30   while [ "${agreed}" == "0" ] ; do
31     echo ""
32     echo -n "Do you accept and agree to be bound by the EULA? (yes/no) "
33     read reply
34     case ${reply} in
35       [yY] | [yY][eE][sS])
36         agreed=1
37         ;;
38       [nN] | [nN][oO])
39         echo "If you do not agree to the license then CrashPlan may not be installed. Exiting.";
40         exit 1
41         ;;
42     esac
43   done
45   echo "" > install.vars
46   echo "JAVACOMMON=$JAVA_HOME/bin/java" >> install.vars
47   echo "TARGETDIR=/opt/$pkgname" >> install.vars
48   echo "BINSDIR=" >> install.vars
49   echo "MANIFESTDIR=/opt/$pkgname/manifest" >> install.vars
50   echo "INITDIR=" >> install.vars
51   echo "RUNLVLDIR=" >> install.vars
52   NOW=`date +%Y%m%d`
53   echo "INSTALLDATE=$NOW" >> install.vars
54   cat .defaults >> install.vars
56   sed -imod "s|Exec=.*|Exec=/opt/$pkgname/bin/CrashPlanDesktop|" $srcdir/CrashPlan-install/scripts/CrashPlan.desktop
57   sed -imod "s|Icon=.*|Icon=/opt/$pkgname/skin/icon_app_64x64.png|" $srcdir/CrashPlan-install/scripts/CrashPlan.desktop
58   sed -imod "s|Categories=.*|Categories=System;|" $srcdir/CrashPlan-install/scripts/CrashPlan.desktop
61 package() {
62   mkdir -p $pkgdir/opt/$pkgname
63   cd $pkgdir/opt/$pkgname
64   
65   cat $srcdir/CrashPlan-install/CrashPlan_$pkgver.cpi | gzip -d -c - | cpio -i --no-preserve-owner
66   chmod 777 $pkgdir/opt/$pkgname/log
67   sed -i "s|<manifestPath>manifest</manifestPath>|<manifestPath>/opt/$pkgname/manifest</manifestPath>|g" $pkgdir/opt/$pkgname/conf/default.service.xml
69   mkdir -p $pkgdir/usr/bin
70   ln -s "/opt/$pkgname/bin/CrashPlanDesktop" $pkgdir/usr/bin/CrashPlanDesktop
72   install -D -m 644 $srcdir/CrashPlan-install/install.vars $pkgdir/opt/$pkgname/install.vars  
73   install -D -m 644 $srcdir/CrashPlan-install/EULA.txt $pkgdir/opt/$pkgname/EULA.txt
74   install -D -m 644 $srcdir/CrashPlan-install/EULA.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
75   install -D -m 755 $srcdir/CrashPlan-install/scripts/CrashPlanDesktop $pkgdir/opt/$pkgname/bin/CrashPlanDesktop
76   install -D -m 644 $srcdir/CrashPlan-install/scripts/run.conf $pkgdir/opt/$pkgname/bin/run.conf
77   install -D -m 755 $srcdir/CrashPlan-install/scripts/CrashPlanEngine $pkgdir/opt/$pkgname/bin/CrashPlanEngine
78   install -D -m 755 $srcdir/CrashPlan-install/scripts/CrashPlan.desktop $pkgdir/usr/share/applications/crashplan.desktop
80   install -D -m 755 $srcdir/crashplan $pkgdir/etc/rc.d/crashplan