Remove Profile Build Dependency 13/99313/1
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Tue, 22 Nov 2016 10:25:04 +0000 (19:25 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Tue, 22 Nov 2016 10:28:14 +0000 (19:28 +0900)
- This is for Tizen 4.0.
  (4.0 Configurability & Building Block prohibits the usage of
  profile macro; the value of "profile" will become "undefined"
  unconditionally.)

  : the usage of "profile" is limited to backward-compatibility
   (due to efl-ext of wearable) and GBM build optimization.

- When SR-ing this, maintainers need to create JIRA-TRE:

  - Add org.tizen.bt-syspopup-profile_wearable for wearable profile
  - Add org.tizen.bt-syspopup-profile_common for common profile
  - Add org.tizen.bt-syspopup-profile_common for mobile profile
  - Add org.tizen.bt-syspopup-profile_common for ivi profile
  - Add org.tizen.bt-syspopup-profile_common for tv profile

Change-Id: I89cd8cff397fc14bfaf77979495e8c2728429287
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
CMakeLists.txt
packaging/org.tizen.bt-syspopup.spec

index 7bab2a1..8cdd74a 100644 (file)
@@ -135,7 +135,7 @@ INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${TZ_SYS_RO_APP}/org.tizen.bt-syspop
 
 # install desktop file & icon
 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
-INSTALL(FILES ${CMAKE_BINARY_DIR}/data/org.tizen.bt-syspopup.xml DESTINATION /usr/share/packages/)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/org.tizen.bt-syspopup.xml DESTINATION /usr/share/packages/)
 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/org.tizen.bt-syspopup.png DESTINATION ${TZ_SYS_SHARE}/icons/default/small)
 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/custom_popup.edj DESTINATION ${TZ_SYS_RO_APP}/org.tizen.bt-syspopup/res/edje)
 IF("$ENV{CFLAGS}" MATCHES "-DTIZEN_PROFILE_WEARABLE")
index daae9d9..6c03621 100644 (file)
@@ -11,9 +11,14 @@ Group:      main
 License:    Flora-1.1
 Source0:    %{name}-%{version}.tar.gz
 BuildRequires:  pkgconfig(evas)
-%if "%{?profile}" == "wearable"
+# For backward-compatibility and GBM build optimization
+# if wearable, "unified". common may be added after efl-ext is unified/refactored.
+%if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
 BuildRequires:  pkgconfig(syspopup-caller)
-%else
+%endif
+# For backward-compatibility and GBM build optimization
+# if mobile, tv, ivi, common, or "unified"
+%if "%{?profile}" != "wearable"
 BuildRequires:  pkgconfig(notification)
 %endif
 BuildRequires: pkgconfig(efl-extension)
@@ -43,26 +48,76 @@ BuildRequires:  pkgconfig(vconf)
 
 BuildRequires:  cmake
 BuildRequires:  gettext-devel
+Requires:       %{name}-compat = %{version}-%{release}
+%if "%{?profile}" != "wearable"
+Recommends:     %{name}-profile_common = %{version}-%{release}
+%endif
+
 
 %description
 bluetooth system-popup application (bluetooth system popup).
 
+%package profile_wearable
+Summary:    bt-syspopup binary for wearable
+Provides:   %{name}-compat = %{version}-%{release}
+Conflicts:  %{name}-profile_common
+%description profile_wearable
+bluetooth system-popup application binary for Tizen wearable profile.
+
+%package profile_common
+Summary:    bt-syspopup binary for common
+Provides:   %{name}-compat = %{version}-%{release}
+Provides:   %{name}-profile_mobile = %{version}-%{release}
+Provides:   %{name}-profile_tv = %{version}-%{release}
+Provides:   %{name}-profile_ivi = %{version}-%{release}
+Conflicts:  %{name}-profile_wearable
+%description profile_common
+bluetooth system-popup application binary for Tizen common profile.
+
 %prep
 %setup -q
 
 
 %build
-%if "%{?profile}" == "wearable"
-export CFLAGS="$CFLAGS -DTIZEN_ENGINEER_MODE -DTIZEN_PROFILE_WEARABLE"
-export CXXFLAGS="$CXXFLAGS -DTIZEN_ENGINEER_MODE"
-export FFLAGS="$FFLAGS -DTIZEN_ENGINEER_MODE"
-%else
-export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE -DTIZEN_PROFILE_MOBILE"
-export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
-export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
-%endif
 export CFLAGS+=" -fpie -fvisibility=hidden"
 export LDFLAGS+=" -Wl,--rpath=/usr/lib -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs -pie"
