Build in a pure Wayland environment
[platform/core/base/rpm-installer.git] / packaging / rpm-installer.spec
index 7608bd5..2f610b9 100755 (executable)
@@ -1,10 +1,14 @@
+%bcond_with wayland
+%bcond_with x
+
 Name:       rpm-installer
 Summary:    Native rpm installer
 Version:    0.1.25
-Release:    2
+Release:    0
 Group:      System/Libraries
-License:    Apache License, Version 2.0
+License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz
+Source1001: rpm-installer.manifest
 Requires(post): /sbin/ldconfig
 Requires(postun): /sbin/ldconfig
 BuildRequires:  cmake
@@ -21,7 +25,7 @@ BuildRequires:  pkgconfig(pkgmgr-types)
 BuildRequires:  pkgconfig(pkgmgr-installer)
 BuildRequires:  pkgconfig(pkgmgr-parser)
 BuildRequires:  pkgconfig(pkgmgr)
-BuildRequires: pkgconfig(pkgmgr-info)
+BuildRequires:  pkgconfig(pkgmgr-info)
 BuildRequires:  pkgconfig(app2sd)
 BuildRequires:  pkgconfig(libxml-2.0)
 BuildRequires:  pkgconfig(security-server)
@@ -30,18 +34,36 @@ BuildRequires:  pkgconfig(appcore-efl)
 BuildRequires:  pkgconfig(evas)
 BuildRequires:  pkgconfig(ecore)
 BuildRequires:  pkgconfig(edje)
+BuildRequires:  pkgconfig(libtzplatform-config)
 BuildRequires:  gettext-tools
-Requires:  /bin/cpio
+%if %{with x}
+BuildRequires:  pkgconfig(ecore-x)
+%endif
+%if %{with wayland}
+BuildRequires:  pkgconfig(ecore-wayland)
+%endif
+Requires:  cpio
 
 %description
 Native rpm installer
 
 %prep
 %setup -q
+cp %{SOURCE1001} .
 
 %build
 CFLAGS+=" -fpic"
-cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
+%cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \
+%if %{with wayland}
+        -DWAYLAND_SUPPORT=On \
+%else
+        -DWAYLAND_SUPPORT=Off \
+%endif
+%if %{with x}
+        -DX11_SUPPORT=On
+%else
+        -DX11_SUPPORT=Off
+%endif
 
 make %{?jobs:-j%jobs}
 
@@ -52,10 +74,10 @@ rm -rf %{buildroot}
 %post
 mkdir -p /usr/etc/package-manager/backend
 mkdir -p /usr/etc/package-manager/backendlib
-ln -sf /usr/bin/rpm-backend /usr/etc/package-manager/backend/rpm
+ln -sf %{_bindir}/rpm-backend /usr/etc/package-manager/backend/rpm
 ln -sf /usr/lib/libnativerpm.so /usr/etc/package-manager/backendlib/librpm.so
 
-chmod 700 /usr/bin/rpm-backend
+chmod 700 %{_bindir}/rpm-backend
 
 vconftool set -t int db/private/rpm-installer/state "0"
 vconftool set -t int db/private/rpm-installer/stateinfo "0"
@@ -64,15 +86,15 @@ vconftool set -t string db/private/rpm-installer/requestinfo/pkgname ""
 vconftool set -t int db/private/rpm-installer/requestinfo/options "0"
 
 %files
-%manifest rpm-installer.manifest
-%attr(0700,-,-) /usr/bin/rpm-backend
-%attr(0700,-,-) /usr/bin/install_rpm_package.sh
-%attr(0755,-,-) /usr/bin/query_rpm_package.sh
-%attr(0700,-,-) /usr/bin/uninstall_rpm_package.sh
-%attr(0700,-,-) /usr/bin/upgrade_rpm_package.sh
-%attr(0644,-,-) /usr/share/locale/en_GB/LC_MESSAGES/rpm-installer.mo
-%attr(0644,-,-) /usr/share/locale/ja_JP/LC_MESSAGES/rpm-installer.mo
-%attr(0644,-,-) /usr/share/locale/zh_CN/LC_MESSAGES/rpm-installer.mo
-%attr(0644,-,-) /usr/share/locale/en_US/LC_MESSAGES/rpm-installer.mo
-%attr(0644,-,-) /usr/share/locale/ko_KR/LC_MESSAGES/rpm-installer.mo
+%manifest %{name}.manifest
+%attr(0700,-,-) %{_bindir}/rpm-backend
+%attr(0700,-,-) %{_bindir}/install_rpm_package.sh
+%attr(0755,-,-) %{_bindir}/query_rpm_package.sh
+%attr(0700,-,-) %{_bindir}/uninstall_rpm_package.sh
+%attr(0700,-,-) %{_bindir}/upgrade_rpm_package.sh
+%attr(0644,-,-) %lang(en_GB) /usr/share/locale/en_GB/LC_MESSAGES/rpm-installer.mo
+%attr(0644,-,-) %lang(ja) /usr/share/locale/ja_JP/LC_MESSAGES/rpm-installer.mo
+%attr(0644,-,-) %lang(zh) /usr/share/locale/zh_CN/LC_MESSAGES/rpm-installer.mo
+%attr(0644,-,-) %lang(en_US) /usr/share/locale/en_US/LC_MESSAGES/rpm-installer.mo
+%attr(0644,-,-) %lang(ko) /usr/share/locale/ko_KR/LC_MESSAGES/rpm-installer.mo
 %attr(0644,-,-) /usr/lib/libnativerpm.so