File libxcrypt.spec of Package libxcrypt

#
# spec file for package libxcrypt
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild


Name:           libxcrypt
License:        LGPLv2.1+ ; Public Domain, Freeware
Group:          System/Libraries
AutoReqProv:    on
# bnc#437293
%ifarch ppc64
Obsoletes:      libxcrypt-64bit
%endif
Version:        3.0.4
Release:        9
Summary:        Crypt Library for DES, MD5, Blowfish and others
Source:         libxcrypt-%{version}.tar.bz2
Url:            http://www.openwall.com/crypt/
Source1:        %{url}crypt_blowfish-1.2.tar.gz
Source2:        %{url}crypt_blowfish-1.2.tar.gz.sign
Source20:       baselibs.conf
Patch0:         fix-werror.patch
Patch1:         libxcrypt-3.0.4-blowfish-noasm.diff
Patch2:         libxcrypt-3.0.4-blowfish-xcrypt.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Provides:       libxcrypt-crypt_blowfish = 1.2

%description
Libxcrypt is a replacement for libcrypt, which comes with the GNU C
Library. It supports DES crypt, MD5, SHA256, SHA512 and passwords with
blowfish encryption.



%package devel
License:        LGPLv2.1+ ; Public Domain, Freeware
Summary:        Development Include Files and Libraries for enhanced crypt functionality
Group:          Development/Libraries/C and C++
Requires:       libxcrypt = %{version}
AutoReqProv:    on
# bnc#437293
%ifarch ppc64
Obsoletes:      libxcrypt-devel-64bit
%endif

%description devel
libxcrypt is a replacement for libcrypt, which comes with the GNU C
Library. It supports DES crypt, MD5, and passwords with blowfish
encryption.

This package contains the header files and static libraries necessary
to develop software using libxcrypt.



%prep
%setup -q -a1
%patch0 -p1
%patch1 -p0
%patch2 -p0
cp crypt_blowfish-*/*.{c,h} plugins/blowfish
mv plugins/blowfish/wrapper.c plugins/blowfish/blowfish-test.c

%build
rm -f libtool
autoreconf -f -i
./configure CFLAGS="$RPM_OPT_FLAGS -Wno-cast-align" \
	--prefix=%{_prefix} \
	--libdir=/%{_lib} --disable-static
make %{?_smp_mflags}

%check
%ifnarch %arm
# testsuite kills qemu-arm and worker :(
make check
%endif

%install
make install DESTDIR=$RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{_libdir}
rm $RPM_BUILD_ROOT/%{_lib}/libxcrypt.{so,la}
rm $RPM_BUILD_ROOT/%{_lib}/xcrypt/lib*.{so,la}
ln -sf ../../%{_lib}/libxcrypt.so.2 $RPM_BUILD_ROOT%{_libdir}/libxcrypt.so
/sbin/ldconfig -n $RPM_BUILD_ROOT/%{_lib}/

%clean
rm -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root)
%doc COPYING README NEWS README.bcrypt README.ufc-crypt
/%{_lib}/libxcrypt.so.*
%dir /%{_lib}/xcrypt
/%{_lib}/xcrypt/lib*.so.*

%files devel
%defattr(-,root,root)
%{_prefix}/include/*.h
%{_libdir}/libxcrypt.so

%changelog
openSUSE Build Service is sponsored by