%global commit 9e3ae0f5e91eced6de3c28a9b61f2d91200119e3 %global shortcommit %(c=%{commit}; echo ${c:0:7}) Name: argon2 Version: 20170531 Release: 1%{?commit:.git%{shortcommit}}%{?dist} Summary: The password hash Argon2 # See LICENSE License: ASL 2.0 or CC0 URL: https://github.com/P-H-C/phc-winner-argon2 %if %{?commit:1}%{!?commit:0} Source0: https://github.com/P-H-C/phc-winner-argon2/archive/%{shortcommit}/%{name}-%{shortcommit}.tar.gz %else Source0: https://github.com/P-H-C/phc-winner-argon2/archive/%{version}/%{name}-%{version}.tar.gz %endif BuildRequires: make BuildRequires: gcc %description Argon2 is a password-hashing function that summarizes the state of the art in the design of memory-hard functions and can be used to hash passwords for credential storage, key derivation, or other applications. %package devel Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} %description devel The %{name}-devel package provides header and documentation files for developing applications which use %{name}. %prep %autosetup -p1 -n %{?commit:phc-winner-%{name}-%{commit}}%{!?commit:phc-winner-%{name}-%{version}} %build CFLAGS="%{optflags}" LDFLAGS="%{__global_ldflags}" make %install %make_install LIBRARY_REL=%{_lib} # Delete static library rm -f %{buildroot}%{_libdir}/lib%{name}.a # Install pkg-config file install -Dpm 0644 lib%{name}.pc %{buildroot}%{_libdir}/pkgconfig/lib%{name}.pc # Install manpage install -Dpm 0644 man/%{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1 %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %check make test %files %doc README.md %license LICENSE %{_bindir}/%{name} %{_libdir}/lib%{name}.so.0 %{_mandir}/man1/%{name}.1* %files devel %doc argon2-specs.pdf %{_includedir}/%{name}.h %{_libdir}/lib%{name}.so %{_libdir}/pkgconfig/lib%{name}.pc %changelog * Wed May 31 2017 Sandro Mani - 20170531-1.git9e3ae0f - Initial package