Package init

This commit is contained in:
overweight 2019-09-30 11:17:03 -04:00
commit aa536cffc2
3 changed files with 95 additions and 0 deletions

BIN
sgpio-1.2.1.tgz Executable file

Binary file not shown.

42
sgpio-makefile.patch Executable file
View File

@ -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; \

53
sgpio.spec Executable file
View File

@ -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 <buildteam@openeuler.org> - 1.2.1-1
- Package init