Fixed wrong progress status during installation
[framework/web/wrt-installer.git] / packaging / wrt-installer.spec
1 #git:framework/web/wrt-installer wrt-installer 0.1.38
2 Name:       wrt-installer
3 Summary:    Installer for tizen Webruntime
4 Version:    0.1.38
5 Release:    1
6 Group:      Development/Libraries
7 License:    Apache License, Version 2.0
8 URL:        N/A
9 Source0:    %{name}-%{version}.tar.gz
10 Source100:  wrt-preinstall-widgets.service
11 BuildRequires:  cmake
12 BuildRequires:  edje-tools
13 BuildRequires:  pkgconfig(appsvc)
14 BuildRequires:  pkgconfig(libxml-2.0)
15 BuildRequires:  pkgconfig(openssl)
16 BuildRequires:  pkgconfig(dpl-efl)
17 BuildRequires:  pkgconfig(cert-svc-vcore)
18 BuildRequires:  pkgconfig(dpl-event-efl)
19 BuildRequires:  pkgconfig(dpl-utils-efl)
20 BuildRequires:  pkgconfig(dpl-wrt-dao-ro)
21 BuildRequires:  pkgconfig(dpl-wrt-dao-rw)
22 BuildRequires:  pkgconfig(security-install)
23 BuildRequires:  pkgconfig(ecore-x)
24 BuildRequires:  pkgconfig(xmlsec1)
25 BuildRequires:  pkgconfig(libidn)
26 BuildRequires:  pkgconfig(libiri)
27 BuildRequires:  pkgconfig(libpcrecpp)
28 BuildRequires:  pkgconfig(pkgmgr-installer)
29 BuildRequires:  pkgconfig(pkgmgr-parser)
30 BuildRequires:  pkgconfig(pkgmgr-types)
31 BuildRequires:  pkgconfig(pkgmgr)
32 BuildRequires:  pkgconfig(dlog)
33 BuildRequires:  pkgconfig(cert-svc)
34 BuildRequires:  pkgconfig(utilX)
35 BuildRequires:  pkgconfig(wrt-plugins-types)
36 BuildRequires:  pkgconfig(tapi)
37 BuildRequires:  pkgconfig(shortcut)
38 BuildRequires:  pkgconfig(dpl-encryption)
39 BuildRequires:  pkgconfig(capi-appfw-app-manager)
40 BuildRequires:  pkgconfig(app2sd)
41 BuildRequires:  pkgconfig(web-provider)
42 BuildRequires:  pkgconfig(libprivilege-control)
43 BuildRequires:  pkgconfig(osp-appfw)
44 BuildRequires:  osp-appfw-internal-devel
45 Requires: osp-appfw
46 Requires: xmlsec1
47
48 %description
49 Description: Wrt Installer for Tizen apps and Wac apps
50
51 %prep
52 %setup -q
53
54 %define with_tests 0
55 %if "%{WITH_TESTS}" == "ON" || "%{WITH_TESTS}" == "Y" || "%{WITH_TESTS}" == "YES" || "%{WITH_TESTS}" == "TRUE" || "%{WITH_TESTS}" == "1"
56     %define with_tests 1
57 %endif
58
59 %build
60
61 export LDFLAGS+="-Wl,--rpath=/usr/lib -Wl,--hash-style=both -Wl,--as-needed"
62 LDFLAGS="$LDFLAGS"
63
64 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
65         -DDPL_LOG=ON \
66         -DCMAKE_BUILD_TYPE=%{?build_type:%build_type} \
67         %{?WITH_TESTS:-DWITH_TESTS=%WITH_TESTS}
68 make %{?jobs:-j%jobs}
69
70 %install
71 rm -rf %{buildroot}
72 mkdir -p %{buildroot}/usr/share/license
73 cp LICENSE %{buildroot}/usr/share/license/%{name}
74 %make_install
75
76 mkdir -p %{buildroot}%{_libdir}/systemd/user
77 install -m 644 %{SOURCE100} %{buildroot}%{_libdir}/systemd/user
78 mkdir -p %{buildroot}%{_libdir}/systemd/user/tizen-mobile-session.target.wants
79 ln -s ../wrt-preinstall-widgets.service %{buildroot}%{_libdir}/systemd/user/tizen-mobile-session.target.wants
80
81 mkdir -p %{buildroot}%{_sysconfdir}/rc.d/rc3.d/
82 mkdir -p %{buildroot}%{_sysconfdir}/rc.d/rc5.d/
83 ln -s ../init.d/wrt_preinstall_widgets.sh %{buildroot}%{_sysconfdir}/rc.d/rc3.d/S48lwrt_preinstall_widgets.sh
84 ln -s ../init.d/wrt_preinstall_widgets.sh %{buildroot}%{_sysconfdir}/rc.d/rc5.d/S48lwrt_preinstall_widgets.sh
85
86 %clean
87 rm -rf %{buildroot}
88
89 %post
90 /sbin/ldconfig
91 chmod +s /usr/bin/wrt-installer
92
93 #symlink for package manager
94 ln -sf /usr/bin/wrt-installer /usr/etc/package-manager/backend/wgt
95
96 #for booting recovery
97 mkdir -p /opt/share/widget/temp_info
98 [ -h /etc/rc.d/rc3.d/S48lwrt_preinstall_widgets.sh ] && rm /etc/rc.d/rc3.d/S48lwrt_preinstall_widgets.sh
99 [ -h /etc/rc.d/rc5.d/S48lwrt_preinstall_widgets.sh ] && rm /etc/rc.d/rc5.d/S48lwrt_preinstall_widgets.sh
100 ln -s /etc/rc.d/init.d/wrt_preinstall_widgets.sh /etc/rc.d/rc3.d/S48lwrt_preinstall_widgets.sh
101 ln -s /etc/rc.d/init.d/wrt_preinstall_widgets.sh /etc/rc.d/rc5.d/S48lwrt_preinstall_widgets.sh
102
103 # for downloadable Application icons path
104 mkdir -p /opt/share/icons/default/small
105
106 %postun -p /sbin/ldconfig
107
108 %files
109 %manifest wrt-installer.manifest
110 %attr(755,root,root) %{_bindir}/wrt-installer
111 %attr(775,root,root) %{_initddir}/wrt_preinstall_widgets.sh
112 %{_sysconfdir}/rc.d/rc3.d/S48lwrt_preinstall_widgets.sh
113 %{_sysconfdir}/rc.d/rc5.d/S48lwrt_preinstall_widgets.sh
114 /usr/etc/package-manager/backendlib/libwgt.so
115 %{_datadir}/license/%{name}
116 %{_libdir}/systemd/user/tizen-mobile-session.target.wants/wrt-preinstall-widgets.service
117 %{_libdir}/systemd/user/wrt-preinstall-widgets.service
118 %if %{with_tests}
119     %attr(755,root,root) %{_bindir}/wrt-installer-tests-*
120     /opt/share/widget/tests/installer/widgets/*
121 %endif