packages: sha2/Makefile (NEW), sha2/sha2.spec (NEW)=?UTF-8?Q?=20?=- new; based on fedora pkg
glen
glen at pld-linux.org
Fri Apr 6 20:21:37 CEST 2012
Author: glen Date: Fri Apr 6 18:21:37 2012 GMT
Module: packages Tag: HEAD
---- Log message:
- new; based on fedora pkg
---- Files affected:
packages/sha2:
Makefile (NONE -> 1.1) (NEW), sha2.spec (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: packages/sha2/Makefile
diff -u /dev/null packages/sha2/Makefile:1.1
--- /dev/null Fri Apr 6 20:21:37 2012
+++ packages/sha2/Makefile Fri Apr 6 20:21:32 2012
@@ -0,0 +1,52 @@
+CC=gcc
+#OPTFLAGS=-g -O0
+OPTFLAGS=-O3
+CFLAGS=-Wall -fPIC $(OPTFLAGS)
+LDFLAGS=$(OPTFLAGS)
+
+MODULES_LIB = sha2.o
+MODULES_PROG = sha2prog.o
+MODULES_SPEED = sha2speed.o
+
+VERSION := 1.0.1
+VERSION_MAJ := $(shell echo $(VERSION) |sed 's/\..*//')
+LIBNAME=libsha2.so
+SONAME=$(LIBNAME).$(VERSION_MAJ)
+
+
+all: libsha2 sha2 sha2speed
+
+libsha2: $(MODULES_LIB)
+ $(CC) $(LDFLAGS) -shared -fPIC -Wl,-soname,$(SONAME) -o $(LIBNAME).$(VERSION) $(MODULES_LIB)
+ ln -sf $(LIBNAME).$(VERSION) $(SONAME)
+ ln -sf $(SONAME) $(LIBNAME)
+
+sha2: libsha2 $(MODULES_PROG)
+ $(CC) $(MODULES_PROG) $(LDFLAGS) -o sha2 -L. -lsha2
+
+sha2speed: libsha2 $(MODULES_SPEED)
+ $(CC) $(MODULES_SPEED) $(LDFLAGS) -o sha2speed -L. -lsha2
+
+%.o: %.c
+ $(CC) $(CFLAGS) -c -o $@ $<
+
+clean:
+ rm -f *.o sha2 sha2speed
+ rm -f *.so*
+
+PREFIX ?= /usr/local
+BINDIR ?= $(PREFIX)/bin
+LIBDIR ?= $(PREFIX)/lib
+INCLUDEDIR ?= $(PREFIX)/include
+
+install: all
+ install -d $(DESTDIR)$(BINDIR)
+ install sha2 sha2speed $(DESTDIR)$(BINDIR)
+ install -d $(DESTDIR)$(INCLUDEDIR)
+ install -pm 644 sha2.h $(DESTDIR)$(INCLUDEDIR)
+ install -d $(DESTDIR)$(LIBDIR)
+ install $(LIBNAME).$(VERSION) $(LIBNAME) $(SONAME) $(DESTDIR)$(LIBDIR)
+ ln -sf $(LIBNAME).$(VERSION) $(DESTDIR)$(LIBDIR)/$(SONAME)
+ ln -sf $(SONAME) $(DESTDIR)$(LIBDIR)/$(LIBNAME)
+
+.PHONY: clean all libsha2 sha2 sha2speed install
================================================================
Index: packages/sha2/sha2.spec
diff -u /dev/null packages/sha2/sha2.spec:1.1
--- /dev/null Fri Apr 6 20:21:37 2012
+++ packages/sha2/sha2.spec Fri Apr 6 20:21:32 2012
@@ -0,0 +1,86 @@
+# $Revision$, $Date$
+#
+# Conditional build:
+%bcond_without tests # build without tests
+
+Summary: SHA Implementation Library
+Name: sha2
+Version: 1.0.1
+Release: 1
+License: BSD
+URL: http://www.aarongifford.com/computers/sha.html
+Source0: http://www.aarongifford.com/computers/%{name}-%{version}.tgz
+# Source0-md5: 5c050ef4edb9d5198e7d57e759c4996f
+Source1: Makefile
+Group: Libraries
+BuildRequires: perl-base
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+The library implements the SHA-256, SHA-384, and SHA-512 hash
+algorithms. The interface is similar to the interface to SHA-1 found
+in the OpenSSL library.
+
+sha2 is a simple program that accepts input from either STDIN or reads
+one or more files specified on the command line, and then generates
+the specified hash (either SHA-256, SHA-384, SHA-512, or any
+combination thereof, including all three at once).
+
+%package devel
+Summary: Development files for %{name}
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description devel
+This package contains libraries and header files for developing
+applications that use %{name}.
+
+%prep
+%setup -q
+cp -p %{SOURCE1} Makefile
+
+%build
+%{__make} \
+ CC="%{__cc}" \
+ OPTFLAGS="%{rpmcflags}"
+
+%if %{with tests}
+LD_PRELOAD=./libsha2.so ./sha2test.pl
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+%{__make} install \
+ DESTDIR=$RPM_BUILD_ROOT \
+ LIBDIR=%{_libdir} \
+ INCLUDEDIR=%{_includedir} \
+ BINDIR=%{_bindir} \
+ OPTFLAGS="%{optflags}"
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%doc README
+%attr(755,root,root) %{_bindir}/sha2
+%attr(755,root,root) %{_bindir}/sha2speed
+%attr(755,root,root,) %{_libdir}/libsha2.so.*.*.*
+%ghost %{_libdir}/libsha2.so.1
+
+%files devel
+%defattr(644,root,root,755)
+%{_includedir}/sha2.h
+%{_libdir}/libsha2.so
+
+%define date %(echo `LC_ALL="C" date +"%a %b %d %Y"`)
+%changelog
+* %{date} PLD Team <feedback at pld-linux.org>
+All persons listed below can be reached at <cvs_login>@pld-linux.org
+
+$Log$
+Revision 1.1 2012/04/06 18:21:32 glen
+- new; based on fedora pkg
================================================================
More information about the pld-cvs-commit
mailing list