Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Luckybackup, new recipe #3183

Merged
merged 61 commits into from Oct 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
8ac8c62
Merge pull request #1 from haikuports/master
mazbrili Sep 25, 2018
a64d58a
Create luckybackup-0.4.9.recipe
mazbrili Sep 27, 2018
183aa98
Merge pull request #2 from haikuports/master
mazbrili Sep 28, 2018
20a230e
Merge pull request #3 from haikuports/master
mazbrili Sep 29, 2018
be21a47
Merge pull request #4 from haikuports/master
mazbrili Oct 2, 2018
bee0978
Merge pull request #5 from mazbrili/master
mazbrili Oct 2, 2018
9339e68
Update luckybackup-0.4.9.recipe
mazbrili Oct 2, 2018
9337421
Update luckybackup-0.4.9.recipe
mazbrili Oct 2, 2018
5851498
Create luckybackup.rdef.in
mazbrili Oct 2, 2018
75f2c14
Update luckybackup-0.4.9.recipe
mazbrili Oct 2, 2018
22b56ff
Update luckybackup-0.4.9.recipe
mazbrili Oct 2, 2018
45891d3
Update luckybackup-0.4.9.recipe
mazbrili Oct 2, 2018
e5e4453
Update luckybackup-0.4.9.recipe
mazbrili Oct 3, 2018
da5a621
Update luckybackup-0.4.9.recipe
mazbrili Oct 3, 2018
5cba9dd
Update luckybackup-0.4.9.recipe
mazbrili Oct 3, 2018
bbe6549
Update luckybackup-0.4.9.recipe
mazbrili Oct 3, 2018
82b1509
Update luckybackup-0.4.9.recipe
mazbrili Oct 3, 2018
7a32561
Update luckybackup-0.4.9.recipe
mazbrili Oct 3, 2018
87d2dae
Update luckybackup.rdef.in
mazbrili Oct 3, 2018
ecedbcb
Update luckybackup-0.4.9.recipe
mazbrili Oct 3, 2018
7452f5c
Update luckybackup-0.4.9.recipe
mazbrili Oct 4, 2018
2f91957
Update luckybackup-0.4.9.recipe
mazbrili Oct 4, 2018
b325d46
Update luckybackup-0.4.9.recipe
mazbrili Oct 4, 2018
098f6b1
Update luckybackup-0.4.9.recipe
mazbrili Oct 4, 2018
091fd49
Update luckybackup-0.4.9.recipe
mazbrili Oct 4, 2018
9a7c49c
Update luckybackup-0.4.9.recipe
mazbrili Oct 4, 2018
6020b8c
Update luckybackup-0.4.9.recipe
mazbrili Oct 4, 2018
9f998fd
Update luckybackup-0.4.9.recipe
mazbrili Oct 4, 2018
19ce708
Update luckybackup-0.4.9.recipe
mazbrili Oct 4, 2018
112362e
Update luckybackup-0.4.9.recipe
mazbrili Oct 4, 2018
5907c98
Update luckybackup-0.4.9.recipe
mazbrili Oct 4, 2018
9ced35b
Update luckybackup-0.4.9.recipe
mazbrili Oct 4, 2018
4243ab5
Update luckybackup-0.4.9.recipe
mazbrili Oct 4, 2018
06e713a
Update luckybackup-0.4.9.recipe
mazbrili Oct 4, 2018
d0a22a7
Update luckybackup-0.4.9.recipe
mazbrili Oct 4, 2018
c010553
Update luckybackup-0.4.9.recipe
mazbrili Oct 4, 2018
3416276
Update luckybackup-0.4.9.recipe
mazbrili Oct 4, 2018
b80dbc4
Update luckybackup-0.4.9.recipe
mazbrili Oct 4, 2018
258de93
Update luckybackup-0.4.9.recipe
mazbrili Oct 4, 2018
9644cf3
Update luckybackup-0.4.9.recipe
mazbrili Oct 4, 2018
86773a6
Update luckybackup-0.4.9.recipe
mazbrili Oct 4, 2018
ab40e08
Update luckybackup-0.4.9.recipe
mazbrili Oct 4, 2018
a2bcd33
Update luckybackup-0.4.9.recipe
mazbrili Oct 4, 2018
332c080
Update luckybackup-0.4.9.recipe
mazbrili Oct 4, 2018
6bb682a
Update luckybackup-0.4.9.recipe
mazbrili Oct 4, 2018
e2aff5d
Update luckybackup-0.4.9.recipe
mazbrili Oct 4, 2018
52e2688
Update luckybackup-0.4.9.recipe
mazbrili Oct 4, 2018
7061673
Update luckybackup-0.4.9.recipe
mazbrili Oct 4, 2018
cd43d17
Update luckybackup-0.4.9.recipe
mazbrili Oct 4, 2018
7c3c6af
Update luckybackup-0.4.9.recipe
mazbrili Oct 4, 2018
9b4020d
Update luckybackup-0.4.9.recipe
mazbrili Oct 5, 2018
6f1c39c
Update luckybackup-0.4.9.recipe
mazbrili Oct 5, 2018
f8044a3
Update luckybackup-0.4.9.recipe
mazbrili Oct 5, 2018
895ac42
Update luckybackup-0.4.9.recipe
mazbrili Oct 5, 2018
e64910d
Update luckybackup-0.4.9.recipe
mazbrili Oct 5, 2018
a0da9b4
Update luckybackup-0.4.9.recipe
mazbrili Oct 5, 2018
932c999
Update luckybackup.rdef.in
mazbrili Oct 5, 2018
735a43e
Add files via upload
mazbrili Oct 17, 2018
a2f42a8
Update luckybackup-0.4.9.recipe
mazbrili Oct 17, 2018
7eb23b5
LuckyBackup: polish patchset a little
fbrosson Oct 17, 2018
e7f7514
LuckyBackup: change layout, hardcode paths.
fbrosson Oct 17, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
36 changes: 36 additions & 0 deletions app-backup/luckybackup/additional-files/luckybackup.rdef.in
@@ -0,0 +1,36 @@

resource app_flags B_MULTIPLE_LAUNCH;

resource app_version {
major = @MAJOR@,
middle = @MIDDLE@,
minor = @MINOR@,

variety = B_APPV_FINAL,
internal = 0,
short_info = "LuckyBackup",
long_info = "@LONG_INFO@"
};

resource app_signature "@APP_SIGNATURE@";

resource file_types message {
"types" = "application/x-bak"
};

resource vector_icon {
$"6E636966080500040071020006043D88273D8827BED4133ED4134B1000C6104F"
$"411942E78597C3FFE1032288FF203BAC020006033B9EE13B9EE1BB9EE13B9EE1"
$"47C3854A3E7A0097C3FF3FE3ECFFFF3369FF020006023C3D533CC875BF1DC53E"
$"81FA4B2B164702C13A33A2FFD43369FF050005FF05FF050604EB4B2B512E4B2B"
$"524C49545D495D495C45020A524C5250524C5242524252BC5E4228C482B82BBE"
$"10B4F1BA33B62736262E2AB6CFB8BEB6CFB8BEB5EAB98F26BC8E26BADB26BC8E"
$"253D253D254031402E45BCE0BA943C3FBBCBBCACC084C20740493F48C3F9C78F"
$"0607FF3E524C5250524C5242524252BC5E4228C482B82BBE10B4F1BA33B62736"
$"262E2AB6CFB8BE3E3CBDE8BE5EBFFFBDF14A504A50534D0206382E382EC045BA"
$"6EC3B448C353BEF1C3B2BEC23A2CC151B9C33A2C3A2C3A2CBAAEB66FB71EB87E"
$"B85AB6D1B86EB788382EBA61B77B382E0209382E382EB89AB69726BC8E26B85F"
$"26BC8E253D253D25403042B809C16BBAECBF89343CBA36BFAB36383F443E3EBF"
$"CFC418474EC15CC5214D4FC3BE4AC3BE4A4ABF8E382EC085BA8F382E060A0101"
$"00000A0001011001178400040A020102000A040104000A030103000A070000"
};
99 changes: 99 additions & 0 deletions app-backup/luckybackup/luckybackup-0.4.9.recipe
@@ -0,0 +1,99 @@
SUMMARY="A powerful, fast and reliable backup & sync tool"
DESCRIPTION="An application that backs-up and/or synchronizes any directories \
with the power of rsync. It is simple to use, fast (transfers over only \
changes made and not all data), safe (keeps your data safe by checking all \
declared directories before proceeding in any data manipulation), reliable and \
fully customizable."
COPYRIGHT="2008-2017 Loukas Avgeriou"
LICENSE="GNU GPL v3"
REVISION="1"
HOMEPAGE="http://luckybackup.sourceforge.net"
SOURCE_URI="https://downloads.sourceforge.net/luckybackup/luckybackup-$portVersion.tar.gz"
CHECKSUM_SHA256="c161e98a11de5ad0a32a8e060e3fd45695a93ea3adf0581764a6b5d32e8da23b"
PATCHES="luckybackup-$portVersion.patchset"
ADDITIONAL_FILES="luckybackup.rdef.in"

