f025c5473d695e48df0e386904c35cc79d7fe2c7
[platform/framework/web/wrt-installer.git] / packaging / wrt-installer.spec
1 %bcond_with livebox
2 %bcond_with decrypt
3 %bcond_with osp
4 %bcond_with wayland
5 %bcond_with x
6
7 Name:       wrt-installer
8 Summary:    Installer for tizen Webruntime
9 Version:    0.1.138
10 Release:    1
11 Group:      Web Framework/Utilities
12 License:    Apache-2.0
13 Source0:    %{name}-%{version}.tar.gz
14 Source1001:     wrt-installer.manifest
15 BuildRequires:  cmake
16 BuildRequires:  edje-tools
17 BuildRequires:  pkgconfig(appsvc)
18 BuildRequires:  pkgconfig(libxml-2.0)
19 BuildRequires:  pkgconfig(openssl)
20 BuildRequires:  pkgconfig(dpl-efl)
21 BuildRequires:  pkgconfig(cert-svc-vcore)
22 BuildRequires:  pkgconfig(dpl-event-efl)
23 BuildRequires:  pkgconfig(dpl-utils-efl)
24 BuildRequires:  pkgconfig(dpl-wrt-dao-ro)
25 BuildRequires:  pkgconfig(dpl-wrt-dao-rw)
26 BuildRequires:  pkgconfig(wrt-commons-i18n-dao-ro)
27 BuildRequires:  pkgconfig(wrt-commons-widget-interface-dao)
28 BuildRequires:  pkgconfig(security-install)
29 %if %{with x}
30 BuildRequires:  pkgconfig(ecore-x)
31 %endif
32 %if %{with wayland}
33 BuildRequires:  pkgconfig(ecore-wayland)
34 %endif
35 BuildRequires:  pkgconfig(xmlsec1)
36 BuildRequires:  pkgconfig(libidn)
37 BuildRequires:  pkgconfig(libiri)
38 BuildRequires:  pkgconfig(libpcrecpp)
39 BuildRequires:  pkgconfig(pkgmgr-installer)
40 BuildRequires:  pkgconfig(pkgmgr-parser)
41 BuildRequires:  pkgconfig(pkgmgr-types)
42 BuildRequires:  pkgconfig(pkgmgr-info)
43 BuildRequires:  pkgconfig(pkgmgr)
44 BuildRequires:  pkgconfig(dlog)
45 BuildRequires:  pkgconfig(cert-svc)
46 BuildRequires:  pkgconfig(wrt-plugins-types)
47 BuildRequires:  pkgconfig(tapi)
48 BuildRequires:  pkgconfig(shortcut)
49 BuildRequires:  pkgconfig(capi-appfw-app-manager)
50 BuildRequires:  pkgconfig(app2sd)
51 %if %{with livebox}
52 BuildRequires:  pkgconfig(web-provider)
53 %endif
54 BuildRequires:  pkgconfig(libprivilege-control)
55 BuildRequires:  pkgconfig(libsmack)
56 BuildRequires:  libss-client-devel
57 Requires: libss-client
58 %if %{with osp}
59 Requires: osp-installer
60 %endif
61 Requires: xmlsec1
62
63 %description
64 Description: Wrt Installer for Tizen apps and Wac apps
65
66 %package preinstall-service
67 Summary: Service for installing wgt files on first boot
68 Group:   Web Framework/Utilities
69 %description preinstall-service
70 This package installs a first time boot systemd service for 
71 completing the installation of preinstalled web apps.
72
73 %prep
74 %setup -q
75 cp %{SOURCE1001} .
76
77 %define with_tests 0
78 %if "%{WITH_TESTS}" == "ON" || "%{WITH_TESTS}" == "Y" || "%{WITH_TESTS}" == "YES" || "%{WITH_TESTS}" == "TRUE" || "%{WITH_TESTS}" == "1"
79     %define with_tests 1
80 %endif
81
82 %build
83 %if 0%{?tizen_build_binary_release_type_eng}
84 export CFLAGS="$CFLAGS -DTIZEN_ENGINEER_MODE"
85 export CXXFLAGS="$CXXFLAGS -DTIZEN_ENGINEER_MODE"
86 export FFLAGS="$FFLAGS -DTIZEN_ENGINEER_MODE"
87 %endif
88
89 export LDFLAGS+="-Wl,--rpath=%{_libdir} -Wl,--hash-style=both -Wl,--as-needed"
90 LDFLAGS="$LDFLAGS"
91
92 %cmake . -DCMAKE_INSTALL_PREFIX=/usr \
93 %if %{with livebox}
94         -DLIVEBOX_SUPPORT=On \
95 %else
96         -DLIVEBOX_SUPPORT=Off \
97 %endif
98 %if %{with decrypt}
99          -DDECRYPT_SUPPORT=On \
100 %else
101          -DDECRYPT_SUPPORT=Off \
102 %endif
103 %if %{with wayland}
104          -DWAYLAND_SUPPORT=On \
105 %else
106          -DWAYLAND_SUPPORT=Off \
107 %endif
108 %if %{with x}
109          -DX11_SUPPORT=On \
110 %else
111          -DX11_SUPPORT=Off \
112 %endif
113         -DSYSCONFDIR=%{_sysconfdir} \
114         -DSMACK=Off \
115         -DDPL_LOG=ON \
116         -DCMAKE_BUILD_TYPE=%{?build_type:%build_type} \
117         %{?WITH_TESTS:-DWITH_TESTS=%WITH_TESTS}
118 make %{?jobs:-j%jobs}
119
120 %install
121 rm -rf %{buildroot}
122 mkdir -p %{buildroot}/usr/share/license
123 cp LICENSE %{buildroot}/usr/share/license/%{name}
124 %make_install
125
126 mkdir -p %{buildroot}%{_unitdir}/graphical.target.wants
127 ln -s ../wrt-preinstall-widgets.service %{buildroot}%{_unitdir}/graphical.target.wants
128
129 %clean
130 rm -rf %{buildroot}
131
132 %post
133 /sbin/ldconfig
134 chmod +s /usr/bin/wrt-installer
135
136 #symlink for package manager
137 %define pkg_manager_backend_path %{_sysconfdir}"/package-manager/backend"
138 ln -sf /usr/bin/wrt-installer %{pkg_manager_backend_path}/wgt
139 ln -sf %{pkg_manager_backend_path}/wgt %{pkg_manager_backend_path}/Wgt
140 ln -sf %{pkg_manager_backend_path}/wgt %{pkg_manager_backend_path}/wGt
141 ln -sf %{pkg_manager_backend_path}/wgt %{pkg_manager_backend_path}/wgT
142 ln -sf %{pkg_manager_backend_path}/wgt %{pkg_manager_backend_path}/WGt
143 ln -sf %{pkg_manager_backend_path}/wgt %{pkg_manager_backend_path}/wGT
144 ln -sf %{pkg_manager_backend_path}/wgt %{pkg_manager_backend_path}/WgT
145 ln -sf %{pkg_manager_backend_path}/wgt %{pkg_manager_backend_path}/WGT
146
147 #for booting recovery
148 mkdir -p /opt/share/widget/temp_info
149
150 # for downloadable Application icons path
151 mkdir -p /opt/share/icons/default/small
152
153 %postun -p /sbin/ldconfig
154
155 %files
156 %manifest %{name}.manifest
157 %attr(755,root,root) %{_bindir}/wrt-installer
158 %{_sysconfdir}/package-manager/backendlib/libwgt.so
159 %attr(644,root,root) %{_sysconfdir}/wrt-installer/*.xsd
160 %{_datadir}/license/%{name}
161 %if %{with_tests}
162     %attr(755,root,root) %{_bindir}/wrt-installer-tests-*
163     /opt/share/widget/tests/installer/widgets/*
164 %endif
165
166 %files preinstall-service
167 %attr(755,root,root) %{_bindir}/wrt_preinstall_widgets.sh
168 %{_unitdir}/wrt-preinstall-widgets.service
169 %{_unitdir}/graphical.target.wants/wrt-preinstall-widgets.service