Name: veracrypt Version: 1.26.18 Release: 3%{?dist} Summary: Open-source disk encryption software License: Apache-2.0 URL: https://www.veracrypt.fr Source0: https://github.com/veracrypt/VeraCrypt.git BuildRequires: gcc, gcc-c++, make, wxGTK-devel, fuse-devel, pcsc-lite-devel, yasm, git, ImageMagick Requires: fuse, wxGTK, libappindicator-gtk3, libayatana-appindicator-gtk3, libayatana-appindicator-gtk3-devel %description VeraCrypt is a free and open-source disk encryption software brought to you by IDRIX. It is based on TrueCrypt, with enhanced security and improved features. %prep # Clone the Git repository into the build directory git clone https://github.com/veracrypt/VeraCrypt.git %{_builddir}/%{name}-%{version} cd %{_builddir}/%{name}-%{version} git checkout VeraCrypt_%{version} # Debugging: Show directory contents echo "Debug: Current working directory during %%prep:" pwd echo "Debug: Directory listing during %%prep:" ls -lR # Ensure file permissions are correct find . -type d -exec chmod 755 {} \; find . -type f -exec chmod 644 {} \; %build # Debugging wx-config echo "Debug: Checking for wx-config in PATH..." command -v wx-config || { echo "wx-config not found!" >&2; exit 1; } echo "Debug: wx-config version: $(wx-config --version)" echo "Debug: wx-config --cxxflags: $(wx-config --cxxflags)" echo "Debug: wx-config --libs: $(wx-config --libs)" wx-config --list || { echo "Failed to list wx-config configurations!" >&2; exit 1; } # Export wx-config path explicitly export WX_CONFIG=$(command -v wx-config) # Ensure shared wxWidgets libraries are used (disable static) export CXXFLAGS="%{optflags} $(wx-config --cxxflags)" export LDFLAGS="$(wx-config --libs)" cd %{_builddir}/%{name}-%{version}/src make VERBOSE=1 %install echo "Debug: Current working directory during %%install:" pwd # Install binary VCRYPT_BIN=$(find %{_builddir}/%{name}-%{version} -name veracrypt || { echo "Error: veracrypt binary not found!" >&2; exit 1; }) mkdir -p %{buildroot}/usr/libexec/veracrypt cp "$VCRYPT_BIN" %{buildroot}/usr/libexec/veracrypt/veracrypt-bin # Create wrapper script mkdir -p %{buildroot}/usr/bin cat > %{buildroot}/usr/bin/veracrypt << 'EOF' #!/bin/bash export GDK_BACKEND=x11 exec /usr/libexec/veracrypt/veracrypt-bin "$@" EOF chmod +x %{buildroot}/usr/bin/veracrypt # Install documentation DOC_FILES=$(find %{_builddir}/%{name}-%{version} -type f -name '*.txt' || { echo "Error: No .txt files found!" >&2; exit 1; }) mkdir -p %{buildroot}/usr/share/doc/%{name} for FILE in $DOC_FILES; do cp "$FILE" %{buildroot}/usr/share/doc/%{name}/ done # Install .xpm icons ICON_SIZES=(16x16 48x48 128x128 256x256) for SIZE in "${ICON_SIZES[@]}"; do ICON_PATH=%{_builddir}/%{name}-%{version}/src/Resources/Icons/VeraCrypt-$SIZE.xpm if [ -f "$ICON_PATH" ]; then ICON_DIR=%{buildroot}/usr/share/icons/hicolor/$SIZE/apps/ mkdir -p "$ICON_DIR" echo "Debug: Copying icon $SIZE to $ICON_DIR" cp "$ICON_PATH" "$ICON_DIR/veracrypt.xpm" else echo "Warning: Icon size $SIZE not found at $ICON_PATH. Skipping." fi done # Install .icns files ICNS_FILES=("VeraCrypt.icns" "TrueCrypt.icns" "VeraCrypt_Volume.icns") mkdir -p %{buildroot}/usr/share/icons/veracrypt for ICNS in "${ICNS_FILES[@]}"; do ICNS_PATH=%{_builddir}/%{name}-%{version}/src/Resources/Icons/$ICNS if [ -f "$ICNS_PATH" ]; then echo "Debug: Copying $ICNS to /usr/share/icons/veracrypt/" cp "$ICNS_PATH" %{buildroot}/usr/share/icons/veracrypt/ else echo "Warning: $ICNS not found at $ICNS_PATH. Skipping." fi done # Install desktop entry mkdir -p %{buildroot}/usr/share/applications cat > %{buildroot}/usr/share/applications/veracrypt.desktop << 'EOF' [Desktop Entry] Name=VeraCrypt Comment=Open-source disk encryption software Exec=/usr/bin/veracrypt Icon=veracrypt Terminal=false Type=Application Categories=Utility;Security; EOF # Do not create or copy index.theme to avoid conflicts echo "Debug: Skipping index.theme to prevent conflicts." # Debugging: Log installed files echo "Debug: Listing installed files in %%buildroot:" find %{buildroot} %files /usr/bin/veracrypt /usr/libexec/veracrypt/veracrypt-bin /usr/share/doc/%{name}/ /usr/share/applications/veracrypt.desktop /usr/share/icons/hicolor/*/apps/veracrypt.xpm /usr/share/icons/veracrypt/* %changelog * Mon Jan 27 2025 Your Name - 1.26.18-3 - Added wrapper script to set GDK_BACKEND=x11 for VeraCrypt