SDB daemon extension for TV.
This changes the service unit files of the default SDB daemon service files.
+%ifarch %{ix86} x86_64
+%package extension-emulator
+Summary: SDB daemon for emulator
+Requires: %{name} = %{version}-%{release}
+%description extension-emulator
+SDB daemon for emulator
+
+%package extension-tv-emulator
+Summary: SDB daemon for tv emulator
+Requires: %{name}-profile_tv = %{version}-%{release}
+%description extension-tv-emulator
+SDB daemon for tv emulator
+%endif // ifarch %{ix86} x86_64
+
%package -n sdbd-devel
Summary: SDBD plugin API
Group: Development/Libraries
%build
-# DO YOU REALLY SURE THAT x86 is never going to be non-emulator?
-%if %{with emulator}
-%define target_arch x86
-%else
-%define target_arch arm
-%endif
-
cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \
- -DTARGET_ARCH=%{target_arch}
make %{?jobs:-j%jobs}
%install
mkdir -p %{buildroot}/usr/share/license
cp LICENSE %{buildroot}/usr/share/license/%{name}
-
-%make_install
mkdir -p %{buildroot}%{_unitdir}
-%if %{with emulator}
-install -m 0644 %SOURCE1006 %{buildroot}%{_unitdir}/sdbd.service.tv
-install -m 0644 %SOURCE1002 %{buildroot}%{_unitdir}/sdbd.service
+# extension-*-emulator
+%ifarch %{ix86} x86_64
+install -m 0644 %SOURCE1006 %{buildroot}%{_unitdir}/sdbd.service.tv.emulator
+install -m 0644 %SOURCE1002 %{buildroot}%{_unitdir}/sdbd.service.emulator
mkdir -p %{buildroot}/%{_unitdir}/emulator_preinit.target.wants
ln -s %{_unitdir}/sdbd.service %{buildroot}/%{_unitdir}/emulator_preinit.target.wants/
+%endif // ifarch %{ix86} x86_64
+
+%make_install
-%else
install -m 0644 %SOURCE1005 %{buildroot}%{_unitdir}/sdbd.service.tv
install -m 0644 %SOURCE1001 %{buildroot}%{_unitdir}/sdbd.service
install -m 0644 %SOURCE1004 %{buildroot}%{_unitdir}/sdbd_tcp.service
mkdir -p %{buildroot}%{_prefix}/lib/udev/rules.d/
install -m 644 rules/99-sdbd.rules %{buildroot}%{_prefix}/lib/udev/rules.d/
-%endif
mkdir -p %{buildroot}%{_prefix}/sbin
install -m 755 script/sdk_launch %{buildroot}%{_prefix}/sbin/
%{_prefix}/sbin/sdk_launch
%attr(0755, root, root) %{_sysconfdir}/init.d/sdbd
%{_unitdir}/sdbd.service
-%if %{with emulator}
-%{_unitdir}/emulator_preinit.target.wants/sdbd.service
-%else
%{_unitdir}/sdbd_tcp.service
%{_unitdir}/multi-user.target.wants/sdbd.service
%{_prefix}/lib/udev/rules.d/99-sdbd.rules
-%endif
/usr/share/license/%{name}
%{TZ_SYS_BIN}/profile_command
+%ifarch %{ix86} x86_64
+%post extension-emulator
+mv %{_unitdir}/sdbd.service.emulator %{_unitdir}/sdbd.service
+%preun extension-emulator
+mv %{_unitdir}/sdbd.service %{_unitdir}/sdbd.service.emulator
+%files extension-emulator
+%manifest sdbd.manifest
+%{_unitdir}/sdbd.service.emulator
+%{_unitdir}/emulator_preinit.target.wants/sdbd.service
+
+%post extension-tv-emulator
+mv %{_unitdir}/sdbd.service.tv.emulator %{_unitdir}/sdbd.service
+%preun extension-tv-emulator
+mv %{_unitdir}/sdbd.service %{_unitdir}/sdbd.service.tv.emulator
+%files extension-tv-emulator
+%manifest sdbd.manifest
+%{_unitdir}/sdbd.service.tv.emulator
+%{_unitdir}/emulator_preinit.target.wants/sdbd.service
+%endif // ifarch %{ix86} x86_64
+
%post profile_tv
pushd {%_unitdir}
mv sdbd.service.tv sdbd.service