+
+%post profile_common
+pushd %{_prefix}/etc/bluetooth/
+ln -sf common/bt-stack-up.sh bt-stack-up.sh
+ln -sf common/bt-stack-down.sh bt-stack-down.sh
+ln -sf common/bt-reset-env.sh bt-reset-env.sh
+popd
+pushd %{_unitdir}
+mv bluetooth-stack-up-common.service bluetooth-stack-up.service
+mv bluetooth-stack-down-common.service bluetooth-stack-down.service
+popd
+%preun profile_common
+pushd %{_prefix}/etc/bluetooth/
+rm bt-stack-up.sh
+rm bt-stack-down.sh
+rm bt-reset-env.sh
+popd
+pushd %{_unitdir}
+rm bluetooth-stack-up.service
+rm bluetooth-stack-down.service
+popd
+%files profile_common
+%license LICENSE.APLv2
+#%{_sysconfdir}/rc.d/init.d/bluetooth-address
+%attr(0755,-,-) %{_prefix}/etc/bluetooth/common/bt-stack-up.sh
+%attr(0755,-,-) %{_prefix}/etc/bluetooth/common/bt-stack-down.sh
+%attr(0755,-,-) %{_prefix}/etc/bluetooth/common/bt-reset-env.sh
+%{_libdir}/systemd/system/bluetooth-stack-up-common.service
+%{_libdir}/systemd/system/bluetooth-stack-down-common.service
+
+%post profile_mobile
+pushd %{_prefix}/etc/bluetooth/
+ln -sf mobile/bt-stack-up.sh bt-stack-up.sh
+ln -sf mobile/bt-stack-down.sh bt-stack-down.sh
+ln -sf mobile/bt-stack-down-with-radio.sh bt-stack-down-with-radio.sh
+ln -sf mobile/bt-reset-env.sh bt-reset-env.sh
+popd
+%preun profile_mobile
+pushd %{_prefix}/etc/bluetooth/
+rm bt-stack-up.sh
+rm bt-stack-down.sh
+rm bt-stack-down-with-radio.sh
+rm bt-reset-env.sh
+popd
+%files profile_mobile
+%license LICENSE.APLv2
+%attr(0755,-,-) %{_prefix}/etc/bluetooth/mobile/bt-stack-up.sh
+%attr(0755,-,-) %{_prefix}/etc/bluetooth/mobile/bt-stack-down.sh
+%attr(0755,-,-) %{_prefix}/etc/bluetooth/mobile/bt-reset-env.sh
+%attr(0755,-,-) %{_prefix}/etc/bluetooth/mobile/bt-stack-down-with-radio.sh
+%{_libdir}/systemd/system/bluetooth-stack-down-with-radio.service
+%{_libdir}/systemd/system/bluez-start.service
+%{_libdir}/systemd/system/bluetooth-stack-up.service
+%{_libdir}/systemd/system/bluetooth-stack-down.service
+%{_libdir}/systemd/system/bluetooth-hci-up.service
+%{_libdir}/systemd/system/bluetooth-hci-down.service
+
+%post profile_ivi
+pushd %{_prefix}/etc/bluetooth/
+ln -sf ivi/bt-stack-up.sh bt-stack-up.sh
+ln -sf ivi/bt-stack-down.sh bt-stack-down.sh
+ln -sf ivi/bt-reset-env.sh bt-reset-env.sh
+popd
+%preun profile_ivi
+pushd %{_prefix}/etc/bluetooth/
+rm bt-stack-up.sh
+rm bt-stack-down.sh
+rm bt-reset-env.sh
+popd
+%files profile_ivi
+%license LICENSE.APLv2
+%attr(0755,-,-) %{_prefix}/etc/bluetooth/ivi/bt-stack-up.sh
+%attr(0755,-,-) %{_prefix}/etc/bluetooth/ivi/bt-stack-down.sh
+%attr(0755,-,-) %{_prefix}/etc/bluetooth/ivi/bt-reset-env.sh
+%{_libdir}/systemd/system/bluez-start.service
+%{_libdir}/systemd/system/bluetooth-stack-up.service
+%{_libdir}/systemd/system/bluetooth-stack-down.service
+%{_libdir}/systemd/system/bluetooth-hci-up.service
+%{_libdir}/systemd/system/bluetooth-hci-down.service
+
+%post profile_wearable
+pushd %{_prefix}/etc/bluetooth/
+ln -sf wearable/bt-stack-up.sh bt-stack-up.sh
+ln -sf wearable/bt-stack-down.sh bt-stack-down.sh
+ln -sf wearable/bt-reset-env.sh bt-reset-env.sh
+popd
+%preun profile_wearable
+pushd %{_prefix}/etc/bluetooth/
+rm bt-stack-up.sh
+rm bt-stack-down.sh
+rm bt-reset-env.sh
+popd
+%files profile_wearable
+%license LICENSE.APLv2
+%attr(0755,-,-) %{_prefix}/etc/bluetooth/wearable/bt-stack-up.sh
+%attr(0755,-,-) %{_prefix}/etc/bluetooth/wearable/bt-stack-down.sh
+%attr(0755,-,-) %{_prefix}/etc/bluetooth/wearable/bt-reset-env.sh
+%{_libdir}/systemd/system/bluez-start.service
+%{_libdir}/systemd/system/bluetooth-stack-up.service
+%{_libdir}/systemd/system/bluetooth-stack-down.service
+%{_libdir}/systemd/system/bluetooth-hci-up.service
+%{_libdir}/systemd/system/bluetooth-hci-down.service