[Release] wrt-installer_0.1.29
[framework/web/wrt-installer.git] / packaging / wrt-installer.spec
1 #git:framework/web/wrt-installer wrt-installer 0.1.29
2 Name:       wrt-installer
3 Summary:    Installer for tizen Webruntime
4 Version:    0.1.29
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 chmod +s /usr/bin/wrt-installer
91
92 #symlink for package manager
93 ln -sf /usr/bin/wrt-installer /usr/etc/package-manager/backend/wgt
94
95 #for booting recovery
96 mkdir -p /opt/share/widget/temp_info
97 [ -h /etc/rc.d/rc3.d/S48lwrt_preinstall_widgets.sh ] && rm /etc/rc.d/rc3.d/S48lwrt_preinstall_widgets.sh
98 [ -h /etc/rc.d/rc5.d/S48lwrt_preinstall_widgets.sh ] && rm /etc/rc.d/rc5.d/S48lwrt_preinstall_widgets.sh
99 ln -s /etc/rc.d/init.d/wrt_preinstall_widgets.sh /etc/rc.d/rc3.d/S48lwrt_preinstall_widgets.sh
100 ln -s /etc/rc.d/init.d/wrt_preinstall_widgets.sh /etc/rc.d/rc5.d/S48lwrt_preinstall_widgets.sh
101
102 # for downloadable Application icons path
103 mkdir -p /opt/share/icons/default/small
104
105 %files
106 %manifest wrt-installer.manifest
107 %attr(755,root,root) %{_bindir}/wrt-installer
108 %attr(775,root,root) %{_initddir}/wrt_preinstall_widgets.sh
109 %{_sysconfdir}/rc.d/rc3.d/S48lwrt_preinstall_widgets.sh
110 %{_sysconfdir}/rc.d/rc5.d/S48lwrt_preinstall_widgets.sh
111 %attr(644,root,root) %{_datadir}/edje/wrt/*
112 /usr/etc/package-manager/backendlib/libwgt.so
113 %{_datadir}/license/%{name}
114 %{_libdir}/systemd/user/tizen-mobile-session.target.wants/wrt-preinstall-widgets.service
115 %{_libdir}/systemd/user/wrt-preinstall-widgets.service
116 %if %{with_tests}
117     %attr(755,root,root) %{_bindir}/wrt-installer-tests-*
118     /opt/share/widget/tests/installer/widgets/*
119 %endif