File libxcrypt.spec of Package libxcrypt

#
# spec file for package libxcrypt (Version 3.0.2)
#
# Copyright (c) 2009 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

%define crypt_bf_version 1.2

Name:           libxcrypt
License:        LGPL v2.1 or later ;  Public Domain, Freeware
Group:          System/Libraries
AutoReqProv:    on
# bug437293
%ifarch ppc64
Obsoletes:      libxcrypt-64bit
%endif
#
Version:        3.0.2
Release:        3.<RELEASE3>
Summary:        Crypt Library for DES, MD5, Blowfish and others
Url:            http://www.openwall.com/crypt/
Source:         libxcrypt-%{version}.tar.bz2
Source1:        %{url}crypt_blowfish-%{crypt_bf_version}.tar.gz
Source2:        %{url}crypt_blowfish-%{crypt_bf_version}.tar.gz.sign
Patch1:         libxcrypt-3.0.4-blowfish-noasm.diff
Patch2:         libxcrypt-3.0.4-blowfish-xcrypt.diff
# just patching Makefile.in to avoid autoreconf
Patch3:         libxcrypt-3.0.4-blowfish-Makefile.in.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:        LGPL v2.1 or later ;  Public Domain, Freeware
Summary:        Development Include Files and Libraries for enhanced crypt functionality
Group:          Development/Libraries/C and C++
Requires:       libxcrypt = %{version}
AutoReqProv:    on
# bug437293
%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
%patch1 -p0
%patch2 -p0
%patch3 -p0
cp crypt_blowfish-*/*.{c,h} plugins/blowfish
mv plugins/blowfish/wrapper.c plugins/blowfish/blowfish-test.c


%build
./configure CFLAGS="$RPM_OPT_FLAGS -Wno-cast-align" \
	--prefix=%{_prefix} \
	--libdir=/%{_lib} --disable-static
make

%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}/
# bnc 713727
for i in x y; do
  cp $RPM_BUILD_ROOT/%{_lib}/xcrypt/libxcrypt_2a.so.1.0.0 $RPM_BUILD_ROOT/%{_lib}/xcrypt/libxcrypt_2$i.so.1.0.0
  ln -s libxcrypt_2$i.so.1.0.0 $RPM_BUILD_ROOT/%{_lib}/xcrypt/libxcrypt_2$i.so.1
done


%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