2 Summary: Geofence Server for Tizen
5 Group: Location/Service
7 Source0: %{name}-%{version}.tar.gz
8 Source1: geofence-server.service
10 %if "%{?profile}" == "tv"
11 ExcludeArch: %{arm} %ix86 x86_64
14 Requires(post): sqlite
15 Requires(post): lbs-server
17 BuildRequires: pkgconfig(glib-2.0)
18 BuildRequires: pkgconfig(network)
19 BuildRequires: pkgconfig(vconf)
20 BuildRequires: pkgconfig(dlog)
21 BuildRequires: pkgconfig(geofence-dbus)
22 BuildRequires: pkgconfig(gio-unix-2.0)
23 BuildRequires: pkgconfig(sqlite3)
24 BuildRequires: pkgconfig(db-util)
25 BuildRequires: pkgconfig(alarm-service)
26 BuildRequires: pkgconfig(deviced)
27 BuildRequires: pkgconfig(vconf)
28 BuildRequires: pkgconfig(vconf-internal-keys)
29 BuildRequires: pkgconfig(capi-appfw-app-manager)
30 BuildRequires: pkgconfig(capi-location-manager)
31 BuildRequires: pkgconfig(capi-network-wifi)
32 BuildRequires: pkgconfig(capi-network-bluetooth)
33 BuildRequires: pkgconfig(secure-storage)
34 BuildRequires: pkgconfig(libcore-context-manager)
35 #BuildRequires: pkgconfig(tapi)
36 #BuildRequires: pkgconfig(capi-telephony-network-info)
37 #BuildRequires: pkgconfig(capi-context-manager)
38 BuildRequires: pkgconfig(capi-geofence-manager)
39 BuildRequires: capi-geofence-manager-plugin-devel
43 Geofence Server for Tizen
51 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
52 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
53 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
55 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
56 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DFULLVER=%{version} -DMAJORVER=${MAJORVER} \
57 -DLIB_DIR=%{_libdir} -DSYSCONF_DIR=%{_sysconfdir} \
65 if [ ! -e "$GEOFENCE_SERVER_DB_PATH" ]
69 mkdir -p %{buildroot}/opt/dbspace
70 sqlite3 %{buildroot}/opt/dbspace/.geofence-server.db 'PRAGMA journal_mode = PERSIST;
71 CREATE TABLE Places ( place_id INTEGER PRIMARY KEY AUTOINCREMENT, access_type INTEGER, place_name TEXT NOT NULL, app_id TEXT NOT NULL);
72 CREATE TABLE GeoFence ( fence_id INTEGER PRIMARY KEY AUTOINCREMENT, place_id INTEGER, enable INTEGER, app_id TEXT NOT NULL, geofence_type INTEGER, access_type INTEGER, running_status INTEGER, FOREIGN KEY(place_id) REFERENCES Places(place_id) ON DELETE CASCADE);
73 CREATE TABLE FenceGeocoordinate ( fence_id INTEGER , latitude TEXT NOT NULL, longitude TEXT NOT NULL, radius TEXT NOT NULL, address TEXT, FOREIGN KEY(fence_id) REFERENCES GeoFence(fence_id) ON DELETE CASCADE);
74 CREATE TABLE FenceGeopointWifi ( fence_id INTEGER, bssid TEXT, ssid TEXT, FOREIGN KEY(fence_id) REFERENCES GeoFence(fence_id) ON DELETE CASCADE);
75 CREATE TABLE FenceBssid ( fence_id INTEGER, bssid TEXT, ssid TEXT, FOREIGN KEY(fence_id) REFERENCES Geofence(fence_id) ON DELETE CASCADE);'
82 GEOFENCE_SERVER_DB_PATH="/opt/dbspace/.geofence-server.db"
84 # geofence-server db file
85 chown system:system /opt/dbspace/.geofence-server.db
86 chown system:system /opt/dbspace/.geofence-server.db-journal
87 ## Change geofence-server db file permissions
88 chmod 660 /opt/dbspace/.geofence-server.db
89 chmod 660 /opt/dbspace/.geofence-server.db-journal
91 %postun -p /sbin/ldconfig
94 %manifest geofence-server.manifest
95 %defattr(-,system,system,-)
96 /usr/bin/geofence-server
97 /usr/share/dbus-1/system-services/org.tizen.lbs.Providers.GeofenceServer.service
99 %config %{_sysconfdir}/dbus-1/system.d/geofence-server.conf
101 %package -n location-geofence-server
102 Summary: Geofence Server for Tizen
103 Group: Development/Libraries
104 Requires: %{name} = %{version}-%{release}
106 %description -n location-geofence-server
107 Geofence Server for Tizen
109 %post -n location-geofence-server
112 %postun -n location-geofence-server
115 %files -n location-geofence-server
116 %manifest location-geofence-server.manifest
117 %{_libdir}/geofence/module/libgeofence.so*