debian-package
dgtlmoon 2 months ago
parent 82e0b99b07
commit 397f79ffd5

@ -0,0 +1,48 @@
name: Build Debian Package
# Check status: systemctl status changedetection.io.service
# Get logs: journalctl -u changedetection.io.service
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
build-deb:
runs-on: ubuntu-latest
name: Build and Package changedetection.io
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install Build Dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
devscripts \
dh-virtualenv \
dh-python \
python3-all \
python3-all-dev \
python3.10 \
python3.10-venv \
python3.10-dev \
debhelper-compat
- name: Build the Debian Package
run: |
debuild -us -uc
- name: Upload Debian Package Artifact
uses: actions/upload-artifact@v3
with:
name: changedetection.io-deb-package
path: ../*.deb

@ -0,0 +1,4 @@
from . import main
if __name__ == '__main__':
main()

@ -0,0 +1 @@
./debian/changedetection.io.service

@ -0,0 +1,13 @@
[Unit]
Description=changedetection.io Service
After=network.target
[Service]
User=changedetio
Group=changedetio
WorkingDirectory=/opt/changedetection.io
ExecStart=/opt/changedetection.io/bin/python -m changedetectionio
Restart=on-failure
[Install]
WantedBy=multi-user.target

@ -0,0 +1,13 @@
[Unit]
Description=changedetection.io Service
After=network.target
[Service]
User=changedetio
Group=changedetio
WorkingDirectory=/opt/changedetection.io
ExecStart=/opt/changedetection.io/bin/python -m changedetectionio
Restart=on-failure
[Install]
WantedBy=multi-user.target

@ -0,0 +1,5 @@
changedetection.io (1.0-1) unstable; urgency=medium
* Initial release.
-- Your Name <your.email@example.com> Wed, 01 Nov 2023 12:00:00 +0000

5
debian/changelog vendored

@ -0,0 +1,5 @@
changedetection.io (1.0-1) unstable; urgency=medium
* Initial release.
-- Your Name <your.email@example.com> Wed, 01 Nov 2023 12:00:00 +0000

14
debian/control vendored

@ -0,0 +1,14 @@
Source: changedetection.io
Section: web
Priority: optional
Maintainer: Your Name <your.email@example.com>
Build-Depends: debhelper-compat (= 13), dh-virtualenv, dh-python, python3-all (>= 3.10), python3-all (<< 3.13), python3.10, python3.10-venv
Standards-Version: 4.6.0
Rules-Requires-Root: no
Homepage: https://github.com/dgtlmoon/changedetection.io
Package: changedetection.io
Architecture: all
Depends: ${misc:Depends}, python3 (>= 3.10), python3 (<< 3.13)
Description: Web page change detection - Python application
A web-based application for monitoring web pages for changes.

@ -0,0 +1 @@
changedetection.io

1
debian/install vendored

@ -0,0 +1 @@
debian/changedetection.io.service lib/systemd/system/

23
debian/postinst vendored

@ -0,0 +1,23 @@
#!/bin/sh
set -e
# Determine Python version
PYTHON_VERSION=$(ls /usr/bin/python3.1[0-2] | head -n1 | xargs basename)
# Create 'changedetio' user if it doesn't exist
if ! id "changedetio" >/dev/null 2>&1; then
adduser --system --group --no-create-home changedetio
fi
# Set ownership of the installation directory
chown -R changedetio:changedetio /opt/changedetection.io
# Update the systemd service file if necessary
sed -i "s|ExecStart=.*|ExecStart=/opt/changedetection.io/bin/$PYTHON_VERSION -m changedetectionio|" /lib/systemd/system/changedetection.io.service
# Enable and start the service
systemctl daemon-reload
systemctl enable changedetection.io.service
systemctl start changedetection.io.service
exit 0

11
debian/postrm vendored

@ -0,0 +1,11 @@
#!/bin/sh
set -e
# Remove user on purge
if [ "$1" = "purge" ]; then
deluser --system changedetio
fi
systemctl daemon-reload
exit 0

8
debian/prerm vendored

@ -0,0 +1,8 @@
#!/bin/sh
set -e
# Stop and disable the service
systemctl stop changedetection.io.service
systemctl disable changedetection.io.service
exit 0

12
debian/rules vendored

@ -0,0 +1,12 @@
#!/usr/bin/make -f
%:
dh $@ --with python-virtualenv --buildsystem=pybuild
PYTHON_VERSION := $(shell py3versions -r '>= 3.10 << 3.13' -i)
override_dh_virtualenv:
dh_virtualenv --sourcedirectory=. \
--install-suffix='' \
--requirements=requirements.txt \
--python=/usr/bin/$(PYTHON_VERSION)
Loading…
Cancel
Save