remove related code to secure-storage
[platform/core/location/geofence-server.git] / packaging / geofence-server.spec
1 Name:       geofence-server
2 Summary:    Geofence Server for Tizen
3 Version:    0.4.1
4 Release:    1
5 Group:      Location/Service
6 License:    Apache-2.0
7 Source0:    %{name}-%{version}.tar.gz
8 Source1:    geofence-server.service
9
10 %if "%{?profile}" == "tv"
11 ExcludeArch: %{arm} %ix86 x86_64
12 %endif
13
14 Requires(post): sqlite
15 Requires(post): lbs-server
16 BuildRequires:  cmake
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(libcore-context-manager)
34 #BuildRequires:  pkgconfig(tapi)
35 #BuildRequires:  pkgconfig(capi-telephony-network-info)
36 #BuildRequires:  pkgconfig(capi-context-manager)
37 BuildRequires:  pkgconfig(capi-geofence-manager)
38 BuildRequires:  pkgconfig(libtzplatform-config)
39 BuildRequires:  capi-geofence-manager-plugin-devel
40 Requires:  sys-assert
41
42 %description
43 Geofence Server for Tizen
44
45
46 %prep
47 %setup -q
48
49
50 %build
51 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
52 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
53 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
54
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} \
58
59 make %{?jobs:-j%jobs}
60
61 %install
62 rm -rf %{buildroot}
63 %make_install
64
65 #[Workaround] create service file for systemd
66 mkdir -p %{buildroot}%{_unitdir_user}/default.target.wants
67 install -m 644 %{SOURCE1} %{buildroot}%{_unitdir_user}/geofence-server.service
68 ln -s ../geofence-server.service %{buildroot}%{_unitdir_user}/default.target.wants/geofence-server.service
69
70 %if 0
71 if [ ! -e "$GEOFENCE_SERVER_DB_PATH" ]
72 then
73
74 # create db
75 mkdir -p %{buildroot}/opt/dbspace
76 sqlite3 %{buildroot}/opt/dbspace/.geofence-server.db 'PRAGMA journal_mode = PERSIST;
77         CREATE TABLE Places ( place_id INTEGER PRIMARY KEY AUTOINCREMENT, access_type INTEGER, place_name TEXT NOT NULL, app_id TEXT NOT NULL);
78         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);
79         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);
80         CREATE TABLE FenceGeopointWifi ( fence_id INTEGER, bssid TEXT, ssid TEXT, FOREIGN KEY(fence_id) REFERENCES GeoFence(fence_id) ON DELETE CASCADE);
81         CREATE TABLE FenceBssid ( fence_id INTEGER, bssid TEXT, ssid TEXT, FOREIGN KEY(fence_id) REFERENCES Geofence(fence_id) ON DELETE CASCADE);'
82 fi
83 %endif
84
85 %clean
86 rm -rf %{buildroot}
87
88 %post
89
90 %if 0
91 GEOFENCE_SERVER_DB_PATH="/opt/dbspace/.geofence-server.db"
92
93 # geofence-server db file
94 chown system:system /opt/dbspace/.geofence-server.db
95 chown system:system /opt/dbspace/.geofence-server.db-journal
96 # Change geofence-server db file permissions
97 chmod 660 /opt/dbspace/.geofence-server.db
98 chmod 660 /opt/dbspace/.geofence-server.db-journal
99 %endif
100
101 %postun -p /sbin/ldconfig
102
103 %files
104 %manifest geofence-server.manifest
105 %defattr(-,root,root,-)
106 /usr/bin/geofence-server
107
108 /usr/share/dbus-1/services/org.tizen.lbs.Providers.GeofenceServer.service
109 #/opt/dbspace/.*.db*
110 %config %{_sysconfdir}/dbus-1/session.d/geofence-server.conf
111
112 #[Workaround] create service file for systemd
113 %{_unitdir_user}/geofence-server.service
114 %{_unitdir_user}/default.target.wants/geofence-server.service
115
116
117 %package -n location-geofence-server
118 Summary:    Geofence Server for Tizen
119 Group:      Development/Libraries
120 Requires:   %{name} = %{version}-%{release}
121
122 %description -n location-geofence-server
123 Geofence Server for Tizen
124
125 %post -n location-geofence-server
126 /sbin/ldconfig
127
128 %postun -n location-geofence-server
129 /sbin/ldconfig
130
131 %files -n location-geofence-server
132 %manifest location-geofence-server.manifest
133 %{_libdir}/geofence/module/libgeofence.so*