Fix syspopup launch API
[platform/core/base/syspopup.git] / packaging / syspopup.spec
1 %bcond_with x
2 %bcond_with wayland
3
4 Name:           syspopup
5 Summary:        Syspopup package
6 Version:        0.0.100
7 Release:        0
8 Group:          System/Libraries
9 License:        Apache-2.0
10 Source0:        syspopup-%{version}.tar.gz
11 Source1001:     %{name}.manifest
12 Source1002:     %{name}-devel.manifest
13 Source1003:     %{name}-caller.manifest
14 Source1004:     %{name}-caller-devel.manifest
15
16 BuildRequires:  cmake
17 BuildRequires:  pkgconfig(sqlite3)
18 BuildRequires:  pkgconfig(bundle)
19 BuildRequires:  pkgconfig(dlog)
20 BuildRequires:  pkgconfig(glib-2.0)
21 BuildRequires:  pkgconfig(gio-2.0)
22 %if %{with wayland}
23 BuildRequires:  pkgconfig(ecore-wayland)
24 BuildRequires:  pkgconfig(capi-ui-efl-util)
25 %else
26 %if %{with x}
27 BuildRequires:  pkgconfig(utilX)
28 BuildRequires:  pkgconfig(x11)
29 BuildRequires:  pkgconfig(ecore-x)
30 %endif
31 %endif
32 BuildRequires:  pkgconfig(evas)
33 BuildRequires:  pkgconfig(elementary)
34 BuildRequires:  pkgconfig(libtzplatform-config)
35 BuildRequires:  pkgconfig(aul)
36
37 %define upgrade_script_path /usr/share/upgrade/scripts
38 %define upgrade_data_path /usr/share/upgrade/data
39
40 %if "%{?profile}" == "wearable"
41 %define profile_wearable 1
42 %else
43 %define profile_wearable 0
44 %endif
45
46 %description
47 syspopup package for popup
48
49 %package devel
50 Summary:    Syspopup development package
51 Group:      System/Libraries
52 Requires:   %{name} = %{version}-%{release}
53
54 %description devel
55 syspopup development package popup
56
57 %package caller
58 Summary:          Syspopup-caller package
59 Group:            System/Libraries
60 Requires:         %{name} = %{version}-%{release}
61 Requires(post):   /sbin/ldconfig
62 Requires(postun): /sbin/ldconfig
63
64 %description caller
65 syspopup-caller package for popup
66
67 %package caller-devel
68 Summary:    Syspopup-caller development package
69 Group:      System/Development
70 Requires:   %{name} = %{version}-%{release}
71
72 %description caller-devel
73 syspopup-caller development package for popup
74
75 %prep
76 %setup -q
77 sed -i %{SOURCE1001} -e "s|TZ_SYS_DB|%TZ_SYS_DB|g"
78 cp %{SOURCE1001} %{SOURCE1002} %{SOURCE1003} %{SOURCE1004} .
79
80 %build
81 %if %{?profile_wearable}
82 PROFILE_WEARABLE=ON
83 %endif
84
85 %cmake \
86 %if %{with wayland}
87         -Dwith_wayland=TRUE \
88 %else
89 %if %{with x}
90         -Dwith_x11=TRUE \
91 %endif
92 %endif
93         -DTZ_SYS_RO_PACKAGES=%{TZ_SYS_RO_PACKAGES} \
94         -DTZ_SYS_RO_SHARE=%{TZ_SYS_RO_SHARE} \
95         -DEXTRA_CFLAGS=-fPIC \
96         -DPROFILE_WEARABLE:BOOL=${PROFILE_WEARABLE} \
97         .
98
99 make %{?jobs:-j%jobs}
100
101 %install
102 %make_install
103 mkdir -p %{buildroot}%{TZ_SYS_RO_SHARE}/license
104 install LICENSE %{buildroot}%{TZ_SYS_RO_SHARE}/license/%{name}
105 install LICENSE %{buildroot}%{TZ_SYS_RO_SHARE}/license/%{name}-devel
106 install LICENSE %{buildroot}%{TZ_SYS_RO_SHARE}/license/%{name}-caller
107 install LICENSE %{buildroot}%{TZ_SYS_RO_SHARE}/license/%{name}-caller-devel
108
109 mkdir -p %{buildroot}%{TZ_SYS_DB}
110 sqlite3 %{buildroot}%{TZ_SYS_DB}/.syspopup.db < %{buildroot}%{TZ_SYS_RO_SHARE}/syspopup/syspopup_db.sql
111 rm -rf %{buildroot}%{TZ_SYS_RO_SHARE}/syspopup/syspopup_db.sql
112 rm -rf %{buildroot}%{TZ_SYS_DB}/.syspopup.db-journal
113
114 touch %{buildroot}%{_datadir}/popup_noti_term
115
116 mkdir -p %{buildroot}%{upgrade_script_path}
117 mkdir -p %{buildroot}%{upgrade_data_path}
118 cp -f scripts/502.syspopup_upgrade.sh %{buildroot}%{upgrade_script_path}
119 cp -f %{buildroot}%{TZ_SYS_DB}/.syspopup.db %{buildroot}%{upgrade_data_path}
120
121 %post -p /sbin/ldconfig
122
123 %postun -p /sbin/ldconfig
124
125 %post caller -p /sbin/ldconfig
126
127 %postun caller -p /sbin/ldconfig
128
129 %files
130 %manifest %{name}.manifest
131 %defattr(-,root,root,-)
132 %{_bindir}/sp_test
133 %{_libdir}/libsyspopup.so.0.1.0
134 %{_datadir}/popup_noti_term
135 %attr(644,root,%{TZ_SYS_USER_GROUP}) %{TZ_SYS_DB}/.syspopup.db
136 %TZ_SYS_RO_SHARE/license/%{name}
137 %{upgrade_script_path}/502.syspopup_upgrade.sh
138 %{upgrade_data_path}/.syspopup.db
139
140 %files devel
141 %manifest %{name}-devel.manifest
142 %defattr(-,root,root,-)
143 %{_includedir}/SLP_SYSPOPUP_PG.h
144 %{_includedir}/syspopup.h
145 %{_libdir}/libsyspopup.so
146 %{_libdir}/pkgconfig/syspopup.pc
147 %TZ_SYS_RO_SHARE/license/%{name}-devel
148
149 %files caller
150 %manifest %{name}-caller.manifest
151 %defattr(-,root,root,-)
152 %{_libdir}/libsyspopup_caller.so.0.1.0
153 %TZ_SYS_RO_SHARE/license/%{name}-caller
154
155 %files caller-devel
156 %manifest %{name}-caller-devel.manifest
157 %defattr(-,root,root,-)
158 %{_libdir}/libsyspopup_caller.so
159 %{_includedir}/syspopup_caller.h
160 %{_libdir}/pkgconfig/syspopup-caller.pc
161 %TZ_SYS_RO_SHARE/license/%{name}-caller-devel