summaryrefslogtreecommitdiff
path: root/packaging/libscl-core.spec
blob: 2ecca932d715aa86e7d3a22bd93bb435e7433cc5 (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
%bcond_with x
%bcond_with wayland

# Do not create auto-Provides from .so files of wearable so that
# we can manually create .so Provides from the main package,
# which eliminates ambiguity in build systems.
%global __provides_exclude_from ^%{_libdir}/.*\\.so.wearable$

Name:       libscl-core
Summary:    A library for developing software keyboards
Version:    0.7.2
Release:    1
Group:      Graphics & UI Framework/Input
License:    Apache-2.0
Source0:    %{name}-%{version}.tar.gz
BuildRequires:  cmake
BuildRequires:  pkgconfig(elementary)
BuildRequires:  pkgconfig(vconf)
BuildRequires:  pkgconfig(dlog)
BuildRequires:  pkgconfig(isf)
%if %{with wayland}
BuildRequires:  pkgconfig(ecore-wl2)
BuildRequires:  pkgconfig(wayland-client)
BuildRequires:  pkgconfig(input-method-client)
%else
BuildRequires:  pkgconfig(ecore-x)
BuildRequires:  pkgconfig(x11)
%endif
BuildRequires:  pkgconfig(libscl-common)
BuildRequires:  pkgconfig(appcore-efl)
BuildRequires:  pkgconfig(capi-appfw-app-common)
# This is for backward-compatibility. This does not deteriorate 4.0 Configurability
# if wearable || "undefined"
%if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
BuildRequires:  pkgconfig(libwebsockets)
%endif

Provides:	%{name}-profile_common = %{version}-%{release}
Provides:	%{name}-profile_mobile = %{version}-%{release}
Provides:	%{name}-profile_tv = %{version}-%{release}
Provides:	%{name}-profile_ivi = %{version}-%{release}

%description
A library that helps developing S/W Keyboard

# This is for backward-compatibility. This does not deteriorate 4.0 Configurability
# if wearable || "undefined"
%if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
%package profile_wearable
Summary:	libscl-core subpackage for wearable
Requires:	%{name} = %{version}-%{release}
%description profile_wearable
A library extension for %{name} for developing software keyboards for wearable.
%endif

%package devel
Summary:    SCL-Core header file
Group:      Development/Libraries
Requires:   %{name} = %{version}-%{release}
%description devel
A devel package of libscl-core library that helps developing S/W Keyboard

%prep
%setup -q

%build
export CFLAGS+=" -fvisibility=hidden -DTIZEN_DEBUG_ENABLE -Werror"
export CXXFLAGS+="  -fvisibility=hidden -fvisibility-inlines-hidden -DTIZEN_DEBUG_ENABLE -Werror"
export FFLAGS+=" -DTIZEN_DEBUG_ENABLE"

rm -rf CMakeFiles
rm -rf CMakeCache.txt

# This is for backward-compatibility. This does not deteriorate 4.0 Configurability
# if wearable || "undefined"
%if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
# wearable
mkdir -p wearable
pushd wearable
%if %{with wayland}
cmake .. -DCMAKE_INSTALL_PREFIX=%{_prefix} -DLIB_INSTALL_DIR:PATH=%{_libdir} -Dwith_wayland=TRUE -Dwith_websocket=TRUE
%else
cmake .. -DCMAKE_INSTALL_PREFIX=%{_prefix} -DLIB_INSTALL_DIR:PATH=%{_libdir} -Dwith_websocket=TRUE
%endif
make %{?_smp_mflags}
popd
%endif

# This is for backward-compatibility. This does not deteriorate 4.0 Configurability
# if mobile || tv || ivi || common || "undefined"
%if "%{?profile}" != "wearable"
# common
%if %{with wayland}
cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DLIB_INSTALL_DIR:PATH=%{_libdir} -Dwith_wayland=TRUE -Dwith_websocket=FALSE
%else
cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DLIB_INSTALL_DIR:PATH=%{_libdir} -Dwith_websocket=FALSE
%endif
make %{?_smp_mflags}
%endif

%install
rm -rf %{buildroot}

# This is for backward-compatibility. This does not deteriorate 4.0 Configurability
# if wearable || "undefined"
%if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
pushd wearable
%make_install
%if "%{?profile}" == "wearable"
cp %{buildroot}%{_libdir}/%{name}.so %{buildroot}%{_libdir}/%{name}.so.wearable
%else
mv %{buildroot}%{_libdir}/%{name}.so %{buildroot}%{_libdir}/%{name}.so.wearable
%endif
popd
%endif

# This is for backward-compatibility. This does not deteriorate 4.0 Configurability
# if mobile || tv || ivi || common || "undefined"
%if "%{?profile}" != "wearable"
%make_install
%endif

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

# This is for backward-compatibility. This does not deteriorate 4.0 Configurability
# if wearable || "undefined"
%if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
%post profile_wearable
pushd %{_libdir}
for FILE in %{name}.so.wearable; do ln -sf "$FILE" "${FILE%.wearable}"; done
popd
/sbin/ldconfig

%preun profile_wearable
rm %{_libdir}/%{name}.so
/sbin/ldconfig
%endif

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

# This is for backward-compatibility. This does not deteriorate 4.0 Configurability
# if wearable || "undefined"
%if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"

%files profile_wearable
%manifest %{name}.manifest
%defattr(-,root,root,-)
%{_libdir}/%{name}.so.wearable
%endif

%files devel
%defattr(-,root,root,-)
%{_includedir}/*
%{_libdir}/pkgconfig/%{name}.pc