Blob Blame History Raw
Summary:         Utility to access BitLocker encrypted volumes
Name:            dislocker
Version:         0.4.1
Release:         3%{?dist}
License:         GPLv2+
Group:           Applications/System
URL:             https://github.com/Aorimn/dislocker
Source0:         https://github.com/Aorimn/dislocker/archive/v%{version}.tar.gz
Patch0:          dislocker-0.4.1-paths.patch
Patch1:          dislocker-0.4.1-off_t.patch
Requires:        %{name}-libs%{?_isa} = %{version}-%{release}
Requires(post):  %{_sbindir}/update-alternatives
Requires(preun): %{_sbindir}/update-alternatives
Provides:        %{_bindir}/%{name}
BuildRequires:   %{_includedir}/polarssl/config.h
BuildRoot:       %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

%description
Dislocker has been designed to read BitLocker encrypted partitions ("drives")
under a Linux system. The driver used to only read volumes encrypted under a
Microsoft Windows 7 system - but is now Microsoft Windows Vista and 8 capable
and has the write functionality.

The file name where the BitLocker encrypted partition will be decrypted needs
to be given. This may take a long time, depending on the size of the encrypted
partition. But afterward, once the partition is decrypted, the access to the
NTFS partition will be faster than with FUSE. Another thing to think about is
the size of the disk (same size as the volume that is tried to be decrypted).
Nevertheless, once the partition is decrypted, the file can be mounted as any
NTFS partition and won't have any link to the original BitLocker partition.

%package libs
Summary:         Libraries for applications using dislocker
Group:           System Environment/Libraries

%description libs
The dislocker-libs package provides the essential shared libraries for any
dislocker client program or interface.

%package -n fuse-dislocker
Summary:         FUSE filesystem to access BitLocker encrypted volumes
Group:           Applications/System
Provides:        %{_bindir}/%{name}
Provides:        dislocker-fuse = %{version}-%{release}
Provides:        dislocker-fuse%{?_isa} = %{version}-%{release}
Requires:        %{name}-libs%{?_isa} = %{version}-%{release}
Requires(post):  %{_sbindir}/update-alternatives
Requires(preun): %{_sbindir}/update-alternatives
BuildRequires:   fuse-devel

%description -n fuse-dislocker
Dislocker has been designed to read BitLocker encrypted partitions ("drives")
under a Linux system. The driver used to only read volumes encrypted under a
Microsoft Windows 7 system - but is now Microsoft Windows Vista and 8 capable
and has the write functionality.

A mount point needs to be given to dislocker-fuse. Once keys are decrypted, a
file named 'dislocker-file' appears into this provided mount point. This file
is a virtual NTFS partition, it can be mounted as any NTFS partition and then
reading from it or writing to it is possible.

%prep
%setup -q
%patch0 -p1 -b .paths
%patch1 -p1 -b .off_t

%build
# PolarSSL was acquired by ARM in November 2014 and renamed to mbed TLS
sed -e 's/-lpolarssl/-lmbedtls/g' -i src/Makefile src/accesses/user_pass/Makefile

cd src
make %{?_smp_mflags} RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wno-error"
cd ..

# Clean up files for later usage in documentation
for file in *.txt; do mv -f $file ${file%.txt}; done

%install
rm -rf $RPM_BUILD_ROOT

cd src
make DESTDIR=$RPM_BUILD_ROOT install
cd ..

# Install a copy of the man page for FUSE package
install -p -m 644 man/dislocker_man $RPM_BUILD_ROOT%{_mandir}/man1/%{name}-fuse.1

# Remove standard symlink due to alternatives
rm -f $RPM_BUILD_ROOT%{_bindir}/%{name}

# Remove symlink, because of missing -devel package
rm -f $RPM_BUILD_ROOT%{_libdir}/libdislocker.so

%clean
rm -rf $RPM_BUILD_ROOT

%post
%{_sbindir}/update-alternatives --install %{_bindir}/%{name} %{name} %{_bindir}/%{name}-file 60

%preun
if [ $1 = 0 ]; then
  %{_sbindir}/update-alternatives --remove %{name} %{_bindir}/%{name}-file
fi

%post libs -p /sbin/ldconfig

%postun libs -p /sbin/ldconfig

%post -n fuse-dislocker
%{_sbindir}/update-alternatives --install %{_bindir}/%{name} %{name} %{_bindir}/%{name}-fuse 80

%preun -n fuse-dislocker
if [ $1 = 0 ]; then
  %{_sbindir}/update-alternatives --remove %{name} %{_bindir}/%{name}-fuse
fi

%files
%defattr(-,root,root,-)
%{_bindir}/%{name}-bek
%{_bindir}/%{name}-file
%{_bindir}/%{name}-metadata
%{_mandir}/man1/%{name}.1*

%files libs
%defattr(-,root,root,-)
%doc CHANGELOG LICENSE README
%{_libdir}/libdislocker.so.*

%files -n fuse-dislocker
%defattr(-,root,root,-)
%{_bindir}/%{name}-fuse
%{_mandir}/man1/%{name}-fuse.1*

%changelog
* Fri Jun 05 2015 Robert Scheck <robert@fedoraproject.org> 0.4.1-3
- Rebuilt for mbed TLS 1.3.11

* Mon Jun 01 2015 Robert Scheck <robert@fedoraproject.org> 0.4.1-2
- Rebuilt for mbed TLS 1.3.10

* Sat May 30 2015 Robert Scheck <robert@fedoraproject.org> 0.4.1-1
- Upgrade to 0.4.1

* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.1-6.20140423git
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Mon Jul 14 2014 Robert Scheck <robert@fedoraproject.org> 0.3.1-5.20140423git
- Rebuild for PolarSSL 1.3.8

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.1-4.20140423git
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Thu May 01 2014 Robert Scheck <robert@fedoraproject.org> 0.3.1-3.20140423git
- Rebuild for PolarSSL 1.3.6

* Wed Apr 23 2014 Robert Scheck <robert@fedoraproject.org> 0.3.1-2.20140423git
- Upgrade to GIT 20140423 (#991689 #c15)
- Added %%{?__global_ldflags} for make (#991689 #c16)

* Mon Nov 25 2013 Robert Scheck <robert@fedoraproject.org> 0.3.1-1.20131102git
- Upgrade to GIT 20131102 (#991689 #c8)

* Mon Nov 25 2013 Robert Scheck <robert@fedoraproject.org> 0.2.3-2.20130131git
- Changed PolarSSL patch to support PolarSSL 1.2 and 1.3 (#991689 #c5)
- Added the missing Group tag on fuse-dislocker sub-package (#991689 #c5)

* Wed May 08 2013 Robert Scheck <robert@fedoraproject.org> 0.2.3-1.20130131git
- Upgrade to GIT 20130131
- Initial spec file for Fedora and Red Hat Enterprise Linux