summaryrefslogtreecommitdiff
path: root/packaging/syspopup.spec
blob: fc3a9e92303c28fa7f3a3d0735ad8eb2c698b063 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
Name:           syspopup
Summary:        Syspopup package
Version:        0.3.4
Release:        0
Group:          System/Libraries
License:        Apache-2.0
Source0:        syspopup-%{version}.tar.gz
Source1001:     %{name}.manifest
Source1002:     %{name}-devel.manifest
Source1003:     %{name}-caller.manifest
Source1004:     %{name}-caller-devel.manifest

BuildRequires:  cmake
BuildRequires:  pkgconfig(sqlite3)
BuildRequires:  pkgconfig(bundle)
BuildRequires:  pkgconfig(dlog)
BuildRequires:  pkgconfig(glib-2.0)
BuildRequires:  pkgconfig(gio-2.0)
BuildRequires:  pkgconfig(ecore-wl2)
BuildRequires:  pkgconfig(capi-ui-efl-util)
BuildRequires:  pkgconfig(evas)
BuildRequires:  pkgconfig(elementary)
BuildRequires:  pkgconfig(libtzplatform-config)
BuildRequires:  pkgconfig(aul)
BuildRequires:  pkgconfig(capi-system-info)
BuildRequires:  pkgconfig(libsmack)
BuildRequires:  pkgconfig(libxml-2.0)

Requires(posttrans): /usr/bin/rm

%define upgrade_script_path /usr/share/upgrade/scripts

%description
syspopup package for popup

%package devel
Summary:    Syspopup development package
Group:      System/Libraries
Requires:   %{name} = %{version}-%{release}

%description devel
syspopup development package popup

%package caller
Summary:          Syspopup-caller package
Group:            System/Libraries
Requires:         %{name} = %{version}-%{release}
Requires(post):   /sbin/ldconfig
Requires(postun): /sbin/ldconfig

%description caller
syspopup-caller package for popup

%package caller-devel
Summary:    Syspopup-caller development package
Group:      System/Development
Requires:   %{name} = %{version}-%{release}

%description caller-devel
syspopup-caller development package for popup

%prep
%setup -q
cp %{SOURCE1001} %{SOURCE1002} %{SOURCE1003} %{SOURCE1004} .

%build
export CFLAGS+=" -DEFL_BETA_API_SUPPORT "
MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
%cmake -DTZ_SYS_RO_PACKAGES=%{TZ_SYS_RO_PACKAGES} \
	-DTZ_SYS_RO_SHARE=%{TZ_SYS_RO_SHARE} \
	-DEXTRA_CFLAGS=-fPIC \
	-DFULLVER=%{version} \
	-DMAJORVER=${MAJORVER} \
	-DSYSCONFDIR=%{_sysconfdir} \
	.

make %{?jobs:-j%jobs}

%install
%make_install
mkdir -p %{buildroot}%{_datadir}
touch %{buildroot}%{_datadir}/popup_noti_term

mkdir -p %{buildroot}%{upgrade_script_path}
cp -f scripts/502.syspopup_upgrade.sh %{buildroot}%{upgrade_script_path}

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%post caller -p /sbin/ldconfig

%postun caller -p /sbin/ldconfig

%posttrans
if [ -e %{_sysconfdir}/config/model-config.xml ]; then
	PROFILE=`grep "feature\/profile" %{_sysconfdir}/config/model-config.xml`
	if [[ "${PROFILE}" == *"mobile"* ]]; then
		rm -rf %{_datarootdir}/syspopup/default/wearable.xml
		rm -rf %{_datarootdir}/syspopup/default/tv.xml
		rm -rf %{_datarootdir}/syspopup/default/common.xml
		rm -rf %{_datarootdir}/syspopup/default/ivi.xml
	elif [[ "${PROFILE}" == *"wearable"* ]]; then
		rm -rf %{_datarootdir}/syspopup/default/mobile.xml
		rm -rf %{_datarootdir}/syspopup/default/tv.xml
		rm -rf %{_datarootdir}/syspopup/default/common.xml
		rm -rf %{_datarootdir}/syspopup/default/ivi.xml
	elif [[ "${PROFILE}" == *"tv"* ]]; then
		rm -rf %{_datarootdir}/syspopup/default/mobile.xml
		rm -rf %{_datarootdir}/syspopup/default/wearable.xml
		rm -rf %{_datarootdir}/syspopup/default/common.xml
		rm -rf %{_datarootdir}/syspopup/default/ivi.xml
	elif [[ "${PROFILE}" == *"common"* ]]; then
		rm -rf %{_datarootdir}/syspopup/default/mobile.xml
		rm -rf %{_datarootdir}/syspopup/default/wearable.xml
		rm -rf %{_datarootdir}/syspopup/default/tv.xml
		rm -rf %{_datarootdir}/syspopup/default/ivi.xml
	elif [[ "${PROFILE}" == *"ivi"* ]]; then
		rm -rf %{_datarootdir}/syspopup/default/mobile.xml
		rm -rf %{_datarootdir}/syspopup/default/wearable.xml
		rm -rf %{_datarootdir}/syspopup/default/tv.xml
		rm -rf %{_datarootdir}/syspopup/default/common.xml
	else
		rm -rf %{_datarootdir}/syspopup/default/mobile.xml
		rm -rf %{_datarootdir}/syspopup/default/wearable.xml
		rm -rf %{_datarootdir}/syspopup/default/tv.xml
		rm -rf %{_datarootdir}/syspopup/default/common.xml
		rm -rf %{_datarootdir}/syspopup/default/ivi.xml

	fi
else
	rm -rf %{_datarootdir}/syspopup/default/mobile.xml
	rm -rf %{_datarootdir}/syspopup/default/wearable.xml
	rm -rf %{_datarootdir}/syspopup/default/tv.xml
	rm -rf %{_datarootdir}/syspopup/default/common.xml
	rm -rf %{_datarootdir}/syspopup/default/ivi.xml
fi

/usr/bin/sp_initdb

%files
%manifest %{name}.manifest
%defattr(-,root,root,-)
%{_bindir}/sp_test
%{_bindir}/sp_initdb
%{_libdir}/libsyspopup.so.*
%{_datadir}/popup_noti_term
%license LICENSE
%{upgrade_script_path}/502.syspopup_upgrade.sh
%{_sysconfdir}/syspopup/preload/*
%{_prefix}/share/syspopup/*

%files devel
%manifest %{name}-devel.manifest
%defattr(-,root,root,-)
%{_includedir}/SLP_SYSPOPUP_PG.h
%{_includedir}/syspopup.h
%{_libdir}/libsyspopup.so
%{_libdir}/pkgconfig/syspopup.pc

%files caller
%manifest %{name}-caller.manifest
%defattr(-,root,root,-)
%{_libdir}/libsyspopup_caller.so.*
%license LICENSE

%files caller-devel
%manifest %{name}-caller-devel.manifest
%defattr(-,root,root,-)
%{_libdir}/libsyspopup_caller.so
%{_includedir}/syspopup_caller.h
%{_libdir}/pkgconfig/syspopup-caller.pc