A streamlined PowerShell module designed to build native Linux deployment packages (.deb and .rpm) directly from Windows by leveraging the Windows Subsystem for Linux (WSL).
⚠️ Prerequisite: This module requires WSL with the Ubuntu distribution installed and configured on your host system.
- Cross-Platform Compilation: Generate Linux packages without leaving your Windows host console.
- Auto-Architecture Detection: Automatically scans your binaries inside the target folder using WSL
filecommands to detect if they areARM64,X64, or architecture-independent (NOARCH). - Automated Spec & Control Generation: Generates Debian
controlfiles and RPM.spectemplates on the fly with proper permissions, builds the package, and cleans up the temporary environment automatically.
You can pull down the module directly from the PowerShell Gallery by running:
Install-Module -Name LinuxPackager -Scope CurrentUser
To verify it is loaded and see the available commands:
Get-Command -Module LinuxPackager
Generates a Debian package (.deb) from a target folder containing your executables.
makedeb -F "C:\Path\To\Your\BuildOutput" -O "C:\Path\To\OutputFolder"
- How it works: It copies your executables to
/usr/local/bininside a temporary staging root, auto-configures a template package control metadata structure targeting the detected binary architecture, runsdpkg-deb, and drops the compiled package into your output folder.
Generates a Red Hat Package Manager file (.rpm) from a target folder.
makerpm -F "C:\Path\To\Your\BuildOutput" -O "C:\Path\To\OutputFolder"
- How it works: It establishes a sandboxed
rpmbuilddirectory tree, automatically drafts a runtime compilation.specfile matching your binary constraints, and executes quiet headless compilation viarpmbuild.
Inspects the compilation headers of binaries inside a folder using native Linux parsing tools.
Get-LinuxBinaryArch -Folder "C:\Path\To\Your\BuildOutput"
Before using the tool, ensure your local environment satisfies the following configurations:
- WSL Ubuntu: Ensure your distribution is named exactly
Ubuntuin your WSL list (wsl -l -v). - Linux Build Dependencies: Your WSL Ubuntu instance must have
rpmand build utilities installed. Open your WSL terminal and run:
sudo apt update sudo apt install rpm binutils -y
This project is open-source and available under the MIT License.