-
-
Notifications
You must be signed in to change notification settings - Fork 580
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8a94220
commit 2a46fdd
Showing
13 changed files
with
210 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
sonic (0.0.0-1) UNRELEASED; urgency=medium | ||
|
||
* Initial release. | ||
|
||
-- Valerian Saliou <[email protected]> Tue, 31 Aug 2023 12:00:00 +0000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Source: sonic | ||
Section: net | ||
Priority: ext | ||
Maintainer: Valerian Saliou <[email protected]> | ||
Standards-Version: 3.9.4 | ||
Build-Depends: wget, ca-certificates | ||
Homepage: https://github.com/valeriansaliou/sonic | ||
|
||
Package: sonic | ||
Architecture: any | ||
Depends: adduser | ||
Provides: sonic | ||
Description: Fast, lightweight & schema-less search backend. An alternative to Elasticsearch that runs on a few MBs of RAM. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ | ||
Upstream-Name: sonic | ||
Upstream-Contact: Valerian Saliou <[email protected]> | ||
Source: https://github.com/valeriansaliou/sonic | ||
|
||
Files: * | ||
Copyright: 2023 Valerian Saliou | ||
License: MPL-2 | ||
|
||
License: MPL-2 | ||
This Source Code Form is subject to the terms of the Mozilla Public License, | ||
v. 2.0. If a copy of the MPL was not distributed with this file, | ||
You can obtain one at http://mozilla.org/MPL/2.0/. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/make -f | ||
|
||
DISTRIBUTION = $(shell lsb_release -sr) | ||
VERSION = 1.4.2 | ||
PACKAGEVERSION = $(VERSION)-0~$(DISTRIBUTION)0 | ||
URL = https://github.com/valeriansaliou/sonic/releases/download/v$(VERSION)/ | ||
|
||
%: | ||
dh $@ --with systemd | ||
|
||
override_dh_auto_clean: | ||
override_dh_auto_test: | ||
override_dh_auto_build: | ||
override_dh_auto_install: | ||
$(eval ENV_ARCH := $(shell dpkg --print-architecture)) | ||
$(eval ENV_ISA := $(shell if [ "$(ENV_ARCH)" = "amd64" ]; then echo "x86_64"; else echo "$(ENV_ARCH)"; fi)) | ||
$(eval ENV_TARBALL := v$(VERSION)-$(ENV_ISA)-gnu.tar.gz) | ||
|
||
echo "Architecture: $(ENV_ARCH)" | ||
echo "Instruction Set: $(ENV_ISA)" | ||
echo "Target: $(URL)$(ENV_TARBALL)" | ||
|
||
wget -N --progress=dot:mega $(URL)$(ENV_TARBALL) | ||
tar -xf $(ENV_TARBALL) | ||
strip sonic/sonic | ||
mv sonic/config.cfg sonic/sonic.cfg | ||
mkdir sonic/store/ | ||
sed -i 's/path = ".\/data\/store\//path = "\/var\/lib\/sonic\/store\//g' sonic/sonic.cfg | ||
|
||
override_dh_gencontrol: | ||
dh_gencontrol -- -v$(PACKAGEVERSION) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
sonic/sonic usr/bin/ | ||
sonic/sonic.cfg etc/ | ||
sonic/store/ var/lib/sonic/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
case "$1" in | ||
configure) | ||
adduser --system --disabled-password --disabled-login --home /var/empty \ | ||
--no-create-home --quiet --group sonic && \ | ||
chown sonic:sonic -R /var/lib/sonic/ | ||
;; | ||
esac | ||
|
||
#DEBHELPER# | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[Unit] | ||
Description=Sonic Search Index | ||
After=network.target | ||
|
||
[Service] | ||
Type=simple | ||
User=sonic | ||
Group=sonic | ||
ExecStart=/usr/bin/sonic -c /etc/sonic.cfg | ||
Restart=on-failure | ||
LimitNOFILE=infinity | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.0 (quilt) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/bin/bash | ||
|
||
## | ||
# Sonic | ||
# | ||
# Fast, lightweight and schema-less search backend | ||
# Copyright: 2023, Valerian Saliou <[email protected]> | ||
# License: Mozilla Public License v2.0 (MPL v2.0) | ||
## | ||
|
||
# Define build pipeline | ||
function build_for_target { | ||
OS="$2" DIST="$3" ARCH="$1" ./packpack/packpack | ||
release_result=$? | ||
|
||
if [ $release_result -eq 0 ]; then | ||
mkdir -p "./packages/$2_$3/" | ||
mv ./build/*$4 "./packages/$2_$3/" | ||
|
||
echo "Result: Packaged architecture: $1 for OS: $2:$3 (*$4)" | ||
fi | ||
|
||
return $release_result | ||
} | ||
|
||
# Run release tasks | ||
ABSPATH=$(cd "$(dirname "$0")"; pwd) | ||
BASE_DIR="$ABSPATH/../" | ||
|
||
rc=0 | ||
|
||
pushd "$BASE_DIR" > /dev/null | ||
echo "Executing packages build steps for Sonic..." | ||
|
||
# Initialize `packpack` | ||
rm -rf ./packpack && \ | ||
git clone https://github.com/packpack/packpack.git packpack | ||
rc=$? | ||
|
||
# Proceed build for each target? | ||
if [ $rc -eq 0 ]; then | ||
build_for_target "x86_64" "debian" "bookworm" ".deb" | ||
rc=$? | ||
fi | ||
|
||
# Cleanup environment | ||
rm -rf ./build ./packpack | ||
|
||
if [ $rc -eq 0 ]; then | ||
echo "Success: Done executing packages build steps for Sonic" | ||
else | ||
echo "Error: Failed executing packages build steps for Sonic" | ||
fi | ||
popd > /dev/null | ||
|
||
exit $rc |