diff --git a/add-riscv64-support.patch b/add-riscv64-support.patch new file mode 100644 index 0000000000000000000000000000000000000000..da5420b077e4d22a62597c7ccf3d1f68cff4dde9 --- /dev/null +++ b/add-riscv64-support.patch @@ -0,0 +1,26 @@ +diff -ur secpaver-1.0.2/cmd/plugin/selinux/selinux.go secpaver-1.0.2/cmd/plugin/selinux/selinux.go +--- secpaver-1.0.2/cmd/plugin/selinux/selinux.go 2021-09-30 17:58:50.000000000 +0800 ++++ secpaver-1.0.2/cmd/plugin/selinux/selinux.go 2023-08-02 22:02:21.745994703 +0800 +@@ -20,7 +20,8 @@ + "secpaver/engine/selinux" + "sync" + ) +- ++func main() { ++} + var e *selinux.Engine + var once sync.Once + +diff -ur secpaver-1.0.2/Makefile secpaver-1.0.2/Makefile +--- secpaver-1.0.2/Makefile 2021-09-30 18:03:53.000000000 +0800 ++++ secpaver-1.0.2/Makefile 2023-08-02 21:29:18.206330167 +0800 + +@@ -35,7 +35,7 @@ + selinux: + CGO_CFLAGS_ALLOW="-ftrapv -D_FORTIFY_SOURCE=2 -O2" CGO_CFLAGS="-fstack-protector-strong -ftrapv -D_FORTIFY_SOURCE=2 -O2" \ + CGO_LDFALGS_ALLOW="-Wl,-z,-s,relro,now,noexecstack" CGO_LDFALGS="-Wl,-z,-s,relro,now,noexecstack" \ +- go build -buildmode=plugin $(BUILDFLAGS) -ldflags '$(LDFLAGS)' -o $(BUILD_DIR)/selinux.so cmd/plugin/selinux/*.go ++ go build $(BUILDFLAGS) -ldflags '$(LDFLAGS)' -o $(BUILD_DIR)/selinux.so cmd/plugin/selinux/*.go + strip $(BUILD_DIR)/selinux.so + + pav: diff --git a/fix-gcc-build-error.patch b/fix-gcc-build-error.patch new file mode 100644 index 0000000000000000000000000000000000000000..db9472d4512e05b4fdb0a0af1e341b0b9ba0c7c4 --- /dev/null +++ b/fix-gcc-build-error.patch @@ -0,0 +1,14 @@ + + +diff -ur secpaver-1.0.2/Makefile secpaver-1.0.2/Makefile +--- secpaver-1.0.2/Makefile 2021-09-30 18:03:53.000000000 +0800 ++++ secpaver-1.0.2/Makefile 2023-08-02 21:29:18.206330167 +0800 +@@ -23,7 +23,7 @@ + LOG_DIR := $(DESTDIR)/var/log/secpaver + + BUILDFLAGS := -trimpath +-LDFLAGS := -w -s -buildid=IdBySecPaver -linkmode=external -extldflags=-static -extldflags=-zrelro -extldflags=-znow $(LDFLAGS) ++LDFLAGS := -w -s -buildid=IdBySecPaver -linkmode=external -extldflags=-static -extldflags=-zrelro -extldflags=-znow + + ifeq ($(shell go help mod >/dev/null 2>&1 && echo true), true) + export GO111MODULE=on diff --git a/secpaver.spec b/secpaver.spec index 36d572849c5873b6a0ebab52fc7613ffd19d668a..d853c01c95f0dfe9aa01b4a6766bc7f5945d4bcb 100755 --- a/secpaver.spec +++ b/secpaver.spec @@ -2,7 +2,7 @@ Name: secpaver Summary: Security policy development tool Version: 1.0.2 -Release: 5 +Release: 6 License: MulanPSL-2.0 URL: https://gitee.com/openeuler/secpaver Source: https://gitee.com/openeuler/secpaver/repository/archive/%{name}-%{version}.tar.gz @@ -11,7 +11,10 @@ Source1: sys.tar.gz Patch0001: dont-do-daemon-reload-in-make-install.patch Patch0002: set-default-log-path.patch - +Patch0003: fix-gcc-build-error.patch +%ifarch riscv64 +Patch0004: add-riscv64-support.patch +%endif BuildRequires: golang make systemd Requires: %{name}-plugin = %{version}-%{release} @@ -33,7 +36,7 @@ SELinux plugin for secPaver. %prep %autosetup -n %{name}-%{version} -p1 -%ifarch loongarch64 +%ifarch loongarch64 riscv64 rm -rf vendor/golang.org/x/sys tar -xf %{SOURCE1} -C vendor/golang.org/x/ %endif @@ -79,6 +82,9 @@ tar -xf %{SOURCE1} -C vendor/golang.org/x/ %systemd_postun_with_restart pavd.service %changelog +* Wed Aug 2 2023 zhangxiang - 1.0.2-6 +- add riscv64 support and remove $(LDFLAGS) to fix build error + * Tue Jul 11 2023 huajingyun - 1.0.2-5 - Add loong64 support