I have made the following changes intended for : CE:UX:MTF / timed Please review and accept ASAP - BOSS has already processed this request and suggests ??? See the "Messages from BOSS" section below
https://build.pub.meego.com/request/show/2651 Thank You, bossbot ([email protected]) [This message was auto-generated] --- Request # 2651: Messages from BOSS: None State: new 2011-10-24T17:22:16 bossbot Reviews: from bossbot :BOSS suggests accepting this review. See email for more details. BOSS accepted this review because: Target repo CE_UX_MTF_armv7hl found. accepted on No date Changes: submit: Project:MTF / timed -> CE:UX:MTF / timed Index: timed-2.27-typofix.patch =================================================================== --- timed-2.27-typofix.patch (revision 0) +++ timed-2.27-typofix.patch (revision 2) @@ -0,0 +1,13 @@ +diff --git a/src/server/timed.cpp b/src/server/timed.cpp +index 601a394..def3319 100644 +--- a/src/server/timed.cpp ++++ b/src/server/timed.cpp +@@ -170,7 +170,7 @@ void Timed::init_scratchbox_mode() + scratchbox_mode = path && strstr(path, "scratchbox") ; // XXX: more robust sb detection? + log_info("%s" "SCRATCHBOX detected", scratchbox_mode ? "" : "no ") ; + #else +- scratcbox_mode = false ; ++ scratchbox_mode = false ; + #endif + } + Index: timed.conf =================================================================== --- timed.conf (revision 0) +++ timed.conf (revision 2) @@ -0,0 +1,14 @@ +<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" + "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> +<busconfig> + + <policy user="root"> + <allow own="com.nokia.time"/> + <allow own="com.nokia.timed.backup"/> + </policy> + + <policy context="default"> + <allow send_destination="com.nokia.time"/> + </policy> + +</busconfig> Index: timed.changes =================================================================== --- timed.changes (revision 0) +++ timed.changes (revision 2) @@ -0,0 +1,92 @@ +* Fri Sep 30 2011 Marko Saukko <[email protected]> - 2.53 +- Removed some documentation deps. + +* Fri Sep 16 2011 Marko Saukko <[email protected]> - 2.53 +- Updated to version 2.53 and removed upstreamed patches. +- Added .yaml and converted to spectacle +- Added .service file for systemd startup +- Disabled DSME as it is not available in the MeeGo anymore. +- Lower timed server loglevel from full to warning + +* Wed May 18 2011 Mika Laitio <[email protected]> - 2.37-5 +- Update date to be more present if year is older than 2011 + on first boot. (BCM#17566) + +* Thu Apr 21 2011 Tapio Rantala <[email protected]> - 2.37-4 +- Don't build files that are in tzdata-timed nowadays + +* Tue Apr 12 2011 Tapio Rantala <[email protected]> - 2.37-3 +- Requires proper tzdata package: tzdata-timed (BMC#12919) + +* Fri Apr 01 2011 Tapio Rantala <[email protected]> - 2.37-2 +- Do not package files that conflict with tzdata-timed (BMC#15652) + +* Fri Mar 04 2011 Tapio Rantala <[email protected]> - 2.37-1 +- New upstream version (FEA#5513) +- Add cellular-separation patch, fix incomplete defines +- Add compiler-fix patch, fix "cannot call constructor directly" +- Add uid-creds patch, uid credentials support (BMC#14696) +- Drop add-missing-if patch, upstream implementation changed +- Drop libcreds3-meego patch +- Refresh patches + +* Mon Jan 31 2011 Ryan Ware <[email protected]> - 2.35 +- Emergency fix to work around change to libcreds3 +- Essentially removes references to creds_add() and creds_set() for MeeGo builds +- Timed developers need to adjust calls to libcreds to libcreds3 api's. +- Timed developers need to remove all references to "aegis". + +* Wed Jan 26 2011 Tapio Rantala <[email protected]> - 2.35-2 +- Drop init script, part of fix for (BMC#12898) + +* Mon Jan 24 2011 Tapio Rantala <[email protected]> - 2.35-1 +- New upstream version (BMC#11834) + +* Thu Dec 30 2010 Tapio Rantala <[email protected]> - 2.32-1 +- New upstream version (BMC#11834) + +* Tue Dec 21 2010 Tapio Rantala <[email protected]> - 2.31-1 +- New upstream version +- Conforms to upstream version 2.31-a +- Add add-missing-if patch +- Drop create-pc-file patch, .pc provided upstream +- Drop uniform-versioning patch, not needed by pc file generation anymore + +* Fri Nov 26 2010 Tapio Rantala <[email protected]> - 2.27-1 +- New upstream version (BMC#10592) +- Add subsys support to init file +- Add enable-creds patch to enable credentials handling +- Add debugflag-fix patch to allow debug mode +- Add uniform-versioning patch so that source version equals library version +- Add typofix patch to allow compilation due to a typo +- Drop libs-includes-fix patch, fixed upstream +- Drop disable-device-modes patch, it's now configurable +- Fix timed not detaching + +* Fri Oct 01 2010 Tapio Rantala <[email protected]> - 2.16-1 +- New upstream version + +* Fri Sep 17 2010 Tapio Rantala <[email protected]> - 2.11-5 +- Run as root, not as user (BMC#6230) + Add run-as-system-service.patch + Remove desktop autostart file and d-bus service file + Add init script + Add dbus conf file + +* Wed Sep 08 2010 Tapio Rantala <[email protected]> - 2.11-4 +- Don't care about files in /tmp + Add disable-device-modes.patch, remove state-fix.patch + +* Tue Sep 07 2010 Tapio Rantala <[email protected]> - 2.11-3 +- Add desktop autostart file and d-bus service file (BMC#6174) + +* Fri Sep 03 2010 Tapio Rantala <[email protected]> - 2.11-2 +- Create runtime data dir +- Do not require state file + +* Tue Aug 31 2010 Tapio Rantala <[email protected]> - 2.11-1 +- New upstream version +- Create pkg-config file + +* Mon Aug 23 2010 Tapio Rantala <[email protected]> - 2.10-1 +- Initial meego packaging Index: timed.yaml =================================================================== --- timed.yaml (revision 0) +++ timed.yaml (revision 2) @@ -0,0 +1,70 @@ +Name: timed +Summary: Time daemon +Version: 2.53 +Release: 1 +Group: System/System Control +License: LGPLv2 +URL: http://meego.gitorious.org/meego-middleware/timed +Sources: + - "%{name}-%{version}.tar.bz2" + - "%{name}.conf" + - "%{name}.service" +Patches: + - "%{name}-2.11-run-as-system-service.patch" + - "%{name}-2.27-debugflag-fix.patch" + - "%{name}-2.27-typofix.patch" + - "%{name}-2.37-cellular-separation.patch" + - "%{name}-2.37-uid-creds.patch" + - "%{name}-2.53-BMC17566-update-old-date-on-first-boot.patch" + - "%{name}-2.53-no-werror.patch" + - "%{name}-2.53-disable-dsme.patch" + - "lower-server-loglevel.patch" + - "%{name}-2.53-no-docs.patch" +Description: | + The time daemon (%{name}) managing system time, time zone and settings, + executing actions at given time and managing the event queue. + +Requires: + - tzdata + - tzdata-timed +PkgBR: +# - asciidoc +# - dblatex +# - docbook-style-xsl +# - graphviz + - libiodata-devel >= 0.17 + - libqmlog-devel >= 0.10 + - libxslt +PkgConfigBR: + - contextprovider-1.0 + - libpcrecpp + - QtCore >= 4.7 +Configure: none +Builder: qmake +QMakeOptions: + - -recursive "CONFIG += MEEGO" +SubPackages: + - Name: tests + Summary: Test cases for %{name} + Group: Development/System + Description: Simple automated test cases, to be executed in cita. + Requires: + - testrunner-lite + - "%{name}-tools = %{version}-%{release}" + + - Name: tools + Summary: Command line tools for communication with the time daemon + Group: Development/Tools + Description: | + Command line timed tools: 'simple-client' - a command line + simple client for time daemon; 'fake-dialog-ui' - a command + line voland implementation; 'ticker' - a command line clock + and signal notification. + + - Name: devel + Summary: Development package for %{name} + Group: Development/Libraries + Description: Header files and shared lib symlink for %{name}. + Requires: + - pkgconfig(QtCore) >= 4.6 + Index: timed-2.37-uid-creds.patch =================================================================== --- timed-2.37-uid-creds.patch (revision 0) +++ timed-2.37-uid-creds.patch (revision 2) @@ -0,0 +1,182 @@ +diff --git a/src/server/credentials.cpp b/src/server/credentials.cpp +index 9fed739..4879211 100644 +--- a/src/server/credentials.cpp ++++ b/src/server/credentials.cpp +@@ -24,12 +24,20 @@ + #include "f.h" + + #include <stdlib.h> ++#if F_CREDS_AEGIS_LIBCREDS + #include <sys/creds.h> ++#endif // F_CREDS_AEGIS_LIBCREDS + + #include <QDBusReply> + + #include <qmlog> + ++#if F_CREDS_UID ++#include <pwd.h> ++#include <grp.h> ++#include "timed/interface" ++#endif // F_CREDS_UID ++ + #include "credentials.h" + + #include "aegis.h" +@@ -84,6 +92,42 @@ uint32_t get_name_owner_from_dbus_sync(const QDBusConnection &bus, const QString + + #endif // F_DBUS_INFO_AS_CREDENTIALS + ++uid_t nameToUid(string name) ++{ ++ passwd *info = getpwnam(name.c_str()) ; ++ if (info) ++ return info->pw_uid ; ++ // couldn't get uid for username ++ return -1 ; ++} ++ ++string uidToName(uid_t u) ++{ ++ passwd *info = getpwuid(u) ; ++ if (info) ++ return info->pw_name ; ++ // couldn't get name for uid ++ return "nobody" ; ++} ++ ++gid_t nameToGid(string name) ++{ ++ group *info = getgrnam(name.c_str()) ; ++ if (info) ++ return info->gr_gid ; ++ // couldn't get gid for groupname ++ return -1 ; ++} ++ ++string gidToName(gid_t g) ++{ ++ group *info = getgrgid(g) ; ++ if (info) ++ return info->gr_name ; ++ // couldn't get name for gid ++ return "nogroup" ; ++} ++ + bool credentials_t::apply() const + { + #if F_CREDS_AEGIS_LIBCREDS +@@ -97,8 +141,15 @@ bool credentials_t::apply() const + creds_free(aegis_creds_want) ; + + return res ; +-#else // F_CREDS_AEGIS_LIBCREDS +-#error credentials_t::apply() is only implemented for F_CREDS_AEGIS_LIBCREDS ++#elif F_CREDS_UID ++ if (setgid(nameToGid(gid)) != 0 || setuid(nameToUid(uid)) != 0) ++ { ++ log_error("uid cred_set() failed") ; ++ return false ; ++ } ++ return true ; ++#else ++#error unimplemented credentials type + #endif + } + +@@ -142,10 +193,14 @@ bool credentials_t::apply_and_compare() + os << "}" ; + + bool equal = id_matches and all_accrued and all_dropped ; ++ bool ret = id_matches and all_dropped ; + + #undef COMMA_A + #undef COMMA_D + ++#else ++ bool equal = id_matches ; ++ bool ret = id_matches ; + #endif // F_TOKENS_AS_CREDENTIALS + + #undef COMMA +@@ -153,7 +208,7 @@ bool credentials_t::apply_and_compare() + if(!equal) + log_warning("applied and wanted credentials differ: %s", os.str().c_str()) ; + +- return id_matches and all_dropped ; ++ return ret ; + } + + credentials_t credentials_t::from_given_process(pid_t pid) +@@ -165,14 +220,23 @@ credentials_t credentials_t::from_given_process(pid_t pid) + creds_free(aegis_creds) ; + + return creds ; +-#else // not F_CREDS_AEGIS_LIBCREDS +-#error credentials_t::from_given_process(pid_t) is only implemented for F_CREDS_AEGIS_LIBCREDS ++#elif F_CREDS_UID ++// TODO: currently nobody:nobody is reported for all processes ++ return credentials_t() ; ++#else ++#error unimplemented credentials type + #endif + } + + credentials_t credentials_t::from_current_process() + { ++#if F_CREDS_AEGIS_LIBCREDS + return credentials_t::from_given_process(0) ; ++#elif F_CREDS_UID ++ return credentials_t(uidToName(getuid()), gidToName(getgid())) ; ++#else ++#error unimplemented credentials type ++#endif + } + + // TODO: F_CREDS_UID +@@ -185,9 +249,25 @@ credentials_t credentials_t::from_current_process() + // TODO: F_CREDS_AEGIS_LIBCREDS --- make this function #ifdef'ed + + credentials_t::credentials_t(const QDBusMessage &message) ++: uid("nobody"), gid("nobody") + { + #if F_CREDS_AEGIS_LIBCREDS + *this = Aegis::credentials_from_dbus_connection(message) ; ++#elif F_CREDS_UID ++ QString sender = message.service() ; ++ uint32_t user_id = get_name_owner_from_dbus_sync(Maemo::Timed::bus(), sender) ; ++ ++ if (user_id == ~0u) ++ log_warning("can't get user (uid) of the caller, already terminated?") ; ++ else ++ { ++ passwd *info = getpwuid(user_id) ; ++ if (info) ++ { ++ uid = info->pw_name ; ++ gid = gidToName(info->pw_gid) ; ++ } ++ } + #else + #error credentials_t;:from_dbus_connection is only implemented for aegis + #endif +diff --git a/src/server/credentials.h b/src/server/credentials.h +index 893d5cb..1632e46 100644 +--- a/src/server/credentials.h ++++ b/src/server/credentials.h +@@ -33,7 +33,6 @@ + using namespace std ; + + #include <sys/types.h> +-#include <sys/creds.h> + #include <QDBusMessage> + #include <QDBusConnection> + +@@ -49,6 +48,7 @@ struct credentials_t + // TODO: make nobody/nogroup run-time option: /etc/timed.rc + credentials_t() : uid("nobody"), gid("nogroup") { } + credentials_t(const credentials_t &x) : uid(x.uid), gid(x.gid), tokens(x.tokens) { } ++ credentials_t(const string &u, const string &g) : uid(u), gid(g) { } + + bool apply() const ; // set the credentials for the current process + bool apply_and_compare() ; // set the credentials and check if they are really set Index: timed-2.53-BMC17566-update-old-date-on-first-boot.patch =================================================================== --- timed-2.53-BMC17566-update-old-date-on-first-boot.patch (revision 0) +++ timed-2.53-BMC17566-update-old-date-on-first-boot.patch (revision 2) @@ -0,0 +1,164 @@ +diff -Naur timed-2.37-orig/src/server/settings.cpp timed-2.37/src/server/settings.cpp +--- timed-2.37-orig/src/server/settings.cpp 2011-02-17 11:32:41.000000000 +0200 ++++ timed-2.37/src/server/settings.cpp 2011-05-19 11:52:40.683301984 +0300 +@@ -186,6 +186,8 @@ + p->flag_auto_dst = auto_dst ; + p->flag_format_24 = format_24 ; + ++ // check whether we need to "bring old time" to more present ++ o->init_first_boot_hwclock_time_adjustment_check(); + log_assert(Maemo::Timed::WallClock::TimezoneManual==0) ; + p->zones.push_back(string_std_to_q(manual_zone->zone())) ; + log_assert(Maemo::Timed::WallClock::TimezoneCellular==1) ; +diff -Naur timed-2.37-orig/src/server/timed.cpp timed-2.37/src/server/timed.cpp +--- timed-2.37-orig/src/server/timed.cpp 2011-05-19 11:48:26.718552937 +0300 ++++ timed-2.37/src/server/timed.cpp 2011-05-19 11:49:11.778337476 +0300 +@@ -49,6 +49,13 @@ + #include "tzdata.h" + #include "csd.h" + #include "notification.h" ++#include "time.h" ++ ++#include <string> ++#include <fstream> ++#include <iostream> ++#include <sstream> ++#include <iomanip> + + static void spam() + { +@@ -85,6 +92,7 @@ + { + spam() ; + halted = "" ; // XXX: remove it, as we don't want to halt anymore ++ first_boot_date_adjusted = false; + log_debug() ; + + init_unix_signal_handler() ; +@@ -126,6 +134,9 @@ + init_main_interface_dbus_name() ; + log_debug() ; + ++ init_first_boot_hwclock_time_adjustment_check(); ++ log_debug() ; ++ + init_load_events() ; + log_debug() ; + +@@ -945,3 +956,99 @@ + am->open_epoch() ; + time_operational_p->setValue(true) ; + } ++ ++#define CONST_FIRST_BOOT_DATE_FILE "/var/cache/timed/first-boot-hwclock.dat" ++ ++template <class NumberDataType> ++static bool convert_str_to_number(NumberDataType& res, const string& str, ios_base& (*fmt)(ios_base&)) ++{ ++ istringstream instream(str); ++ return !(instream >> fmt >> res).fail(); ++} ++ ++static int parse_year_from_date_str(string dataline, int *err_flg_param) { ++ stringstream ss(dataline); ++ string item; ++ int ii; ++ int val; ++ int err_flg; ++ int ret_val; ++ ++ ii = 0; ++ ret_val = -1; ++ *err_flg_param = -1; ++ while(getline(ss, item, ' ')) { ++ if (ii == 3) { ++ // parse year ++ err_flg = convert_str_to_number<int>(val, item, dec); ++ if (err_flg != 0) { ++ ret_val = val; ++ *err_flg_param = 0; ++ break; ++ } ++ } ++ ii++; ++ } ++ return ret_val; ++} ++ ++static int parse_year_from_date_file(const char *date_fname, int *err_flg) { ++ ifstream in; ++ string line; ++ int ret_val; ++ ++ ret_val = -1; ++ *err_flg = -1; ++ in.open(date_fname); ++ if (in.is_open() == true) { ++ getline(in, line); ++ if (line.empty() == false) { ++ ret_val = parse_year_from_date_str(line, err_flg); ++ } ++ } ++ return ret_val; ++} ++ ++void Timed::init_first_boot_hwclock_time_adjustment_check() { ++ int err_flg; ++ int old_year; ++ ++ //time_t tt; ++ //time(&tt); ++ //log_info("time at timed boottime: %ld", tt); ++ if (first_boot_date_adjusted == false) { ++ if (access(CONST_FIRST_BOOT_DATE_FILE, R_OK) != 0) { ++ /* first boot date file not found, try to create one... ++ Check that we can execute this succesfully before putting output to file: ++ (wont neccessarily work at boot time if /dev/rtc0 is not yet populated by udev ++ */ ++ err_flg = system("hwclock -r"); ++ if (err_flg == 0) { ++ err_flg = system("hwclock -r -u > /var/cache/timed/first-boot-hwclock.dat"); ++ if (err_flg == 0) { ++ old_year = parse_year_from_date_file(CONST_FIRST_BOOT_DATE_FILE, &err_flg); ++ if (err_flg == 0) { ++ if (old_year < 2011) { ++ // lets udpdate year because it's first boot and old year older than 2011 ++ settings->set_system_time(1304244403); ++ log_info("first boot, old date from year %d updated to 05/01/2011", old_year); ++ first_boot_date_adjusted = true; ++ } ++ } ++ else { ++ log_error("Failed to read current year from %s", CONST_FIRST_BOOT_DATE_FILE); ++ } ++ } ++ else { ++ log_error("Failed to execute: hwclock -r -u > %s", CONST_FIRST_BOOT_DATE_FILE); ++ } ++ } ++ else { ++ log_error("Failed to execute: 'hwclock -r', maybe /dev/rtc0 is not yet available."); ++ } ++ } ++ else { ++ first_boot_date_adjusted = true; ++ } ++ } ++} +diff -Naur timed-2.37-orig/src/server/timed.h timed-2.37/src/server/timed.h +--- timed-2.37-orig/src/server/timed.h 2011-02-17 11:32:41.000000000 +0200 ++++ timed-2.37/src/server/timed.h 2011-05-19 11:49:05.032315312 +0300 +@@ -70,11 +70,13 @@ + + bool nitz_supported ; + string tz_by_default ; ++ bool first_boot_date_adjusted; + + public: + bool is_nitz_supported() { return nitz_supported ; } + const string &default_timezone() { return tz_by_default ; } + const string &get_settings_path() { return settings_path ; } ++ void init_first_boot_hwclock_time_adjustment_check(); + + private: + Index: lower-server-loglevel.patch =================================================================== --- lower-server-loglevel.patch (revision 0) +++ lower-server-loglevel.patch (revision 2) @@ -0,0 +1,13 @@ +--- a/src/server/main.cpp 2011-07-20 13:48:20.000000000 +0300 ++++ b/src/server/main.cpp 2011-09-22 10:09:41.000000000 +0300 +@@ -41,8 +41,8 @@ + + // fprintf(stderr, "getcwd returned '%s'", p?cwd:"(null)") ; + +- int syslog_level = qmlog::Full ; +- int varlog_level = qmlog::Full ; ++ int syslog_level = qmlog::Warning ; ++ int varlog_level = qmlog::Warning ; + + bool enable_qmlog = true ; + Index: timed-2.37-cellular-separation.patch =================================================================== --- timed-2.37-cellular-separation.patch (revision 0) +++ timed-2.37-cellular-separation.patch (revision 2) @@ -0,0 +1,89 @@ +diff --git a/src/lib/interface.h b/src/lib/interface.h +index f4b4e06..c7c767f 100644 +--- a/src/lib/interface.h ++++ b/src/lib/interface.h +@@ -96,10 +96,12 @@ namespace Maemo + qtdbus_method(pid, (void)) ; + qtdbus_method(parse, (const QString &text), text) ; + qtdbus_method(customization_values, (void)) ; ++#if __HARMATTAN__ + qtdbus_method(fake_nitz_signal, (int mcc, int offset, int time, int dst), mcc, offset, time, dst) ; + qtdbus_method(fake_operator_signal, (const QString &mcc, const QString &mnc), mcc, mnc) ; + qtdbus_method(fake_csd_time_signal, (const QString &mcc, const QString &mnc, int offset, int time, int dst, int seconds, int nano_seconds), mcc, mnc, offset, time, dst, seconds, nano_seconds) ; + qtdbus_method(fake_csd_time_signal_now, (const QString &mcc, const QString &mnc, int offset, int time, int dst), mcc, mnc, offset, time, dst) ; ++#endif // __HARMATTAN__ + qtdbus_method(get_log_level, (void)) ; + qtdbus_method(set_log_level, (int n), n) ; + } ; +diff --git a/src/server/adaptor.h b/src/server/adaptor.h +index 31909e9..ddcd073 100644 +--- a/src/server/adaptor.h ++++ b/src/server/adaptor.h +@@ -198,6 +198,7 @@ public slots: + timed->halt(string_q_to_std(what)) ; + } + ++#if F_CSD + bool fake_csd_time_signal(const QString &mcc, const QString &mnc, int offset, int time, int dst, int seconds, int nano_seconds) + { + log_notice("(fake_csd_time_signal) mcc='%s' mnc='%s' offset=%d time=%d dst=%d seconds=%d nano_seconds=%d", mcc.toStdString().c_str(), mnc.toStdString().c_str(), offset, time, dst, seconds, nano_seconds) ; +@@ -247,6 +248,7 @@ public slots: + timed->csd->process_csd_network_operator(mcc, mnc) ; + return true ; + } ++#endif // F_CSD + + int get_log_level(const QDBusMessage &message) + { +diff --git a/src/server/timed.cpp b/src/server/timed.cpp +index def3319..37e184b 100644 +--- a/src/server/timed.cpp ++++ b/src/server/timed.cpp +@@ -129,7 +129,10 @@ Timed::Timed(int ac, char **av) : QCoreApplication(ac, av) + init_load_events() ; + log_debug() ; + ++#if F_CSD + init_cellular_services() ; ++#endif // F_CSD ++ + log_debug() ; + + init_dst_checker() ; +@@ -527,6 +530,7 @@ void Timed::init_start_event_machine() + am->start() ; + } + ++#if F_CSD + void Timed::init_cellular_services() + { + #if 0 +@@ -553,6 +557,7 @@ void Timed::init_cellular_services() + QObject::connect(nitz_object, SIGNAL(cellular_data_received(const cellular_info_t &)), tz_oracle, SLOT(nitz_data(const cellular_info_t &))) ; + #endif + } ++#endif // F_CSD + + void Timed::init_dst_checker() + { +diff --git a/src/ticker/ticker.h b/src/ticker/ticker.h +index a959059..8a53722 100644 +--- a/src/ticker/ticker.h ++++ b/src/ticker/ticker.h +@@ -91,6 +91,7 @@ static string str_printf(const char *format, ...) + + return formatted ; + } ++#if USE_CELLULAR_QT + static string csd_network_time_info_to_string(const Cellular::NetworkTimeInfo &nti) + { + if (not nti.isValid()) +@@ -120,7 +121,7 @@ static string csd_network_time_info_to_string(const Cellular::NetworkTimeInfo &n + + return os.str() ; + } +- ++#endif // USE_CELLULAR_QT + + class ticker : public QCoreApplication + { Index: timed.spec =================================================================== --- timed.spec (revision 0) +++ timed.spec (revision 2) @@ -0,0 +1,234 @@ +# +# Do NOT Edit the Auto-generated Part! +# Generated by: spectacle version 0.23 +# +# >> macros +# << macros + +Name: timed +Summary: Time daemon +Version: 2.53 +Release: 1 +Group: System/System Control +License: LGPLv2 +URL: http://meego.gitorious.org/meego-middleware/timed +Source0: %{name}-%{version}.tar.bz2 +Source1: %{name}.conf +Source2: %{name}.service +Source100: timed.yaml +Patch0: %{name}-2.11-run-as-system-service.patch +Patch1: %{name}-2.27-debugflag-fix.patch +Patch2: %{name}-2.27-typofix.patch +Patch3: %{name}-2.37-cellular-separation.patch +Patch4: %{name}-2.37-uid-creds.patch +Patch5: %{name}-2.53-BMC17566-update-old-date-on-first-boot.patch +Patch6: %{name}-2.53-no-werror.patch +Patch7: %{name}-2.53-disable-dsme.patch +Patch8: lower-server-loglevel.patch +Patch9: %{name}-2.53-no-docs.patch +Requires: tzdata +Requires: tzdata-timed +Requires: systemd +Requires(preun): systemd +Requires(post): /sbin/ldconfig +Requires(post): systemd +Requires(postun): /sbin/ldconfig +Requires(postun): systemd +BuildRequires: pkgconfig(contextprovider-1.0) +BuildRequires: pkgconfig(libpcrecpp) +BuildRequires: pkgconfig(QtCore) >= 4.7 +BuildRequires: libiodata-devel >= 0.17 +BuildRequires: libqmlog-devel >= 0.10 +BuildRequires: libxslt + + +%description +The time daemon (%{name}) managing system time, time zone and settings, +executing actions at given time and managing the event queue. + + + +%package tests +Summary: Test cases for %{name} +Group: Development/System +Requires: %{name} = %{version}-%{release} +Requires: testrunner-lite +Requires: %{name}-tools = %{version}-%{release} + +%description tests +Simple automated test cases, to be executed in cita. + +%package tools +Summary: Command line tools for communication with the time daemon +Group: Development/Tools +Requires: %{name} = %{version}-%{release} + +%description tools +Command line timed tools: 'simple-client' - a command line +simple client for time daemon; 'fake-dialog-ui' - a command +line voland implementation; 'ticker' - a command line clock +and signal notification. + + +%package devel +Summary: Development package for %{name} +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} +Requires: pkgconfig(QtCore) >= 4.6 + +%description devel +Header files and shared lib symlink for %{name}. + + +%prep +%setup -q -n %{name}-%{version} + +# %{name}-2.11-run-as-system-service.patch +%patch0 -p1 +# %{name}-2.27-debugflag-fix.patch +%patch1 -p1 +# %{name}-2.27-typofix.patch +%patch2 -p1 +# %{name}-2.37-cellular-separation.patch +%patch3 -p1 +# %{name}-2.37-uid-creds.patch +%patch4 -p1 +# %{name}-2.53-BMC17566-update-old-date-on-first-boot.patch +%patch5 -p1 +# %{name}-2.53-no-werror.patch +%patch6 -p1 +# %{name}-2.53-disable-dsme.patch +%patch7 -p1 +# lower-server-loglevel.patch +%patch8 -p1 +# %{name}-2.53-no-docs.patch +%patch9 -p1 +# >> setup +# << setup + +%build +# >> build pre +export TIMED_VERSION=`head -n1 debian/changelog | sed "s/.*(\([^)+]*\).*/\1/"` +mkdir -p src/h +ln -s ../server src/h/daemon +ln -s ../lib src/h/timed +ln -s ../voland src/h/timed-voland +cd src +# << build pre + +%qmake \ + -recursive "CONFIG += MEEGO" + +make %{?jobs:-j%jobs} + +# >> build post +# << build post +%install +rm -rf %{buildroot} +# >> install pre +cd src +# << install pre +%qmake_install + +# >> install post +cd .. +#install -m 644 -D src/doc/timed.8 %{buildroot}/%{_mandir}/man8/timed.8 +#install -m 644 -D src/doc/libtimed.3 %{buildroot}/%{_mandir}/man3/libtimed.3 +#install -m 644 src/doc/libtimed-voland.3 %{buildroot}/%{_mandir}/man3/libtimed-voland.3 + +install -m 644 -D %{SOURCE1} %{buildroot}/%{_sysconfdir}/dbus-1/system.d/%{name}.conf +install -d %{buildroot}/%{_localstatedir}/cache/%{name}/ + +install -m 644 -D %{SOURCE2} %{buildroot}/lib/systemd/system/%{name}.service +install -d %{buildroot}/lib/systemd/system/multi-user.target.wants/ +ln -s ../%{name}.service %{buildroot}/lib/systemd/system/multi-user.target.wants/%{name}.service + +# Missing executable flags. +chmod 755 %{buildroot}%{_datadir}/backup-framework/scripts/timed-restore-script.sh +# << install post + + +%preun +systemctl stop %{name}.service + +%post +/sbin/ldconfig +systemctl daemon-reload +systemctl reload-or-try-restart %{name}.service + +%postun +/sbin/ldconfig +systemctl daemon-reload + + + + + + + + + + + +%files +%defattr(-,root,root,-) +# >> files +%doc COPYING debian/changelog debian/copyright +%config(noreplace) %{_sysconfdir}/dbus-1/system.d/%{name}.conf +%config(noreplace) %{_sysconfdir}/aegisfs.d/timed.aegisfs.conf +%config(noreplace) %{_sysconfdir}/timed.rc +%{_sysconfdir}/osso-cud-scripts/timed-clear-device.sh +%{_sysconfdir}/osso-rfs-scripts/timed-restore-original-settings.sh +%{_bindir}/%{name} +%{_bindir}/tfd +%{_bindir}/timed-aegis-session-helper +%{_libdir}/libtimed.so.* +%{_libdir}/libtimed-voland.so.* +%{_datadir}/backup-framework/applications/timedbackup.conf +%{_datadir}/backup-framework/scripts/timed-backup-script.sh +%{_datadir}/backup-framework/scripts/timed-restore-script.sh +%{_datadir}/contextkit/providers/com.nokia.time.context +# %{_mandir}/man3/libtimed.3.gz +# %{_mandir}/man3/libtimed-voland.3.gz +# %{_mandir}/man8/timed.8.gz +%{_localstatedir}/cache/timed/ +/lib/systemd/system/%{name}.service +/lib/systemd/system/multi-user.target.wants/%{name}.service +# << files + + +%files tests (34 more lines skipped) Index: timed-2.53-no-docs.patch =================================================================== --- timed-2.53-no-docs.patch (revision 0) +++ timed-2.53-no-docs.patch (revision 2) @@ -0,0 +1,10 @@ +diff -ruN --exclude='*~' timed-2.53.orig/src/root.pro timed-2.53/src/root.pro +--- timed-2.53.orig/src/root.pro 2011-09-30 14:41:50.699849990 +0300 ++++ timed-2.53/src/root.pro 2011-09-30 14:42:16.703393085 +0300 +@@ -1,5 +1,5 @@ + TEMPLATE = subdirs +-SUBDIRS = lib voland doc server simple-client fake-dialog-ui ticker logging-test ntp tfd ++SUBDIRS = lib voland server simple-client fake-dialog-ui ticker logging-test ntp tfd + SUBDIRS += memory + # SUBDIRS += arch + CONFIG += ordered Index: timed-2.53-disable-dsme.patch =================================================================== --- timed-2.53-disable-dsme.patch (revision 0) +++ timed-2.53-disable-dsme.patch (revision 2) @@ -0,0 +1,187 @@ +diff -ruN --exclude='*~' timed-2.53.orig/src/memory/memory.pro timed-2.53/src/memory/memory.pro +--- timed-2.53.orig/src/memory/memory.pro 2011-09-20 18:01:06.773912581 +0300 ++++ timed-2.53/src/memory/memory.pro 2011-09-21 09:56:01.138049914 +0300 +@@ -4,7 +4,10 @@ + CONFIG += qmlog + CONFIG += link_pkgconfig + +-PKGCONFIG += contextprovider-1.0 libpcrecpp dsme_dbus_if ++PKGCONFIG += contextprovider-1.0 libpcrecpp ++CONFIG(dsme_dbus_if) { ++ PKGCONFIG += dsme_dbus_if ++} + + TEMPLATE = app + TARGET = memory +diff -ruN --exclude='*~' timed-2.53.orig/src/server/server.pro timed-2.53/src/server/server.pro +--- timed-2.53.orig/src/server/server.pro 2011-09-20 18:01:06.811913422 +0300 ++++ timed-2.53/src/server/server.pro 2011-09-21 10:19:44.037333596 +0300 +@@ -14,10 +14,12 @@ + + IODATA_TYPES = queue.type config.type settings.type customization.type tzdata.type + +-SOURCES += dsme-mode.cpp +-HEADERS += dsme-mode.h ++CONFIG(dsme_dbus_if) { ++ SOURCES += dsme-mode.cpp ++ HEADERS += dsme-mode.h interfaces.h ++} + +-HEADERS += peer.h settings.h csd.h interfaces.h adaptor.h timed.h state.h cluster.h machine.h singleshot.h pinguin.h unix-signal.h onitz.h ++HEADERS += peer.h settings.h csd.h adaptor.h timed.h state.h cluster.h machine.h singleshot.h pinguin.h unix-signal.h onitz.h + SOURCES += peer.cpp tzdata.cpp cellular.cpp csd.cpp cluster.cpp machine.cpp state.cpp main.cpp timed.cpp timeutil.cpp event.cpp misc.cpp settings.cpp pinguin.cpp unix-signal.cpp onitz.cpp + + SOURCES += credentials.cpp aegis.cpp +@@ -33,7 +35,11 @@ + HEADERS += notification.h + + CONFIG += link_pkgconfig iodata +-PKGCONFIG += contextprovider-1.0 libpcrecpp dsme_dbus_if ++PKGCONFIG += contextprovider-1.0 libpcrecpp ++ ++CONFIG(dsme_dbus_if) { ++ PKGCONFIG += dsme_dbus_if ++} + + target.path = $$(DESTDIR)/usr/bin + +diff -ruN --exclude='*~' timed-2.53.orig/src/server/timed.cpp timed-2.53/src/server/timed.cpp +--- timed-2.53.orig/src/server/timed.cpp 2011-09-20 18:01:06.809913377 +0300 ++++ timed-2.53/src/server/timed.cpp 2011-09-21 10:25:50.917215409 +0300 +@@ -41,7 +41,9 @@ + #include "customization.type.h" + #include "settings.type.h" + ++#if HAVE_DSME + #include "interfaces.h" ++#endif + #include "adaptor.h" + #include "backup.h" + #include "timed.h" +@@ -313,9 +315,11 @@ + void Timed::init_device_mode() + { + current_mode = "(unknown)" ; ++#if HAVE_DSME + dsme_mode_handler = new dsme_mode_t ; + QObject::connect(dsme_mode_handler, SIGNAL(mode_is_changing()), this, SLOT(dsme_mode_is_changing())) ; + QObject::connect(dsme_mode_handler, SIGNAL(mode_reported(const string &)), this, SLOT(dsme_mode_reported(const string &))) ; ++#if F_ACTING_DEAD + if (scratchbox_mode) + { + int is_act_dead = is_act_dead_by_status_files() ; +@@ -325,7 +329,11 @@ + device_mode_reached(user_mode) ; + } + else ++#endif ++ { + dsme_mode_handler->init_request() ; ++ } ++#endif + const char *startup_path="/com/nokia/startup/signal", *startup_iface="com.nokia.startup.signal" ; + const char *desktop_visible_slot = SLOT(harmattan_desktop_visible()) ; + const char *init_done_slot = SLOT(harmattan_init_done(int)) ; +@@ -811,6 +819,7 @@ + + void Timed::send_next_bootup_event(int value) + { ++#if HAVE_DSME + QDBusConnection dsme = QDBusConnection::systemBus() ; + QString path = Maemo::Timed::objpath() ; + QString iface = Maemo::Timed::interface() ; +@@ -821,6 +830,7 @@ + log_info("signal %s(%d) sent", string_q_to_std(signal).c_str(), value) ; + else + log_error("Failed to send the signal %s(%d) on system bus: %s", string_q_to_std(signal).c_str(), value, dsme.lastError().message().toStdString().c_str()) ; ++#endif + } + + void Timed::event_queue_changed() +@@ -1074,6 +1084,7 @@ + time_operational_p->setValue(true) ; + } + ++#if HAVE_DSME + void Timed::dsme_mode_is_changing() + { + log_notice("mode is changing, freezeng machine") ; +@@ -1105,6 +1116,7 @@ + start_voland_watcher() ; + #endif + } ++#endif + + void Timed::connect_to_session_bus(const string &session_bus_address) + { +diff -ruN --exclude='*~' timed-2.53.orig/src/server/timed.h timed-2.53/src/server/timed.h +--- timed-2.53.orig/src/server/timed.h 2011-09-20 18:01:06.811913422 +0300 ++++ timed-2.53/src/server/timed.h 2011-09-21 09:51:25.180233851 +0300 +@@ -46,7 +46,9 @@ + #include "csd.h" + #include "event.h" + #include "peer.h" ++#if HAVE_DSME + #include "dsme-mode.h" ++#endif + #include "notification.h" + + struct Timed : public QCoreApplication +@@ -163,7 +165,9 @@ + unsigned ping_period, ping_max_num ; + string events_path, settings_path ; + int default_gmt_offset ; ++#if HAVE_DSME + dsme_mode_t *dsme_mode_handler ; ++#endif + std::string current_mode ; + void load_rc() ; + void load_settings() ; +@@ -194,8 +198,10 @@ + private Q_SLOTS: + void queue_threshold_timeout() ; + void unix_signal(int signo) ; ++#if HAVE_DSME + void dsme_mode_reported(const string &mode) ; + void dsme_mode_is_changing() ; ++#endif + void harmattan_init_done(int runlevel) ; + void harmattan_desktop_visible() ; + void harmattan_session_started() ; +diff -ruN --exclude='*~' timed-2.53.orig/src/ticker/ticker.h timed-2.53/src/ticker/ticker.h +--- timed-2.53.orig/src/ticker/ticker.h 2011-09-20 18:01:06.816913533 +0300 ++++ timed-2.53/src/ticker/ticker.h 2011-09-21 09:51:25.183233914 +0300 +@@ -159,6 +159,7 @@ + else + log_critical("not connected to D-Bus signal, no time change signal will be delivered!") ; + ++#if HAVE_DSME + QDBusConnection dsme_bus = QDBusConnection::systemBus() ; + QString path = Maemo::Timed::objpath() ; + QString iface = Maemo::Timed::interface() ; +@@ -168,7 +169,8 @@ + log_notice("connected to system bus signal '%s'", signal.toStdString().c_str()) ; + else + log_critical("not connected to system bus signal '%s'",signal.toStdString().c_str()) ; +- ++#endif ++ + #if USE_CELLULAR_QT + cellular_time = new Cellular::NetworkTime ; + # if NEW_CELLULAR +@@ -242,6 +244,7 @@ + cout << endl ; + log_notice("Settings change signalled (system time %schanged), new settings: %s", time ? "" : "not ", info.str().toStdString().c_str()) ; + } ++#if HAVE_DSME + void dsme(int value) + { + ostringstream os ; +@@ -254,6 +257,7 @@ + cout << endl ; + log_notice("%s", os.str().c_str()) ; + } ++#endif + #if NEW_CELLULAR + + #if NEW_CELLULAR_BROKEN_SIGNAL Index: timed-2.27-debugflag-fix.patch =================================================================== --- timed-2.27-debugflag-fix.patch (revision 0) +++ timed-2.27-debugflag-fix.patch (revision 2) @@ -0,0 +1,12 @@ +diff --git a/src/server/f.h b/src/server/f.h +index 4b36e8f..c4ee442 100644 +--- a/src/server/f.h ++++ b/src/server/f.h +@@ -27,6 +27,7 @@ + #if __MEEGO__ + # define F_CREDS_UID 1 + //# define F_CREDS_NOBODY 1 ++# define F_FORCE_DEBUG_PATH "/var/cache/timed/DEBUG" + #endif + + #if __HARMATTAN__ Index: timed.service =================================================================== --- timed.service (revision 0) +++ timed.service (revision 2) @@ -0,0 +1,10 @@ +[Unit] +Description=Time Daemon +After=syslog.target + +[Service] +ExecStart=/usr/bin/timed + +[Install] +WantedBy=multi-user.target + Index: timed-2.53.tar.bz2 =================================================================== Binary file timed-2.53.tar.bz2 added Index: timed-2.53-no-werror.patch =================================================================== --- timed-2.53-no-werror.patch (revision 0) +++ timed-2.53-no-werror.patch (revision 2) @@ -0,0 +1,27 @@ +diff --exclude='*~' -ruN timed-2.53.orig/src/lib/lib.pro timed-2.53/src/lib/lib.pro +--- timed-2.53.orig/src/lib/lib.pro 2011-09-17 00:31:49.255301733 +0300 ++++ timed-2.53/src/lib/lib.pro 2011-09-17 00:31:32.517157752 +0300 +@@ -44,4 +44,4 @@ + LIBS += -lsysinfo + QMAKE_CXXFLAGS += -Wall -Wno-psabi + } +-QMAKE_CXXFLAGS += -Wall -Werror ++QMAKE_CXXFLAGS += -Wall +diff --exclude='*~' -ruN timed-2.53.orig/src/server/server.pro timed-2.53/src/server/server.pro +--- timed-2.53.orig/src/server/server.pro 2011-09-17 00:25:18.447834057 +0300 ++++ timed-2.53/src/server/server.pro 2011-09-17 16:55:42.644879026 +0300 +@@ -80,4 +80,4 @@ + QMAKE_CXXFLAGS += -Wall -Wno-psabi + } + +-QMAKE_CXXFLAGS += -Wall -Werror ++QMAKE_CXXFLAGS += -Wall +diff --exclude='*~' -ruN timed-2.53.orig/src/ticker/ticker.pro timed-2.53/src/ticker/ticker.pro +--- timed-2.53.orig/src/ticker/ticker.pro 2011-09-17 00:25:18.415834701 +0300 ++++ timed-2.53/src/ticker/ticker.pro 2011-09-17 17:18:56.313536563 +0300 +@@ -31,4 +31,4 @@ + QMAKE_CXXFLAGS += -Wall -Wno-psabi + } + +-QMAKE_CXXFLAGS += -Wall -Werror ++QMAKE_CXXFLAGS += -Wall Index: timed-2.11-run-as-system-service.patch =================================================================== --- timed-2.11-run-as-system-service.patch (revision 0) +++ timed-2.11-run-as-system-service.patch (revision 2) @@ -0,0 +1,13 @@ +diff --git a/src/voland/interface.h b/src/voland/interface.h +index 8d770de..5195677 100644 +--- a/src/voland/interface.h ++++ b/src/voland/interface.h +@@ -54,7 +54,7 @@ namespace Maemo + } + inline QDBusConnection bus() + { +- return QDBusConnection::sessionBus() ; ++ return QDBusConnection::systemBus() ; + } + class Interface : public QDBusAbstractInterface + {
