From 77fd84a1265610d91c8a6aca4c2c2a54520fc059fc0b7fb1035359b811530151 Mon Sep 17 00:00:00 2001 From: Hillwood Yang Date: Tue, 27 Apr 2021 12:16:09 +0000 Subject: [PATCH] Accepting request 888780 from X11:Deepin:Factory OBS-URL: https://build.opensuse.org/request/show/888780 OBS-URL: https://build.opensuse.org/package/show/X11:Deepin/deepin-feature-enable?expand=0&rev=1 --- .gitattributes | 23 ++++++ .gitignore | 1 + deepin-feature-enable.changes | 4 + deepin-feature-enable.in | 137 ++++++++++++++++++++++++++++++++++ deepin-feature-enable.spec | 60 +++++++++++++++ 5 files changed, 225 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 deepin-feature-enable.changes create mode 100644 deepin-feature-enable.in create mode 100644 deepin-feature-enable.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/deepin-feature-enable.changes b/deepin-feature-enable.changes new file mode 100644 index 0000000..7b9e9eb --- /dev/null +++ b/deepin-feature-enable.changes @@ -0,0 +1,4 @@ +------------------------------------------------------------------- +Tue Apr 27 12:05:03 UTC 2021 - Hillwood Yang + +- Initial package for version 1.0 diff --git a/deepin-feature-enable.in b/deepin-feature-enable.in new file mode 100644 index 0000000..13a9abc --- /dev/null +++ b/deepin-feature-enable.in @@ -0,0 +1,137 @@ +#!/bin/bash +# Name: Deepin Features installer +# Version: 1.0 +# Description: Enable dbus and policykit for Deepin Desktop on openSUSE +# Author: Hillwood Yang +# License: WTFPL-2.0 + +SYSTEM_TMP=/tmp + +################################################################################ +# deepin-api-dbus +TMP_DIR=$SYSTEM_TMP/deepin-api-dbus + +pushd /usr/share/dbus-1/system.d/ &>/dev/null + + Filelist1=&(ls com.deepin.api*) &>/dev/null + + if [ "$Filelist1" != "" ]; then + rm -rf "$Filelist1" + fi + +popd &>/dev/null + +pushd /usr/share/dbus-1/system-services/ &>/dev/null + + Filelist2=&(ls com.deepin.api*) &>/dev/null + + if [ "$Filelist2" != "" ]; then + rm -rf "$Filelist2" + fi + +popd &>/dev/null + +mkdir -p $TMP_DIR + +pushd $TMP_DIR &>/dev/null + tar -xvf /usr/share/dde-api/dbus.tar.gz &>/dev/null + cp dbus/system.d/* /usr/share/dbus-1/system.d/ + cp dbus/system-services/* /usr/share/dbus-1/system-services/ + chmod 0644 /usr/share/dbus-1/system.d/com.deepin.api* + chmod 0644 /usr/share/dbus-1/system-services/com.deepin.api* +popd &>/dev/null + +rm -rf $TMP_DIR + +echo "Deepin api profiles install succeed!" + +################################################################################ +# deepin-api-polkit +TMP_DIR=$SYSTEM_TMP/deepin-api-polkit + +pushd /usr/share/polkit-1/actions/ &>/dev/null + + Filelist=&(ls com.deepin.api*) &>/dev/null + + if [ "$Filelist" != "" ]; then + rm -rf "$Filelist" + fi + +popd &>/dev/null + +mkdir -p $TMP_DIR + +pushd $TMP_DIR &>/dev/null + tar -xvf /usr/share/dde-api/polkit.tar.gz &>/dev/null + cp polkit/* /usr/share/polkit-1/actions/ + chmod 0644 /usr/share/polkit-1/actions/com.deepin.api* +popd &>/dev/null + +rm -rf $TMP_DIR + +echo "Deepin API polkit profiles install succeed!" + +################################################################################ +# deepin-daemon-dbus +TMP_DIR=$SYSTEM_TMP/deepin-daemon-dbus + +pushd /usr/share/dbus-1/system.d/ &>/dev/null + + Filelist1=&(ls com.deepin.daemon*) &>/dev/null + + if [ "$Filelist1" != "" ]; then + rm -rf "$Filelist1" + fi + +popd &>/dev/null + +pushd /usr/share/dbus-1/system-services/ &>/dev/null + + Filelist2=&(ls com.deepin.daemon*) &>/dev/null + + if [ "$Filelist2" != "" ]; then + rm -rf "$Filelist2" + fi + +popd &>/dev/null + +mkdir -p $TMP_DIR + +pushd $TMP_DIR &>/dev/null + tar -xvf /usr/share/dde-daemon/dbus.tar.gz &>/dev/null + cp dbus/system.d/* /usr/share/dbus-1/system.d/ + cp dbus/system-services/* /usr/share/dbus-1/system-services/ + chmod 0644 /usr/share/dbus-1/system.d/com.deepin.daemon* + chmod 0644 /usr/share/dbus-1/system-services/com.deepin.daemon* +popd &>/dev/null + +rm -rf $TMP_DIR + +echo "Deepin DBus profiles install succeed!" + +################################################################################ +# deepin-daemon-polkit +TMP_DIR=$SYSTEM_TMP/deepin-daemon-polkit + +pushd /usr/share/polkit-1/actions/ &>/dev/null + + Filelist=&(ls com.deepin.daemon*) &>/dev/null + + if [ "$Filelist" != "" ]; then + rm -rf "$Filelist" + fi + +popd &>/dev/null + +mkdir -p $TMP_DIR + +pushd $TMP_DIR &>/dev/null + tar -xvf /usr/share/dde-daemon/polkit.tar.gz &>/dev/null + cp polkit/* /usr/share/polkit-1/actions/ + chmod 0644 /usr/share/polkit-1/actions/com.deepin.daemon* +popd &>/dev/null + +rm -rf $TMP_DIR + +echo "Deepin polkit profiles install succeed!" + diff --git a/deepin-feature-enable.spec b/deepin-feature-enable.spec new file mode 100644 index 0000000..bb8fcd6 --- /dev/null +++ b/deepin-feature-enable.spec @@ -0,0 +1,60 @@ +# +# spec file for package deepin-feature-enable +# +# Copyright (c) 2021 SUSE LINUX GmbH, Nuernberg, Germany. +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# + + +Name: deepin-feature-enable +Version: 1.0 +Release: 0 +Summary: Deepin Features installer +License: WTFPL +Group: System/GUI/Other +Url: https://github.com/linuxdeepin +Source0: %{name}.in +Requires: deepin-api-dbus +Requires: deepin-api-polkit +Requires: deepin-daemon-dbus +Requires: deepin-daemon-polkit +Recommends: deepin-file-manager-dbus +Recommends: deepin-file-manager-polkit + +%description +The tool will help you to enable all feature of deepin-api and deepin-daemon. +For Ensuring you openSUSE is in security, We remove all the dbus and policykit +features on deepin-api and deepin-daemon. + +If user dose not care about security issues, he can click "I agree" to install +this package. Or click "I disagree" to exit installation. + +%prep + +%build + +%install +%suse_install_update_script %{SOURCE0} +install -d %{buildroot}%{_localstatedir}/adm/update-messages +touch %{buildroot}%{_localstatedir}/adm/update-messages/%{name}-%{version}-%{release} + +%post -p /sbin/ldconfig +%postun -p /sbin/ldconfig + +%files +%defattr(-,root,root) +%{_localstatedir}/adm/update-scripts/* +%{_localstatedir}/adm/update-messages/* + +%changelog +