From 79f4da18f2248d338d6d50a713d459952af236aa Mon Sep 17 00:00:00 2001 From: Robin Lee Date: Nov 10 2020 08:00:18 +0000 Subject: [packit] 5.11.0.36 upstream release Upstream tag: 5.11.0.36 Upstream commit: 344289f7 Signed-off-by: Robin Lee --- diff --git a/.gitignore b/.gitignore index 7404fb5..d6cdbf0 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ /dde-daemon-3.23.0.tar.gz /default-settings-2019.1.30.tar.gz /dde-daemon-5.0.0.tar.gz +/dde-daemon-5.11.0.36.tar.gz diff --git a/.packit.yaml b/.packit.yaml new file mode 100644 index 0000000..a58a13c --- /dev/null +++ b/.packit.yaml @@ -0,0 +1,20 @@ +# See the documentation for more information: +# https://packit.dev/docs/configuration/ + +specfile_path: rpm/deepin-daemon.spec + +# add or remove files that should be synced +synced_files: + - rpm/deepin-daemon.spec + - .packit.yaml + +upstream_ref: 5.11.0.36 +upstream_package_name: dde-daemon +# downstream (Fedora) RPM package name +downstream_package_name: deepin-daemon + +actions: + fix-spec-file: | + bash -c "sed -i -r \"s/Version:(\s*)\S*/Version:\1${PACKIT_PROJECT_VERSION}/\" rpm/deepin-daemon.spec" + post-upstream-clone: | + cp rpm/dde-daemon.spec rpm/deepin-daemon.spec diff --git a/0001-fix-Fix-build-with-glibc-2.33.patch b/0001-fix-Fix-build-with-glibc-2.33.patch new file mode 100644 index 0000000..a95e810 --- /dev/null +++ b/0001-fix-Fix-build-with-glibc-2.33.patch @@ -0,0 +1,29 @@ +From 5949360507af21cca6c039a3089936eb963d5a8d Mon Sep 17 00:00:00 2001 +From: Robin Lee +Date: Thu, 22 Oct 2020 09:58:32 +0800 +Subject: [PATCH 1/6] fix: Fix build with glibc 2.33 + +glibc 2.33 will remove the header `sys/timeb.h` and this source does not +actually use any symbol provided by that header. + +Log: +Signed-off-by: Robin Lee +--- + system/gesture/touchscreen_core.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/system/gesture/touchscreen_core.c b/system/gesture/touchscreen_core.c +index f5eb249b..8853b1a4 100644 +--- a/system/gesture/touchscreen_core.c ++++ b/system/gesture/touchscreen_core.c +@@ -38,7 +38,6 @@ + #include + #include + #include +-#include + + #include "utils.h" + #include "touchscreen_core.h" +-- +2.26.2 + diff --git a/0002-feat-rpm-add-rpm-spec.patch b/0002-feat-rpm-add-rpm-spec.patch new file mode 100644 index 0000000..ce93040 --- /dev/null +++ b/0002-feat-rpm-add-rpm-spec.patch @@ -0,0 +1,61 @@ +From ca5e475189c42f9f0d1974e4e5a914d9b4cea498 Mon Sep 17 00:00:00 2001 +From: hubenchang0515 +Date: Fri, 11 Sep 2020 14:02:43 +0800 +Subject: [PATCH 2/6] feat(rpm): add rpm spec +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +添加RPM打包脚本 + +Log: 添加RPM打包脚本 +Change-Id: I5e3c36bd1257073265ce076e177e8fea3cb91df9 +Reviewed-on: http://gerrit.uniontech.com/c/dde-daemon/+/4427 +Reviewed-by: +Reviewed-by: quezhiyong +Tested-by: +--- + Makefile | 2 +- + system/gesture/core.h | 13 +++++++++++++ + 2 files changed, 14 insertions(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 13306098..82876747 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,7 +1,7 @@ + PREFIX = /usr + GOPATH_DIR = gopath + GOPKG_PREFIX = pkg.deepin.io/dde/daemon +-GOBUILD = go build ++GOBUILD = go build $(flags) + + BINARIES = \ + dde-session-daemon \ +diff --git a/system/gesture/core.h b/system/gesture/core.h +index c2371c8b..cf1abdba 100644 +--- a/system/gesture/core.h ++++ b/system/gesture/core.h +@@ -43,6 +43,19 @@ + #define GESTURE_DIRECTION_IN 14 + #define GESTURE_DIRECTION_OUT 15 + ++#ifndef LIBINPUT_EVENT_GESTURE_TAP_BEGIN ++#define LIBINPUT_EVENT_GESTURE_TAP_BEGIN 806 ++#endif ++ ++#ifndef LIBINPUT_EVENT_GESTURE_TAP_UPDATE ++#define LIBINPUT_EVENT_GESTURE_TAP_UPDATE 807 ++#endif ++ ++#ifndef LIBINPUT_EVENT_GESTURE_TAP_END ++#define LIBINPUT_EVENT_GESTURE_TAP_END 808 ++#endif ++ ++ + int start_loop(int verbose, double distance); + void quit_loop(void); + void set_timer_duration(int duration); +-- +2.26.2 + diff --git a/0003-fix-backlight-remove-DDCCI.patch b/0003-fix-backlight-remove-DDCCI.patch new file mode 100644 index 0000000..8212539 --- /dev/null +++ b/0003-fix-backlight-remove-DDCCI.patch @@ -0,0 +1,354 @@ +From da3febed1796f3ee81a8a623f535c2496539094e Mon Sep 17 00:00:00 2001 +From: hubenchang0515 +Date: Mon, 21 Sep 2020 15:32:21 +0800 +Subject: [PATCH 3/6] fix(backlight): remove DDCCI +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +DDCCI设置亮度太慢,导致了很多问题,现在删除 + +Log: 删除DDCCI +Bug: https://pms.uniontech.com/zentao/bug-view-48540.html +Change-Id: I87474b13743f68c3a39ecf33e1f3a97ab934a78c +Reviewed-on: http://gerrit.uniontech.com/c/dde-daemon/+/5696 +Reviewed-by: +Reviewed-by: quezhiyong +Tested-by: +--- + bin/backlight_helper/ddcci/ddcci.go | 180 -------------------------- + bin/backlight_helper/ddcci/manager.go | 96 -------------- + bin/backlight_helper/main.go | 13 +- + 3 files changed, 1 insertion(+), 288 deletions(-) + delete mode 100644 bin/backlight_helper/ddcci/ddcci.go + delete mode 100644 bin/backlight_helper/ddcci/manager.go + +diff --git a/bin/backlight_helper/ddcci/ddcci.go b/bin/backlight_helper/ddcci/ddcci.go +deleted file mode 100644 +index cd4a66da..00000000 +--- a/bin/backlight_helper/ddcci/ddcci.go ++++ /dev/null +@@ -1,180 +0,0 @@ +-package ddcci +- +-// #cgo pkg-config: ddcutil +-// #include +-import "C" +-import ( +- "fmt" +- "sync" +- "unsafe" +- +- "pkg.deepin.io/lib/utils" +-) +- +-type ddcci struct { +- listPointer *C.DDCA_Display_Info_List +- listMu sync.Mutex +- +- displayMap map[string]int +-} +- +-const ( +- brightnessVCP = 0x10 +-) +- +-func newDDCCI() (*ddcci, error) { +- ddc := &ddcci{ +- displayMap: make(map[string]int), +- } +- +- status := C.ddca_set_max_tries(C.DDCA_MULTI_PART_TRIES, 5) +- if status < C.int(0) { +- return nil, fmt.Errorf("Error setting retries: %d", status) +- } +- +- err := ddc.RefreshDisplays() +- if err != nil { +- return nil, err +- } +- +- return ddc, nil +-} +- +-func (d *ddcci) freeList() { +- if d.listPointer != nil { +- C.ddca_free_display_info_list(d.listPointer) +- d.listPointer = nil +- } +-} +- +-func (d *ddcci) RefreshDisplays() error { +- d.listMu.Lock() +- defer d.listMu.Unlock() +- +- d.freeList() +- +- status := C.ddca_get_display_info_list2(C.bool(true), &d.listPointer) +- if status != C.int(0) { +- return fmt.Errorf("failed to get display info list: %d", status) +- } +- +- for i := 0; i < int(d.listPointer.ct); i++ { +- err := d.initDisplay(i) +- if err != nil { +- logger.Warning(err) +- } +- } +- +- return nil +-} +- +-func (d *ddcci) initDisplay(idx int) error { +- item := d.getDisplayInfoByIdx(idx) +- +- var handle C.DDCA_Display_Handle +- status := C.ddca_open_display2(item.dref, C.bool(true), &handle) +- if status != C.int(0) { +- return fmt.Errorf("failed to open monitor: %d", status) +- } +- +- defer C.ddca_close_display(handle) +- +- var val C.DDCA_Non_Table_Vcp_Value +- status = C.ddca_get_non_table_vcp_value(handle, brightnessVCP, &val) +- if status != C.int(0) { +- return fmt.Errorf("failed to check DDC/CI support: %d", status) +- } +- +- edid := C.GoBytes(unsafe.Pointer(&item.edid_bytes), 128) +- edidChecksum := getEDIDChecksum(edid) +- +- d.displayMap[string(edidChecksum)] = idx +- return nil +-} +- +-func (d *ddcci) SupportBrightness(edidChecksum string) bool { +- d.listMu.Lock() +- _, ok := d.displayMap[edidChecksum] +- d.listMu.Unlock() +- +- return ok +-} +- +-func (d *ddcci) GetBrightness(edidChecksum string) (brightness int, err error) { +- d.listMu.Lock() +- defer d.listMu.Unlock() +- +- idx, ok := d.displayMap[edidChecksum] +- if !ok { +- err = fmt.Errorf("monitor not support DDC/CI") +- return +- } +- +- item := d.getDisplayInfoByIdx(idx) +- +- var handle C.DDCA_Display_Handle +- status := C.ddca_open_display2(item.dref, C.bool(true), &handle) +- if status != C.int(0) { +- err = fmt.Errorf("failed to open monitor: %d", status) +- return +- } +- +- defer C.ddca_close_display(handle) +- +- var val C.DDCA_Non_Table_Vcp_Value +- status = C.ddca_get_non_table_vcp_value(handle, brightnessVCP, &val) +- if status != C.int(0) { +- err = fmt.Errorf("failed to get brightness: %d", status) +- return +- } +- +- brightness = int(val.sl) +- return +-} +- +-func (d *ddcci) SetBrightness(edidChecksum string, percent int) error { +- d.listMu.Lock() +- defer d.listMu.Unlock() +- +- idx, ok := d.displayMap[edidChecksum] +- if !ok { +- return fmt.Errorf("monitor not support DDC/CI") +- } +- +- item := d.getDisplayInfoByIdx(idx) +- +- var handle C.DDCA_Display_Handle +- status := C.ddca_open_display2(item.dref, C.bool(true), &handle) +- if status != C.int(0) { +- return fmt.Errorf("failed to open monitor: %d", status) +- } +- +- defer C.ddca_close_display(handle) +- +- // 开启结果验证,防止返回设置成功,但实际上没有生效的情况 +- // 此方法仅对当前线程生效 +- C.ddca_enable_verify(true) +- +- status = C.ddca_set_non_table_vcp_value(handle, brightnessVCP, 0, C.uchar(percent)) +- if status != C.int(0) { +- return fmt.Errorf("failed to set brightness via DDC/CI: %d", status) +- } +- +- return nil +-} +- +-func (d *ddcci) getDisplayInfoByIdx(idx int) *C.DDCA_Display_Info { +- start := unsafe.Pointer(uintptr(unsafe.Pointer(d.listPointer)) + uintptr(C.sizeof_DDCA_Display_Info_List)) +- size := uintptr(C.sizeof_DDCA_Display_Info) +- +- return (*C.DDCA_Display_Info)(unsafe.Pointer(uintptr(start) + size*uintptr(idx))) +-} +- +-func getEDIDChecksum(edid []byte) string { +- if len(edid) < 128 { +- return "" +- } +- +- id, _ := utils.SumStrMd5(string(edid[:128])) +- return id +-} +diff --git a/bin/backlight_helper/ddcci/manager.go b/bin/backlight_helper/ddcci/manager.go +deleted file mode 100644 +index e87083d2..00000000 +--- a/bin/backlight_helper/ddcci/manager.go ++++ /dev/null +@@ -1,96 +0,0 @@ +-package ddcci +- +-import ( +- "fmt" +- "runtime" +- "strings" +- "sync" +- +- dbus "github.com/godbus/dbus" +- "pkg.deepin.io/lib/dbusutil" +- "pkg.deepin.io/lib/log" +-) +- +-const ( +- DbusPath = "/com/deepin/daemon/helper/Backlight/DDCCI" +- dbusInterface = "com.deepin.daemon.helper.Backlight.DDCCI" +-) +- +-var logger = log.NewLogger("backlight_helper/ddcci") +- +-type Manager struct { +- ddcci *ddcci +- PropsMu sync.RWMutex +- +- methods *struct { //nolint +- CheckSupport func() `in:"edidChecksum" out:"support"` +- GetBrightness func() `in:"edidChecksum" out:"value"` +- SetBrightness func() `in:"edidChecksum,value"` +- RefreshDisplays func() +- } +-} +- +-func NewManager() (*Manager, error) { +- m := &Manager{} +- +- // 在 arm 和 mips 架构下,调用 i2c 的接口会导致待机后无法唤醒, +- // 所以不在 arm 和 mips 架构下使用 DDC/CI 功能。 +- if !strings.HasPrefix(runtime.GOARCH, "arm") && !strings.HasPrefix(runtime.GOARCH, "mips") { +- var err error +- m.ddcci, err = newDDCCI() +- if err != nil { +- return nil, fmt.Errorf("failed to init ddc/ci: %s", err) +- } +- } +- +- return m, nil +-} +- +-func (*Manager) GetInterfaceName() string { +- return dbusInterface +-} +- +-func (m *Manager) CheckSupport(edidChecksum string) (bool, *dbus.Error) { +- if m.ddcci == nil { +- return false, nil +- } +- +- return m.ddcci.SupportBrightness(edidChecksum), nil +-} +- +-func (m *Manager) GetBrightness(edidChecksum string) (int32, *dbus.Error) { +- if m.ddcci == nil { +- return 0, nil +- } +- +- if !m.ddcci.SupportBrightness(edidChecksum) { +- err := fmt.Errorf("not support ddc/ci: %s", edidChecksum) +- return 0, dbusutil.ToError(err) +- } +- +- brightness, err := m.ddcci.GetBrightness(edidChecksum) +- return int32(brightness), dbusutil.ToError(err) +-} +- +-func (m *Manager) SetBrightness(edidChecksum string, value int32) *dbus.Error { +- if m.ddcci == nil { +- return nil +- } +- +- if !m.ddcci.SupportBrightness(edidChecksum) { +- err := fmt.Errorf("not support ddc/ci: %s", edidChecksum) +- return dbusutil.ToError(err) +- } +- +- err := m.ddcci.SetBrightness(edidChecksum, int(value)) +- return dbusutil.ToError(err) +-} +- +-func (m *Manager) RefreshDisplays() *dbus.Error { +- if m.ddcci == nil { +- return nil +- } +- +- err := m.ddcci.RefreshDisplays() +- return dbusutil.ToError(err) +-} +diff --git a/bin/backlight_helper/main.go b/bin/backlight_helper/main.go +index c8e6e7e1..84f13805 100644 +--- a/bin/backlight_helper/main.go ++++ b/bin/backlight_helper/main.go +@@ -27,7 +27,6 @@ import ( + "strings" + + dbus "github.com/godbus/dbus" +- "pkg.deepin.io/dde/daemon/bin/backlight_helper/ddcci" + "pkg.deepin.io/lib/dbusutil" + "pkg.deepin.io/lib/log" + ) +@@ -45,7 +44,7 @@ const ( + + type Manager struct { + service *dbusutil.Service +- methods *struct { //nolint ++ methods *struct { //nolint + SetBrightness func() `in:"type,name,value"` + } + } +@@ -111,16 +110,6 @@ func main() { + logger.Fatal("failed to export:", err) + } + +- ddcciManager, err := ddcci.NewManager() +- if err != nil { +- logger.Warning(err) +- } else { +- err = service.Export(ddcci.DbusPath, ddcciManager) +- if err != nil { +- logger.Warning("failed to export:", err) +- } +- } +- + err = service.RequestName(dbusServiceName) + if err != nil { + logger.Fatal("failed to request name:", err) +-- +2.26.2 + diff --git a/0004-feat-Initial-packit-setup.patch b/0004-feat-Initial-packit-setup.patch new file mode 100644 index 0000000..3317117 --- /dev/null +++ b/0004-feat-Initial-packit-setup.patch @@ -0,0 +1,404 @@ +From 51265618cd6c187ee93cb3674d4e5a04045a1429 Mon Sep 17 00:00:00 2001 +From: Robin Lee +Date: Tue, 10 Nov 2020 14:23:10 +0800 +Subject: [PATCH 4/6] feat: Initial packit setup + +This commit contains the specfile for building the official package for Fedora +with a Packit setup. + +Ultimately, a unified specfile is targeted for Fedora and any other rpm-based +distributions, e.g. openEuler. + +And Packit(https://packit.dev/) is a tool for maintaining specfile within +upstream source. It requires a simple config file(.packit.yaml). + +Log: Initial packit setup +Signed-off-by: Robin Lee +--- + rpm/dde-daemon.spec | 154 ++++++++++++++++++++++++++++---------------- + rpm/fontconfig.json | 26 ++++++++ + rpm/locale.go.patch | 81 +++++++++++++++++++++++ + 3 files changed, 204 insertions(+), 57 deletions(-) + create mode 100644 rpm/fontconfig.json + create mode 100644 rpm/locale.go.patch + +diff --git a/rpm/dde-daemon.spec b/rpm/dde-daemon.spec +index 437bd9b2..e81ea7ed 100644 +--- a/rpm/dde-daemon.spec ++++ b/rpm/dde-daemon.spec +@@ -1,80 +1,94 @@ + %global _smp_mflags -j1 + ++%if 0%{?fedora} == 0 + %global debug_package %{nil} + %global _unpackaged_files_terminate_build 0 + %global _missing_build_ids_terminate_build 0 + %define __debug_install_post \ + %{_rpmconfigdir}/find-debuginfo.sh %{?_find_debuginfo_opts} "%{_builddir}/%{?buildsubdir}"\ + %{nil} ++%endif + + %global sname deepin-daemon ++%global repo dde-daemon + %global release_name server-industry + +-Name: dde-daemon +-Version: 5.10.0.23 +-Release: 5 ++%if 0%{?fedora} ++Name: %{sname} ++%else ++Name: %{repo} ++%endif ++Version: 5.11.0.36 ++Release: 1%{?fedora:%dist} + Summary: Daemon handling the DDE session settings + License: GPLv3 ++%if 0%{?fedora} ++URL: https://github.com/linuxdeepin/dde-daemon ++Source0: %{url}/archive/%{version}/%{repo}-%{version}.tar.gz ++# upstream default mono font set to 'Noto Mono', which is not yet available in ++# Fedora. We change to 'Noto Sans Mono' ++Source1: fontconfig.json ++%else + URL: http://shuttle.corp.deepin.com/cache/tasks/18802/unstable-amd64/ +-Source0: %{name}-%{version}-%{release_name}.orig.tar.xz +-Patch0: 0001-fix-building-error.patch +- +-BuildRequires: python37 ++Source0: %{repo}-%{version}.orig.tar.xz ++%endif ++ ++BuildRequires: python3 ++%if 0%{?fedora} ++ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 aarch64 %{arm}} ++BuildRequires: golang(pkg.deepin.io/dde/api/dxinput) >= 3.1.26 ++BuildRequires: golang(github.com/linuxdeepin/go-dbus-factory/org.bluez) ++BuildRequires: golang(github.com/linuxdeepin/go-x11-client) ++BuildRequires: golang(github.com/BurntSushi/xgb) ++BuildRequires: golang(github.com/BurntSushi/xgbutil) ++BuildRequires: golang(github.com/axgle/mahonia) ++BuildRequires: golang(github.com/msteinert/pam) ++BuildRequires: golang(github.com/nfnt/resize) ++BuildRequires: golang(github.com/cryptix/wav) ++BuildRequires: golang(gopkg.in/alecthomas/kingpin.v2) ++BuildRequires: golang(gopkg.in/yaml.v2) ++BuildRequires: golang(github.com/gosexy/gettext) ++BuildRequires: golang(github.com/jinzhu/gorm) ++BuildRequires: golang(github.com/jinzhu/gorm/dialects/sqlite) ++BuildRequires: golang(github.com/kelvins/sunrisesunset) ++BuildRequires: golang(github.com/rickb777/date) ++BuildRequires: golang(github.com/teambition/rrule-go) ++BuildRequires: golang(github.com/davecgh/go-spew/spew) ++%else ++BuildRequires: gocode ++BuildRequires: ddcutil-devel ++BuildRequires: resize-devel ++BuildRequires: gorm-devel ++BuildRequires: inflection-devel ++%endif + BuildRequires: compiler(go-compiler) + BuildRequires: deepin-gettext-tools + BuildRequires: fontpackages-devel + BuildRequires: librsvg2-tools + BuildRequires: pam-devel >= 1.3.1 +-BuildRequires: pam >= 1.3.1 +-BuildRequires: golang-github-linuxdeepin-go-x11-client-devel +-BuildRequires: golang-golang-org-net-devel + BuildRequires: glib2-devel + BuildRequires: gtk3-devel + BuildRequires: systemd-devel +-BuildRequires: golang-github-axgle-mahonia-devel +-BuildRequires: golang-golang-x-xerrors-devel +-BuildRequires: golang-gopkg-alecthomas-kingpin-devel +-BuildRequires: dde-api-devel +-BuildRequires: golang.org-x-image-devel +-BuildRequires: text-devel +-BuildRequires: resize-devel +-BuildRequires: golang-github-teambition-rrule-go-devel +-BuildRequires: golang-github-rickb777-date-devel +-BuildRequires: golang-github-mozillazg-go-pinyin-devel +-BuildRequires: golang-github-kelvins-sunrisesunset-devel +-BuildRequires: gorm-devel +-BuildRequires: golang-github-cryptix-wav-devel +-BuildRequires: golang-github-mattn-go-sqlite3-devel +-BuildRequires: golang-github-alecthomas-template-devel +-BuildRequires: inflection-devel +-BuildRequires: golang-github-rickb777-plural-devel +-BuildRequires: golang-github-alecthomas-units-devel + BuildRequires: alsa-lib-devel +-BuildRequires: alsa-lib + BuildRequires: pulseaudio-libs-devel + BuildRequires: gdk-pixbuf2-xlib-devel +-BuildRequires: gdk-pixbuf2-xlib + BuildRequires: libnl3-devel +-BuildRequires: libnl3 + BuildRequires: libgudev-devel +-BuildRequires: libgudev +-BuildRequires: golang-github-davecgh-go-spew-devel + BuildRequires: libinput-devel +-BuildRequires: libinput +-BuildRequires: golang-github-gosexy-gettext-devel + BuildRequires: librsvg2-devel +-BuildRequires: librsvg2 +-BuildRequires: golang-github-msteinert-pam-devel +-BuildRequires: go-lib-devel +-BuildRequires: golang-github-linuxdeepin-go-dbus-factory-devel +-BuildRequires: deepin-gir-generator + BuildRequires: libXcursor-devel ++BuildRequires: pkgconfig(sqlite3) + +-Requires: bluez-libs ++Requires: bluez-libs%{?_isa} + Requires: deepin-desktop-base + Requires: deepin-desktop-schemas ++%if 0%{?fedora} ++Requires: deepin-session-ui ++Requires: deepin-polkit-agent ++%else + Requires: dde-session-ui + Requires: dde-polkit-agent ++%endif + Requires: rfkill + Requires: gvfs + Requires: iw +@@ -84,16 +98,22 @@ Recommends: imwheel + Recommends: mobile-broadband-provider-info + Recommends: google-noto-mono-fonts + Recommends: google-noto-sans-fonts ++%if 0%{?fedora} ++Recommends: google-noto-sans-mono-fonts ++%endif + + %description + Daemon handling the DDE session settings + + %prep +-%setup -q -n %{name}-%{version}-%{release_name} +-%patch0 -p1 ++%autosetup -p1 -n %{repo}-%{version} ++#patch langselector/locale.go < rpm/locale.go.patch ++#install -m 644 %{SOURCE2} misc/etc/pam.d/deepin-auth + + # Fix library exec path + sed -i '/deepin/s|lib|libexec|' Makefile ++sed -i '/systemd/s|lib|usr/lib|' Makefile ++sed -i 's:/lib/udev/rules.d:%{_udevrulesdir}:' Makefile + sed -i '/${DESTDIR}\/usr\/lib\/deepin-daemon\/service-trigger/s|${DESTDIR}/usr/lib/deepin-daemon/service-trigger|${DESTDIR}/usr/libexec/deepin-daemon/service-trigger|g' Makefile + sed -i '/${DESTDIR}${PREFIX}\/lib\/deepin-daemon/s|${DESTDIR}${PREFIX}/lib/deepin-daemon|${DESTDIR}${PREFIX}/usr/libexec/deepin-daemon|g' Makefile + sed -i 's|lib/NetworkManager|libexec|' network/utils_test.go +@@ -135,13 +155,24 @@ sed -i 's/google-chrome/chromium-browser/g' misc/dde-daemon/mime/data.json + + %build + BUILDID="0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')" ++%if 0%{?fedora} ++export GOPATH="$(pwd)/build:%{gopath}" ++%else + export GOPATH=/usr/share/gocode +-%make_build GOBUILD="go build -compiler gc -ldflags \"-B $BUILDID\"" +-#make GOPATH=/usr/share/gocode ++%endif ++%make_build GO_BUILD_FLAGS=-trimpath GOBUILD="go build -compiler gc -ldflags \"-B $BUILDID\"" + + %install ++BUILDID="0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')" ++%if 0%{?fedora} ++export GOPATH="$(pwd)/build:%{gopath}" ++%else + export GOPATH=/usr/share/gocode +-%make_install ++%endif ++%make_install PAM_MODULE_DIR=%{_libdir}/security GOBUILD="go build -compiler gc -ldflags \"-B $BUILDID\"" ++ ++# don't install pam module ++rm %{buildroot}%{_libdir}/security/pam_deepin_auth.so %{buildroot}%{_datadir}/pam-configs/deepin-auth + + # fix systemd/logind config + install -d %{buildroot}/usr/lib/systemd/logind.conf.d/ +@@ -151,10 +182,13 @@ HandlePowerKey=ignore + HandleSuspendKey=ignore + EOF + +-install -d %{buildroot}/%{_libdir}/security/ +-install -Dm755 %{buildroot}/pam_deepin_auth.so %{buildroot}/%{_libdir}/security/pam_deepin_auth.so ++%if 0%{?fedora} ++# install default settings ++install -Dm644 %{SOURCE1} \ ++ %{buildroot}%{_datadir}/deepin-default-settings/fontconfig.json ++%endif + +-%find_lang %{name} ++%find_lang %{repo} + + %post + if [ $1 -ge 1 ]; then +@@ -175,19 +209,21 @@ if [ $1 -eq 0 ]; then + rm -f /var/log/deepin.log + fi + +-%files -f %{name}.lang ++%files -f %{repo}.lang + %doc README.md + %license LICENSE + %{_sysconfdir}/default/grub.d/10_deepin.cfg + %{_sysconfdir}/grub.d/35_deepin_gfxmode + %{_sysconfdir}/pam.d/deepin-auth-keyboard ++%{_sysconfdir}/NetworkManager/conf.d/deepin.dde.daemon.conf ++%{_sysconfdir}/modules-load.d/i2c_dev.conf + %{_libexecdir}/%{sname}/ + %{_prefix}/lib/systemd/logind.conf.d/10-%{sname}.conf + %{_datadir}/dbus-1/services/*.service + %{_datadir}/dbus-1/system-services/*.service + %{_datadir}/dbus-1/system.d/*.conf + %{_datadir}/icons/hicolor/*/status/* +-%{_datadir}/%{name}/ ++%{_datadir}/%{repo}/ + %{_datadir}/dde/ + %{_datadir}/polkit-1/actions/*.policy + %{_var}/cache/appearance/ +@@ -195,13 +231,17 @@ fi + %{_var}/lib/polkit-1/localauthority/10-vendor.d/com.deepin.daemon.Grub2.pkla + %{_sysconfdir}/acpi/actions/deepin_lid.sh + %{_sysconfdir}/acpi/events/deepin_lid ++# This directory is not provided by any other package. ++%dir %{_sysconfdir}/pulse/daemon.conf.d + %{_sysconfdir}/pulse/daemon.conf.d/10-deepin.conf +-/lib/udev/rules.d/80-deepin-fprintd.rules +-%{_datadir}/pam-configs/deepin-auth +-/var/lib/polkit-1/localauthority/10-vendor.d/com.deepin.daemon.Fprintd.pkla +-%{_libdir}/security/pam_deepin_auth.so +-/lib/systemd/system/dbus-com.deepin.dde.lockservice.service +-/lib/systemd/system/deepin-accounts-daemon.service ++%{_udevrulesdir}/80-deepin-fprintd.rules ++%{_var}/lib/polkit-1/localauthority/10-vendor.d/com.deepin.daemon.Fprintd.pkla ++%{_unitdir}/dbus-com.deepin.dde.lockservice.service ++%{_unitdir}/deepin-accounts-daemon.service ++%{_unitdir}/hwclock_stop.service ++%if 0%{?fedora} ++%{_datadir}/deepin-default-settings/ ++%endif + + %changelog + * Thu May 28 2020 uoser - 5.9.4-2 +diff --git a/rpm/fontconfig.json b/rpm/fontconfig.json +new file mode 100644 +index 00000000..0ca993a7 +--- /dev/null ++++ b/rpm/fontconfig.json +@@ -0,0 +1,26 @@ ++{ ++ "zh_CN":{ ++ "Standard":"Noto Sans CJK SC", ++ "Mono":"Noto Sans Mono" ++ }, ++ "zh_TW":{ ++ "Standard":"Noto Sans CJK TC", ++ "Mono":"Noto Sans Mono" ++ }, ++ "zh_HK":{ ++ "Standard":"Noto Sans CJK TC", ++ "Mono":"Noto Sans Mono" ++ }, ++ "ja":{ ++ "Standard":"Noto Sans CJK JP", ++ "Mono":"Noto Sans Mono" ++ }, ++ "ko":{ ++ "Standard":"Noto Sans CJK KR", ++ "Mono":"Noto Sans Mono" ++ }, ++ "en_US":{ ++ "Standard":"Noto Sans", ++ "Mono":"Noto Sans Mono" ++ } ++} +diff --git a/rpm/locale.go.patch b/rpm/locale.go.patch +new file mode 100644 +index 00000000..34ad22fc +--- /dev/null ++++ b/rpm/locale.go.patch +@@ -0,0 +1,81 @@ ++--- langselector/locale.go.orig 2020-09-18 10:39:04.213018350 +0800 +++++ langselector/locale.go 2020-09-18 10:43:56.901011981 +0800 ++@@ -33,15 +33,15 @@ ++ ++ "github.com/godbus/dbus" ++ // dbus services: ++- "github.com/linuxdeepin/go-dbus-factory/com.deepin.api.localehelper" +++ localehelper "github.com/linuxdeepin/go-dbus-factory/com.deepin.api.localehelper" ++ libnetwork "github.com/linuxdeepin/go-dbus-factory/com.deepin.daemon.network" ++- "github.com/linuxdeepin/go-dbus-factory/com.deepin.lastore" ++- "github.com/linuxdeepin/go-dbus-factory/org.freedesktop.notifications" +++ lastore "github.com/linuxdeepin/go-dbus-factory/com.deepin.lastore" +++ notifications "github.com/linuxdeepin/go-dbus-factory/org.freedesktop.notifications" ++ "pkg.deepin.io/dde/api/lang_info" ++ "pkg.deepin.io/dde/api/language_support" ++ "pkg.deepin.io/dde/api/userenv" ++ ddbus "pkg.deepin.io/dde/daemon/dbus" ++- "pkg.deepin.io/gir/gio-2.0" +++ gio "pkg.deepin.io/gir/gio-2.0" ++ "pkg.deepin.io/lib/dbusutil" ++ . "pkg.deepin.io/lib/gettext" ++ "pkg.deepin.io/lib/gsettings" ++@@ -94,8 +94,8 @@ ++ var ( ++ //save old language notifycation data ++ notifyTxtStartWithInstall string ++- notifyTxtStart string ++- notifyTxtDone string +++ notifyTxtStart string +++ notifyTxtDone string ++ ) ++ ++ //go:generate dbusutil-gen -type LangSelector locale.go ++@@ -415,29 +415,7 @@ ++ lang.setPropCurrentLocale(locale) ++ lang.PropsMu.Unlock() ++ ++- // send notification ++- networkEnabled, err := isNetworkEnable() ++- if err != nil { ++- logger.Warning(err) ++- } ++- ++- if networkEnabled { ++- sendNotify(localeIconStart, "", notifyTxtStartWithInstall) ++- } else { ++- sendNotify(localeIconStart, "", notifyTxtStart) ++- } ++- ++- // generate locale ++- err = lang.generateLocale(locale) ++- if err != nil { ++- logger.Warning("failed to generate locale:", err) ++- lang.setLocaleFailed(oldLocale) ++- return ++- } else { ++- logger.Debug("generate locale success") ++- } ++- ++- err = writeUserLocale(locale) +++ err := writeUserLocale(locale) ++ if err != nil { ++ logger.Warning("failed to write user locale:", err) ++ lang.setLocaleFailed(oldLocale) ++@@ -461,16 +439,6 @@ ++ } ++ } ++ ++- // install language support packages ++- if networkEnabled { ++- err = lang.installLangSupportPackages(locale) ++- if err != nil { ++- logger.Warning("failed to install packages:", err) ++- } else { ++- logger.Debug("install packages success") ++- } ++- } ++- ++ sendNotify(localeIconFinished, "", notifyTxtDone) ++ ++ // end +-- +2.26.2 + diff --git a/0005-fix-include-sysuser-config-file-for-Fedora.patch b/0005-fix-include-sysuser-config-file-for-Fedora.patch new file mode 100644 index 0000000..f17ffab --- /dev/null +++ b/0005-fix-include-sysuser-config-file-for-Fedora.patch @@ -0,0 +1,57 @@ +From cccfc3e59c9858b30deebd899e873a0387ea7140 Mon Sep 17 00:00:00 2001 +From: Robin Lee +Date: Tue, 10 Nov 2020 15:45:30 +0800 +Subject: [PATCH 5/6] fix: include sysuser config file for Fedora + +The sysuser config file was dropped in 214afea93 + +Log: include sysuser config file for Fedora +Signed-off-by: Robin Lee +--- + rpm/dde-daemon.spec | 6 ++++++ + rpm/deepin-daemon.sysusers | 2 ++ + 2 files changed, 8 insertions(+) + create mode 100644 rpm/deepin-daemon.sysusers + +diff --git a/rpm/dde-daemon.spec b/rpm/dde-daemon.spec +index e81ea7ed..6091f00f 100644 +--- a/rpm/dde-daemon.spec ++++ b/rpm/dde-daemon.spec +@@ -28,6 +28,7 @@ Source0: %{url}/archive/%{version}/%{repo}-%{version}.tar.gz + # upstream default mono font set to 'Noto Mono', which is not yet available in + # Fedora. We change to 'Noto Sans Mono' + Source1: fontconfig.json ++Source2: %{sname}.sysusers + %else + URL: http://shuttle.corp.deepin.com/cache/tasks/18802/unstable-amd64/ + Source0: %{repo}-%{version}.orig.tar.xz +@@ -174,6 +175,10 @@ export GOPATH=/usr/share/gocode + # don't install pam module + rm %{buildroot}%{_libdir}/security/pam_deepin_auth.so %{buildroot}%{_datadir}/pam-configs/deepin-auth + ++%if 0%{?fedora} ++install -Dm644 %{SOURCE2} %{buildroot}/usr/lib/sysusers.d/%{name}.conf ++%endif ++ + # fix systemd/logind config + install -d %{buildroot}/usr/lib/systemd/logind.conf.d/ + cat > %{buildroot}/usr/lib/systemd/logind.conf.d/10-%{sname}.conf < +Date: Tue, 10 Nov 2020 15:48:11 +0800 +Subject: [PATCH 6/6] fix: Disable grub-related functions + +Grub-related functions may not work well on Fedora + +Log: Disable grub-related functions +Signed-off-by: Robin Lee +--- + rpm/dde-daemon.spec | 14 +++++++++++--- + 1 file changed, 11 insertions(+), 3 deletions(-) + +diff --git a/rpm/dde-daemon.spec b/rpm/dde-daemon.spec +index 6091f00f..86287bc8 100644 +--- a/rpm/dde-daemon.spec ++++ b/rpm/dde-daemon.spec +@@ -217,8 +217,6 @@ fi + %files -f %{repo}.lang + %doc README.md + %license LICENSE +-%{_sysconfdir}/default/grub.d/10_deepin.cfg +-%{_sysconfdir}/grub.d/35_deepin_gfxmode + %{_sysconfdir}/pam.d/deepin-auth-keyboard + %{_sysconfdir}/NetworkManager/conf.d/deepin.dde.daemon.conf + %{_sysconfdir}/modules-load.d/i2c_dev.conf +@@ -233,7 +231,6 @@ fi + %{_datadir}/polkit-1/actions/*.policy + %{_var}/cache/appearance/ + %{_var}/lib/polkit-1/localauthority/10-vendor.d/com.deepin.daemon.Accounts.pkla +-%{_var}/lib/polkit-1/localauthority/10-vendor.d/com.deepin.daemon.Grub2.pkla + %{_sysconfdir}/acpi/actions/deepin_lid.sh + %{_sysconfdir}/acpi/events/deepin_lid + # This directory is not provided by any other package. +@@ -247,6 +244,17 @@ fi + %if 0%{?fedora} + %{_sysusersdir}/%{name}.conf + %{_datadir}/deepin-default-settings/ ++%exclude %{_sysconfdir}/default/grub.d/10_deepin.cfg ++%exclude %{_sysconfdir}/grub.d/35_deepin_gfxmode ++%exclude %{_libexecdir}/%{name}/grub2 ++%exclude %{_datadir}/dbus-1/system-services/com.deepin.daemon.Grub2.service ++%exclude %{_datadir}/dbus-1/system.d/com.deepin.daemon.Grub2.conf ++%exclude %{_datadir}/polkit-1/actions/com.deepin.daemon.Grub2.policy ++%exclude %{_var}/lib/polkit-1/localauthority/10-vendor.d/com.deepin.daemon.Grub2.pkla ++%else ++%{_sysconfdir}/default/grub.d/10_deepin.cfg ++%{_sysconfdir}/grub.d/35_deepin_gfxmode ++%{_var}/lib/polkit-1/localauthority/10-vendor.d/com.deepin.daemon.Grub2.pkla + %endif + + %changelog +-- +2.26.2 + diff --git a/README.packit b/README.packit new file mode 100644 index 0000000..0b7be24 --- /dev/null +++ b/README.packit @@ -0,0 +1,3 @@ +This repository is maintained by packit. +https://packit.dev/ +The file was generated using packit 0.18.0. diff --git a/dde-daemon_3.8.0.patch b/dde-daemon_3.8.0.patch deleted file mode 100644 index dfbc459..0000000 --- a/dde-daemon_3.8.0.patch +++ /dev/null @@ -1,66 +0,0 @@ -diff --git a/misc/dde-daemon/gesture.json b/misc/dde-daemon/gesture.json -index 2fc0ce60..9548d8f2 100644 ---- a/misc/dde-daemon/gesture.json -+++ b/misc/dde-daemon/gesture.json -@@ -53,15 +53,6 @@ - "Action": "ShowWindow" - } - }, -- { -- "Name": "tap", -- "Direction": "none", -- "Fingers": 3, -- "Action": { -- "Type": "built-in", -- "Action": "MoveWindow" -- } -- }, - { - "Name": "swipe", - "Direction": "up", -diff --git a/system/gesture/core.c b/system/gesture/core.c -index 750baabb..066c4fd9 100644 ---- a/system/gesture/core.c -+++ b/system/gesture/core.c -@@ -294,16 +294,16 @@ handle_gesture_events(struct libinput_event *ev, int type) - } - raw_event_reset(raw); - break; -- case LIBINPUT_EVENT_GESTURE_TAP_BEGIN: -- break; -- case LIBINPUT_EVENT_GESTURE_TAP_END: -- if (libinput_event_gesture_get_cancelled(gesture)) { -- break; -- } -- raw->fingers = libinput_event_gesture_get_finger_count(gesture); -- g_debug("[Tap] fingers: %d", raw->fingers); -- handleGestureEvent(GESTURE_TYPE_TAP, GESTURE_DIRECTION_NONE, raw->fingers); -- break; -+ /*case LIBINPUT_EVENT_GESTURE_TAP_BEGIN:*/ -+ /*break;*/ -+ /*case LIBINPUT_EVENT_GESTURE_TAP_END:*/ -+ /*if (libinput_event_gesture_get_cancelled(gesture)) {*/ -+ /*break;*/ -+ /*}*/ -+ /*raw->fingers = libinput_event_gesture_get_finger_count(gesture);*/ -+ /*g_debug("[Tap] fingers: %d", raw->fingers);*/ -+ /*handleGestureEvent(GESTURE_TYPE_TAP, GESTURE_DIRECTION_NONE, raw->fingers);*/ -+ /*break;*/ - } - } - -@@ -410,10 +410,10 @@ handle_events(struct libinput *li) - case LIBINPUT_EVENT_GESTURE_PINCH_END: - case LIBINPUT_EVENT_GESTURE_SWIPE_BEGIN: - case LIBINPUT_EVENT_GESTURE_SWIPE_UPDATE: -- case LIBINPUT_EVENT_GESTURE_SWIPE_END: -- case LIBINPUT_EVENT_GESTURE_TAP_BEGIN: -- case LIBINPUT_EVENT_GESTURE_TAP_UPDATE: -- case LIBINPUT_EVENT_GESTURE_TAP_END:{ -+ case LIBINPUT_EVENT_GESTURE_SWIPE_END:{ -+ /*case LIBINPUT_EVENT_GESTURE_TAP_BEGIN:*/ -+ /*case LIBINPUT_EVENT_GESTURE_TAP_UPDATE:*/ -+ /*case LIBINPUT_EVENT_GESTURE_TAP_END:{*/ - handle_gesture_events(ev, type); - break; - } diff --git a/deepin-auth b/deepin-auth deleted file mode 100644 index f7a9779..0000000 --- a/deepin-auth +++ /dev/null @@ -1,5 +0,0 @@ -# get the username -auth optional pam_debug.so -auth [success=1 ignore=1 default=bad] pam_deepin_auth.so -auth requisite pam_deny.so -auth required pam_permit.so diff --git a/deepin-daemon.spec b/deepin-daemon.spec index a8a35f9..f082f96 100644 --- a/deepin-daemon.spec +++ b/deepin-daemon.spec @@ -1,53 +1,69 @@ -# https://github.com/linuxdeepin/dde-daemon/issues/63 %global _smp_mflags -j1 + +%if 0%{?fedora} == 0 +%global debug_package %{nil} +%global _unpackaged_files_terminate_build 0 +%global _missing_build_ids_terminate_build 0 +%define __debug_install_post \ + %{_rpmconfigdir}/find-debuginfo.sh %{?_find_debuginfo_opts} "%{_builddir}/%{?buildsubdir}"\ +%{nil} +%endif + +%global sname deepin-daemon %global repo dde-daemon +%global release_name server-industry -Name: deepin-daemon -Version: 5.0.0 -Release: 4%{?dist} +%if 0%{?fedora} +Name: %{sname} +%else +Name: %{repo} +%endif +Version: 5.11.0.36 +Release: 1%{?fedora:%dist} Summary: Daemon handling the DDE session settings License: GPLv3 +%if 0%{?fedora} URL: https://github.com/linuxdeepin/dde-daemon Source0: %{url}/archive/%{version}/%{repo}-%{version}.tar.gz # upstream default mono font set to 'Noto Mono', which is not yet available in # Fedora. We change to 'Noto Sans Mono' Source1: fontconfig.json -Source2: %{name}.sysusers -Source3: deepin-auth -Patch0: https://raw.github.com/jouyouyun/tap-gesture-patches/master/patches/dde-daemon_3.8.0.patch +Source2: %{sname}.sysusers +%else +URL: http://shuttle.corp.deepin.com/cache/tasks/18802/unstable-amd64/ +Source0: %{repo}-%{version}.orig.tar.xz +%endif + +# PATCHES FROM SOURCE GIT: + +# fix: Fix build with glibc 2.33 +# Author: Robin Lee +Patch0001: 0001-fix-Fix-build-with-glibc-2.33.patch + +# feat(rpm): add rpm spec +# Author: hubenchang0515 +Patch0002: 0002-feat-rpm-add-rpm-spec.patch +# fix(backlight): remove DDCCI +# Author: hubenchang0515 +Patch0003: 0003-fix-backlight-remove-DDCCI.patch + +# feat: Initial packit setup +# Author: Robin Lee +Patch0004: 0004-feat-Initial-packit-setup.patch + +# fix: include sysuser config file for Fedora +# Author: Robin Lee +Patch0005: 0005-fix-include-sysuser-config-file-for-Fedora.patch + +# fix: Disable grub-related functions +# Author: Robin Lee +Patch0006: 0006-fix-Disable-grub-related-functions.patch + + +BuildRequires: python3 +%if 0%{?fedora} ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 aarch64 %{arm}} -BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang} -BuildRequires: deepin-gettext-tools -BuildRequires: deepin-gir-generator -BuildRequires: fontpackages-devel -BuildRequires: librsvg2-tools -BuildRequires: pam-devel -BuildRequires: pkgconfig(alsa) -BuildRequires: pkgconfig(fontconfig) -BuildRequires: pkgconfig(gnome-keyring-1) -BuildRequires: pkgconfig(gdk-pixbuf-xlib-2.0) -BuildRequires: pkgconfig(gtk+-3.0) -BuildRequires: pkgconfig(gio-2.0) -BuildRequires: pkgconfig(libbamf3) -BuildRequires: pkgconfig(libcanberra) -BuildRequires: pkgconfig(libnl-3.0) -BuildRequires: pkgconfig(libnl-genl-3.0) -BuildRequires: pkgconfig(libpulse) -BuildRequires: pkgconfig(libsystemd) -BuildRequires: pkgconfig(libudev) -BuildRequires: pkgconfig(gudev-1.0) -BuildRequires: pkgconfig(librsvg-2.0) -BuildRequires: pkgconfig(libinput) -BuildRequires: pkgconfig(poppler-glib) -BuildRequires: pkgconfig(x11) -BuildRequires: pkgconfig(xi) -BuildRequires: pkgconfig(xtst) -BuildRequires: pkgconfig(xcursor) -BuildRequires: pkgconfig(xfixes) -BuildRequires: pkgconfig(xkbfile) -BuildRequires: golang(pkg.deepin.io/lib) >= 1.2.11 -BuildRequires: golang(pkg.deepin.io/lib/fsnotify) BuildRequires: golang(pkg.deepin.io/dde/api/dxinput) >= 3.1.26 BuildRequires: golang(github.com/linuxdeepin/go-dbus-factory/org.bluez) BuildRequires: golang(github.com/linuxdeepin/go-x11-client) @@ -60,64 +76,80 @@ BuildRequires: golang(github.com/cryptix/wav) BuildRequires: golang(gopkg.in/alecthomas/kingpin.v2) BuildRequires: golang(gopkg.in/yaml.v2) BuildRequires: golang(github.com/gosexy/gettext) - -Requires: bamf-daemon -Requires: bluez-libs +BuildRequires: golang(github.com/jinzhu/gorm) +BuildRequires: golang(github.com/jinzhu/gorm/dialects/sqlite) +BuildRequires: golang(github.com/kelvins/sunrisesunset) +BuildRequires: golang(github.com/rickb777/date) +BuildRequires: golang(github.com/teambition/rrule-go) +BuildRequires: golang(github.com/davecgh/go-spew/spew) +%else +BuildRequires: gocode +BuildRequires: ddcutil-devel +BuildRequires: resize-devel +BuildRequires: gorm-devel +BuildRequires: inflection-devel +%endif +BuildRequires: compiler(go-compiler) +BuildRequires: deepin-gettext-tools +BuildRequires: fontpackages-devel +BuildRequires: librsvg2-tools +BuildRequires: pam-devel >= 1.3.1 +BuildRequires: glib2-devel +BuildRequires: gtk3-devel +BuildRequires: systemd-devel +BuildRequires: alsa-lib-devel +BuildRequires: pulseaudio-libs-devel +BuildRequires: gdk-pixbuf2-xlib-devel +BuildRequires: libnl3-devel +BuildRequires: libgudev-devel +BuildRequires: libinput-devel +BuildRequires: librsvg2-devel +BuildRequires: libXcursor-devel +BuildRequires: pkgconfig(sqlite3) + +Requires: bluez-libs%{?_isa} Requires: deepin-desktop-base Requires: deepin-desktop-schemas -Requires: deepin-notifications +%if 0%{?fedora} +Requires: deepin-session-ui Requires: deepin-polkit-agent -%ifnarch s390 s390x %{arm} %{power64} -Obsoletes: deepin-grub2-themes <= 1.0.0 -Requires: acpid -Requires: rfkill +%else +Requires: dde-session-ui +Requires: dde-polkit-agent %endif +Requires: rfkill Requires: gvfs Requires: iw -Requires: libudisks2 -Requires: qt5-qtaccountsservice -Requires: upower -Requires: xdotool -Recommends: NetworkManager-vpnc-gnome -Recommends: NetworkManager-pptp-gnome -Recommends: NetworkManager-l2tp-gnome -Recommends: NetworkManager-strongswan-gnome -Recommends: NetworkManager-openvpn-gnome -Recommends: NetworkManager-openconnect-gnome + Recommends: iso-codes Recommends: imwheel Recommends: mobile-broadband-provider-info -Recommends: google-noto-sans-mono-fonts +Recommends: google-noto-mono-fonts Recommends: google-noto-sans-fonts +%if 0%{?fedora} +Recommends: google-noto-sans-mono-fonts +%endif %description Daemon handling the DDE session settings %prep -%setup -q -n %{repo}-%{version} -%patch0 -p1 -b dde-daemon-3.8.0 -install -m 644 %{SOURCE3} misc/etc/pam.d/deepin-auth +%autosetup -p1 -n %{repo}-%{version} +#patch langselector/locale.go < rpm/locale.go.patch +#install -m 644 %{SOURCE2} misc/etc/pam.d/deepin-auth # Fix library exec path sed -i '/deepin/s|lib|libexec|' Makefile sed -i '/systemd/s|lib|usr/lib|' Makefile +sed -i 's:/lib/udev/rules.d:%{_udevrulesdir}:' Makefile +sed -i '/${DESTDIR}\/usr\/lib\/deepin-daemon\/service-trigger/s|${DESTDIR}/usr/lib/deepin-daemon/service-trigger|${DESTDIR}/usr/libexec/deepin-daemon/service-trigger|g' Makefile +sed -i '/${DESTDIR}${PREFIX}\/lib\/deepin-daemon/s|${DESTDIR}${PREFIX}/lib/deepin-daemon|${DESTDIR}${PREFIX}/usr/libexec/deepin-daemon|g' Makefile sed -i 's|lib/NetworkManager|libexec|' network/utils_test.go -sed -i 's|/usr/lib|%{_libexecdir}|' \ - misc/*services/*.service \ - misc/systemd/services/*.service \ - misc/pam-configs/deepin-auth \ - misc/applications/deepin-toggle-desktop.desktop \ - misc/dde-daemon/gesture.json \ - misc/dde-daemon/keybinding/system_actions.json \ - keybinding/shortcuts/system_shortcut.go \ - session/power/constant.go \ - session/power/lid_switch.go \ - service_trigger/manager.go \ - bin/dde-system-daemon/main.go \ - bin/search/main.go \ - accounts/image_blur.go \ - network/secret_agent.go \ - grub2/modify_manger.go + +for file in $(grep "/usr/lib/deepin-daemon" * -nR |awk -F: '{print $1}') +do + sed -i 's|/usr/lib/deepin-daemon|/usr/libexec/deepin-daemon|g' $file +done # Fix grub.cfg path sed -i 's|boot/grub|boot/grub2|' grub2/{grub2,grub_params,theme}.go @@ -140,7 +172,7 @@ After=user.slice dbus.socket [Service] Type=dbus BusName=com.deepin.dde.LockService -ExecStart=%{_libexecdir}/%{name}/dde-lockservice +ExecStart=%{_libexecdir}/%{sname}/dde-lockservice [Install] WantedBy=graphical.target @@ -150,42 +182,57 @@ EOF sed -i 's/google-chrome/chromium-browser/g' misc/dde-daemon/mime/data.json %build -export GOPATH="$(pwd)/build:%{gopath}" BUILDID="0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')" -%make_build GOBUILD="go build -compiler gc -ldflags \"-B $BUILDID\"" +%if 0%{?fedora} +export GOPATH="$(pwd)/build:%{gopath}" +%else +export GOPATH=/usr/share/gocode +%endif +%make_build GO_BUILD_FLAGS=-trimpath GOBUILD="go build -compiler gc -ldflags \"-B $BUILDID\"" %install -export GOPATH="$(pwd)/build:%{gopath}" BUILDID="0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')" +%if 0%{?fedora} +export GOPATH="$(pwd)/build:%{gopath}" +%else +export GOPATH=/usr/share/gocode +%endif %make_install PAM_MODULE_DIR=%{_libdir}/security GOBUILD="go build -compiler gc -ldflags \"-B $BUILDID\"" -install -Dm644 %{S:2} %{buildroot}/usr/lib/sysusers.d/%{name}.conf +# don't install pam module +rm %{buildroot}%{_libdir}/security/pam_deepin_auth.so %{buildroot}%{_datadir}/pam-configs/deepin-auth + +%if 0%{?fedora} +install -Dm644 %{SOURCE2} %{buildroot}/usr/lib/sysusers.d/%{name}.conf +%endif # fix systemd/logind config install -d %{buildroot}/usr/lib/systemd/logind.conf.d/ -cat > %{buildroot}/usr/lib/systemd/logind.conf.d/10-%{name}.conf < %{buildroot}/usr/lib/systemd/logind.conf.d/10-%{sname}.conf < - 5.11.0.36-1 +- new upstream release: 5.11.0.36 + * Sat Aug 01 2020 Fedora Release Engineering - 5.0.0-4 - Second attempt - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild diff --git a/sources b/sources index 3fb53c4..cc07cfa 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (dde-daemon-5.0.0.tar.gz) = b0247fb8e529bac387b1ce53a448eb8078cb4b2c2dee01b9388d344b366b67abb981efc43bfdd65ff0a91102009feee3f48bc5c7af689a85f30a33a96e3d7a3b +SHA512 (dde-daemon-5.11.0.36.tar.gz) = d36e5629950ac76094da1c79bec1cfc19c2da61ac4adbd7f65ba925ade4162bcf44856e6876512b27b79bb799ad22d732e0078bf647c9e4ae178a88d545a70ac