summaryrefslogtreecommitdiff
path: root/scx-veracrypt/veracrypt.spec
blob: 7e8abf2cbcf6d3756980d55b8e6a7a56ba8eced0 (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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
%define wx_version_major 3
%define wx_version_minor 0
%define wx_version %{wx_version_major}.%{wx_version_minor}

%define force_wx_gtk2 %{nil}
%define force_wx_gtk2 0

################################################################################

%define wx_name_postfix %{nil}
%if 0%{?wx_version_major} >= 3
  %if 0%{?wx_version_minor} == 0
    %define wx_name_postfix %{wx_version_major}
  %else
    %define wx_name_postfix %{wx_version_major}%{wx_version_minor}
  %endif
%endif

# Force toolkit
# e.g. gtk2 instead of gtk3
%define wx_toolkit %{nil}
%if 0%{?force_wx_gtk2}
  %if 0%{?wx_version_major} >= 3
    %if 0%{?wx_version_minor} == 0
      %define wx_toolkit gtk2
    %endif
  %endif
%endif

%undefine update_mime_database_n
%if 0%{?fedora}%{?rhel}
  %define update_mime_database_n 1
%endif

%define debug_package %{nil}

%define doc_license %{nil}
%define doc_license 1
%if 0%{?rhel}%{?fedora}
  %if 0%{?rhel}
    %if 0%{?rhel} < 7
      %define doc_license 0
    %endif
  %else
    %if 0%{?fedora} < 19
      %define doc_license 0
    %endif
  %endif
%endif

%define enable_dumpfullversion %{nil}
%define enable_dumpfullversion 0
%if 0%{?rhel}%{?fedora}
  %if 0%{?rhel}
    %if 0%{?rhel} > 7
      %define enable_dumpfullversion 1
    %endif
  %else
    %if 0%{?fedora} > 25
      %define enable_dumpfullversion 1
    %endif
  %endif
%endif

%define license_files src/License.txt

Name:           veracrypt
Version:        1.22
Release:        3%{?dist}
Group:          File tools
#License:        Microsoft Public License
#License:        Apache License 2.0
License:        ASL 2.0 or TrueCrypt License
Summary:        Disk encryption software 
#URL:            https://veracrypt.codeplex.com
URL:            https://www.veracrypt.fr/en/Home.html
#Source0:        https://github.com/veracrypt/VeraCrypt/archive/VeraCrypt-VeraCrypt_%{version}.tar.gz
Source0:        https://launchpad.net/veracrypt/trunk/%{version}/+download/VeraCrypt_%{version}_Source.tar.bz2
Patch1:         veracrypt-1.0f-2-no-makeself.patch
Patch2:         veracrypt-1.0f-2-desktop.patch
# https://github.com/veracrypt/VeraCrypt/issues/198
# In file included from ../Crypto/cpu.h:175:0,
#                  from ../Crypto/cpu.c:3:
# ../Crypto/cpu.c: In function 'TryAESNI':
# /usr/lib/gcc/x86_64-redhat-linux/7/include/wmmintrin.h:61:1: error: inlining failed in call to always_inline '_mm_aesenc_si128': target specific option mismatch
#  _mm_aesenc_si128 (__m128i __X, __m128i __Y)
Patch3:         veracrypt-1.21-dumpfullversion.patch
Patch4:         veracrypt-1.22-include-sysmacros.patch

#BuildRequires:	wxGTK3-devel
%if "%{?wx_toolkit}" != ""
BuildRequires:  compat-wxGTK%{?wx_name_postfix}-%{wx_toolkit}-devel
%else
BuildRequires:  wxGTK%{?wx_name_postfix}-devel
%endif
BuildRequires:	nasm
BuildRequires:	fuse-devel
BuildRequires:	ImageMagick
BuildRequires:	gcc
BuildRequires:	gcc-c++
BuildRequires:	gzip
BuildRequires:	bzip2
BuildRequires:	yasm

%if 0%{?rhel}%{?fedora}
%if 0%{?rhel}
BuildRequires:	ghostscript
%else
BuildRequires:	ghostscript-core
%endif
%else
BuildRequires:	ghostscript
%endif

%description
Free disk encryption software based on TrueCrypt.

%prep
# for 1.19:
#setup -qn "VeraCrypt-VeraCrypt_%{version}"
# for 1.21:
%setup -q -c
%patch1 -p1
%patch2 -p1
%if 0%{?enable_dumpfullversion}
%patch3 -p1
%endif
%patch4 -p1

%build
%if 0%{wx_version_major} < 3
WXCONFIG="wx-config"
%else
WXCONFIG="wx-config-%{wx_version}"
%endif
export WXCONFIG

%if "%{?wx_toolkit}" != ""
if hash "${WXCONFIG}-%{?wx_toolkit}" >/dev/null 2>&1 ; then
  WXCONFIG="${WXCONFIG}-%{?wx_toolkit}"
  export WXCONFIG
fi
%endif

pushd "src"
%{__make} WX_CONFIG="${WXCONFIG}" %{?_smp_mflags}
popd

pushd src/Resources/Icons
for s in {16,48,128,256} ; do
  convert "VeraCrypt-${s}x${s}.xpm" "VeraCrypt-${s}x${s}.png"
done
popd

find "src/Setup/Linux/usr" -xtype f -iname 'License.txt' -print0 | xargs --null -I{} sed -i -re 's/\r$//' '{}'

find "src/Setup/Linux/usr" "doc/chm" -xtype f \( -iname '*.pdf' -o -iname '*.chm' \) -print0 | while IFS= read -r -d $'\0' file ; do
  d="$( dirname "${file}" )"
  f="$( basename "${file}" )"
  
  g="$( sed -re 's/[[:blank:]]/_/g' <<< "${f}" )"
  
  if [[ "${f}" != "${g}" ]]; then
    mv "${file}" "${d}/${g}"
  fi
done

[[ -f "src/Setup/Linux/usr/bin/veracrypt-uninstall.sh" ]] && rm -f "src/Setup/Linux/usr/bin/veracrypt-uninstall.sh" || :

[[ -f "src/Setup/Linux/usr/share/pixmaps/veracrypt.xpm" ]] && rm -f "src/Setup/Linux/usr/share/pixmaps/veracrypt.xpm" || :

%install
[[ -d "src/Setup/Linux/usr" ]] && cp -r "src/Setup/Linux/usr" "%{buildroot}"/ || :

[[ -f "src/Setup/Linux/veracrypt.desktop" ]] && install -p -D -m 0644 "src/Setup/Linux/veracrypt.desktop" "%{buildroot}%{_datadir}/applications/%{name}.desktop" || :
[[ -f "src/Main/veracrypt" ]] &&  install -p -D -m 0755 "src/Main/veracrypt"  "%{buildroot}%{_bindir}/%{name}" || :

for s in {16,48,128,256} ; do
  [[ -f "src/Resources/Icons/VeraCrypt-${s}x${s}.png" ]] || continue
  install -p -D -m 0644 "src/Resources/Icons/VeraCrypt-${s}x${s}.png" "%{buildroot}%{_datadir}/icons/hicolor/${s}x${s}/apps/%{name}.png"
done

for e in {xpm,png} ; do
  [[ -f "src/Resources/Icons/VeraCrypt-256x256.${e}" ]] || continue
  install -p -D -m 0644 "src/Resources/Icons/VeraCrypt-256x256.${e}" "%{buildroot}%{_datadir}/pixmaps/%{name}.${e}"
done

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

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

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

%files
%if 0%{?doc_license}
%license %{license_files}
%else
%doc %{license_files}
%endif
%doc README.md doc/chm/VeraCrypt_User_Guide.chm doc/EFI-DCS/ doc/html/
%{_bindir}/%{name}
#%{_datadir}/%{name}
%{_datadir}/applications/*.desktop
%{_datadir}/pixmaps/*
%{_datadir}/icons/hicolor/*/apps/*

%changelog
* Tue Sep 04 2018 B Stack <bgstack15@gmail.com> - 1.22-1
- Update to 1.22

* Thu Nov 02 2017 Tomasz Tomasik <scx.mail@gmail.com> - 1.21-3
- Add additional macros for wxGTK
- Add post, postun and posttrans sections
- Rebuild for EL7

* Tue Oct 24 2017 Tomasz Tomasik <scx.mail@gmail.com> - 1.21-2
- Fix for Fedora < 26
- Rebuild for EL7

* Tue Oct 24 2017 Tomasz Tomasik <scx.mail@gmail.com> - 1.21-1
- Update to version 1.21
- Update License and URL
- Change source
- Backport patch from GitHub: https://github.com/veracrypt/VeraCrypt/issues/198
- Rewrite prep, build and install sections
- Use doc and license macro
- Rebuild for EL7

* Mon Oct 23 2017 Tomasz Tomasik <scx.mail@gmail.com> - 1.19-5
- Update changelog
- Rebuild for EL7

* Mon Apr 24 2017 Tomasz Tomasik <scx.mail@gmail.com> - 1.19-4
- Update requirements
- Rewrite build and install sections
- Rebuilt for EL7

* Thu Nov 17 2016 Huaren Zhong <huaren.zhong@gmail.com> - 1.19
- Rebuild for Fedora

* Tue Oct 18 2016 Denis Silakov <denis.silakov@rosalab.ru> - 1.19-1
- (9623fad) Merge pull request #4 from tremod/veracrypt:rosa2016.1
- (9623fad) Update to 1.19

* Sun Oct 18 2015 Denis Silakov <dsilakov@gmail.com> - 1.16-1
- (eac346d) Updated to 1.16

bgstack15