Skip to content

NuggiDev/LinuxPackager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

LinuxPackager 🚀

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.


Features

  • 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 file commands to detect if they are ARM64, X64, or architecture-independent (NOARCH).
  • Automated Spec & Control Generation: Generates Debian control files and RPM .spec templates on the fly with proper permissions, builds the package, and cleans up the temporary environment automatically.

Installation

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


Command Reference & Usage

1. makedeb

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/bin inside a temporary staging root, auto-configures a template package control metadata structure targeting the detected binary architecture, runs dpkg-deb, and drops the compiled package into your output folder.

2. makerpm

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 rpmbuild directory tree, automatically drafts a runtime compilation .spec file matching your binary constraints, and executes quiet headless compilation via rpmbuild.

3. Get-LinuxBinaryArch

Inspects the compilation headers of binaries inside a folder using native Linux parsing tools.

Get-LinuxBinaryArch -Folder "C:\Path\To\Your\BuildOutput"


Requirements & Environment Setup

Before using the tool, ensure your local environment satisfies the following configurations:

  1. WSL Ubuntu: Ensure your distribution is named exactly Ubuntu in your WSL list (wsl -l -v).
  2. Linux Build Dependencies: Your WSL Ubuntu instance must have rpm and build utilities installed. Open your WSL terminal and run:

sudo apt update sudo apt install rpm binutils -y


License

This project is open-source and available under the MIT License.

About

Linux packaging tool utilities (Needs Ubuntu WSL)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors