commit aa536cffc23c0a799ee93c37aa6265798396cd45 Author: overweight <5324761+overweight@user.noreply.gitee.com> Date: Mon Sep 30 11:17:03 2019 -0400 Package init diff --git a/sgpio-1.2.1.tgz b/sgpio-1.2.1.tgz new file mode 100755 index 0000000..4d4b139 Binary files /dev/null and b/sgpio-1.2.1.tgz differ diff --git a/sgpio-makefile.patch b/sgpio-makefile.patch new file mode 100755 index 0000000..cd46e38 --- /dev/null +++ b/sgpio-makefile.patch @@ -0,0 +1,42 @@ +diff --git a/Makefile b/Makefile +index 278d966..2b1abe5 100755 +--- a/Makefile ++++ b/Makefile +@@ -23,29 +23,31 @@ + + + MANDIR ?= /usr/local/man ++SBINDIR = /sbin ++INSTALL = /usr/bin/install + ALL = sgpio + + all: $(ALL) + + sgpio.o: sgpio.c +- gcc -g -Wall -c sgpio.c ++ gcc $(CFLAGS) -g -Wall -c sgpio.c + + sgpio: sgpio.o +- gcc -g sgpio.o -o sgpio ++ gcc $(LDFLAGS) -g sgpio.o -o sgpio + + clean: + rm -f sgpio.o sgpio + + install: $(ALL) + for i in $(ALL); do \ +- install $$i /sbin/$$i; \ ++ $(INSTALL) $$i $(SBINDIR)/$$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 \ +- rm -f /sbin/$$i; \ ++ rm -f $(SBINDIR)/$$i; \ + done + for i in $(ALL:=.1); do \ + rm -f $(MANDIR)/man1/$$i; \ diff --git a/sgpio.spec b/sgpio.spec new file mode 100755 index 0000000..0d7b77f --- /dev/null +++ b/sgpio.spec @@ -0,0 +1,53 @@ +Name: sgpio +Version: 1.2.1 +Release: 1 +Summary: captive backplane LED control utility +License: GPLv2+ +URL: http://sources.redhat.com/lvm2/wiki/DMRAID_Eventing +Source0: %{name}-%{version}.tgz + +BuildRequires: gcc, dos2unix + +Patch0: sgpio-makefile.patch + +%description +Serial General Purpose Input Output (SGPIO) is a communication method used +between a main board and a variety of internal and external hard disk drive +bay enclosures. This utility can be used to control LEDs in an enclosure. + +%prep +%autosetup -p1 -n %{name} +chmod a-x * + +%build +make clean +export CFLAGS="%{optflags}" +export LDFLAGS="%{build_ldflags}" +%make_build +dos2unix README LICENSE_GPL + +%install +%make_install \ + INSTALL="%{__install} -p -D" \ + SBINDIR="%{buildroot}%{_sbindir}"\ + MANDIR="%{buildroot}%{_mandir}" + +%check + +%pre + +%preun + +%post + +%postun + +%files +%doc README LICENSE_GPL +%{_sbindir}/sgpio +%{_mandir}/man*/* + +%changelog +* Sat Aug 31 2019 openEuler Buildteam - 1.2.1-1 +- Package init +