Search beyond keywords - This directory contains scripts and configuration files for building distribution packages (Debian .deb and RPM .rpm) for hlquery.
The package builder clones the requested hlquery branch or tag, builds the source tree with the selected package layout, stages an install tree, and produces native packages in dist/.
Use the package builder when you need reproducible installable artifacts for Debian, Ubuntu, Fedora, RHEL-compatible systems, or other RPM-based distributions. It keeps the build, staging, service files, package metadata, and install scripts in one place instead of requiring manual packaging steps.
./build.shBy default, build.sh auto-detects the current platform and builds the native
package type in the dist/ directory:
- Debian/Ubuntu systems build a
.deb - Fedora/RHEL-compatible systems build an
.rpm - Ambiguous or mixed environments build both package types
./build.sh --type allUse --type all when you want to build both Debian and RPM packages in the
dist/ directory.
# Build only Debian package
$ ./build.sh --type deb
# Build only RPM package
$ ./build.sh --type rpm### Build all packages
$ make
### Build specific package type
$ make deb
$ make rpm
### Clean build directories
$ make cleanInstall on Debian/Ubuntu:
$ sudo apt-get update
$ sudo apt-get install build-essential zlib1g-dev libssl-dev dpkg-dev fakeroot cmake gitOr use the bundled helper:
$ ./install-deps-debian.shInstall on RedHat/CentOS/Fedora:
$ sudo dnf install rpm-build gcc-c++ make openssl-devel zlib-devel cmake git tar gzip perl 'perl(File::Copy)'Or use the bundled helper:
$ ./install-deps-rpm.sh# Build with default settings (clones from GitHub unstable branch)
$ ./build.sh
# Build from a specific Git branch or tag
$ ./build.sh --git-version 1.0.0
# Build with custom package version
$ ./build.sh --version 1.0.0 --release 1
# Build for specific architecture
$ ./build.sh --arch x86_64# Build with all options
$ ./build.sh \
--type all \
--version 1.0.0 \
--git-version v1.0.0 \
--release 1 \
--arch x86_64
# Build from a specific branch
$ ./build.sh --git-version develop --version 1.1.0~dev
# Clean build directories
$ ./build.sh --clean--type TYPE: Package type to build (deb,rpm, orall; default: auto-detect native package type). Use--type allto build both.deband.rpmpackages.--version VER: Package version (default:1.0.0)- Use package-safe values such as
1.0.0or1.0.0~rc1; do not use OS release text such as24.04.4 LTS (Noble Numbat)
- Use package-safe values such as
--git-version VER: Git branch or tag to clone (default:unstable)- Examples:
unstable,1.0.0,v1.0.0,develop
- Examples:
--release REL: Package release number (default:1)--arch ARCH: Target architecture (default: auto-detect)--clean: Clean build directories and exit--help: Show help message
You can also set these via environment variables:
$ export VERSION=1.0.0
$ export GIT_VERSION=unstable
$ export RELEASE=1
$ export ARCH=x86_64
$ export BUILD_MODE=release
$ ./build.shThe Debian package includes:
- Binary files:
/usr/bin/hlquery,/usr/bin/hlquery-cli,/usr/bin/hlquery-wrapper - Configuration:
/etc/hlquery/ - Data directories:
/var/lib/hlquery,/var/log/hlquery,/run/hlquery - Systemd service:
/lib/systemd/system/hlquery.service
The RPM package includes:
- Binary files:
/usr/bin/hlquery,/usr/bin/hlquery-cli,/usr/bin/hlquery-wrapper - Configuration:
/etc/hlquery/ - Data directories:
/var/lib/hlquery,/var/log/hlquery,/run/hlquery - Systemd service:
/usr/lib/systemd/system/hlquery.service
# Install package
$ sudo ./dist/install-hlquery-deb.sh
# Verify installation
$ systemctl status hlquery
$ hlquery-wrapper statusThe generated install helper sets Debian's standard root paths before invoking dpkg, which avoids install failures in minimal shells where /usr/sbin or /sbin are missing from PATH.
# Install package
$ sudo rpm -ivh dist/hlquery-1.0.0-1.x86_64.rpm
# Or use yum/dnf
$ sudo yum install dist/hlquery-1.0.0-1.x86_64.rpm
$ sudo dnf install dist/hlquery-1.0.0-1.x86_64.rpm
# Verify installation
$ systemctl status hlquery
$ hlquery-wrapper statusThe build process follows these steps:
- Clone Source: Clones hlquery source code from GitHub (https://github.com/hlquery/hlquery)
- Source Build: Configures the source tree for the target packaging layout and compiles hlquery
- Installation: Installs files into a staged filesystem tree using
DESTDIR - Package Creation: Creates package structure and metadata
- Package Building: Builds the final package file
The build script automatically clones the specified version from GitHub, so you don't need the source code locally.
build.sh: Main build script that orchestrates the build processbuild-deb.sh: Builds Debian packagesbuild-rpm.sh: Builds RPM packages
Edit the variables in build.sh:
PACKAGE_NAME="hlquery"
MAINTAINER="Your Name <your.email@example.com>"
DESCRIPTION="Your custom description"
URL="https://your-website.com"Modify the respective build scripts:
- Debian: Edit
build-deb.shto add files to$DEB_DIR - RPM: Edit
build-rpm.shspec file to add files to%filessection
Edit the package control files:
- Debian: Modify
Depends:inbuild-deb.sh - RPM: Modify
Requires:inbuild-rpm.shspec file
Install required build tools:
# Debian/Ubuntu
sudo apt-get install dpkg-dev fakeroot rpm-build
# RedHat/CentOS/Fedora
sudo dnf install rpm-build dpkg-devCheck package contents:
# Debian
$ dpkg -c dist/hlquery_1.0.0-1_amd64.deb
# RPM
$ rpm -qlp dist/hlquery-1.0.0-1.x86_64.rpmFor issues or questions:
