+%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
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)
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}
%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"
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