+export CFLAGS_BASE="$CFLAGS"
+export CXXFLAGS_BASE="$CXXFLAGS"
+export FFLAGS_BASE="$FFLAGS"
+
+# For backward-compatibility and GBM build optimization
+# if wearable, "unified". common may be added after efl-ext is unified/refactored.
+%if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
+mkdir -p build_wearable
+pushd build_wearable
+export CFLAGS="$CFLAGS_BASE -DTIZEN_ENGINEER_MODE -DTIZEN_PROFILE_WEARABLE"
+export CXXFLAGS="$CXXFLAGS_BASE -DTIZEN_ENGINEER_MODE"
+export FFLAGS="$FFLAGS_BASE -DTIZEN_ENGINEER_MODE"
+
+cmake .. \
+    -DCMAKE_INSTALL_PREFIX=%{TZ_SYS_RO_APP}/org.tizen.bt-syspopup \
+%if %{with wayland}
+    -DWAYLAND_SUPPORT=On \
+%else
+    -DWAYLAND_SUPPORT=Off \
+%endif
+    #eol
+
+make %{?jobs:-j%jobs}
+
+%cmake .. \
+       -DTZ_SYS_RO_APP=%{TZ_SYS_RO_APP} \
+       -DTZ_SYS_SHARE=%{TZ_SYS_SHARE}
+make
+popd
+%endif
+
+# For backward-compatibility and GBM build optimization
+# if mobile, tv, ivi, common, or "unified"
+%if "%{?profile}" != "wearable"
+export CFLAGS="$CFLAGS_BASE -DTIZEN_DEBUG_ENABLE -DTIZEN_PROFILE_MOBILE"
+export CXXFLAGS="$CXXFLAGS_BASE -DTIZEN_DEBUG_ENABLE"
+export FFLAGS="$FFLAGS_BASE -DTIZEN_DEBUG_ENABLE"
 
 cmake . \
     -DCMAKE_INSTALL_PREFIX=%{TZ_SYS_RO_APP}/org.tizen.bt-syspopup \
@@ -79,20 +134,52 @@ make %{?jobs:-j%jobs}
        -DTZ_SYS_RO_APP=%{TZ_SYS_RO_APP} \
        -DTZ_SYS_SHARE=%{TZ_SYS_SHARE}
 make
+%endif
+
 
 %install
 rm -rf %{buildroot}
+# For backward-compatibility and GBM build optimization
+# if wearable, "unified". common may be added after efl-ext is unified/refactored.
+%if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
+pushd build_wearable
 %make_install
+popd
+pushd %{buildroot}%{TZ_SYS_RO_APP}/org.tizen.bt-syspopup/bin
+mv bt-syspopup bt-syspopup.wearable
+popd
+pushd %{buildroot}%{TZ_SYS_RO_APP}/org.tizen.bt-syspopup/res/edje
+mv custom_popup.edj custom_popup.edj.wearable
+popd
+%endif
+
+# For backward-compatibility and GBM build optimization
+# if mobile, tv, ivi, common, or "unified"
+%if "%{?profile}" != "wearable"
+%make_install
+%endif
 
 
 %files
 %manifest org.tizen.bt-syspopup.manifest
 %defattr(-,root,root,-)
 %{TZ_SYS_RO_PACKAGES}/org.tizen.bt-syspopup.xml
-%{TZ_SYS_RO_APP}/org.tizen.bt-syspopup/bin/bt-syspopup
-%{TZ_SYS_RO_APP}/org.tizen.bt-syspopup/res/edje/*.edj
 %{TZ_SYS_SHARE}/icons/default/small/org.tizen.bt-syspopup.png
-%if "%{?profile}" == "wearable"
+
+# For backward-compatibility and GBM build optimization
+# if mobile, tv, ivi, common, or "unified"
+%if "%{?profile}" != "wearable"
+%files profile_common
+%{TZ_SYS_RO_APP}/org.tizen.bt-syspopup/bin/bt-syspopup
+%{TZ_SYS_RO_APP}/org.tizen.bt-syspopup/res/edje/custom_popup.edj
+%endif
+
+# For backward-compatibility and GBM build optimization
+# if wearable, "unified". common may be added after efl-ext is unified/refactored.
+%if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
+%files profile_wearable
+%{TZ_SYS_RO_APP}/org.tizen.bt-syspopup/bin/bt-syspopup.wearable
+%{TZ_SYS_RO_APP}/org.tizen.bt-syspopup/res/edje/custom_popup.edj.wearable
 %{TZ_SYS_RO_APP}/org.tizen.bt-syspopup/shared/res/tables/org.tizen.bt-syspopup_ChangeableColorTable.xml
 %{TZ_SYS_RO_APP}/org.tizen.bt-syspopup/shared/res/tables/org.tizen.bt-syspopup_FontInfoTable.xml
 %{TZ_SYS_RO_APP}/org.tizen.bt-syspopup/res/images/*