Remove Profile Build Dependency 72/98972/2
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Mon, 21 Nov 2016 09:03:32 +0000 (18:03 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Mon, 5 Dec 2016 10:44:34 +0000 (02:44 -0800)
- This is for Tizen 4.0.
  (4.0 Configurability & Building Blocks requires not to use
  profile macro soon.)

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

  - Add wifi-efl-ug-profile_common for common/ivi profile
  - Add wifi-efl-ug-profile_mobile for mobile profile
  - Add wifi-efl-ug-profile_wearable for wearable profile

ps. I've added some code clean as well.

Change-Id: Idda60210da9b038f0f7c7f833cf5047ce9768146
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
packaging/wifi-efl-ug.spec
sources/ui-gadget/CMakeLists.txt

index 4bba8c7..12c2996 100644 (file)
@@ -1,16 +1,11 @@
-%define _unpackaged_files_terminate_build 0
 Name:          wifi-efl-ug
 Summary:       Wi-Fi UI Gadget for TIZEN
 Version:       1.0.220
 Release:       1
-Group:         App/Network
+Group:         Applications/Network
 License:       Flora-1.1
 Source0:       %{name}-%{version}.tar.gz
 
-%if "%{?profile}" == "tv"
-ExcludeArch: %{arm} %ix86 x86_64
-%endif
-
 BuildRequires: pkgconfig(ecore)
 BuildRequires: pkgconfig(ecore-imf)
 BuildRequires: pkgconfig(ecore-input)
@@ -23,6 +18,7 @@ BuildRequires:        pkgconfig(ui-gadget-1)
 BuildRequires: pkgconfig(sensor)
 BuildRequires: pkgconfig(capi-network-wifi)
 BuildRequires: pkgconfig(capi-network-connection)
+# For backward compatibility. Not needed (always true) in unified environment.
 %if "%{?profile}" != "wearable"
 BuildRequires: pkgconfig(capi-network-tethering)
 %endif
@@ -38,11 +34,19 @@ BuildRequires:      gettext-tools
 BuildRequires: edje-tools
 Requires(post):                /sbin/ldconfig
 requires(postun):      /sbin/ldconfig
+Requires:       %{name}-compat = %{version}-%{release}
+# For backward compatibility. Not needed (always true) in unified environment.
+# common, tv, ivi, or unified (undefined)
+%if "%{?profile}" != "mobile" && "%{?profile}" != "wearable"
+Recommends:     %{name}-profile_common
+%endif
 
 %description
 Wi-Fi UI Gadget
 
-%if "%{profile}" == "mobile"
+# For backward compatibility. Not needed (always true) in unified environment.
+# mobile, common, or unified (undefined)
+%if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi"
 %package -n net.wifi-qs
 Summary:    Wi-Fi System popup
 Requires:   %{name} = %{version}
@@ -51,7 +55,9 @@ Requires:   %{name} = %{version}
 Wi-Fi System popup for TIZEN
 %endif
 
-%if "%{profile}" == "wearable"
+# For backward compatibility. Not needed (always true) in unified environment.
+# wearable, or unified (undefined) (add common after refactoring efl-ext)
+%if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
 %package -n org.tizen.w-wifi
 Summary:    Wi-Fi UI Gadget for wearable
 
@@ -59,6 +65,44 @@ Summary:    Wi-Fi UI Gadget for wearable
 Wi-Fi UI Gadget for wearable
 %endif
 
+# For backward compatibility. Not needed (always true) in unified environment.
+# common, or unified (undefined)
+%if "%{?profile}" != "mobile" && "%{?profile}" != "wearable"
+%package profile_common
+Summary:    Wifi-efl-ug binary for common profile (tv/ivi included)
+Provides:   %{name}-compat = %{version}-%{release}
+Provides:   %{name}-profile_tv = %{version}-%{release}
+Provides:   %{name}-profile_ivi = %{version}-%{release}
+Conflicts:  %{name}-profile_mobile
+Conflicts:  %{name}-profile_wearable
+%description profile_common
+Wi-Fi UI Gadget binary for common profile (not mobile & not wearable)
+%endif
+
+# For backward compatibility. Not needed (always true) in unified environment.
+# mobile, common, or unified (undefined)
+%if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi"
+%package profile_mobile
+Summary:    Wifi-efl-ug binary for mobile
+Provides:   %{name}-compat = %{version}-%{release}
+Conflicts:  %{name}-profile_common
+Conflicts:  %{name}-profile_wearable
+%description profile_mobile
+Wi-Fi UI Gadget binary for mobile profile
+%endif
+
+# For backward compatibility. Not needed (always true) in unified environment.
+# wearable, or unified (undefined) (add common after refactoring efl-ext)
+%if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
+%package profile_wearable
+Summary:    Wifi-efl-ug binary for wearable
+Provides:   %{name}-compat = %{version}-%{release}
+Conflicts:  %{name}-profile_common
+Conflicts:  %{name}-profile_mobile
+%description profile_wearable
+Wi-Fi UI Gadget binary for wearable profile
+%endif
+
 %prep
 %setup -q
 
@@ -66,35 +110,98 @@ Wi-Fi UI Gadget for wearable
 
 %build
 #LDFLAGS+="-Wl,--rpath=%{PREFIX}/lib -Wl,--as-needed"
+
+# For backward compatibility. Not needed (always true) in unified environment.
+# mobile, common, or unified (undefined)
+%if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi"
+mkdir -p build_mobile
+pushd build_mobile
 cmake -DCMAKE_INSTALL_PREFIX=%{PREFIX} \
-%if "%{profile}" != "wearable"
        -DTIZEN_TETHERING_ENABLE=1 \
-%endif
        -DMODEL_BUILD_FEATURE_WLAN_CONCURRENT_MODE=1 \
-%if "%{profile}" == "mobile"
        -DTIZEN_MOBILE=1 \
+%if "%{?_with_emulator}" == "1"
+       -DTIZEN_EMULATOR=1 \
+%endif
+       ..
+
+make %{?_smp_mflags}
+popd
 %endif
-%if "%{profile}" == "wearable"
+
+
+# For backward compatibility. Not needed (always true) in unified environment.
+# wearable, or unified (undefined) (add common after refactoring efl-ext)
+%if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
+mkdir -p build_wearable
+pushd build_wearable
+cmake -DCMAKE_INSTALL_PREFIX=%{PREFIX} \
+       -DMODEL_BUILD_FEATURE_WLAN_CONCURRENT_MODE=1 \
        -DTIZEN_WEARABLE=1 \
+%if "%{?_with_emulator}" == "1"
+       -DTIZEN_EMULATOR=1 \
+%endif
+       ..
+
+make %{?_smp_mflags}
+popd
 %endif
+
+# For backward compatibility. Not needed (always true) in unified environment.
+# common, or unified (undefined)
+%if "%{?profile}" != "mobile" && "%{?profile}" != "wearable"
+cmake -DCMAKE_INSTALL_PREFIX=%{PREFIX} \
+       -DTIZEN_TETHERING_ENABLE=1 \
+       -DMODEL_BUILD_FEATURE_WLAN_CONCURRENT_MODE=1 \
 %if "%{?_with_emulator}" == "1"
        -DTIZEN_EMULATOR=1 \
 %endif
        .
 
 make %{?_smp_mflags}
+%endif
 
 
 %install
+# For backward compatibility. Not needed (always true) in unified environment.
+# mobile, common, or unified (undefined)
+%if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi"
+pushd build_mobile
+%make_install
+popd
+pushd %{buildroot}%{PREFIX}/ug/lib
+for FILE in *.so*; do mv "${FILE}" "${FILE}.mobile"; done
+popd
+%endif
+
+# For backward compatibility. Not needed (always true) in unified environment.
+# wearable, or unified (undefined) (add common after refactoring efl-ext)
+%if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
+pushd build_wearable
+%make_install
+popd
+pushd %{buildroot}%{PREFIX}/ug/lib
+for FILE in *.so*; do if [[ $FILE =~ .*mobile$ ]]; then echo skip "${FILE}"; else mv "${FILE}" "${FILE}.wearable"; fi; done
+popd
+%endif
+
+# For backward compatibility. Not needed (always true) in unified environment.
+# common, or unified (undefined)
+%if "%{?profile}" != "mobile" && "%{?profile}" != "wearable"
 %make_install
+%endif
 
 #License
 mkdir -p %{buildroot}%{_datadir}/license
 cp LICENSE %{buildroot}%{_datadir}/license/wifi-efl-ug
-%if "%{profile}" == "mobile"
+# For backward compatibility. Not needed (always true) in unified environment.
+# mobile, common, or unified (undefined)
+%if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi"
 cp LICENSE %{buildroot}%{_datadir}/license/net.wifi-qs
 %endif
-%if "%{profile}" == "wearable"
+# For backward compatibility. Not needed (always true) in unified environment.
+# wearable, or unified (undefined) (add common after refactoring efl-ext)
+%if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
 cp LICENSE %{buildroot}%{_datadir}/license/org.tizen.w-wifi
 %endif
 
@@ -108,20 +215,67 @@ mkdir -p /usr/apps/wifi-efl-ug/bin/ -m 777
 
 %files
 %manifest wifi-efl-ug.manifest
-%{PREFIX}/ug/lib/*
-%attr(644,-,-) %{PREFIX}/ug/lib/*
-%attr(755,-,-) %{PREFIX}/ug/lib/
 %{PREFIX}/apps/wifi-efl-ug/res/edje/*.edj
 %{_datadir}/license/wifi-efl-ug
 %{_datadir}/packages/wifi-efl-ug.xml
-%if "%{profile}" == "mobile"
+/usr/apps/wifi-efl-ug/shared/res/tables/ug-wifi-efl_ChangeableColorTable.xml
+/usr/apps/wifi-efl-ug/shared/res/tables/ug-wifi-efl_FontInfoTable.xml
+
+# For backward compatibility. Not needed (always true) in unified environment.
+# common, or unified (undefined)
+%if "%{?profile}" != "mobile" && "%{?profile}" != "wearable"
+%post profile_common -p /sbin/ldconfig
+%postun profile_common -p /sbin/ldconfig
+%files profile_common
+%exclude %{PREFIX}/ug/lib/*.mobile
+%exclude %{PREFIX}/ug/lib/*.wearable
+%attr(755,-,-) %{PREFIX}/ug/lib/libug-wifi-efl*.so
+%attr(755,-,-) %{PREFIX}/ug/lib/libug-wifi-efl*.so.*
+%endif
+
+# For backward compatibility. Not needed (always true) in unified environment.
+# mobile, common, or unified (undefined)
+%if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi"
+%post profile_mobile
+pushd %{PREFIX}/ug/lib/
+for FILE in libug-wifi-efl*.mobile; do mv "${FILE}" "${FILE%.mobile}"; done
+popd
+/sbin/ldconfig
+%preun profile_mobile
+pushd %{PREFIX}/ug/lib/
+for FILE in libug-wifi-efl*.so; do mv "${FILE}" "${FILE}.mobile"; done
+for FILE in libug-wifi-efl*.so.*; do mv "${FILE}" "${FILE}.mobile"; done
+popd
+%postun profile_mobile -p /sbin/ldconfig
+%files profile_mobile
+%attr(755,-,-) %{PREFIX}/ug/lib/libug-wifi-efl*.so.mobile
+%attr(755,-,-) %{PREFIX}/ug/lib/libug-wifi-efl*.so.*.mobile
 %{_datadir}/locale/*/LC_MESSAGES/*.mo
 %{_datadir}/icons/*.png
 %endif
-/usr/apps/wifi-efl-ug/shared/res/tables/ug-wifi-efl_ChangeableColorTable.xml
-/usr/apps/wifi-efl-ug/shared/res/tables/ug-wifi-efl_FontInfoTable.xml
 
-%if "%{profile}" == "mobile"
+# For backward compatibility. Not needed (always true) in unified environment.
+# wearable, or unified (undefined) (add common after refactoring efl-ext)
+%if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
+%post profile_wearable
+pushd %{PREFIX}/ug/lib/
+for FILE in libug-wifi-efl*.wearable; do mv "${FILE}" "${FILE%.wearable}"; done
+popd
+/sbin/ldconfig
+%preun profile_wearable
+pushd %{PREFIX}/ug/lib/
+for FILE in libug-wifi-efl*.so; do mv "${FILE}" "${FILE}.wearable"; done
+for FILE in libug-wifi-efl*.so.*; do mv "${FILE}" "${FILE}.wearable"; done
+popd
+%postun profile_wearable -p /sbin/ldconfig
+%files profile_wearable
+%attr(755,-,-) %{PREFIX}/ug/lib/libug-wifi-efl*.so.wearable
+%attr(755,-,-) %{PREFIX}/ug/lib/libug-wifi-efl*.so.*.wearable
+%endif
+
+# For backward compatibility. Not needed (always true) in unified environment.
+# mobile, common, or unified (undefined)
+%if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi"
 %files -n net.wifi-qs
 %manifest net.wifi-qs.manifest
 %{_bindir}/wifi-qs
@@ -131,7 +285,9 @@ mkdir -p /usr/apps/wifi-efl-ug/bin/ -m 777
 %{_datadir}/license/net.wifi-qs
 %endif
 
-%if "%{profile}" == "wearable"
+# For backward compatibility. Not needed (always true) in unified environment.
+# wearable, or unified (undefined) (add common after refactoring efl-ext)
+%if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
 %files -n org.tizen.w-wifi
 %manifest org.tizen.w-wifi.manifest
 /usr/shared/res/tables/color_table.xml
index 804bd3f..341c836 100644 (file)
@@ -76,6 +76,5 @@ INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /usr/ug/lib/)
 # install image files
 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/edcs/custom_editfield.edj DESTINATION /usr/apps/wifi-efl-ug/res/edje)
 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/edcs/setup_wizard.edj DESTINATION /usr/apps/wifi-efl-ug/res/edje)
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../resources/images/setting_wifi.png DESTINATION /usr/apps/wifi-efl-ug/res/icons/)
 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../wifi-efl-ug.xml DESTINATION /usr/share/packages/)
 INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../tables/ DESTINATION ${TABLEDIR} FILES_MATCHING PATTERN "*.xml")