Blame SPECS/argon2.spec

d560a5
# remirepo/fedora spec file for argon2
d560a5
#
d560a5
# Copyright (c) 2017-2018 Remi Collet
d560a5
# License: CC-BY-SA
d560a5
# http://creativecommons.org/licenses/by-sa/4.0/
d560a5
#
d560a5
# Please, preserve the changelog entries
d560a5
#
d560a5
%global libname      libargon2
d560a5
%global gh_commit    670229c849b9fe882583688b74eb7dfdc846f9f6
d560a5
%global gh_short     %(c=%{gh_commit}; echo ${c:0:7})
d560a5
%global gh_owner     P-H-C
d560a5
%global gh_project   phc-winner-argon2
d560a5
%global soname       1
d560a5
d560a5
%global upstream_version 20171227
d560a5
#global upstream_prever  RC1
d560a5
d560a5
Name:    argon2
d560a5
Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}}
d560a5
Release: 7%{?dist}
d560a5
Summary: The password-hashing tools
d560a5
d560a5
License: Public Domain or ASL 2.0
d560a5
URL:     https://github.com/%{gh_owner}/%{gh_project}
d560a5
Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{upstream_version}%{?upstream_prever}-%{gh_short}.tar.gz
d560a5
Patch0:  argon2-Use-explicit_bzero-on-recent-glibc-versions.patch
d560a5
Patch1:  argon2-Wait-for-already-running-threads-if-a-thread-creatio.patch
d560a5
d560a5
BuildRequires: gcc
d560a5
BuildRequires: make
d560a5
Requires: %{libname}%{?_isa} = %{version}-%{release}
d560a5
d560a5
d560a5
%description
d560a5
Argon2 is a password-hashing function that summarizes the state of the art
d560a5
in the design of memory-hard functions and can be used to hash passwords
d560a5
for credential storage, key derivation, or other applications.
d560a5
d560a5
It has a simple design aimed at the highest memory filling rate and
d560a5
effective use of multiple computing units, while still providing defense
d560a5
against tradeoff attacks (by exploiting the cache and memory organization
d560a5
of the recent processors).
d560a5
d560a5
Argon2 has three variants: Argon2i, Argon2d, and Argon2id.
d560a5
d560a5
* Argon2d is faster and uses data-depending memory access, which makes it
d560a5
  highly resistant against GPU cracking attacks and suitable for applications
d560a5
  with no threats from side-channel timing attacks (eg. cryptocurrencies). 
d560a5
* Argon2i instead uses data-independent memory access, which is preferred for
d560a5
  password hashing and password-based key derivation, but it is slower as it
d560a5
  makes more passes over the memory to protect from tradeoff attacks.
d560a5
* Argon2id is a hybrid of Argon2i and Argon2d, using a combination of
d560a5
  data-depending and data-independent memory accesses, which gives some of
d560a5
  Argon2i's resistance to side-channel cache timing attacks and much of
d560a5
  Argon2d's resistance to GPU cracking attacks.
d560a5
d560a5
d560a5
%package -n %{libname}
d560a5
Summary:  The password-hashing library
d560a5
d560a5
%description -n %{libname}
d560a5
Argon2 is a password-hashing function that summarizes the state of the art
d560a5
in the design of memory-hard functions and can be used to hash passwords
d560a5
for credential storage, key derivation, or other applications.
d560a5
d560a5
d560a5
%package -n %{libname}-devel
d560a5
Summary:  Development files for %{libname}
d560a5
Requires: %{libname}%{?_isa} = %{version}-%{release}
d560a5
d560a5
%description -n %{libname}-devel
d560a5
The %{libname}-devel package contains libraries and header files for
d560a5
developing applications that use %{libname}.
d560a5
d560a5
d560a5
%prep
d560a5
%setup -qn %{gh_project}-%{gh_commit}
d560a5
%patch0 -p1
d560a5
%patch1 -p1
d560a5
d560a5
if ! grep -q 'ABI_VERSION = %{soname}' Makefile; then
d560a5
  : soname have changed
