File wimlib.spec of Package wimlib

%global __os_install_post %{nil}
Summary: Wimlib is a C library for working with WIM files
Name: wimlib
Version: 1.14.4.6
Release: 1
Group: Productivity/Networking/opsi
License: GNU GENERAL PUBLIC LICENSE Version 3
URL: https://github.com/ebiggers/wimlib
Vendor: uib GmbH <info@uib.de>
Packager: uib GmbH <info@uib.de>
Source: wimlib_1.14.4.6-1.tar.gz
BuildRoot: %{_tmppath}/wimlib-1.14.4.6-1-build
BuildRequires: gcc
BuildRequires: (g++ or gcc-c++)
BuildRequires: fuse
BuildRequires: (libfuse3-dev or fuse3-devel)
BuildRequires: (libxml2-dev or libxml2-devel)
BuildRequires: (libssl-dev or openssl-devel)
BuildRequires: (libattr1-dev or libattr-devel)
BuildRequires: attr
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libtool
BuildRequires: (pkgconf or pkgconfig)
Requires: fuse
AutoReqProv: no

%description
wimlib is a C library for creating, modifying, extracting, and mounting files in the Windows Imaging Format (WIM files). wimlib and its command-line frontend wimlib-imagex provide a free and cross-platform alternative to Microsoft's WIMGAPI, ImageX, and DISM.

%global debug_package %{nil}
%clean

%prep

%setup -n wimlib-1.14.4.6

%define _build_id_links none
%build
./bootstrap
./configure CPPFLAGS=-Wno-cpp --without-ntfs-3g
make
pwd
ls -la
WORKDIR=$(pwd)
echo "Building wimlib in ${WORKDIR}"
ROOT_DIR_PATH=$(pwd)/rootfs
echo "Creating rootfs directory at ${ROOT_DIR_PATH}"
mkdir -p /tmp/wimlib
echo "Build successful."
echo "Installing files to /tmp/wimlib..."
ls -la /tmp/wimlib
make install DESTDIR=/tmp/wimlib
ls -la /tmp/wimlib
echo "Files copied to rootfs."
mkdir -p rootfs
cp -a /tmp/wimlib/* rootfs/
ls -la rootfs

%install
>INSTALLED_FILES
sys_arch_alt="unset";
if [ %{_arch} = 'x86_64' ]; then
   sys_arch="amd64";
   sys_arch_alt="x64"
elif [ "%{_arch}" = "i386" ]; then
   sys_arch="i586"
elif [ "%{_arch}" = "i386" ]; then
   sys_arch="i586"
elif [ "%{_arch}" = "aarch64" ]; then
   sys_arch="arm64"
elif [ "%{_arch}" = "noarch" ]; then
   sys_arch="all"
fi
for rootfs in rootfs rootfs-${sys_arch} rootfs-${sys_arch_alt}; do
   if [ -d ${rootfs} ]; then
      find  ${rootfs} -type d -print0 | while read -d $'\0' file; do
      dst=$(echo $file | sed s"#^${rootfs}##")
         [ "$dst" == "" ] && continue
         mkdir -p "${RPM_BUILD_ROOT}${dst}"
         [ "$dst" == "/usr/bin" -o "$dst" == "/usr/lib" ] && continue
         echo "%dir \"${dst}\"" >>INSTALLED_FILES
      done
      find ${rootfs} -not -type d -print0 | while read -d $'\0' file; do
         dst=$(echo $file | sed s"#^${rootfs}##")
         cp -a "$file" "${RPM_BUILD_ROOT}${dst}"
         if [[ $dst == /etc/logrotate.d/* ]]; then
            echo "%config \"${dst}\"" >>INSTALLED_FILES
         elif [[ $dst == /etc/* ]]; then
            echo "%config(noreplace) \"${dst}\"" >>INSTALLED_FILES
         else
            echo "\"${dst}\"" >>INSTALLED_FILES
         fi
      done
   fi
done
INSTALLED_FILES="$(echo $INSTALLED_FILES | tr " " "\n" | sort -u)"
cat INSTALLED_FILES

%files -f INSTALLED_FILES
%defattr(-,root,root)

%post 
echo "Post installation script for wimlib"





%changelog
* Thu Aug 14 2025 Fabian Kalweit <f.kalweit@uib.de> 1.14.4.6-1
- Changed: No public changes
* Thu Aug 07 2025 Fabian Kalweit <f.kalweit@uib.de> 1.14.4.5-1
- Changed: add summary to package
- Changed: change libfuse dependencies
- Changed: add build dependencies
openSUSE Build Service is sponsored by