1SUMMARY="A powerful, fast and reliable backup & sync tool"
2DESCRIPTION="An application that backs-up and/or synchronizes any directories \
3with the power of rsync. It is simple to use, fast (transfers over only \
4changes made and not all data), safe (keeps your data safe by checking all \
5declared directories before proceeding in any data manipulation), reliable and \
6fully customizable."
7COPYRIGHT="2008-2018 Loukas Avgeriou"
8LICENSE="GNU GPL v3"
9REVISION="2"
10HOMEPAGE="http://luckybackup.sourceforge.net"
11SOURCE_URI="https://downloads.sourceforge.net/luckybackup/luckybackup-$portVersion.tar.gz"
12CHECKSUM_SHA256="e801af2483cbdd62bc9af8e2ded252c51adbad81482e291042f58e21c3d4925b"
13PATCHES="luckybackup-$portVersion.patchset"
14ADDITIONAL_FILES="luckybackup.rdef.in"
15
16ARCHITECTURES="all !x86_gcc2"
17if [ "$targetArchitecture" = x86_gcc2 ]; then
18SECONDARY_ARCHITECTURES="x86"
19fi
20
21PROVIDES="
22	luckybackup$secondaryArchSuffix = $portVersion
23	app:LuckyBackup = $portVersion
24	"
25REQUIRES="
26	cmd:rsync
27	haiku$secondaryArchSuffix
28	lib:libGL$secondaryArchSuffix
29	lib:libQt5Core$secondaryArchSuffix
30	lib:libQt5Gui$secondaryArchSuffix
31	lib:libQt5Network$secondaryArchSuffix
32	lib:libQt5WebKit$secondaryArchSuffix
33	lib:libQt5Widgets$secondaryArchSuffix
34	lib:librsync$secondaryArchSuffix
35	lib:libssl$secondaryArchSuffix
36	lib:libz$secondaryArchSuffix
37	"
38
39BUILD_REQUIRES="
40	haiku${secondaryArchSuffix}_devel
41	devel:libGL$secondaryArchSuffix
42	devel:libQt5Core$secondaryArchSuffix
43	devel:libQt5Gui$secondaryArchSuffix
44	devel:libQt5Network$secondaryArchSuffix
45	devel:libQt5WebKit$secondaryArchSuffix
46	devel:libQt5Widgets$secondaryArchSuffix
47	devel:librsync$secondaryArchSuffix
48	devel:libssl$secondaryArchSuffix
49	devel:libz$secondaryArchSuffix
50	"
51BUILD_PREREQUIRES="
52	cmd:gcc$secondaryArchSuffix
53	cmd:ld$secondaryArchSuffix
54	cmd:make
55	cmd:pkg_config$secondaryArchSuffix
56	cmd:qmake$secondaryArchSuffix >= 5
57	"
58
59PATCH()
60{
61	sed -i \
62		-e "s|^\(documentation\.paff =\).*|\1 $docDir|" \
63		-e "s|^\(documentation\.path =\).*|\1 $dataDir/luckybackup|" \
64		-e "s|^\(translations\.path =\).*|\1 $dataDir/luckybackup|" \
65		-e "s|^\(manpage\.path =\).*|\1 $manDir/man8|" \
66		-e "s|^\(license\.path =\).*|\1 $dataDir/luckybackup|" \
67		luckybackup.pro
68}
69
70BUILD()
71{
72	qmake luckybackup.pro
73	make $jobArgs
74}
75
76INSTALL()
77{
78	make install
79	install -d "$appsDir"
80	install -T luckybackup "$appsDir"/LuckyBackup
81	gunzip "$manDir"/man8/luckybackup.8.gz
82	sed -i -e 's|~/\.luckyBackup/|~/config/settings/LuckyBackup/|' \
83		"$manDir"/man8/luckybackup.8
84
85	local APP_SIGNATURE="application/x-vnd.LuckyBackup"
86	local MAJOR="`echo "$portVersion" | cut -d. -f1`"
87	local MIDDLE="`echo "$portVersion" | cut -d. -f2`"
88	local MINOR="`echo "$portVersion" | cut -d. -f3`"
89	local LONG_INFO="$SUMMARY"
90	sed \
91		-e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \
92		-e "s|@MAJOR@|$MAJOR|" \
93		-e "s|@MIDDLE@|$MIDDLE|" \
94		-e "s|@MINOR@|$MINOR|" \
95		-e "s|@LONG_INFO@|$LONG_INFO|" \
96		"$portDir"/additional-files/luckybackup.rdef.in > luckybackup.rdef
97
98	addResourcesToBinaries luckybackup.rdef "$appsDir"/LuckyBackup
99	addAppDeskbarSymlink "$appsDir"/LuckyBackup
100}
101