d560a5
  grep soname Makefile
d560a5
  exit 1
d560a5
fi
d560a5
d560a5
# Fix pkgconfig file
d560a5
sed -e 's:lib/@HOST_MULTIARCH@:%{_lib}:;s/@UPSTREAM_VER@/%{version}/' -i %{libname}.pc
d560a5
d560a5
# Honours default RPM build options and library path, do not use -march=native
d560a5
sed -e '/^CFLAGS/s:^CFLAGS:LDFLAGS=%{build_ldflags}\nCFLAGS:' \
d560a5
    -e 's:-O3 -Wall:%{optflags}:' \
d560a5
    -e '/^LIBRARY_REL/s:lib:%{_lib}:' \
d560a5
    -e 's:-march=\$(OPTTARGET) :${CFLAGS} :' \
d560a5
    -e 's:CFLAGS += -march=\$(OPTTARGET)::' \
d560a5
    -i Makefile
d560a5
d560a5
%build
d560a5
# parallel build is not supported
d560a5
make -j1
d560a5
d560a5
d560a5
%install
d560a5
make install DESTDIR=%{buildroot}
d560a5
d560a5
# Drop static library
d560a5
rm %{buildroot}%{_libdir}/%{libname}.a
d560a5
d560a5
# pkgconfig file
d560a5
install -Dpm 644 %{libname}.pc %{buildroot}%{_libdir}/pkgconfig/%{libname}.pc
d560a5
d560a5
# Fix perms
d560a5
chmod -x %{buildroot}%{_includedir}/%{name}.h
d560a5
d560a5
d560a5
%check
d560a5
make test
d560a5
d560a5
d560a5
%files
d560a5
%{_bindir}/%{name}
d560a5
d560a5
%files -n %{libname}
d560a5
%{!?_licensedir:%global license %%doc}
d560a5
%license LICENSE
d560a5
%{_libdir}/%{libname}.so.%{soname}
d560a5
d560a5
d560a5
%files -n %{libname}-devel
d560a5
%doc *md
d560a5
%{_includedir}/%{name}.h
d560a5
%{_libdir}/%{libname}.so
d560a5
%{_libdir}/pkgconfig/%{libname}.pc
d560a5
d560a5
d560a5
%changelog
d560a5
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 20171227-7
d560a5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
d560a5
d560a5
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 20171227-6
d560a5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
d560a5
d560a5
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 20171227-5
d560a5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
d560a5
d560a5
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 20171227-4
d560a5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
d560a5
d560a5
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 20171227-3
d560a5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
d560a5
d560a5
* Mon Mar 18 2019 Milan Broz <gmazyland@gmail.com> - 20171227-2
d560a5
- Rebuilt to remove old library.
d560a5
d560a5
* Mon Mar 18 2019 Milan Broz <gmazyland@gmail.com> - 20171227-1
d560a5
- Update to version 20171227 (soname increase).
d560a5
- Temporarily keep libargon2.so.0.
d560a5
- Fix a crash if running under memory pressure.
d560a5
d560a5
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 20161029-7
d560a5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
d560a5
d560a5
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 20161029-6
d560a5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
d560a5
d560a5
* Thu Feb 15 2018 Remi Collet <remi@remirepo.net> - 20161029-5
d560a5
- honours all build flags #1558128
d560a5
d560a5
* Thu Feb 15 2018 Remi Collet <remi@remirepo.net> - 20161029-4
d560a5
- drop ldconfig scriptlets
d560a5
d560a5
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 20161029-3
d560a5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
d560a5
d560a5
* Thu Nov 16 2017 Milan Broz <gmazyland@gmail.com> - 20161029-2
d560a5
- Do not use -march=native in build, use system flags (rh #1512845).
d560a5
d560a5
* Wed Oct 18 2017 Remi Collet <remi@remirepo.net> - 20161029-1
d560a5
- initial package