update deb packaging

This commit is contained in:
Aliberk Sandıkçı 2023-08-23 22:54:49 +03:00
parent f4091fc9ae
commit b257abb63f
Signed by: asandikci
GPG key ID: 25C67A03B5666BC1
3 changed files with 26 additions and 25 deletions

View file

@ -1,21 +1,22 @@
REPO_NAME="ahenk-go"
REPO_LINK="https://git.aliberksandikci.com.tr/liderahenk/${REPO_NAME}"
REPO_NAME=ahenk-go
REPO_LINK=https://git.aliberksandikci.com.tr/liderahenk/${REPO_NAME}
DAEMON_NAME="ahenk-go"
OLD_DAEMON_NAME="ahenkd-go"
PYTHON_DAEMON_NAME="ahenkd"
DAEMON_NAME=ahenk-go
OLD_DAEMON_NAME=ahenkd-go
PYTHON_DAEMON_NAME=ahenkd
CONF_DIR="/etc/ahenk-go/"
TEMP_DIR="$(mktemp -d)"
MAIN_DIR="${TEMP_DIR}/${REPO_NAME}/"
DATA_DIR=/etc/ahenk-go/
LIB_DIR=/usr/share/ahenk-go/
PLUGIN_DIR=${LIB_DIR}/plugins/
TEMP_DIR=$(mktemp -d)
MAIN_DIR=${TEMP_DIR}/${REPO_NAME}/
info:
@echo "Made by Aliberk Sandıı - 2023"
@echo "preclean: for cleaning old files, configurations"
@echo "TODO test: Test go files"
@echo "install: Build and install ahenk-go"
@echo "TODO uninstall: Uninstall ahenk-go"
@echo "TODO clean: for postclean"
@echo "install: Build and install ahenk-go to DESTDIR"
@echo "uninstall: Uninstall ahenk-go from DESTDIR"
preclean:
sudo rm -rf /usr/bin/$(DAEMON_NAME)
@ -29,21 +30,22 @@ preclean:
@# TODO
@# echo -e "Do you want to remove python implementation of ahenk if installed in system?"
# read -rp "(Y/N) " input
@# read -rp "(Y/N) " input
@pgrep -x ${PYTHON_DAEMON_NAME} && (sudo killall "${PYTHON_DAEMON_NAME}" || sudo systemctl disable "${PYTHON_DAEMON_NAME}" || sudo systemctl stop "${PYTHON_DAEMON_NAME}") || echo "no ${PYTHON_DAEMON_NAME} found"
sudo systemctl daemon-reload
sudo rm -rf ${CONF_DIR}
sudo rm -rf ${DATA_DIR}
@echo -e "PRE-CLENING DONE\n"
test:
@echo -e "Testing go files not implemented yet!"
install:
go build -o ${DESTDIR}/usr/bin/${REPO_NAME} ./cmd/ahenk-go/
@sudo mkdir -p "${CONF_DIR}"
sudo go build -o ${DESTDIR}/usr/bin/${REPO_NAME} ./cmd/ahenk-go/
@sudo mkdir -p "${DESTDIR}/${LIB_DIR}"
@sudo mkdir -p "${DESTDIR}/${PLUGIN_DIR}"
sudo go build -buildmode=plugin -o ${DESTDIR}/${PLUGIN_DIR}/resources.so ./plugins/resources
@sudo mkdir -p "${DESTDIR}/${DATA_DIR}"
uninstall:
clean: #postclean:
@sudo rm -rf ${DESTDIR}/usr/bin/${REPO_NAME}

3
debian/control vendored
View file

@ -4,7 +4,8 @@ Uploaders: Aliberk Sandıı <asandikci@aliberksandikci.com.tr>
Section: utils
Testsuite: autopkgtest-pkg-go
Priority: optional
Build-Depends: debhelper-compat (= 13),
Build-Depends: debhelper (>= 13),
debhelper-compat (= 10),
dh-golang,
golang-any,
golang-github-sevlyar-go-daemon-dev,

6
debian/rules vendored
View file

@ -1,10 +1,8 @@
#!/usr/bin/make -f
%:
dh $@ --builddirectory=_build --buildsystem=golang --with=golang
dh $@
override_dh_auto_install:
dh_auto_install -- --no-source
# dh_systemd_enable || true
# dh_systemd_start || true
dh_auto_install
dh_installsystemd