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 builds both the Debian and RPM package in the dist/
directory. Use --type deb or --type rpm when you only need one format.
The package version is read from src/version.sh in the cloned source tree.
At the start of each build, the builder removes all existing contents from
dist/, so the directory contains only artifacts produced by the current run.
./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 liburing-dev dpkg-dev fakeroot cmake gitIf CMake prints a uring lookup warning while building RocksDB, liburing-dev is the package that usually fixes it. It installs the development files CMake looks for when optional io_uring support is enabled.
Or 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 (version comes from the cloned src/version.sh)
$ ./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_64The source checkout under build/hlquery-src is a disposable build cache.
Before updating or changing the selected Git branch/tag, the builder removes
generated files and local changes from that cached checkout.
# 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:all)--version VER: Package version (default: value from the clonedsrc/version.sh)- 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:1.0)- Examples:
1.0,v1.0.0,unstable,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=1.0
$ 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:
/usr/lib/systemd/system/hlquery.service - SysV compatibility:
/etc/init.d/hlquery
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 - SysV compatibility:
/etc/init.d/hlquery
# Install package
$ sudo ./dist/install-hlquery-deb.sh
# Verify installation
$ systemctl status hlquery
$ sudo /etc/init.d/hlquery status
$ 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.x86_64.rpm
# Or use yum/dnf
$ sudo yum install dist/hlquery-1.0.0.x86_64.rpm
$ sudo dnf install dist/hlquery-1.0.0.x86_64.rpm
# Verify installation
$ systemctl status hlquery
$ sudo /etc/init.d/hlquery status
$ 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 liburing-dev
# RedHat/CentOS/Fedora
sudo dnf install rpm-build dpkg-devCheck package contents:
# Debian
$ dpkg -c dist/hlquery_1.0.0_amd64.deb
# RPM
$ rpm -qlp dist/hlquery-1.0.0.x86_64.rpmFor issues or questions:
