forked from organicmaps/organicmaps
[linux][packaging] moved to /opt/
This commit is contained in:
parent
eb287847ed
commit
34b33ab275
6 changed files with 37 additions and 34 deletions
|
@ -126,9 +126,12 @@ unix|win32-g++ {
|
|||
QMAKE_CFLAGS_RELEASE *= -ffast-math
|
||||
QMAKE_CXXFLAGS_RELEASE *= -ffast-math
|
||||
|
||||
QMAKE_CFLAGS_RELEASE = -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security
|
||||
QMAKE_CXXFLAGS_RELEASE = -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security
|
||||
QMAKE_LFLAGS = -Wl,-z,relro
|
||||
# debian build requirements
|
||||
CONFIG(production) {
|
||||
QMAKE_CFLAGS_RELEASE = -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security
|
||||
QMAKE_CXXFLAGS_RELEASE = -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security
|
||||
QMAKE_LFLAGS = -Wl,-z,relro
|
||||
}
|
||||
}
|
||||
|
||||
linux-g++* {
|
||||
|
|
|
@ -152,7 +152,7 @@ win32* {
|
|||
SOURCES += opengl/opengl_es2.cpp
|
||||
} else {
|
||||
HEADERS +=
|
||||
if CONFIG(OMIM_OS_MAEMO) {
|
||||
CONFIG(OMIM_OS_MAEMO) {
|
||||
SOURCES += opengl/opengl_es2.cpp
|
||||
} else {
|
||||
SOURCES += opengl/opengl_ext.cpp
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
#include "platform.hpp"
|
||||
|
||||
#include "../base/logging.hpp"
|
||||
#include "../coding/file_reader.hpp"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include "../std/fstream.hpp"
|
||||
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
@ -30,8 +29,8 @@ Platform::Platform()
|
|||
string path;
|
||||
CHECK(GetBinaryFolder(path), ("Can't retrieve path to executable"));
|
||||
|
||||
string home;
|
||||
home = ::getenv("HOME");
|
||||
char const * homePath = ::getenv("HOME");
|
||||
string const home(homePath ? homePath : "");
|
||||
|
||||
m_settingsDir = home + "/.config/MapsWithMe/";
|
||||
|
||||
|
@ -46,37 +45,38 @@ Platform::Platform()
|
|||
mkdir((home + "/.local/share/").c_str(), 0755);
|
||||
mkdir(m_writableDir.c_str(), 0755);
|
||||
|
||||
char * resDir = ::getenv("MWM_RESOURCES_DIR");
|
||||
char const * resDir = ::getenv("MWM_RESOURCES_DIR");
|
||||
if (resDir)
|
||||
m_resourcesDir = resDir;
|
||||
else
|
||||
{
|
||||
// installed version
|
||||
if (IsFileExistsByFullPath("/usr/share/MapsWithMe/eula.html"))
|
||||
m_resourcesDir = "/usr/share/MapsWithMe";
|
||||
// developer builds with symlink
|
||||
if (IsFileExistsByFullPath(path + "../../data/eula.html")){
|
||||
m_resourcesDir = path + "../../data";
|
||||
m_writableDir = m_resourcesDir;
|
||||
}
|
||||
// developer builds without symlink
|
||||
if (IsFileExistsByFullPath(path + "../../../omim/data/eula.html"))
|
||||
else if (IsFileExistsByFullPath(path + "../../../omim/data/eula.html"))
|
||||
{
|
||||
m_resourcesDir = path + "../../../omim/data";
|
||||
m_writableDir = m_resourcesDir;
|
||||
}
|
||||
// portable installations
|
||||
// installed version - /opt/MapsWithMe
|
||||
else if (IsFileExistsByFullPath("/opt/MapsWithMe/share/eula.html"))
|
||||
m_resourcesDir = "/opt/MapsWithMe/share";
|
||||
// installed version
|
||||
else if (IsFileExistsByFullPath("/usr/share/MapsWithMe/eula.html"))
|
||||
m_resourcesDir = "/usr/share/MapsWithMe";
|
||||
// all-nearby installs
|
||||
else if (IsFileExistsByFullPath(path + "/eula.html"))
|
||||
{
|
||||
m_resourcesDir = path;
|
||||
m_writableDir = m_resourcesDir;
|
||||
m_settingsDir = m_resourcesDir;
|
||||
}
|
||||
}
|
||||
m_resourcesDir += '/';
|
||||
m_settingsDir += '/';
|
||||
|
||||
char * tmpDir = ::getenv("TMPDIR");
|
||||
char const * tmpDir = ::getenv("TMPDIR");
|
||||
if (tmpDir)
|
||||
m_tmpDir = tmpDir;
|
||||
else
|
||||
|
@ -87,7 +87,7 @@ Platform::Platform()
|
|||
LOG(LDEBUG, ("Writable directory:", m_writableDir));
|
||||
LOG(LDEBUG, ("Tmp directory:", m_tmpDir));
|
||||
LOG(LDEBUG, ("Settings directory:", m_settingsDir));
|
||||
LOG(LDEBUG, ("Client ID:", UniqueClientId()));
|
||||
LOG(LDEBUG, ("Client ID:", UniqueClientId()));
|
||||
}
|
||||
|
||||
int Platform::CpuCores() const
|
||||
|
@ -100,13 +100,12 @@ int Platform::CpuCores() const
|
|||
|
||||
string Platform::UniqueClientId() const
|
||||
{
|
||||
string machinefile = "/var/lib/dbus/machine-id";
|
||||
string machineFile = "/var/lib/dbus/machine-id";
|
||||
if (IsFileExistsByFullPath("/etc/machine-id"))
|
||||
machinefile = "/etc/machine-id";
|
||||
machineFile = "/etc/machine-id";
|
||||
|
||||
std::ifstream ifs(machinefile.c_str());
|
||||
string content( (std::istreambuf_iterator<char>(ifs) ),
|
||||
(std::istreambuf_iterator<char>() ) );
|
||||
string content;
|
||||
FileReader(machineFile).ReadAsString(content);
|
||||
|
||||
return content.substr(0,32);
|
||||
}
|
||||
|
|
17
qt/qt.pro
17
qt/qt.pro
|
@ -3,6 +3,7 @@ ROOT_DIR = ..
|
|||
DEPENDENCIES = map gui search storage indexer graphics platform anim geometry coding base \
|
||||
bzip2 freetype expat fribidi tomcrypt jansson protobuf zlib
|
||||
|
||||
|
||||
include($$ROOT_DIR/common.pri)
|
||||
|
||||
TARGET = MapsWithMe
|
||||
|
@ -23,23 +24,23 @@ win32*|linux* {
|
|||
|
||||
linux* {
|
||||
DEFINES += NO_DOWNLOADER
|
||||
isEmpty(PREFIX):PREFIX = /usr
|
||||
|
||||
isEmpty(PREFIX):PREFIX = /opt/MapsWithMe
|
||||
DEFINES += INSTALL_PREFIX=$$(PREFIX)
|
||||
BINDIR = $$PREFIX/bin
|
||||
|
||||
DATADIR = $$PREFIX/share
|
||||
RESDIR = $$DATADIR/$${TARGET}
|
||||
RESDIR = $$DATADIR
|
||||
|
||||
target.path = $$BINDIR
|
||||
desktop.path = $$DATADIR/applications/
|
||||
desktop.path = /usr/share/applications/
|
||||
desktop.files += res/$${TARGET}.desktop
|
||||
pixmaps.path = $$DATADIR/pixmaps/
|
||||
pixmaps.files += res/icons/128/$${TARGET}.png
|
||||
icon128.path = $$DATADIR/icons/hicolor/128x128/apps/
|
||||
icon128.files += res/icons/128/$${TARGET}.png
|
||||
|
||||
OTHER_RES.path = $$RESDIR
|
||||
OTHER_RES.files = ../data/about.html ../data/eula.html ../data/welcome.html \
|
||||
../data/countries.txt \
|
||||
../data/languages.txt ../data/categories.txt \
|
||||
../data/packed_polygons.bin
|
||||
../data/packed_polygons.bin res/logo.png
|
||||
CLASSIFICATOR_RES.path = $$RESDIR
|
||||
CLASSIFICATOR_RES.files = ../data/classificator.txt \
|
||||
../data/types.txt
|
||||
|
|
|
@ -4,9 +4,9 @@ Name=MapsWithMe
|
|||
Version=1.0
|
||||
GenericName=Detailed Offline Maps of the World
|
||||
GenericName[ru]=Подробная оффлайновая карта мира
|
||||
Icon=MapsWithMe
|
||||
TryExec=/usr/bin/MapsWithMe
|
||||
Exec=/usr/bin/MapsWithMe
|
||||
Icon=/opt/MapsWithMe/share/logo.png
|
||||
TryExec=/opt/MapsWithMe/bin/MapsWithMe
|
||||
Exec=/opt/MapsWithMe/bin/MapsWithMe
|
||||
Terminal=false
|
||||
StartupNotify=false
|
||||
Categories=Qt;Education;Science;Geography;Geoscience
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 17 KiB |
Loading…
Add table
Reference in a new issue