Add build config for decrypt support
[platform/framework/web/wrt.git] / packaging / wrt.spec
1 %bcond_with wayland
2 Name:       wrt
3 Summary:    Web runtime
4 Version:    0.8.198.3
5 Release:    1
6 Group:      Development/Libraries
7 License:    Apache-2.0
8 URL:        N/A
9 Source0:    %{name}-%{version}.tar.gz
10 ## wrt-launchpad-daemon #######################################################
11 Source101:  wrt_launchpad_daemon@.service
12 ###############################################################################
13
14 BuildRequires:  cmake
15 BuildRequires:  gettext
16 BuildRequires:  edje-tools
17 BuildRequires:  pkgconfig(aul)
18 BuildRequires:  pkgconfig(glib-2.0)
19 BuildRequires:  pkgconfig(ewebkit2)
20 BuildRequires:  pkgconfig(appcore-efl)
21 BuildRequires:  pkgconfig(openssl)
22 BuildRequires:  pkgconfig(cert-svc)
23 BuildRequires:  pkgconfig(dpl-efl)
24 BuildRequires:  pkgconfig(libpcrecpp)
25 BuildRequires:  pkgconfig(ecore)
26 BuildRequires:  pkgconfig(eina)
27 BuildRequires:  pkgconfig(ui-gadget-1)
28 BuildRequires:  pkgconfig(utilX)
29 BuildRequires:  pkgconfig(secure-storage)
30 BuildRequires:  pkgconfig(pkgmgr)
31 BuildRequires:  pkgconfig(libiri)
32 BuildRequires:  pkgconfig(appsvc)
33 BuildRequires:  pkgconfig(cert-svc-vcore)
34 BuildRequires:  pkgconfig(libsoup-2.4)
35 BuildRequires:  pkgconfig(security-core)
36 BuildRequires:  pkgconfig(security-client)
37 BuildRequires:  pkgconfig(notification)
38 BuildRequires:  pkgconfig(libprivilege-control)
39 BuildRequires:  pkgconfig(capi-appfw-app-manager)
40 BuildRequires:  pkgconfig(haptic)
41 BuildRequires:  pkgconfig(capi-web-url-download)
42 BuildRequires:  pkgconfig(wrt-plugin-loading)
43 BuildRequires:  pkgconfig(wrt-plugin-js-overlay)
44 BuildRequires:  pkgconfig(dpl-encryption)
45 BuildRequires:  pkgconfig(wrt-popup-wrt-runner)
46 BuildRequires:  pkgconfig(wrt-popup-ace-runner)
47 BuildRequires:  pkgconfig(sysman)
48 BuildRequires:  pkgconfig(app2sd)
49 BuildRequires:  pkgconfig(capi-system-system-settings)
50 %if !%{with wayland}
51 BuildRequires:  pkgconfig(osp-appfw)
52 BuildRequires:  osp-appfw-internal-devel
53 Requires: osp-appfw
54 %endif
55 Requires(post): /sbin/ldconfig
56 Requires(postun): /sbin/ldconfig
57
58 ## wrt-launchpad-daemon #######################################################
59 BuildRequires:  pkgconfig(app-checker)
60 BuildRequires:  pkgconfig(bundle)
61 BuildRequires:  pkgconfig(dlog)
62 BuildRequires:  pkgconfig(dbus-glib-1)
63 BuildRequires:  pkgconfig(libsmack)
64 BuildRequires:  pkgconfig(sqlite3)
65 BuildRequires:  pkgconfig(x11)
66 BuildRequires:  pkgconfig(aul)
67 ###############################################################################
68
69 %description
70 web runtime
71
72 %package devel
73 Summary:    Wrt header files for external modules
74 Group:      Development/Libraries
75 Requires:   %{name} = %{version}
76
77 %description devel
78 wrt library development headers
79
80 %prep
81 %setup -q
82
83 %define with_tests 0
84 %if "%{WITH_TESTS}" == "ON" || "%{WITH_TESTS}" == "Y" || "%{WITH_TESTS}" == "YES" || "%{WITH_TESTS}" == "TRUE" || "%{WITH_TESTS}" == "1"
85     %define with_tests 1
86 %endif
87
88 %build
89 export LDFLAGS+="-Wl,--rpath=%{_libdir}"
90
91 %cmake . -DDPL_LOG="ON"       \
92          -DPROJECT_VERSION=%{version} \
93          -DCMAKE_BUILD_TYPE=%{?build_type:%build_type} \
94 %if %{with wayland}
95          -DDECRYPT_SUPPORT=Off \
96 %else
97          -DDECRYPT_SUPPORT=On \
98 %endif
99         %{?WITH_TESTS:-DWITH_TESTS=%WITH_TESTS}
100
101 make %{?jobs:-j%jobs}
102
103 %install
104 mkdir -p %{buildroot}/usr/share/license
105 cp LICENSE %{buildroot}/usr/share/license/%{name}
106 %make_install
107
108 ## wrt-launchpad-daemon #######################################################
109 mkdir -p %{buildroot}/etc/init.d
110 install -m 755 src/wrt-launchpad-daemon/wrt_launchpad_run.sh %{buildroot}/%{_sysconfdir}/init.d
111
112 mkdir -p %{buildroot}/etc/rc.d/rc3.d
113 mkdir -p %{buildroot}/etc/rc.d/rc4.d
114 ln -sf ../../init.d/wrt_launchpad_run.sh %{buildroot}/%{_sysconfdir}/rc.d/rc3.d/S15wrt_launchpad_run
115 ln -sf ../../init.d/wrt_launchpad_run.sh %{buildroot}/%{_sysconfdir}/rc.d/rc4.d/S80wrt_launchpad_run
116
117 #systemd
118 mkdir -p %{buildroot}%{_unitdir}/graphical.target.wants
119 install -m 0644 %SOURCE101 %{buildroot}%{_unitdir}/wrt_launchpad_daemon@.service
120 ln -s ../wrt_launchpad_daemon@.service %{buildroot}%{_unitdir}/graphical.target.wants/wrt_launchpad_daemon@app.service
121
122 %preun
123 if [ $1 == 0 ]; then
124     systemctl stop wrt_launchpad_daemon@app.service
125 fi
126 ###############################################################################
127
128 %clean
129 rm -rf %{buildroot}
130
131 %post
132 /sbin/ldconfig
133 chmod +s /usr/bin/wrt-launcher
134
135 ## wrt-launchpad-daemon #######################################################
136 #systemd
137 /sbin/ldconfig
138 systemctl daemon-reload
139 if [ $1 == 1 ]; then
140     systemctl restart wrt_launchpad_daemon@app.service
141 fi
142 ###############################################################################
143
144 echo "[WRT] wrt postinst done ..."
145
146 ## wrt-launchpad-daemon #######################################################
147 #systemd
148 %postun -p /sbin/ldconfig
149 systemctl daemon-reload
150 ###############################################################################
151
152 %files
153 %manifest wrt.manifest
154 %{_libdir}/*.so
155 %{_libdir}/*.so.*
156 %attr(755,root,root) %{_bindir}/wrt-client
157 %attr(755,root,root) %{_bindir}/wrt-launcher
158 %attr(755,root,root) %{_bindir}/wrt_reset_all.sh
159 %attr(755,root,root) %{_bindir}/wrt_reset_db.sh
160 %{_datadir}/locale/*
161 %{_datadir}/wrt-engine/*
162 %{_datadir}/license/%{name}
163 %attr(644,root,root) %{_datadir}/edje/wrt/*
164 %attr(644,root,root) %{_datadir}/edje/ace/*
165 %attr(644,root,root) /usr/etc/wrt/*
166 %if %{with_tests}
167     %attr(755,root,root) %{_bindir}/wrt-tests-general
168     /opt/share/widget/tests/general/*
169 %endif
170 %attr(755,root,root) %{_sysconfdir}/profile.d/wrt_env.sh
171
172 ## wrt-launchpad-daemon #######################################################
173 %attr(755,root,root) %{_bindir}/wrt_launchpad_daemon
174 /usr/share/aul/preload_list_wrt.txt
175 %{_sysconfdir}/init.d/wrt_launchpad_run.sh
176 %attr(0755,root,root) %{_sysconfdir}/rc.d/rc3.d/S15wrt_launchpad_run
177 %attr(0755,root,root) %{_sysconfdir}/rc.d/rc4.d/S80wrt_launchpad_run
178 /etc/smack/accesses2.d/wrt_launchpad_daemon.rule
179 /opt/etc/smack/accesses.d/wrt_launchpad_daemon.rule
180 #systemd
181 %{_unitdir}/graphical.target.wants/wrt_launchpad_daemon@app.service
182 %{_unitdir}/wrt_launchpad_daemon@.service
183 ###############################################################################
184
185 %files devel
186 %{_includedir}/*
187 %{_libdir}/pkgconfig/*
188