Пакет cryptsetup: Specfile

# SPEC file for cryptsetup utility: setup crypto disks using
# /dev/mapper interface in 2.6.x kernels

%define version 1.0.6
%define release alt2
%define rname cryptsetup

Name: cryptsetup
Version: %version
Release: %release

Summary: utility to setup a encrypted disks with LUKS support
Summary(ru_RU.UTF-8): утилита управления зашифрованными дисковыми разделами с поддержкой LUKS

License: %gpl2only
Group: System/Kernel and hardware
URL: http://luks.endorphin.org/dm-crypt

Packager: Nikolay A. Fetisov <naf@altlinux.ru>

Source0: %rname-%version.tar.bz2
Source1: %rname.README.ALT.utf-8

Patch5:  %rname-1.0.6-debian-03_check_for_root.patch
Patch6:  %rname-1.0.6-debian-06_run_udevsettle.patch
Patch7:  %rname-1.0.6-alt-unused_results.patch
Patch8:  %rname-1.0.6-alt-type_fix.patch
Patch9:  %rname-1.0.6-alt-const_types.patch
Patch10: %rname-1.0.6-alt-dm_type_fix.patch
Patch11: %rname-1.0.6-alt-popt_fix.patch
Patch12: %rname-1.0.6-debian-02_manpage.patch

AutoReqProv: yes
Requires: cryptplug, libdevmapper
BuildPreReq: rpm-build-licenses
BuildRequires(pre): libgcrypt-devel, libgpg-error-devel, libdevmapper-devel
BuildRequires(pre): libpopt-devel, libe2fs-devel, glibc-kernheaders

# Rename package from cryptsetup-luks-1.0.6-alt0.pre2 to cryptsetup-1.0.6-alt1
Provides:  cryptsetup-luks = %version
Obsoletes: cryptsetup-luks < %version-%release

%description
LUKS ( Linux Unified Key Setup ) is the upcoming standard for 
Linux disk encryption. By providing a standard on-disk-format, 
it does not only facilitate compatibility among distributions,
but also provide secure management of multiple user passwords.
In contrast to existing solution,  LUKS stores all  necessary 
setup information  in the partition header, enabling the user
to transport or migrate his data seamlessly.

This package contains cryptsetup utility to setup a encrypted 
disks based on  dm-crypt  module for 2.6 kernel, with support 
for LUKS infrastructure. Also cryptsetup can handle old 2.4.x
cryptoloop devices.

%description -l ru_RU.UTF-8
LUKS ( Linux Unified Key Setup ) - разрабатываемый стандарт 
для шифрования дисков в Linux. Определяя стандартный формат
хранения  информации на дисках,  он не только  способствует 
совместимости  между различными  дистрибутивами,  но  также 
предоставляет возможность управлять безопасностью доступа к 
данным  путём  использования  нескольких   пользовательских
паролей. По сравнению с существующими решениями, в LUKS вся
необходимая  информация по  настройке параметров шифрования 
хранится в заголовке  раздела диска, облегчая пользователям
перемещение или миграцию данных.

Данный пакет содержит  утилиту  cryptsetup  для  управления 
зашифрованными  дисками, основанными на модуле dm-crypt для
ядер Linux 2.6.x,  с поддержкой  инфраструктуры LUKS. Также 
cryptsetup может  управлять старыми дисками,  использующими 
модуль cryptoloop ядер 2.4.x. 

%package devel
Summary: development files for cryptsetup-luks
Summary(ru_RU.UTF-8): файлы для разработки программ с использованием cryptsetup-luks
Group: Development/Kernel
Requires: %name = %version-%release
Provides: %name-devel = %version-%release
Obsoletes: %name-devel

%description devel
LUKS ( Linux Unified Key Setup ) is the upcoming standard for 
Linux disk encryption. By providing a standard on-disk-format, 
it does not only facilitate compatibility among distributions,
but also provide secure management of multiple user passwords.
In contrast to existing solution,  LUKS stores all  necessary 
setup information  in the partition header, enabling the user
to transport or migrate his data seamlessly.

This package includes  the  development libraries  and header 
files needed for developing applications  that use LUKS.  You
need it only  if  You  plan to  develop or  compile some LUKS 
applications.

%description devel -l ru_RU.UTF-8
LUKS ( Linux Unified Key Setup ) - разрабатываемый стандарт 
для шифрования дисков в Linux. Определяя стандартный формат
хранения  информации на дисках,  он не только  способствует 
совместимости  между различными  дистрибутивами,  но  также 
предоставляет возможность управлять безопасностью доступа к 
данным  путём  использования  нескольких   пользовательских
паролей. По сравнению с существующими решениями, в LUKS вся
необходимая  информация по  настройке параметров шифрования 
хранится в заголовке  раздела диска, облегчая пользователям
перемещение или миграцию данных.

