diff --git a/sgpio-1.2-makefile.patch b/sgpio-1.2-makefile.patch new file mode 100644 index 0000000000000000000000000000000000000000..83366ea86b81d049d1a24300232eba4a22c6f0b2 --- /dev/null +++ b/sgpio-1.2-makefile.patch @@ -0,0 +1,37 @@ +--- sgpio/Makefile 2008-11-24 12:27:12.000000000 +0100 ++++ sgpio-new/Makefile 2018-02-26 11:32:14.394597823 +0100 +@@ -23,25 +23,29 @@ + + + MANDIR ?= /usr/local/man ++SBIN_DIR = /sbin ++INSTALL =/usr/bin/install -c + ALL = sgpio ++CFLAGS = -g -Wall ++LDFLAGS = + + all: $(ALL) + + sgpio.o: sgpio.c +- gcc -g -Wall -c sgpio.c ++ gcc $(CFLAGS) -c sgpio.c + + sgpio: sgpio.o +- gcc -g sgpio.o -o sgpio ++ gcc $(LDFLAGS) sgpio.o -o sgpio + + clean: + rm -f sgpio.o sgpio + + install: $(ALL) + for i in $(ALL); do \ +- install $$i /sbin/$$i; \ ++ $(INSTALL) -D $$i $(SBIN_DIR)/$$i; \ + done +- install -d $(MANDIR)/man1 +- install -m 0644 *.1 $(MANDIR)/man1 ++ $(INSTALL) -d $(MANDIR)/man1 ++ $(INSTALL) -m 0644 *.1 $(MANDIR)/man1 + + uninstall: + for i in $(ALL); do \ diff --git a/sgpio-1.2.1.tgz b/sgpio-1.2.1.tgz new file mode 100644 index 0000000000000000000000000000000000000000..4d4b139d509af4928d0e365ea57ec2a3990efc62 Binary files /dev/null and b/sgpio-1.2.1.tgz differ diff --git a/sgpio.spec b/sgpio.spec new file mode 100644 index 0000000000000000000000000000000000000000..110a79e1eaec0a1a61a03afd6b6af79a75135cd1 --- /dev/null +++ b/sgpio.spec @@ -0,0 +1,36 @@ +%define anolis_release 1 +Summary: SGPIO captive backplane tool +Name: sgpio +Version: 1.2.1 +Release: %{anolis_release}%{?dist} +License: GPLv2+ +URL: http://sources.redhat.com/lvm2/wiki/DMRAID_Eventing +Source: https://www.sourceware.org/lvm2/wiki/DMRAID_Eventing?action=AttachFile&do=get&target=sgpio-%{version}.tgz +Patch0: sgpio-1.2-makefile.patch +BuildRequires: make +BuildRequires: gcc +BuildRequires: dos2unix + +%description +Intel SGPIO enclosure management utility + +%prep +%setup -q -n sgpio +dos2unix --keepdate Makefile README +%patch0 -p1 -b .makefile +chmod a-x * + +%build +%make_build CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$RPM_LD_FLAGS" + +%install +%make_install SBIN_DIR=$RPM_BUILD_ROOT%{_sbindir} MANDIR=$RPM_BUILD_ROOT%{_mandir} + +%files +%doc README +%{_sbindir}/sgpio +%{_mandir}/man1/sgpio.* + +%changelog +* Tue Apr 19 2022 Chunmei Xu - 1.2.1-1 +- init from upstream