summaryrefslogtreecommitdiff
path: root/veracrypt/veracrypt.spec
blob: e59f1c2ae89edb68fad4899b847eccaddba2b92f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
%global  pname VeraCrypt
%global  dummy_package   0
%global  tarballdir %{pname}_%{version}
%global  srcdir %{tarballdir}/src
%global  indocdir %{tarballdir}/doc
%define license_files src/License.txt
%define debug_package %{nil}

Name:		veracrypt
Version:	1.22
Release:	1
Summary:	Disk encryption with strong security based on TrueCrypt

Group:	Applications/File
License:	Apache License 2.0 and TrueCrypt License 3.0
URL:		https://www.veracrypt.fr/
Source0: https://www.veracrypt.fr/code/%{pname}/snapshot/%{pname}_%{version}.tar.gz
# in case upstream ever malfunctions here is my mirror
#Source0: https://gitlab.com/bgstack15/big-sources/raw/master/%{name}/%{pname}_%{version}.tar.gz
Patch0:  vc_fedora.patch
Patch1:  vc_desktop.patch

Packager:	Bgstack15 <bgstack15@gmail.com>
BuildRequires: gcc-c++
BuildRequires: wxGTK3-devel
BuildRequires: fuse-devel
BuildRequires: desktop-file-utils
BuildRequires: ImageMagick
BuildRequires: yasm
Requires:	wxGTK3

%description
VeraCrypt is a free open source disk encryption software for Windows, Mac OSX and Linux. Brought to you by IDRIX (https://www.idrix.fr) and based on TrueCrypt 7.1a.

%prep
%setup -q -c

%patch0 -p0
%patch1 -p0

%build
#%make_build -C %{tarballdir}/src
pushd %{srcdir}
make %{_smp_mflags}
popd

%install
#%make_install -C %{tarballdir}/src
%{__install} -d "%{buildroot}%{_bindir}"
%{__install} %{srcdir}/Main/veracrypt "%{buildroot}%{_bindir}"
%{__install} -d "%{buildroot}%{_docdir}/%{name}"
%{__install} -m 0644 %{srcdir}/License.txt "%{buildroot}%{_docdir}/%{name}"
%{__install} -d "%{buildroot}%{_datadir}/applications" "%{buildroot}%{_datadir}/pixmaps"
%{__install} %{srcdir}/Setup/Linux/%{name}.desktop "%{buildroot}%{_datadir}/applications"
%{__install} %{srcdir}/Resources/Icons/VeraCrypt-256x256.xpm "%{buildroot}%{_datadir}/pixmaps/veracrypt.xpm"

# cleanup

# desktop files
test -f %{srcdir}/Setup/Linux/%{name}.desktop && \
   %{__install} -p -D -m 0644 "%{srcdir}/Setup/Linux/%{name}.desktop" "%{buildroot}%{_datadir}/applications/%{name}.desktop" || :

# application start script
# none

# man pages
# handled by the %files %doc directive?
# not really man pages in this case, just html and text
#for thisdir in $( find %{indocdir} -mindepth 1 -maxdepth 1 -printf '%f\n' ) ;
#do
#   %{__install} -p -D -d %{indocdir}/${thisdir} %{buildroot}%{_defaultdocdir}/%{name}/${thisdir}
#done

# icons
pushd %{srcdir}/Resources/Icons
for s in {16,48,128,256} ;
do
   convert "%{pname}-${s}x${s}.xpm" "%{pname}-${s}x${s}.png" && \
      %{__install} -p -D -m 0644 "%{pname}-${s}x${s}.png" "%{buildroot}%{_datadir}/icons/hicolor/${s}x${s}/apps/%{name}.png" || :
done
popd

for e in {xpm,png} ;
do
  test -f "%{srcdir}/Resources/Icons/%{pname}-256x256.${e}" || continue
  %{__install} -p -D -m 0644 "%{srcdir}/Resources/Icons/%{pname}-256x256.${e}" "%{buildroot}%{_datadir}/pixmaps/%{name}.${e}"
done

:

%clean
rm -rf %{buildroot} || :

%post
touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
/usr/bin/update-mime-database "%{_datadir}/mime" &>/dev/null || :
update-desktop-database &> /dev/null || :
/sbin/ldconfig || :

%preun
# is it a final removal?
#if test "$1" = "0" ;
#then
#fi   

%postun
update-desktop-database &> /dev/null || :
if test "$1" = "0" ;
then
   touch --no-create %{_datadir}/icons/hicolor &>/dev/null
   gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
   /usr/bin/update-mime-database "%{_datadir}/mime" &>/dev/null || :
fi
/sbin/ldconfig || :

%posttrans
/usr/bin/gtk-update-icon-cache "%{_datadir}/icons/hicolor" &>/dev/null || :
/usr/bin/update-mime-database "%{_datadir}/mime" &>/dev/null || :

%files
%if 0%{?doc_license}
%license %{license_files}
%else
%doc %{license_files}
%endif
%doc "%{indocdir}/chm/VeraCrypt User Guide.chm" %{indocdir}/EFI-DCS/ %{indocdir}/html/
%{_bindir}/%{name}
#%{_docdir}/%{name} # handled by %doc above?
%{_datadir}/applications/*.desktop
%{_datadir}/pixmaps/*
%{_datadir}/icons/hicolor/*/apps/*

%changelog
* Sat Sep 1 2018 B Stack <bgstack15@gmail.com> 1.22-1
- Initial rpm built.
bgstack15