BuildRequires: pkgconfig(eventsystem)
BuildRequires: python-xml
+%define upgrade_script_path /usr/share/upgrade/scripts
+
%description
Alarm Server and devel libraries
mkdir -p %{buildroot}%{_libdir}/udev/rules.d
install -m 0644 %SOURCE5 %{buildroot}%{_libdir}/udev/rules.d
+mkdir -p %{buildroot}%{upgrade_script_path}
+cp -f scripts/108.alarmmgr_upgrade.sh %{buildroot}%{upgrade_script_path}
+
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%if 0%{?appfw_feature_alarm_manager_module_log}
%attr(0755,root,root) %{_sysconfdir}/dump.d/module.d/alarmmgr_log_dump.sh
%endif
+%{upgrade_script_path}/108.alarmmgr_upgrade.sh
%files -n libalarm
%manifest alarm-lib.manifest
--- /dev/null
+#!/bin/sh
+
+#------------------------------------------#
+# alarmmgr upgrade (2.4 -> 3.0) #
+#------------------------------------------#
+
+# Macro
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+
+DB_DIR=/opt/dbspace
+DB_ALARMMGR=$DB_DIR/.alarmmgr.db
+
+# Upgrade table
+sqlite3 $DB_ALARMMGR << EOF
+DROP TABLE IF EXISTS alarmmgr_temp;
+
+CREATE TABLE alarmmgr_temp (
+ alarm_id integer primary key,
+ start integer,
+ end integer,
+ uid integer,
+ pid integer,
+ global integer,
+ caller_pkgid text,
+ callee_pkgid text,
+ app_unique_name text,
+ app_service_name text,
+ app_service_name_mod text,
+ bundle text,
+ year integer,
+ month integer,
+ day integer,
+ hour integer,
+ min integer,
+ sec integer,
+ day_of_week integer,
+ repeat integer,
+ alarm_type integer,
+ reserved_info integer,
+ dst_service_name text,
+ dst_service_name_mod text
+);
+
+INSERT INTO alarmmgr_temp \
+ (alarm_id, start, end, pid, caller_pkgid, \
+ callee_pkgid, app_unique_name, app_service_name, \
+ app_service_name_mod, bundle, year, month, \
+ day, hour, min, sec, day_of_week, repeat, \
+ alarm_type, reserved_info, dst_service_name, \
+ dst_service_name_mod) \
+ SELECT alarm_id, start, end, pid, caller_pkgid, \
+ callee_pkgid, app_unique_name, app_service_name, \
+ app_service_name_mod, bundle, year, month, \
+ day, hour, min, sec, day_of_week, repeat, \
+ alarm_type, reserved_info, dst_service_name, dst_service_name_mod \
+ FROM alarmmgr;
+
+UPDATE alarmmgr_temp SET uid=5001,global=0;
+DROP TABLE alarmmgr;
+ALTER TABLE alarmmgr_temp RENAME TO alarmmgr;
+
+EOF
+
+chown app_fw:app_fw $DB_ALARMMGR
+chown app_fw:app_fw $DB_ALARMMGR-journal
+
+chsmack -a System $DB_ALARMMGR
+chsmack -a System $DB_ALARMMGR-journal