summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8285a828dc4d6c3a335be1efcf5fb5099c1de62b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# Maintainer: Justin dray <justin@dray.be>
# Contributor: Egon Geerardyn <egon [dot] geerardyn [at] gmail [dot] com>
# Contributor: Bill Durr <billyburly [at] gmail [dot] com>
pkgname=crashplan
pkgver=4.8.4
pkgrel=1
pkgdesc="An online/offsite backup solution"
url="http://www.crashplan.com"
arch=('i686' 'x86_64')
license=('custom')
depends=('bash' 'java-runtime-headless>=8')
makedepends=('cpio')
optdepends=('java-runtime>=8: For Crashplan GUI'
            'gtk2: For Crashplan GUI'
            'webkitgtk: For Crashplan GUI')
backup=('opt/crashplan/bin/run.conf')
install=crashplan.install
source=("https://download.code42.com/installs/linux/install/CrashPlan/CrashPlan_${pkgver}_Linux.tgz"
	'https://raw.githubusercontent.com/pdemonaco/init/master/crashplan/crashplan'
	'crashplan.service'
	'install.vars'
	'sysctl-crashplan.conf')
sha256sums=('6634f3c0669a6a77d1b53fcfcbe64f4cc84130556554d4257ca3ba482449f7bc'
            '259d38afa8fc34246ac0ecfeefc701d47501c552eb0ffcd1bd4b8e9a2751c3c8'
            'a2b4d4469847721f8e68970fb55a2c78655441e124ad8db151e047ff6a592416'
            'c6dc626a180671d6b01f46f22158857c3fa86cd3eec79e3388284a2ab2682617'
            '2ec3d9cea180e92f1410ff89ece85c01f79d454cfc2e814f583c0e2b3ff8ce30')

build() {
	sed -i "s|Exec=.*|Exec=/opt/$pkgname/bin/CrashPlanDesktop|" "$srcdir/crashplan-install/scripts/CrashPlan.desktop"
	sed -i "s|Icon=.*|Icon=crashplan|" "$srcdir/crashplan-install/scripts/CrashPlan.desktop"
	sed -i "s|Categories=.*|Categories=System;|" "$srcdir/crashplan-install/scripts/CrashPlan.desktop"

	# Fix for encoding troubles (CrashPlan ticket 178827)
	# Make sure the daemon is running using a sane locale
	echo "" >> "$srcdir/crashplan-install/scripts/run.conf"
	echo "LC_ALL=${LANG-en_US.utf8}" >> "$srcdir/crashplan-install/scripts/run.conf"

	# Fix for GUI crashing with libsoup errors
	sed -i '/GUI_JAVA_OPTS/s/"$/ -Dorg.eclipse.swt.browser.DefaultType=mozilla"/' "$srcdir/crashplan-install/scripts/run.conf"
}

package() {
	mkdir -p "$pkgdir/opt/$pkgname"
	cd "$pkgdir/opt/$pkgname"

	zcat "$srcdir/crashplan-install/CrashPlan_${pkgver}.cpi" | cpio -i --no-preserve-owner

	chmod -R g-w "$pkgdir/opt/$pkgname"

	# All users need write permissions or the GUI will fail to open
	chmod 777 "$pkgdir/opt/$pkgname/log"
	sed -i "s|<manifestPath>manifest</manifestPath>|<manifestPath>/opt/$pkgname/manifest</manifestPath>|g" "$pkgdir/opt/$pkgname/conf/default.service.xml"

	# Fix for 32 bit: 64 bit libs cannot be stripped from symbols
	# so we just remove those libs
	if [ "$CARCH" = "i686" ]; then
		rm "$pkgdir/opt/$pkgname/"*64.so
	fi

	# Use systemctl start/stop commands when it attempts to auto-update
	sed -i 's/^$ENGINE_SCRIPT stop.*/systemctl stop crashplan >> $logfile 2>\&1/g' "$pkgdir/opt/crashplan/bin/restartLinux.sh"
	sed -i 's/^$ENGINE_SCRIPT start.*/systemctl start crashplan >> $logfile 2>\&1/g' "$pkgdir/opt/crashplan/bin/restartLinux.sh"

	for size in 16x16 32x32 64x64 128x128
	do
		install -Dm 644 "$pkgdir/opt/$pkgname/skin/icon_app_${size}.png" "$pkgdir/usr/share/icons/hicolor/${size}/apps/crashplan.png"
	done

	install -dm 755 "$pkgdir/usr/bin"
	ln -s "/opt/$pkgname/bin/CrashPlanDesktop" "$pkgdir/usr/bin/CrashPlanDesktop"
	install -dm 755 "$pkgdir/etc/init.d"
	install -Dm 644 "$srcdir/crashplan" "$pkgdir/etc/init.d/crashplan"
	install -Dm 644 "$srcdir/sysctl-crashplan.conf" "$pkgdir/etc/sysctl.d/99-crashplan.conf"
	install -Dm 644 "$srcdir/crashplan.service" "$pkgdir/usr/lib/systemd/system/crashplan.service"
	install -Dm 644 "$srcdir/install.vars" "$pkgdir/opt/$pkgname/install.vars"
	install -Dm 755 "$srcdir/crashplan-install/scripts/CrashPlanDesktop" "$pkgdir/opt/$pkgname/bin/CrashPlanDesktop"
	install -Dm 644 "$srcdir/crashplan-install/scripts/run.conf" "$pkgdir/opt/$pkgname/bin/run.conf"
	install -Dm 755 "$srcdir/crashplan-install/scripts/CrashPlanEngine" "$pkgdir/opt/$pkgname/bin/CrashPlanEngine"
	install -Dm 755 "$srcdir/crashplan-install/scripts/CrashPlan.desktop" "$pkgdir/usr/share/applications/crashplan.desktop"
}