From 93153e047cf2572a05276e29f96ac64002f6e79e Mon Sep 17 00:00:00 2001 From: DoHyun Pyun Date: Mon, 19 Feb 2018 10:20:38 +0900 Subject: [PATCH] Refactory the packages for each functionality Change-Id: Icb671c48b1b0f17b06b5e691161362f0c3c94497 Signed-off-by: DoHyun Pyun --- CMakeLists.txt | 2 +- hid-agent/CMakeLists.txt | 6 +- {bt-ipsp => ipsp-agent}/CMakeLists.txt | 14 +-- .../bluetooth-ipsp-agent.conf | 0 .../bt-ipsp.c => ipsp-agent/bluetooth_ipsp_agent.c | 2 +- .../bt-ipsp.h => ipsp-agent/bluetooth_ipsp_agent.h | 4 +- .../org.bluez.ipsp_agent.service | 2 +- packaging/bluetooth-agent.spec | 130 +++++++++++---------- 8 files changed, 83 insertions(+), 77 deletions(-) rename {bt-ipsp => ipsp-agent}/CMakeLists.txt (68%) rename bt-ipsp/bluetooth-frwk-ipsp.conf => ipsp-agent/bluetooth-ipsp-agent.conf (100%) rename bt-ipsp/bt-ipsp.c => ipsp-agent/bluetooth_ipsp_agent.c (99%) rename bt-ipsp/bt-ipsp.h => ipsp-agent/bluetooth_ipsp_agent.h (97%) rename bt-ipsp/org.projectx.bt_ipsp.service => ipsp-agent/org.bluez.ipsp_agent.service (59%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3da6309..243207b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,5 +7,5 @@ ADD_SUBDIRECTORY(hf-agent) ADD_SUBDIRECTORY(map-agent) ADD_SUBDIRECTORY(pb-agent) ADD_SUBDIRECTORY(ag-agent) -ADD_SUBDIRECTORY(bt-ipsp) +ADD_SUBDIRECTORY(ipsp-agent) ADD_SUBDIRECTORY(hid-agent) \ No newline at end of file diff --git a/hid-agent/CMakeLists.txt b/hid-agent/CMakeLists.txt index 09f54dc..094bba1 100644 --- a/hid-agent/CMakeLists.txt +++ b/hid-agent/CMakeLists.txt @@ -6,19 +6,19 @@ SET(SRCS bluetooth-hid-agent.c bluetooth-hid-manager.c) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) INCLUDE(FindPkgConfig) -pkg_check_modules(pkgs_hf_agent +pkg_check_modules(pkgs_hid_agent REQUIRED dlog aul bluetooth-api capi-appfw-app-manager glib-2.0 gio-2.0 gio-unix-2.0 capi-system-device vconf) -FOREACH(flag ${pkgs_hf_agent_CFLAGS}) +FOREACH(flag ${pkgs_hid_agent_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") ENDFOREACH(flag) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall") ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS}) -TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_hf_agent_LDFLAGS}) +TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_hid_agent_LDFLAGS}) INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin) INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/org.bluez.hid_agent.service diff --git a/bt-ipsp/CMakeLists.txt b/ipsp-agent/CMakeLists.txt similarity index 68% rename from bt-ipsp/CMakeLists.txt rename to ipsp-agent/CMakeLists.txt index 5d3f910..7c54aa9 100644 --- a/bt-ipsp/CMakeLists.txt +++ b/ipsp-agent/CMakeLists.txt @@ -1,7 +1,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6) -PROJECT(bt-ipsp C) +PROJECT(bluetooth-ipsp-agent C) -SET(SRCS bt-ipsp.c +SET(SRCS bluetooth_ipsp_agent.c ../include/bluetooth-agent-profile.c) IF("${CMAKE_BUILD_TYPE}" STREQUAL "") @@ -23,9 +23,9 @@ SET(PKG_MODULES ) INCLUDE(FindPkgConfig) -pkg_check_modules(ipsp_pkgs REQUIRED ${PKG_MODULES}) +pkg_check_modules(pkgs_ipsp_agent REQUIRED ${PKG_MODULES}) -FOREACH(flag ${ipsp_pkgs_CFLAGS}) +FOREACH(flag ${pkgs_ipsp_agent_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag} -Wall") ENDFOREACH(flag) @@ -37,11 +37,11 @@ SET(APP_SYSCONFDIR /opt/var/lib/bluetooth) SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie") ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS}) -TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${ipsp_pkgs_LDFLAGS} -L${CMAKE_CURRENT_SOURCE_DIR}/../bt-api -lbluetooth-api) +TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_ipsp_agent_LDFLAGS} -L${CMAKE_CURRENT_SOURCE_DIR}/../bt-api -lbluetooth-api) INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/org.projectx.bt_ipsp.service DESTINATION share/dbus-1/system-services) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/org.bluez.ipsp_agent.service DESTINATION share/dbus-1/system-services) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/bluetooth-frwk-ipsp.conf DESTINATION /etc/dbus-1/system.d) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/bluetooth-ipsp-agent.conf DESTINATION /etc/dbus-1/system.d) SET(PREFIX ${CMAKE_INSTALL_PREFIX}) diff --git a/bt-ipsp/bluetooth-frwk-ipsp.conf b/ipsp-agent/bluetooth-ipsp-agent.conf similarity index 100% rename from bt-ipsp/bluetooth-frwk-ipsp.conf rename to ipsp-agent/bluetooth-ipsp-agent.conf diff --git a/bt-ipsp/bt-ipsp.c b/ipsp-agent/bluetooth_ipsp_agent.c similarity index 99% rename from bt-ipsp/bt-ipsp.c rename to ipsp-agent/bluetooth_ipsp_agent.c index c6ce561..ca8ef0e 100644 --- a/bt-ipsp/bt-ipsp.c +++ b/ipsp-agent/bluetooth_ipsp_agent.c @@ -23,7 +23,7 @@ #include #include -#include "bt-ipsp.h" +#include "bluetooth_ipsp_agent.h" #include "bluetooth-api.h" #include #include diff --git a/bt-ipsp/bt-ipsp.h b/ipsp-agent/bluetooth_ipsp_agent.h similarity index 97% rename from bt-ipsp/bt-ipsp.h rename to ipsp-agent/bluetooth_ipsp_agent.h index 81a35d2..1a66af7 100644 --- a/bt-ipsp/bt-ipsp.h +++ b/ipsp-agent/bluetooth_ipsp_agent.h @@ -15,8 +15,8 @@ * */ -#ifndef __BT_IPSP_H__ -#define __BT_IPSP_H__ +#ifndef __BLUETOOTH_IPSP_AGENT_H__ +#define __BLUETOOTH_IPSP_AGENT_H__ #include #include diff --git a/bt-ipsp/org.projectx.bt_ipsp.service b/ipsp-agent/org.bluez.ipsp_agent.service similarity index 59% rename from bt-ipsp/org.projectx.bt_ipsp.service rename to ipsp-agent/org.bluez.ipsp_agent.service index b8d5a47..22b3329 100644 --- a/bt-ipsp/org.projectx.bt_ipsp.service +++ b/ipsp-agent/org.bluez.ipsp_agent.service @@ -1,4 +1,4 @@ [D-BUS Service] Name=org.projectx.bt_ipsp -Exec=/usr/bin/bt-ipsp +Exec=/usr/bin/bluetooth-ipsp-agent User=root diff --git a/packaging/bluetooth-agent.spec b/packaging/bluetooth-agent.spec index 599db73..9c80b8e 100644 --- a/packaging/bluetooth-agent.spec +++ b/packaging/bluetooth-agent.spec @@ -45,45 +45,53 @@ BuildRequires: pkgconfig(libexif) BuildRequires: pkgconfig(gio-2.0) BuildRequires: cmake Requires: security-config -Requires: %{name}-compat = %{version}-%{release} -Recommends: %{name}-profile_common = %{version}-%{release} +#Requires: %{name}-compat = %{version}-%{release} +#Recommends: %{name}-profile_common = %{version}-%{release} %description Bluetooth agent packages that support various external profiles -%package profile_common -Summary: Bluetooth agent for common/tv/mobile -Provides: %{name}-compat = %{version}-%{release} -Provides: %{name}-profile_mobile = %{version}-%{release} -Provides: %{name}-profile_tv = %{version}-%{release} -Conflicts: %{name}-profile_ivi -Conflicts: %{name}-profile_wearable -%description profile_common -Bluetooth agent binary compiled for common, tv, mobile profiles - -%package profile_ivi -Summary: Bluetooth agent for ivi -Provides: %{name}-compat = %{version}-%{release} -Conflicts: %{name}-profile_common -Conflicts: %{name}-profile_wearable -%description profile_ivi -Bluetooth agent binary compiled for ivi profile - -%package profile_wearable -Summary: Bluetooth agent for wearable -Provides: %{name}-compat = %{version}-%{release} -Conflicts: %{name}-profile_common -Conflicts: %{name}-profile_ivi -%description profile_wearable -Bluetooth agent binary compiled for wearable profile +%package hfp_ag +Summary: Bluetooth agent for HFP(Hands-Free Profile)'s AG(Audio Gate) role +Requires: %{name} = %{version}-%{release} +Group: Network & Connectivity/Bluetooth +%description hfp_ag +Bluetooth agent binary compiled for HFP(Hands-Free Profile)'s AG(Audio Gate) role -%package ipsp -Summary: Bluetooth Ipsp daemon +%package hfp_hf +Summary: Bluetooth agent for HFP(Hands-Free Profile)'s HF(Hands-Free) role +Requires: %{name} = %{version}-%{release} Group: Network & Connectivity/Bluetooth +%description hfp_hf +Bluetooth agent binary compiled for HFP(Hands-Free Profile)'s HF(Hands-Free) role + +%package map +Summary: Bluetooth agent for MAP(Message Access Profile) server Requires: %{name} = %{version}-%{release} +Group: Network & Connectivity/Bluetooth +%description map +Bluetooth agent binary compiled for MAP(Message Access Profile) server +%package pbap +Summary: Bluetooth agent for PBAP(PhoneBook Access Profile) server +Requires: %{name} = %{version}-%{release} +Group: Network & Connectivity/Bluetooth +%description pbap +Bluetooth agent binary compiled for PBAP(PhoneBook Access Profile) server + +%package hid +Summary: Bluetooth agent for HID(Human Interface Device)'s device role +Requires: %{name} = %{version}-%{release} +Group: Network & Connectivity/Bluetooth +%description hid +Bluetooth agent binary compiled for HID(Human Interface Device)'s device role + +%package ipsp +Summary: Bluetooth agent for IPSP(Internet Protocol Support Profile) +Requires: %{name} = %{version}-%{release} +Group: Network & Connectivity/Bluetooth %description ipsp -This package is Bluetooth ipsp daemon to manage activation / deactivation. +Bluetooth agent binary compiled for IPSP(Internet Protocol Support Profile) %prep %setup -q @@ -133,9 +141,9 @@ install -D -m 0644 packaging/bluetooth-map-agent.service %{buildroot}%{_libdir}/ #mkdir -p %{buildroot}%{_datadir}/dbus-1/system-services #mkdir -p %{buildroot}%{_bindir}/ #install -D -m 0644 %{buildroot}/usr/share/dbus-1/system-services/org.bluez.hf_agent.service %{buildroot}%{_datadir}/dbus-1/system-services/ -#install -D -m 0644 %{buildroot}/usr/share/dbus-1/system-services/org.projectx.bt_ipsp.service %{buildroot}%{_datadir}/dbus-1/system-services/ +#install -D -m 0644 %{buildroot}/usr/share/dbus-1/system-services/org.bluez.ipsp_agent.service %{buildroot}%{_datadir}/dbus-1/system-services/ #install -D -m 0644 %{buildroot}/usr/bin/bluetooth-hf-agent %{buildroot}%{_bindir}/ -#install -D -m 0644 %{buildroot}/usr/bin/bt-ipsp %{buildroot}%{_bindir}/ +#install -D -m 0644 %{buildroot}/usr/bin/bluetooth-ipsp-agent %{buildroot}%{_bindir}/ #%endif install -D -m 0644 packaging/bluetooth-pbap-agent.service %{buildroot}%{_libdir}/systemd/system/bluetooth-pbap-agent.service @@ -150,51 +158,49 @@ ln -sf %{_libdir}/systemd/system/bluetooth-pbap-agent.service %{_sysconfdir}/sys %license LICENSE %defattr(-, root, root) -# This usage of profile macro does NOT conflict 4.0 configurability. -%if "%{?profile}" != "mobile" && "%{?profile}" != "tv" -# Original: wearable, ivi. Added: common, "undefined" -%files profile_wearable +%files hfp_ag +%manifest %{name}.manifest %license LICENSE -%{_bindir}/bluetooth-hf-agent %{_bindir}/bluetooth-ag-agent -%{_bindir}/bluetooth-hid-agent -%{_datadir}/dbus-1/system-services/org.bluez.hf_agent.service +%attr(0666,-,-) /var/lib/bluetooth/voice-recognition-blacklist %{_datadir}/dbus-1/system-services/org.bluez.ag_agent.service -%{_datadir}/dbus-1/system-services/org.bluez.hid_agent.service %{_sysconfdir}/dbus-1/system.d/bluetooth-ag-agent.conf -%{_sysconfdir}/dbus-1/system.d/bluetooth-hf-agent.conf -%exclude %{_libdir}/systemd/system/bluetooth-map-agent.service -%exclude %{_libdir}/systemd/system/bluetooth-pbap-agent.service -%endif +#%exclude %{_libdir}/systemd/system/bluetooth-map-agent.service +#%exclude %{_libdir}/systemd/system/bluetooth-pbap-agent.service -%files profile_ivi +%files hfp_hf +%manifest %{name}.manifest %license LICENSE %{_bindir}/bluetooth-hf-agent %{_datadir}/dbus-1/system-services/org.bluez.hf_agent.service -%exclude %{_libdir}/systemd/system/bluetooth-map-agent.service -%exclude %{_libdir}/systemd/system/bluetooth-pbap-agent.service +%{_sysconfdir}/dbus-1/system.d/bluetooth-hf-agent.conf +#%exclude %{_libdir}/systemd/system/bluetooth-map-agent.service +#%exclude %{_libdir}/systemd/system/bluetooth-pbap-agent.service -# This usage of profile macro does NOT conflict 4.0 configurability. -%if "%{?profile}" != "wearable" && "%{?profile}" != "ivi" -# Original: common, mobile, tv. Added: "undefined" -%files profile_common +%files map +%manifest %{name}.manifest %license LICENSE -%{_bindir}/bluetooth-ag-agent %{_bindir}/bluetooth-map-agent -%{_bindir}/bluetooth-pb-agent -%{_datadir}/dbus-1/system-services/org.bluez.pb_agent.service %{_datadir}/dbus-1/system-services/org.bluez.map_agent.service -%{_datadir}/dbus-1/system-services/org.bluez.ag_agent.service -%attr(0666,-,-) /var/lib/bluetooth/voice-recognition-blacklist -%{_sysconfdir}/dbus-1/system.d/bluetooth-ag-agent.conf %{_libdir}/systemd/system/bluetooth-map-agent.service + +%files pbap +%manifest %{name}.manifest +%license LICENSE +%{_bindir}/bluetooth-pb-agent +%{_datadir}/dbus-1/system-services/org.bluez.pb_agent.service %{_libdir}/systemd/system/bluetooth-pbap-agent.service -%endif + +%files hid +%manifest %{name}.manifest +%license LICENSE +%{_bindir}/bluetooth-hid-agent +%{_datadir}/dbus-1/system-services/org.bluez.hid_agent.service %files ipsp %manifest %{name}.manifest %license LICENSE -%defattr(-, root, root) -%{_datadir}/dbus-1/system-services/org.projectx.bt_ipsp.service -%{_bindir}/bt-ipsp -%{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-ipsp.conf +%{_bindir}/bluetooth-ipsp-agent +%{_datadir}/dbus-1/system-services/org.bluez.ipsp_agent.service +%{_sysconfdir}/dbus-1/system.d/bluetooth-ipsp-agent.conf + -- 2.7.4