commit 82c28d328643421457e5ebaef2deeb3e8d6b836a
Author: Jakub Bogusz <[email protected]>
Date:   Sun Sep 1 21:05:46 2024 +0200

    - new

 zxcvbn-c-install.patch | 30 ++++++++++++++++++
 zxcvbn-c.spec          | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 116 insertions(+)
---
diff --git a/zxcvbn-c.spec b/zxcvbn-c.spec
new file mode 100644
index 0000000..8d565c0
--- /dev/null
+++ b/zxcvbn-c.spec
@@ -0,0 +1,86 @@
+Summary:       C/C++ implementation of the zxcvbn password strength estimation
+Summary(pl.UTF-8):     Implementacja C/C++ algorytmu zxcvbn estymacji jakości 
haseł
+Name:          zxcvbn-c
+Version:       2.5
+Release:       1
+License:       MIT
+Group:         Libraries
+#Source0Download: https://github.com/tsyrogit/zxcvbn-c/releases
+Source0:       
https://github.com/tsyrogit/zxcvbn-c/archive/v%{version}/%{name}-%{version}.tar.gz
+# Source0-md5: cdc0f679b10b195ad3883f8adf16babc
+Patch0:                %{name}-install.patch
+URL:           https://github.com/tsyrogit/zxcvbn-c
+BuildRequires: libstdc++-devel
+BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+C/C++ implementation of the zxcvbn password strength estimation.
+
+%description -l pl.UTF-8
+Implementacja C/C++ algorytmu zxcvbn estymacji jakości haseł.
+
+%package devel
+Summary:       Header files for zxcvbn library
+Summary(pl.UTF-8):     Pliki nagłówkowe biblioteki zxcvbn
+Group:         Development/Libraries
+Requires:      %{name} = %{version}-%{release}
+
+%description devel
+Header files for zxcvbn library.
+
+%description devel -l pl.UTF-8
+Pliki nagłówkowe biblioteki zxcvbn.
+
+%package static
+Summary:       Static zxcvbn library
+Summary(pl.UTF-8):     Statyczna biblioteka zxcvbn
+Group:         Development/Libraries
+Requires:      %{name}-devel = %{version}-%{release}
+
+%description static
+Static zxcvbn library.
+
+%description static -l pl.UTF-8
+Statyczna biblioteka zxcvbn.
+
+%prep
+%setup -q
+%patch0 -p1
+
+%build
+CC="%{__cc}" \
+CFLAGS="%{rpmcflags} -Wall -Wextra -Wdeclaration-after-statement" \
+CPPFLAGS="%{rpmcppflags}" \
+CXX="%{__cxx}" \
+CXXFLAGS="%{rpmcxxflags} -Wall -Wextra" \
+%{__make} package
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} install \
+       DESTDIR=$RPM_BUILD_ROOT \
+       LIBDIR=%{_libdir}
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post  -p /sbin/ldconfig
+%postun        -p /sbin/ldconfig
+
+%files
+%defattr(644,root,root,755)
+%doc LICENSE.txt README.md
+%attr(755,root,root) %{_bindir}/zxcvbn-dictgen
+%attr(755,root,root) %{_libdir}/libzxcvbn.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libzxcvbn.so.0
+%{_datadir}/zxcvbn
+
+%files devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libzxcvbn.so
+%{_includedir}/zxcvbn
+
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/libzxcvbn.a
diff --git a/zxcvbn-c-install.patch b/zxcvbn-c-install.patch
new file mode 100644
index 0000000..7ae313d
--- /dev/null
+++ b/zxcvbn-c-install.patch
@@ -0,0 +1,30 @@
+Based on rpm/libzxcvbn-2.4-makefile-install.patch included in git archive
+--- zxcvbn-c-2.5/makefile.orig 2022-04-07 19:19:00.000000000 +0200
++++ zxcvbn-c-2.5/makefile      2024-09-01 20:43:07.889927559 +0200
+@@ -13,6 +13,8 @@ CPPFLAGS += -I.
+ TARGET_LIB = libzxcvbn.so.0.0.0
+ SONAME = libzxcvbn.so.0
+ 
++LIBDIR := $(or $(LIBDIR),$(/usr/lib))
++
+ WORDS = words-eng_wiki.txt words-female.txt words-male.txt words-passwd.txt 
words-surname.txt words-tv_film.txt
+ 
+ all: test-file test-inline test-c++inline test-c++file test-shlib 
test-statlib test-internals
+@@ -101,6 +103,17 @@ test: test-internals test-file test-inli
+       ./test-c++inline -t testcases.txt
+       @echo Finished
+ 
++package: $(TARGET_LIB) libzxcvbn.a dict-crc.h dict-src.h
++
++install: package
++      mkdir -p $(DESTDIR)/usr/{include,share}/zxcvbn $(DESTDIR)/usr/bin 
$(DESTDIR)$(LIBDIR)
++      install -m 0644 *.h $(DESTDIR)/usr/include/zxcvbn
++      install -m 0644 $(TARGET_LIB) libzxcvbn.a $(DESTDIR)$(LIBDIR)
++      ln -s $(TARGET_LIB) $(DESTDIR)$(LIBDIR)/$(SONAME)
++      ln -s $(SONAME) $(basename $(DESTDIR)$(LIBDIR)/$(SONAME))
++      install -m 0755 dictgen $(DESTDIR)/usr/bin/zxcvbn-dictgen
++      install -m 0644 zxcvbn.dict $(DESTDIR)/usr/share/zxcvbn
++
+ clean:
+       rm -f test-file zxcvbn-file.o test-c++file zxcvbn-c++file.o 
+       rm -f test-inline test-internals zxcvbn-inline.o zxcvbn-inline-pic.o 
test-c++inline zxcvbn-c++inline.o
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/zxcvbn-c.git/commitdiff/82c28d328643421457e5ebaef2deeb3e8d6b836a

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to