Данный  пакет  содержит  библиотеки  и  заголовочные  файлы,
необходимые для разработки использующих LUKS приложений.  Он
необходим Вам  только  если Вы планируете  разрабатывать или
компилировать какие-либо приложения с поддержкой LUKS.

%prep
%setup -n %rname-%version
%patch5 -p1
%patch6 -p1
%patch7
%patch8
%patch9
%patch10
%patch11
%patch12

cp -- %SOURCE1 README.ALT.utf-8

%build
#%%__subst 's|test "$gentoo_lt_version" != "$gentoo_ltmain_version"|test "$gentoo_lt_version" -ge "$gentoo_ltmain_version"|g' aclocal.m4
subst 's|poptConfigFileToString|poptGetInvocationName|g' configure.in

%def_enable Werror

/usr/bin/autoconf

# We already have packaged ltmain.sh and other stuff, and we don't need
# to copy them in %%configure via '%%{__libtoolize} --copy --force'
%undefine __libtoolize

%configure
%make

%install
%makeinstall
%find_lang %rname

# Replacing license file with reference
mv -f -- COPYING COPYING.orig
ln -s -- $(relative %_licensedir/GPL-2 %_docdir/%name/COPYING) COPYING

%files -f %rname.lang
%doc ChangeLog AUTHORS 
## NEWS README - empty files 
%doc --no-dereference COPYING
%doc README.ALT.utf-8

%_sbindir/%rname
%_libdir/lib%rname.so.0
%_libdir/lib%rname.so.0.0.0
%_mandir/man8/%{rname}*

%files devel
%_includedir/lib%rname.h
%_libdir/lib%rname.so

%changelog
* Fri Dec 12 2008 Nikolay A. Fetisov <naf@altlinux.ru> 1.0.6-alt2
- Remove %%post_ldconfig calls
- Man page typos fixed

* Fri Mar 14 2008 Nikolay A. Fetisov <naf@altlinux.ru> 1.0.6-alt1
- New version 1.0.6
- Rename package back from cryptsetup-luks to cryptsetup following upstream

* Sun Mar 02 2008 Nikolay A. Fetisov <naf@altlinux.ru> 1.0.6-alt0.pre2
- New version 1.0.6-pre2
  - Now cryptsetup will fail when trying to create two mappings for a single device
  - Remove O_EXCL requirement for certain LUKS operations
  - Deprecate 'reload' action
  - No password retry for I/O errors
  - A lot of bug fixes

* Fri Mar 23 2007 Nikolay A. Fetisov <naf@altlinux.ru> 1.0.4-alt2.svn26
- Fix build with -Werror on x86_64

* Thu Mar 15 2007 Nikolay A. Fetisov <naf@altlinux.ru> 1.0.4-alt1.svn26
- Current developer version svn26
 -- Fix segfaults with unsupported keysize
 -- Fix a sector size error
 -- Prevents password retrying with I/O errors
 -- Allow hashing of keys passed through stdin
 -- Other bugfixes and code improvements
- Adding several patches for build with -Werror
- Spec file cleanup
- Adding README.ALT (fix FR # 8300)

* Mon Jan 15 2007 Nikolay A. Fetisov <naf@altlinux.ru> 1.0.4-alt0
- New version 1.0.4
 -- Fix getline problem for 64-bit archs
 -- Fix 64 bit compiler warning issues
 -- Add support for reading binary keys from stdin using the "-" as key file
 -- Add support to allow user selection of key slot
  
* Mon Jul 10 2006 Nikolay A. Fetisov <naf@altlinux.ru> 1.0.3-alt1
- New version 1.0.3
 -- Fix sector size of the temporary mapping to be an integral 
    of the block's sector size.
 -- Add LUKS key copy cmd: luksKeyCopy
 -- Add option to supply a master key directly for LUKS commands:
    luksFormat, luksOpen and luksAddKey.
 -- More verbose error logging; meaningful exit codes
 -- Other small bugfixes, see CHANGELOG for details
- Adding numerous patches from Debian, most significant is:
 -- Fix the terminal status after a timeout
 -- Fixes standard input to allow more than 32 characters password

* Sun Feb 26 2006 Nikolay A. Fetisov <naf@altlinux.ru> 1.0.3-alt0.1
- New version 1.0.3-rc2
  * Work with libdevmapper 1.02.02
  * Add LUKS key copy cmd: luksKeyCopy
  * Add option to supply a master key directly for LUKS commands:
    luksFormat, luksOpen and luksAddKey.
	 
* Fri Jan 27 2006 Nikolay A. Fetisov <naf@altlinux.ru> 1.0.1-alt2
- Fix incompatibility with libdevmapper 1.02.02
- SPEC file cleanup

* Mon Sep 05 2005 Nikolay A. Fetisov <naf@altlinux.ru> 1.0.1-alt1
- Initial build for ALT Linux Sisyphus

* Thu Jul 21 2005 Nikolay A. Fetisov <naf@altlinux.ru> 1.0.1-alt0
- Initial build