Update package version to 0.9.8
[platform/core/uifw/libscl-core.git] / packaging / libscl-core.spec
1 %bcond_with x
2 %bcond_with wayland
3
4 # Do not create auto-Provides from .so files of wearable so that
5 # we can manually create .so Provides from the main package,
6 # which eliminates ambiguity in build systems.
7 %global __provides_exclude_from ^%{_libdir}/.*\\.so.wearable$
8
9 Name:       libscl-core
10 Summary:    A library for developing software keyboards
11 Version:    0.9.8
12 Release:    1
13 Group:      Graphics & UI Framework/Input
14 License:    Apache-2.0
15 Source0:    %{name}-%{version}.tar.gz
16 BuildRequires:  cmake
17 BuildRequires:  pkgconfig(elementary)
18 BuildRequires:  pkgconfig(vconf)
19 BuildRequires:  pkgconfig(dlog)
20 BuildRequires:  pkgconfig(isf)
21 %if %{with wayland}
22 BuildRequires:  pkgconfig(ecore-wl2)
23 BuildRequires:  pkgconfig(wayland-client)
24 BuildRequires:  pkgconfig(input-method-client)
25 %else
26 BuildRequires:  pkgconfig(ecore-x)
27 BuildRequires:  pkgconfig(x11)
28 %endif
29 BuildRequires:  pkgconfig(libscl-common)
30 BuildRequires:  pkgconfig(appcore-efl)
31 BuildRequires:  pkgconfig(capi-appfw-app-common)
32 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
33 # if wearable || "undefined"
34 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
35 BuildRequires:  pkgconfig(libwebsockets)
36 %endif
37
38 Provides:       %{name}-profile_common = %{version}-%{release}
39 Provides:       %{name}-profile_mobile = %{version}-%{release}
40 Provides:       %{name}-profile_tv = %{version}-%{release}
41 Provides:       %{name}-profile_ivi = %{version}-%{release}
42
43 %description
44 A library that helps developing S/W Keyboard
45
46 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
47 # if wearable || "undefined"
48 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
49 %package profile_wearable
50 Summary:        libscl-core subpackage for wearable
51 Requires:       %{name} = %{version}-%{release}
52 %description profile_wearable
53 A library extension for %{name} for developing software keyboards for wearable.
54 %endif
55
56 %package devel
57 Summary:    SCL-Core header file
58 Group:      Development/Libraries
59 Requires:   %{name} = %{version}-%{release}
60 %description devel
61 A devel package of libscl-core library that helps developing S/W Keyboard
62
63 %prep
64 %setup -q
65
66 %build
67 export CFLAGS+=" -fvisibility=hidden -DTIZEN_DEBUG_ENABLE -Werror"
68 export CXXFLAGS+="  -fvisibility=hidden -fvisibility-inlines-hidden -DTIZEN_DEBUG_ENABLE -Werror"
69 export FFLAGS+=" -DTIZEN_DEBUG_ENABLE"
70
71 rm -rf CMakeFiles
72 rm -rf CMakeCache.txt
73
74 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
75 # if wearable || "undefined"
76 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
77 # wearable
78 mkdir -p wearable
79 pushd wearable
80 %if %{with wayland}
81 cmake .. -DCMAKE_INSTALL_PREFIX=%{_prefix} -DLIB_INSTALL_DIR:PATH=%{_libdir} -Dwith_wayland=TRUE -Dwith_websocket=TRUE
82 %else
83 cmake .. -DCMAKE_INSTALL_PREFIX=%{_prefix} -DLIB_INSTALL_DIR:PATH=%{_libdir} -Dwith_websocket=TRUE
84 %endif
85 make %{?_smp_mflags}
86 popd
87 %endif
88
89 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
90 # if mobile || tv || ivi || common || "undefined"
91 %if "%{?profile}" != "wearable"
92 # common
93 %if %{with wayland}
94 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DLIB_INSTALL_DIR:PATH=%{_libdir} -Dwith_wayland=TRUE -Dwith_websocket=FALSE
95 %else
96 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DLIB_INSTALL_DIR:PATH=%{_libdir} -Dwith_websocket=FALSE
97 %endif
98 make %{?_smp_mflags}
99 %endif
100
101 %install
102 rm -rf %{buildroot}
103
104 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
105 # if wearable || "undefined"
106 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
107 pushd wearable
108 %make_install
109 %if "%{?profile}" == "wearable"
110 cp %{buildroot}%{_libdir}/%{name}.so %{buildroot}%{_libdir}/%{name}.so.wearable
111 %else
112 mv %{buildroot}%{_libdir}/%{name}.so %{buildroot}%{_libdir}/%{name}.so.wearable
113 %endif
114 popd
115 %endif
116
117 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
118 # if mobile || tv || ivi || common || "undefined"
119 %if "%{?profile}" != "wearable"
120 %make_install
121 %endif
122
123 %post -p /sbin/ldconfig
124
125 %postun -p /sbin/ldconfig
126
127 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
128 # if wearable || "undefined"
129 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
130 %post profile_wearable
131 pushd %{_libdir}
132 for FILE in %{name}.so.wearable; do ln -sf "$FILE" "${FILE%.wearable}"; done
133 popd
134 /sbin/ldconfig
135
136 %preun profile_wearable
137 rm %{_libdir}/%{name}.so
138 /sbin/ldconfig
139 %endif
140
141 %files
142 %manifest %{name}.manifest
143 %defattr(-,root,root,-)
144 %{_libdir}/%{name}.so
145 %license LICENSE
146
147 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
148 # if wearable || "undefined"
149 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
150
151 %files profile_wearable
152 %manifest %{name}.manifest
153 %defattr(-,root,root,-)
154 %{_libdir}/%{name}.so.wearable
155 %endif
156
157 %files devel
158 %defattr(-,root,root,-)
159 %{_includedir}/*
160 %{_libdir}/pkgconfig/%{name}.pc