Apply wearable profile
[apps/native/starter.git] / packaging / starter.spec
1 %bcond_with wayland
2 %define __usrdir /usr/lib/systemd/user
3
4 Name:       starter
5 Summary:    starter
6 Version: 0.5.52
7 Release:    1
8 Group:      TO_BE/FILLED_IN
9 License:    Apache-2.0
10 Source0:    starter-%{version}.tar.gz
11 Source1:    starter.service
12 Source2:    starter.path
13 Source3:    starter-pre.service
14 Source4:    starter-pre.path
15
16 %if "%{profile}" == "tv"
17 ExcludeArch: %{arm} %ix86 x86_64
18 %endif
19
20 BuildRequires:  cmake
21 BuildRequires:  pkgconfig(appcore-efl)
22 BuildRequires:  pkgconfig(aul)
23 BuildRequires:  pkgconfig(capi-appfw-application)
24 BuildRequires:  pkgconfig(capi-appfw-app-manager)
25 BuildRequires:  pkgconfig(capi-system-media-key)
26 BuildRequires:  pkgconfig(capi-network-bluetooth)
27 BuildRequires:  pkgconfig(capi-system-system-settings)
28
29 %if "%{profile}" == "mobile"
30 BuildRequires:  tts
31 BuildRequires:  tts-devel
32 BuildRequires:  pkgconfig(capi-message-port)
33 BuildRequires:  pkgconfig(security-manager)
34 BuildRequires:  pkgconfig(efl-extension)
35 %endif
36
37 BuildRequires:  pkgconfig(feedback)
38 BuildRequires:  pkgconfig(db-util)
39 BuildRequires:  pkgconfig(dlog)
40 BuildRequires:  pkgconfig(ecore)
41 BuildRequires:  pkgconfig(ecore-wayland)
42 BuildRequires:  pkgconfig(edje)
43 BuildRequires:  pkgconfig(edbus)
44 BuildRequires:  pkgconfig(eina)
45 BuildRequires:  pkgconfig(elementary)
46 BuildRequires:  pkgconfig(evas)
47 BuildRequires:  pkgconfig(glib-2.0)
48 BuildRequires:  pkgconfig(syspopup-caller)
49 BuildRequires:  pkgconfig(ui-gadget-1)
50 BuildRequires:  pkgconfig(vconf)
51 BuildRequires:  pkgconfig(alarm-service)
52 BuildRequires:  pkgconfig(pkgmgr-info)
53 BuildRequires:  pkgconfig(deviced)
54 BuildRequires:  pkgconfig(edbus)
55 BuildRequires:  pkgconfig(dbus-1)
56 BuildRequires:  pkgconfig(dbus-glib-1)
57 BuildRequires:  cmake
58 BuildRequires:  edje-bin
59 BuildRequires:  gettext
60 BuildRequires:  gettext-tools
61 Requires(post): /usr/bin/vconftool
62 #Requires: sys-assert
63
64 %if !%{with wayland}
65 BuildRequires:  pkgconfig(utilX)
66 %endif
67
68 %description
69 Description: Starter
70
71
72 %prep
73 %setup -q
74
75 %build
76 %if 0%{?sec_build_binary_debug_enable}
77 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
78 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
79 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
80 %endif
81
82 %if "%{profile}" == "wearable"
83 %define TIZEN_PROFILE_NAME "WEARABLE"
84 export CFLAGS="$CFLAGS -DTIZEN_PROFILE_WEARABLE"
85 export CXXFLAGS="$CXXFLAGS -DTIZEN_PROFILE_WEARABLE"
86 %else
87 %define TIZEN_PROFILE_NAME "MOBILE"
88 export CFLAGS="$CFLAGS -DTIZEN_PROFILE_MOBILE"
89 export CXXFLAGS="$CXXFLAGS -DTIZEN_PROFILE_MOBILE"
90 %endif
91
92 %ifarch %{arm}
93 export CFLAGS="$CFLAGS -DTIZEN_BUILD_TARGET"
94 export CXXFLAGS="$CXXFLAGS -DTIZEN_BUILD_TARGET"
95 %else
96 export CFLAGS="$CFLAGS -DTIZEN_BUILD_EMULATOR"
97 export CXXFLAGS="$CXXFLAGS -DTIZEN_BUILD_EMULATOR"
98 %endif
99
100 %if %{with wayland}
101 export WAYLAND_SUPPORT=On
102 export X11_SUPPORT=Off
103 %else
104 export WAYLAND_SUPPORT=Off
105 export X11_SUPPORT=On
106 %endif
107
108 cmake . -DTIZEN_PROFILE_NAME=%{TIZEN_PROFILE_NAME} -DCMAKE_INSTALL_PREFIX=%{_prefix} -DWAYLAND_SUPPORT=${WAYLAND_SUPPORT} -DX11_SUPPORT=${X11_SUPPORT}
109
110 make
111 make -j1
112 %install
113 rm -rf %{buildroot}
114 %make_install
115
116 mkdir -p %{buildroot}%{__usrdir}/default.target.wants
117 mkdir -p %{buildroot}%{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
118
119 install -m 0644 %SOURCE1 %{buildroot}%{__usrdir}/starter.service
120 ln -s ../starter.service %{buildroot}%{__usrdir}/default.target.wants/starter.service
121
122 install -m 0644 %SOURCE2 %{buildroot}%{__usrdir}/starter.path
123 ln -s ../starter.path %{buildroot}%{__usrdir}/default.target.wants/starter.path
124
125 install -m 0644 %SOURCE3 %{buildroot}%{__usrdir}/starter-pre.service
126 ln -s ../starter-pre.service %{buildroot}%{__usrdir}/default.target.wants/starter-pre.service
127
128 install -m 0644 %SOURCE4 %{buildroot}%{__usrdir}/starter-pre.path
129 ln -s ../starter-pre.path %{buildroot}%{__usrdir}/default.target.wants/starter-pre.path
130
131 mkdir -p %{buildroot}/usr/share/license
132 cp -f LICENSE %{buildroot}/usr/share/license/%{name}
133 mkdir -p %{buildroot}/opt/data/home-daemon
134
135 %post
136 change_file_executable()
137 {
138     chmod +x $@ 2>/dev/null
139     if [ $? -ne 0 ]; then
140         echo "Failed to change the perms of $@"
141     fi
142 }
143
144 mkdir -p %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
145
146 #ln -sf /etc/init.d/rd4starter /etc/rc.d/rc4.d/S81starter
147 #ln -sf /etc/init.d/rd4starter /etc/rc.d/rc3.d/S81starter
148
149 sync
150
151 %files
152 %manifest starter.manifest
153 %defattr(-,root,root,-)
154 %{_sysconfdir}/init.d/rd4starter
155 %{_sysconfdir}/init.d/rd3starter
156 %{_bindir}/starter
157 %{__usrdir}/starter.service
158 %{__usrdir}/starter.path
159 %{__usrdir}/starter-pre.service
160 %{__usrdir}/starter-pre.path
161 %{__usrdir}/default.target.wants/starter.service
162 %{__usrdir}/default.target.wants/starter.path
163 %{__usrdir}/default.target.wants/starter-pre.service
164 %{__usrdir}/default.target.wants/starter-pre.path
165 /usr/share/license/%{name}
166 /opt/data/home-daemon
167 /usr/share/locale/*/LC_MESSAGES/*
168
169 %if "%{profile}" == "mobile"
170 /usr/share/starter/res/edje/*
171 %endif