Introduced a minimal version of RetroShare.

You can enable it in libretroshare.pro and RetroShare.pro by uncomment
CONFIG += minimal

This enables two new defines for stripping all not needed things
- libretroshare: MINIMAL_LIBRS
- GUI:           MINIMAL_RSGUI

and removes not needed files from build (see end of the files libretroshare.pro and RetroShare.pro).

Beware: All data of the stripped services are lost

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3414 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2010-08-31 20:00:49 +00:00
parent b6b5fa5cd6
commit 8832f7dfc5
10 changed files with 225 additions and 27 deletions

View file

@ -5,6 +5,15 @@ CONFIG += staticlib testnetwork bitdht
CONFIG -= qt
TARGET = retroshare
# Beware: All data of the stripped services are lost
#CONFIG += minimal
minimal {
CONFIG -= use_blogs bitdht
DEFINES += MINIMAL_LIBRS
}
profiling {
QMAKE_CXXFLAGS -= -fomit-frame-pointer
QMAKE_CXXFLAGS *= -pg -g -fno-omit-frame-pointer
@ -488,3 +497,25 @@ SOURCES += util/folderiterator.cc \
util/rsversion.cc \
util/rswin.cc \
util/rsrandom.cc
minimal {
SOURCES -= rsserver/p3msgs.cc \
rsserver/p3rank.cc \
rsserver/p3status.cc \
rsserver/p3photo.cc
SOURCES -= serialiser/rsforumitems.cc \
serialiser/rsstatusitems.cc \
serialiser/rsrankitems.cc \
serialiser/rschannelitems.cc \
serialiser/rsgameitems.cc \
serialiser/rsphotoitems.cc
SOURCES -= services/p3forums.cc \
services/p3msgservice.cc \
services/p3statusservice.cc \
services/p3ranking.cc \
services/p3channels.cc \
services/p3gamelauncher.cc \
services/p3photoservice.cc
}

View file

@ -169,7 +169,9 @@ void RsServer::ConfigFinalSave()
void RsServer::rsGlobalShutDown()
{
// TODO: cache should also clean up old files
#ifndef MINIMAL_LIBRS
mChannels->cleanUpOldFiles();
#endif // MINIMAL_LIBRS
ConfigFinalSave(); // save configuration before exit
mConnMgr->shutdown(); /* Handles UPnP */

View file

@ -41,7 +41,24 @@
RsServer::RsServer(RsIface &i, NotifyBase &callback)
:RsControl(i, callback)
{
return;
ftserver = NULL;
mConnMgr = NULL;
pqih = NULL;
/* services */
ad = NULL;
msgSrv = NULL;
chatSrv = NULL;
mStatusSrv = NULL;
mChannels = NULL;
/* caches (that need ticking) */
mRanking = NULL;
/* Config */
mConfigMgr = NULL;
mGeneralConfig = NULL;
}
RsServer::~RsServer()
@ -211,8 +228,10 @@ void RsServer::run()
/* Tick slow services */
#ifndef MINIMAL_LIBRS
if (mRanking)
mRanking->tick();
#endif // MINIMAL_LIBRS
#if 0
std::string opt;

View file

@ -2184,9 +2184,11 @@ int RsServer::StartupRetroShare()
/* create Services */
ad = new p3disc(mConnMgr, pqih);
#ifndef MINIMAL_LIBRS
msgSrv = new p3MsgService(mConnMgr);
chatSrv = new p3ChatService(mConnMgr);
mStatusSrv = new p3StatusService(mConnMgr);
#endif // MINIMAL_LIBRS
#ifndef PQI_DISABLE_TUNNEL
p3tunnel *tn = new p3tunnel(mConnMgr, pqih);
@ -2200,9 +2202,11 @@ int RsServer::StartupRetroShare()
ftserver->connectToTurtleRouter(tr) ;
pqih -> addService(ad);
#ifndef MINIMAL_LIBRS
pqih -> addService(msgSrv);
pqih -> addService(chatSrv);
pqih ->addService(mStatusSrv);
#endif // MINIMAL_LIBRS
/* create Cache Services */
std::string config_dir = RsInitConfig::configDir;
@ -2213,7 +2217,7 @@ int RsServer::StartupRetroShare()
std::string forumdir = config_dir + "/forums";
//mRanking = NULL;
#ifndef MINIMAL_LIBRS
mRanking = new p3Ranking(mConnMgr, RS_SERVICE_TYPE_RANK, /* declaration of cache enable service rank */
mCacheStrapper, mCacheTransfer,
localcachedir, remotecachedir, 3600 * 24 * 30 * 6); // 6 Months
@ -2259,6 +2263,7 @@ int RsServer::StartupRetroShare()
CachePair cp2(photoService, photoService, CacheId(RS_SERVICE_TYPE_PHOTO, 0));
mCacheStrapper -> addCachePair(cp2);
#endif
#endif // MINIMAL_LIBRS
/**************************************************************************/
@ -2273,8 +2278,10 @@ int RsServer::StartupRetroShare()
mConnMgr->addMonitor(pqih);
mConnMgr->addMonitor(mCacheStrapper);
mConnMgr->addMonitor(ad);
#ifndef MINIMAL_LIBRS
mConnMgr->addMonitor(msgSrv);
mConnMgr->addMonitor(mStatusSrv);
#endif // MINIMAL_LIBRS
/* must also add the controller as a Monitor...
* a little hack to get it to work.
@ -2292,18 +2299,20 @@ int RsServer::StartupRetroShare()
//mConfigMgr->addConfiguration("sslcerts.cfg", AuthSSL::getAuthSSL());
mConfigMgr->addConfiguration("peers.cfg", mConnMgr);
mConfigMgr->addConfiguration("general.cfg", mGeneralConfig);
mConfigMgr->addConfiguration("cache.cfg", mCacheStrapper);
#ifndef MINIMAL_LIBRS
mConfigMgr->addConfiguration("msgs.cfg", msgSrv);
mConfigMgr->addConfiguration("chat.cfg", chatSrv);
mConfigMgr->addConfiguration("cache.cfg", mCacheStrapper);
#ifdef RS_USE_BLOGS
mConfigMgr->addConfiguration("blogs.cfg", mBlogs);
#endif
mConfigMgr->addConfiguration("ranklink.cfg", mRanking);
mConfigMgr->addConfiguration("forums.cfg", mForums);
mConfigMgr->addConfiguration("channels.cfg", mChannels);
mConfigMgr->addConfiguration("p3Status.cfg", mStatusSrv);
#endif // MINIMAL_LIBRS
mConfigMgr->addConfiguration("turtle.cfg", tr);
mConfigMgr->addConfiguration("p3disc.cfg", ad);
mConfigMgr->addConfiguration("p3Status.cfg", mStatusSrv);
ftserver->addConfiguration(mConfigMgr);
@ -2432,9 +2441,10 @@ int RsServer::StartupRetroShare()
/* Setup GUI Interfaces. */
rsPeers = new p3Peers(mConnMgr);
rsMsgs = new p3Msgs(msgSrv, chatSrv);
rsDisc = new p3Discovery(ad);
#ifndef MINIMAL_LIBRS
rsMsgs = new p3Msgs(msgSrv, chatSrv);
rsForums = mForums;
rsChannels = mChannels;
rsRanks = new p3Rank(mRanking);
@ -2450,13 +2460,16 @@ int RsServer::StartupRetroShare()
rsGameLauncher = NULL;
rsPhoto = NULL;
#endif
#endif // MINIMAL_LIBRS
#ifndef MINIMAL_LIBRS
/* put a welcome message in! */
if (RsInitConfig::firsttime_run)
{
msgSrv->loadWelcomeMsg();
}
#endif // MINIMAL_LIBRS
// load up the help page
std::string helppage = RsInitConfig::basedir + RsInitConfig::dirSeperator;