commit a001a0397b3585881b6ed3ae99ab9795fbd1e9d2 Author: overweight <5324761+overweight@user.noreply.gitee.com> Date: Mon Sep 30 10:36:38 2019 -0400 Package init diff --git a/0001-don-t-use-f-in-dbxtool.service.patch b/0001-don-t-use-f-in-dbxtool.service.patch new file mode 100644 index 0000000..a2a5270 --- /dev/null +++ b/0001-don-t-use-f-in-dbxtool.service.patch @@ -0,0 +1,28 @@ +From 8a6039df37353a3ef9208de0c4d63b611f549922 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Thu, 19 Oct 2017 12:46:53 -0400 +Subject: [PATCH 1/2] *don't* use -f in dbxtool.service + +Use -q to make it quiet but don't try to override it when we think it +won't work. + +Related: rhbz#1489942 + +Signed-off-by: Peter Jones +--- + src/dbxtool.service | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/dbxtool.service b/src/dbxtool.service +index fcfb6e6..1a2a829 100644 +--- a/src/dbxtool.service ++++ b/src/dbxtool.service +@@ -7,4 +7,4 @@ WantedBy=multi-user.target + + [Service] + RemainAfterExit=yes +-ExecStart=/usr/bin/dbxtool -a /usr/share/dbxtool/ -q -f ++ExecStart=/usr/bin/dbxtool -a /usr/share/dbxtool/ -q +-- +2.14.2 + diff --git a/0002-Make-quiet-exit-on-missing-PK-KEK-not-return-error-s.patch b/0002-Make-quiet-exit-on-missing-PK-KEK-not-return-error-s.patch new file mode 100644 index 0000000..c4fa459 --- /dev/null +++ b/0002-Make-quiet-exit-on-missing-PK-KEK-not-return-error-s.patch @@ -0,0 +1,36 @@ +From 946380463bb9a233381fc122a8374806d77b1778 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Mon, 23 Oct 2017 09:45:48 -0400 +Subject: [PATCH 2/2] Make quiet exit on missing PK/KEK not return error + status. + +Signed-off-by: Peter Jones +--- + src/dbxtool.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/src/dbxtool.c b/src/dbxtool.c +index 717c991..b2cb587 100644 +--- a/src/dbxtool.c ++++ b/src/dbxtool.c +@@ -541,13 +541,14 @@ check_pk_and_kek(bool force, bool quiet) + } + } + if (!all_found) { +- if (!quiet) { ++ if (quiet) { ++ if (!force) ++ exit(0); ++ } else { + if (!force) + errx(1, "Not attempting to apply updates."); + warnx("attempting to apply updates anyway."); + } +- if (!force) +- exit(1); + } + } + +-- +2.14.2 + diff --git a/dbxtool-8-ccldflags.patch b/dbxtool-8-ccldflags.patch new file mode 100644 index 0000000..099f9a6 --- /dev/null +++ b/dbxtool-8-ccldflags.patch @@ -0,0 +1,45 @@ +From f229181c015f7353602e6b32e6ed61f9b47480ae Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20=C5=A0abata?= +Date: Thu, 12 Apr 2018 12:58:51 +0200 +Subject: [PATCH] Respect environment CCLDFLAGS +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Allow passing custom flags for the linker. + +Signed-off-by: Petr Ĺ abata +--- + Make.defaults | 2 +- + src/Makefile | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Make.defaults b/Make.defaults +index 9bfa5b2..1030be9 100644 +--- a/Make.defaults ++++ b/Make.defaults +@@ -14,7 +14,7 @@ BUILDFLAGS = $(CFLAGS) -fPIC -fshort-wchar -fno-strict-aliasing \ + --param=ssp-buffer-size=4 -fexceptions + ASFLAGS = + LDFLAGS = -nostdlib +-CCLDFLAGS = -shared ++CCLDFLAGS += -shared + INSTALL = install + COMPILER ?= + +diff --git a/src/Makefile b/src/Makefile +index 1a6277a..669bfab 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -6,7 +6,7 @@ include $(TOPDIR)/Make.defaults + PKLIBS = efivar + LIBS = popt + LDFLAGS = +-CCLDFLAGS = $(foreach pklib,$(PKLIBS), $(shell pkg-config --libs-only-L $(pklib))) ++CCLDFLAGS += $(foreach pklib,$(PKLIBS), $(shell pkg-config --libs-only-L $(pklib))) + BUILDFLAGS += $(foreach pklib,$(PKLIBS), $(shell pkg-config --cflags $(pklib))) + + TARGETS = dbxtool +-- +2.17.0 + diff --git a/dbxtool-8.tar.bz2 b/dbxtool-8.tar.bz2 new file mode 100644 index 0000000..78e12bd Binary files /dev/null and b/dbxtool-8.tar.bz2 differ diff --git a/dbxtool.spec b/dbxtool.spec new file mode 100644 index 0000000..e6d19cd --- /dev/null +++ b/dbxtool.spec @@ -0,0 +1,51 @@ +Name: dbxtool +Version: 8 +Release: 8 +Summary: Tool for managing dbx updates installed on a machine. +License: GPLv2 +URL: https://github.com/vathpela/dbxtool +#The file dbxtool-8.tar.bz2 is from fedora:https://kojipkgs.fedoraproject.org//packages/dbxtool/8/7.fc29/src/dbxtool-8-7.fc29.src.rpm. +Source0: https://github.com/vathpela/dbxtool/releases/download/dbxtool-%{version}/dbxtool-%{version}.tar.bz2 +#Patch0,Patch1 and Patch2 are from fedora:https://kojipkgs.fedoraproject.org//packages/dbxtool/8/7.fc29/src/dbxtool-8-7.fc29.src.rpm. +Patch0: dbxtool-8-ccldflags.patch +Patch1: 0001-don-t-use-f-in-dbxtool.service.patch +Patch2: 0002-Make-quiet-exit-on-missing-PK-KEK-not-return-error-s.patch + +BuildRequires: gcc popt-devel efivar-devel >= 31-3 systemd +Requires: efivar systemd + +%description +Tool for managing dbx updates installed on a machine. + +%package_help + +%prep +%autosetup -n %{name}-%{version} -p1 + +%build +%make_build CFLAGS="$RPM_OPT_FLAGS" CCLDFLAGS="%{__global_ldflags}" + +%install +%make_install + +%preun +%systemd_preun dbxtool.service + +%post +%systemd_post dbxtool.service + +%files +%{!?_licensedir:%global license %%doc} +%license COPYING +%exclude %{_docdir}/%{name}/COPYING +%{_unitdir}/dbxtool.service +%{_bindir}/dbxtool +%dir %{_datadir}/dbxtool/ +%{_datadir}/dbxtool/*.bin + +%files help +%doc %{_mandir}/man1/* + +%changelog +* Mon Sep 2 2019 openEuler Buildteam - 8-8 +- Package init