[4.0] Remove Repository Dependency 65/110365/1
authorhk57.kim <hk57.kim@samsung.com>
Mon, 16 Jan 2017 06:00:36 +0000 (15:00 +0900)
committerhk57.kim <hk57.kim@samsung.com>
Mon, 16 Jan 2017 06:00:36 +0000 (15:00 +0900)
- This is for Tizen 4.0

- We are going to unify repositories as well as build projects.

- When you SR this, you need to create JIRA-TRE issue of:

  : add mobileap-agent-extension-TM1 for TM1 (mobile)

Change-Id: I3fcb866035ea2a5a02d28d0574858d1d5e746aeb
Signed-off-by: hk57.kim <hk57.kim@samsung.com>
packaging/bluez.spec

index 21d1d12..7acc706 100644 (file)
@@ -1,3 +1,7 @@
+# Do not create provides fro extension-tm1 because the main package
+# should anchor any reverse-dependencies
+%global __provides_exclude_from ^(.*\\.tm1)$
+
 #%define with_libcapng --enable-capng
 %define _libpath /usr/lib
 %define upgrade_script_path /usr/share/upgrade/scripts
@@ -116,6 +120,17 @@ Conflicts: %{name}-profile_wearable
 %description profile_tv
 Bluez modified service script for Tizen TV
 
+%ifarch %{ix86} || %{arm}
+%package -n libbluetooth-extension-TM1
+Summary:       Extension for mobile TM1
+Requires:      libbluetooth = %{version}-%{release}
+%description -n libbluetooth-extension-TM1
+Bluez default service script for Tizen mobile TM1
+When you want to uninstall this while keeping libbluetooth, you need
+to reinstall libbluetooth after uninstalling this because this package
+overwrites some contents of libbluetooth.
+%endif
+
 %prep
 %setup -q
 cp %{SOURCE1001} .
@@ -123,12 +138,6 @@ cp %{SOURCE1001} .
 %build
 autoreconf -fiv
 
-%if "%{?tizen_target_name}" == "TM1"
-export CFLAGS="${CFLAGS} -DTIZEN_FEATURE_BLUEZ_SPRD_QOS -DTIZEN_FEATURE_BLUEZ_SPRD_PAGE_SCAN"
-# TIZEN_FEATURE_BLUEZ_SPRD_QOS: only in profiles/audio/avdtp.c
-# TIZEN_FEATURE_BLUEZ_SPRD_PAGE_SCAN: src/adapter.c
-%endif
-
 #if "{?profile}" == "ivi"
 # TIZEN_FEATURE_BLUEZ_BRCM_CHIP: only in tools/hciattach.c ==> RUNTIME! (profile.h)
 #endif
@@ -142,6 +151,57 @@ export CFLAGS="${CFLAGS} -DTIZEN_FEATURE_BLUEZ_SPRD_QOS -DTIZEN_FEATURE_BLUEZ_SP
 
 export LDFLAGS=" -lncurses -Wl,--as-needed "
 export CFLAGS+=" -DTIZEN_FEATURE_BLUEZ_MODIFY -DTIZEN_FEATURE_BLUEZ_PBAP_SIM -DTIZEN_FEATURE_BLUEZ_AVRCP_TARGET"
+export CFLAGS_DEFAULT="$CFLAGS"
+
+%ifarch %{ix86} || %{arm}
+# extension-TM1
+export CFLAGS="$CFLAGS_DEFAULT -DTIZEN_FEATURE_BLUEZ_SPRD_QOS -DTIZEN_FEATURE_BLUEZ_SPRD_PAGE_SCAN"
+# TIZEN_FEATURE_BLUEZ_SPRD_QOS: only in profiles/audio/avdtp.c
+# TIZEN_FEATURE_BLUEZ_SPRD_PAGE_SCAN: src/adapter.c
+
+%reconfigure --disable-static \
+                       --sysconfdir=%{_sysconfdir} \
+                       --localstatedir=%{_localstatedir} \
+                       --with-systemdsystemunitdir=%{_libpath}/systemd/system \
+                       --with-systemduserunitdir=%{_libpath}/systemd/user \
+                       --libexecdir=%{_libexecdir} \
+                       --enable-debug \
+                       --enable-pie \
+                       --enable-serial \
+                       --enable-input \
+                       --enable-usb=no \
+                       --enable-tools \
+                       --disable-bccmd \
+                       --enable-pcmcia=no \
+                       --enable-hid2hci=no \
+                       --enable-alsa=no \
+                       --enable-gstreamer=no \
+                       --disable-dfutool \
+                       --disable-cups \
+                       --enable-health=yes \
+                       --enable-proximity=yes \
+                       --enable-dbusoob \
+                       --enable-test \
+                       --with-telephony=tizen \
+                       --enable-obex \
+                       --enable-library \
+                       --enable-gatt \
+                       --enable-experimental \
+                       --enable-autopair=no \
+                       --enable-hid=yes \
+                       --enable-tizenunusedplugin=no
+
+
+make %{?_smp_mflags} all V=1
+
+mkdir -p tm1
+
+%make_install
+cp -a  %{buildroot}%{_libdir}/libbluetooth.so* tm1/
+%endif
+
+# non-extension-TM1
+export CFLAGS="$CFLAGS_DEFAULT"
 
 %reconfigure --disable-static \
                        --sysconfdir=%{_sysconfdir} \
@@ -192,6 +252,11 @@ make check
 
 %install
 %make_install
+%ifarch %{ix86} || %{arm}
+pushd tm1
+for FILE in libbluetooth.so*; do mv "$FILE" "%{buildroot}%{_libdir}/$FILE.tm1"; done
+popd
+%endif
 
 # bluez-test
 rm -rvf $RPM_BUILD_ROOT/%{_libdir}/gstreamer-*
@@ -241,6 +306,14 @@ cp -f packaging/bluetoothd_upgrade.sh %{buildroot}%{upgrade_script_path}
 
 %postun -n libbluetooth -p /sbin/ldconfig
 
+%ifarch %{ix86} || %{arm}
+%post -n libbluetooth-extension-TM1
+pushd %{_libdir}
+for FILE in libbluetooth.so*.tm1; do mv "$FILE" "${FILE%.tm1}"; done
+popd
+/sbin/ldconfig
+%endif
+
 %files
 %manifest %{name}.manifest
 %defattr(-, root, root)
@@ -291,8 +364,16 @@ cp -f packaging/bluetoothd_upgrade.sh %{buildroot}%{upgrade_script_path}
 %manifest %{name}.manifest
 %defattr(-, root, root)
 %{_libdir}/libbluetooth.so.*
+%exclude %{_libdir}/libbluetooth.so*.tm1
 %license COPYING
 
+%ifarch %{ix86} || %{arm}
+%files -n libbluetooth-extension-TM1
+%manifest %{name}.manifest
+%defattr(-, root, root)
+%{_libdir}/libbluetooth.so*.tm1
+%endif
+
 %files -n obexd
 %manifest %{name}.manifest
 %defattr(-,root,root,-)