ARCHITECTURES="!x86_gcc2 x86 x86_64"
if [ "$targetArchitecture" = x86_gcc2 ]; then
SECONDARY_ARCHITECTURES="x86"
fi

Begasus marked this conversation as resolved.
Show resolved Hide resolved
mazbrili marked this conversation as resolved.
Show resolved Hide resolved
PROVIDES="
luckybackup$secondaryArchSuffix = $portVersion
app:LuckyBackup = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
Begasus marked this conversation as resolved.
Show resolved Hide resolved
lib:libGL$secondaryArchSuffix
lib:libQt5Core$secondaryArchSuffix
lib:libQt5Gui$secondaryArchSuffix
lib:libQt5Network$secondaryArchSuffix
lib:libQt5WebKit$secondaryArchSuffix
lib:libQt5Widgets$secondaryArchSuffix
lib:librsync$secondaryArchSuffix
lib:libssl$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"

BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libGL$secondaryArchSuffix
devel:libQt5Core$secondaryArchSuffix
devel:libQt5Gui$secondaryArchSuffix
devel:libQt5Network$secondaryArchSuffix
devel:libQt5WebKit$secondaryArchSuffix
devel:libQt5Widgets$secondaryArchSuffix
devel:librsync$secondaryArchSuffix
devel:libssl$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:make
cmd:pkg_config$secondaryArchSuffix
cmd:qmake$secondaryArchSuffix >= 5
"

PATCH()
{
sed -i \
-e "s|^\(documentation\.paff =\).*|\1 $docDir|" \
-e "s|^\(documentation\.path =\).*|\1 $dataDir/luckybackup|" \
-e "s|^\(translations\.path =\).*|\1 $dataDir/luckybackup|" \
-e "s|^\(manpage\.path =\).*|\1 $manDir/man8|" \
-e "s|^\(license\.path =\).*|\1 $dataDir/luckybackup|" \
luckybackup.pro
}

BUILD()
{
qmake luckybackup.pro
make $jobArgs
}

INSTALL()
{
make install
install -d "$appsDir"
install -T luckybackup "$appsDir"/LuckyBackup
gunzip "$manDir"/man8/luckybackup.8.gz
sed -i -e 's|~/\.luckyBackup/|~/config/settings/LuckyBackup/|' \
"$manDir"/man8/luckybackup.8

local APP_SIGNATURE="application/x-vnd.LuckyBackup"
local MAJOR="`echo "$portVersion" | cut -d. -f1`"
local MIDDLE="`echo "$portVersion" | cut -d. -f2`"
local MINOR="`echo "$portVersion" | cut -d. -f3`"
local LONG_INFO="$SUMMARY"
sed \
-e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \
-e "s|@MAJOR@|$MAJOR|" \
-e "s|@MIDDLE@|$MIDDLE|" \
-e "s|@MINOR@|$MINOR|" \
-e "s|@LONG_INFO@|$LONG_INFO|" \
"$portDir"/additional-files/luckybackup.rdef.in > luckybackup.rdef

addResourcesToBinaries luckybackup.rdef "$appsDir"/LuckyBackup
addAppDeskbarSymlink "$appsDir"/LuckyBackup
}
84 changes: 84 additions & 0 deletions app-backup/luckybackup/patches/luckybackup-0.4.9.patchset
@@ -0,0 +1,84 @@
From ab3fd8dfc57e6240ffcba7605a6c9602125b00cb Mon Sep 17 00:00:00 2001
From: mazbrili <mazbrili@yahoo.com>
Date: Fri, 5 Oct 2018 09:28:19 +0700
Subject: set current dir to application dir


diff --git a/src/main.cpp b/src/main.cpp
index 935603e..4f66bba 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -33,6 +33,9 @@

#include <QApplication>
#include <QTranslator>
+#ifdef Q_OS_HAIKU
+#include <QDir>
+#endif

#include "luckybackupwindow.h"
#include "global.h"
@@ -52,6 +55,10 @@ int main(int argc, char *argv[])
{
QScopedPointer<QCoreApplication> app(createApplication(argc, argv));

+#ifdef Q_OS_HAIKU
+ QDir::setCurrent(QCoreApplication::applicationDirPath());
+#endif
+
//arguments test
if (!argumentsTest(argc,argv))
return 1; // error code1: something wrong with the command arguments - app fail to start (or just --help or --version given as args)
--
2.19.0


From 8ea9eea609a179dfe67852cfab86250d10142f83 Mon Sep 17 00:00:00 2001
From: fbrosson <fbrosson@localhost>
Date: Wed, 17 Oct 2018 14:23:21 +0000
Subject: hardcode paths for Haiku


diff --git a/src/global.cpp b/src/global.cpp
index 1efe3ed..3e0cb0f 100644
--- a/src/global.cpp
+++ b/src/global.cpp
@@ -52,8 +52,8 @@ QString appVersionString = "0.4.9";
double const validProfileVersion = 0.21;
double const validScheduleVersion = 0.34;
double const validSettingsVersion = 0.3;
-QString luckyBackupDir = myHome + "/."+appName+"/";
-QString luckyBackupDefaultDir = myHome + "/."+appName+"/";
+QString luckyBackupDir = myHome + "/config/settings/LuckyBackup/";
+QString luckyBackupDefaultDir = myHome + "/config/settings/LuckyBackup/";
mazbrili marked this conversation as resolved.
Show resolved Hide resolved
QString settingsFile = luckyBackupDir + "settings.ini";
QString profileDir = luckyBackupDir + "profiles/";
QString defaultProfile = profileDir + "default.profile";
@@ -71,18 +71,18 @@ QString snapChangesString = "[changed_data]%i[LB]%n";
QString scheduleDir = luckyBackupDir + "schedule/";
QString schedulefilename = scheduleDir + "schedule.dat";
QString cronfilename = scheduleDir + "luckyCron.txt";
-QString relativeTransDir = "translations/";
-QString systemTransDir = "/usr/share/luckybackup/translations/";
+QString relativeTransDir = "../data/luckybackup/translations/";
+QString systemTransDir = "/boot/system/data/luckybackup/translations/";
QDir transDir;
QTranslator appTranslator;
QTranslator translator_qt;
QString locale = QLocale::system().name();
-QString relativeLicense = "license/gpl.html";
-QString systemLicense = "/usr/share/doc/luckybackup/license/gpl.html";
+QString relativeLicense = "../data/luckybackup/license/gpl.html";
+QString systemLicense = "/boot/system/data/luckybackup/license/gpl.html";
QString suseLicense = "/usr/share/doc/packages/luckybackup/license/gpl.html";
QString debianLicense = "/usr/share/common-licenses/GPL-3";
-QString relativeManual = "manual/index.html";
-QString systemManual = "/usr/share/doc/luckybackup/manual/index.html";
+QString relativeManual = "../data/luckybackup/manual/index.html";
+QString systemManual = "/boot/system/data/luckybackup/manual/index.html";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fbrosson

Are there any reasons why these can't be changed into @Template@ which then you can sed in the recipe?

I'm a bit concerned about the "relative" paths, what exactly are they relative to? As seen last time, they might be relative to the current working dir, which may causes unintended content injection. I'd like to get rid of these relative paths instead.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we could use patterns and have INSTALL replace them with sed commands, but since this recipe will sooner or later get a much nicer patch using find_directory(), I thought that a few extra hard-coded paths were OK for now. (Adding a sed command that would probably go away during GCI 2018 would have been worse, imho, than using hard-coded paths, but I'm ok with anyone willing to rework this :)

Regarding the relative paths, I believe they are relative to /boot/system/apps/ because that's where the app "changes dir" at start-up (thanks to @mazbrili's patch.)
Regarding the unintended risk of injection, although I did not review the code to see if the app changes dir later, I'm confident that it does not, so the users are probably safe here. BTW, if the app did change dir after start-up to any directory other than that of argv[0] then all the relative paths present in global.cpp would be unusable. That's why I believe the app does not change dir.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All apps will have to tolerate relative paths eventually, as they can get installed in HOME as well as /system/.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really, /package/name-version/.self/ stay the same regardless of installation location. Also, there's find_path if you want the fancy /boot/{home,system} paths.

QString suseManual = "/usr/share/doc/packages/luckybackup/manual/index.html";

QString countStr;
--
2.19.1