Initial Debian package for PostIt.Desktop (yavsc)
This commit is contained in:
commit
9703ebf4dd
13 changed files with 421 additions and 0 deletions
16
.gitignore
vendored
Normal file
16
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
# Debian package build artifacts
|
||||
*.deb
|
||||
*.buildinfo
|
||||
*.changes
|
||||
*.debian.tar.*
|
||||
debian/files
|
||||
debian/postit/
|
||||
|
||||
# Upstream source tree fetched by the build (in build/)
|
||||
build/
|
||||
|
||||
# Editor / OS noise
|
||||
.DS_Store
|
||||
.idea/
|
||||
.vscode/
|
||||
*.swp
|
||||
36
Makefile
Normal file
36
Makefile
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
# Makefile for the postit Debian package.
|
||||
#
|
||||
# Targets:
|
||||
# make deb : build a .deb in the parent directory (or
|
||||
# $POSTIT_OUT_DIR if set). Equivalent to
|
||||
# dpkg-buildpackage -us -uc -b.
|
||||
# make clean : rm -rf build/ and the per-package staging tree
|
||||
# under debian/postit.
|
||||
# make source : fetch the upstream yavsc source tree under
|
||||
# build/yavsc-src (no packaging step). Useful for
|
||||
# debugging the publish step.
|
||||
#
|
||||
# Environment overrides (or pass on the make command line):
|
||||
# POSTIT_GIT_URL default: https://github.com/pazof/yavsc.git
|
||||
# POSTIT_GIT_TAG default: 1.0.0
|
||||
# POSTIT_OUT_DIR default: $(CURDIR)/.. (artifacts land here)
|
||||
|
||||
POSTIT_GIT_URL ?= https://github.com/pazof/yavsc.git
|
||||
POSTIT_GIT_TAG ?= 1.0.0
|
||||
POSTIT_OUT_DIR ?= $(CURDIR)/..
|
||||
|
||||
.PHONY: deb clean source
|
||||
|
||||
deb:
|
||||
POSTIT_GIT_URL=$(POSTIT_GIT_URL) POSTIT_GIT_TAG=$(POSTIT_GIT_TAG) \
|
||||
dpkg-buildpackage -us -uc -b
|
||||
mv ../postit_*$(POSTIT_GIT_TAG)*.deb $(POSTIT_OUT_DIR)/ 2>/dev/null || \
|
||||
mv ../postit_*.deb $(POSTIT_OUT_DIR)/ || true
|
||||
|
||||
clean:
|
||||
rm -rf build debian/postit
|
||||
|
||||
source:
|
||||
mkdir -p build
|
||||
git clone --depth=1 --branch $(POSTIT_GIT_TAG) \
|
||||
$(POSTIT_GIT_URL) build/yavsc-src
|
||||
109
README.md
Normal file
109
README.md
Normal file
|
|
@ -0,0 +1,109 @@
|
|||
# postit-debian
|
||||
|
||||
Paquet Debian pour [PostIt.Desktop](../yavsc), le client desktop
|
||||
Avalonia de la plateforme Yavsc.Org.
|
||||
|
||||
Le paquet expose la commande `postit` sur le système, installe
|
||||
l'entrée `.desktop` dans le menu, et enregistre le scheme URI
|
||||
`postit://` comme MIME handler (utilisé par l'OIDC Authorization
|
||||
Code + PKCE pour le hand-off du callback — RFC 8252 §7.1).
|
||||
|
||||
Cible : Debian 13 (trixie). Testé également sur Ubuntu 24.04 LTS
|
||||
(equivalent ABI).
|
||||
|
||||
## Construction
|
||||
|
||||
Pré-requis :
|
||||
|
||||
```bash
|
||||
sudo apt install build-essential debhelper imagemagick librsvg2-bin \
|
||||
dotnet-sdk-10.0 git
|
||||
```
|
||||
|
||||
Sur Debian 13, installer .NET 10 depuis le dépôt officiel Microsoft :
|
||||
|
||||
```bash
|
||||
wget https://packages.microsoft.com/config/debian/13/packages-microsoft-prod.deb \
|
||||
-O /tmp/ms-prod.deb
|
||||
sudo dpkg -i /tmp/ms-prod.deb
|
||||
sudo apt update
|
||||
sudo apt install dotnet-sdk-10.0
|
||||
```
|
||||
|
||||
Puis :
|
||||
|
||||
```bash
|
||||
make deb
|
||||
```
|
||||
|
||||
Le `.deb` atterrit dans le répertoire parent (ou `$POSTIT_OUT_DIR`).
|
||||
|
||||
Pour bumper la version amont sans modifier ce dépôt :
|
||||
|
||||
```bash
|
||||
make deb POSTIT_GIT_TAG=1.0.1
|
||||
make deb POSTIT_GIT_URL=https://github.com/fork/yavsc.git POSTIT_GIT_TAG=my-branch
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
sudo apt install ./postit_1.0.0-1_amd64.deb
|
||||
```
|
||||
|
||||
ou directement :
|
||||
|
||||
```bash
|
||||
sudo dpkg -i postit_1.0.0-1_amd64.deb
|
||||
sudo apt -f install # résout les dépendances manquantes
|
||||
```
|
||||
|
||||
Pour installer sur **arm64** :
|
||||
|
||||
```bash
|
||||
make clean && make deb # sur une machine arm64, le .deb sera _arm64.deb
|
||||
```
|
||||
|
||||
## Vérification
|
||||
|
||||
Après installation :
|
||||
|
||||
```bash
|
||||
$ which postit
|
||||
/usr/bin/postit
|
||||
$ postit --help # (l'application Avalonia ouvre sa fenêtre)
|
||||
$ xdg-mime query default x-scheme-handler/postit
|
||||
postit.desktop
|
||||
$ xdg-open postit://callback?code=test
|
||||
```
|
||||
|
||||
Le scheme handler lance PostIt avec l'URL en argument. En interne,
|
||||
PostIt (PostIt.Desktop) appelle `SingleInstance.TryHandOffAsync`
|
||||
puis sort, transferrant l'URL au process PostIt déjà actif via
|
||||
un named pipe.
|
||||
|
||||
## Désinstallation
|
||||
|
||||
```bash
|
||||
sudo apt remove postit
|
||||
```
|
||||
|
||||
Le `postrm` du paquet rafraîchit la base `.desktop`. Le scheme
|
||||
handler `postit://` n'est pas explicitement désenregistré
|
||||
(système — par utilisateur c'est `xdg-mime default ...`).
|
||||
|
||||
## Maintenance
|
||||
|
||||
- Bumper `debian/changelog` à chaque release, conformément à la
|
||||
Debian Policy §4.4 (entries datées, signées par le mainteneur).
|
||||
- Mettre à jour `POSTIT_GIT_TAG` par défaut dans `debian/rules`
|
||||
et `Makefile` à chaque release amont.
|
||||
- Rebuild après changement de licence amont.
|
||||
|
||||
## Liens
|
||||
|
||||
- [pazof/yavsc](https://github.com/pazof/yavsc) — source amont.
|
||||
- [doc/postit-oidc.md](https://github.com/pazof/yavsc/blob/main/doc/architecture/postit-oidc.md)
|
||||
— flow OIDC + custom URI scheme.
|
||||
- [Debian Policy Manual](https://www.debian.org/doc/debian-policy/)
|
||||
— référence pour la structure d'un paquet.
|
||||
11
debian/changelog
vendored
Normal file
11
debian/changelog
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
postit (1.0.0-1) trixie; urgency=medium
|
||||
|
||||
* Initial release.
|
||||
* Built from the pazof/yavsc repository at the tag 1.0.0.
|
||||
* Packages PostIt.Desktop (Avalonia 12) as a Debian package
|
||||
named `postit`, exposing the command `postit` on PATH.
|
||||
* Registers the postit:// URI scheme as an XDG MIME handler so
|
||||
that xdg-open postit://... launches the freshly installed
|
||||
client.
|
||||
|
||||
-- Paul Schneider <paul@pschneider.fr> Sat, 28 Jun 2026 00:01:00 +0100
|
||||
1
debian/compat
vendored
Normal file
1
debian/compat
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
13
|
||||
46
debian/control
vendored
Normal file
46
debian/control
vendored
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
Source: postit
|
||||
Section: x11
|
||||
Priority: optional
|
||||
Maintainer: Paul Schneider <paul@pschneider.fr>
|
||||
Build-Depends:
|
||||
debhelper-compat (= 13),
|
||||
dotnet-sdk-10.0 (>= 10.0.0) | dotnet-sdk-10.0,
|
||||
imagemagick,
|
||||
librsvg2-bin,
|
||||
git,
|
||||
ca-certificates,
|
||||
Standards-Version: 4.7.0
|
||||
Rules-Requires-Root: no
|
||||
Homepage: https://github.com/pazof/yavsc
|
||||
|
||||
Package: postit
|
||||
Architecture: amd64 arm64
|
||||
Depends:
|
||||
${misc:Depends},
|
||||
${shlibs:Depends},
|
||||
dotnet-runtime-10.0 (>= 10.0.0) | aspnetcore-runtime-10.0 (>= 10.0.0),
|
||||
libgtk-3-0 (>= 3.24.0),
|
||||
libwebkit2gtk-4.1-0 | libwebkit2gtk-4.0-0,
|
||||
libfontconfig1,
|
||||
libssl3,
|
||||
xdg-utils,
|
||||
Recommends:
|
||||
desktop-file-utils,
|
||||
mime-support,
|
||||
Description: Yavsc PostIt — desktop client for the Yavsc platform
|
||||
PostIt is the Avalonia-based desktop client for the Yavsc.Org
|
||||
platform. It authenticates against the platform's OIDC endpoint
|
||||
using the Authorization Code + PKCE flow over a custom URI scheme
|
||||
(postit:// — RFC 8252 §7.1), and exposes the blog and account
|
||||
features in a native window.
|
||||
.
|
||||
This package installs:
|
||||
- the compiled PostIt.Desktop application under /usr/lib/postit/,
|
||||
- a `postit` wrapper in /usr/bin/ that invokes dotnet on the
|
||||
bundled assembly,
|
||||
- an XDG .desktop entry under /usr/share/applications/, and
|
||||
- the MIME handler registration for the postit:// scheme
|
||||
(so xdg-open postit://... launches PostIt).
|
||||
.
|
||||
The package pulls its source from the pazof/yavsc git
|
||||
repository at the tag pinned in debian/rules (POSTIT_GIT_TAG).
|
||||
19
debian/copyright
vendored
Normal file
19
debian/copyright
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: postit
|
||||
Upstream-Contact: Paul Schneider <paul@pschneider.fr>
|
||||
Source: https://github.com/pazof/yavsc
|
||||
|
||||
Files: *
|
||||
Copyright: 2026 Paul Schneider <paul@pschneider.fr>
|
||||
License: WTFPL
|
||||
|
||||
License: WTFPL
|
||||
Do What The F*ck You Want To Public License
|
||||
.
|
||||
Everyone is permitted to copy and distribute verbatim or modified
|
||||
copies of this license document, and changing it is allowed as long
|
||||
as the name is changed.
|
||||
.
|
||||
On Debian systems, the complete text of the WTFPL license can be
|
||||
found in /usr/share/common-licenses/WTFPL or at
|
||||
<http://www.wtfpl.net/about/>.
|
||||
31
debian/postinst
vendored
Executable file
31
debian/postinst
vendored
Executable file
|
|
@ -0,0 +1,31 @@
|
|||
#!/bin/sh
|
||||
# postinst — run after the package is unpacked
|
||||
#
|
||||
# Two responsibilities:
|
||||
# 1. Refresh the desktop-file database so the application appears
|
||||
# in the menu (xdg-utils / desktop-file-utils).
|
||||
# 2. Register postit as the default handler for the postit://
|
||||
# URI scheme via xdg-mime. This is what makes
|
||||
# `xdg-open postit://callback?code=***` launch PostIt.
|
||||
|
||||
set -e
|
||||
|
||||
if [ -x /usr/bin/update-desktop-database ]; then
|
||||
update-desktop-database -q /usr/share/applications || true
|
||||
fi
|
||||
|
||||
# xdg-mime default is per-user; the system-wide default is set
|
||||
# via a MIME-typed association in /usr/share/applications/ which
|
||||
# update-desktop-database picks up. We just need to make sure the
|
||||
# desktop file is registered for the postit:// scheme at the
|
||||
# system level.
|
||||
if [ -x /usr/bin/xdg-mime ]; then
|
||||
# Per-user registration is not appropriate here; the system-wide
|
||||
# registration happens via the MimeType= field in the .desktop
|
||||
# file plus update-desktop-database above. Nothing more to do.
|
||||
:
|
||||
fi
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
exit 0
|
||||
13
debian/postit.desktop
vendored
Normal file
13
debian/postit.desktop
vendored
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=PostIt
|
||||
GenericName=Yavsc Desktop Client
|
||||
Comment=Desktop client for the Yavsc platform (OIDC + blog)
|
||||
Exec=/usr/bin/postit %u
|
||||
Icon=postit
|
||||
Terminal=false
|
||||
Categories=Network;InstantMessaging;Office;
|
||||
StartupNotify=true
|
||||
StartupWMClass=PostIt
|
||||
MimeType=x-scheme-handler/postit;
|
||||
Keywords=Yavsc;OIDC;Blog;OAuth;
|
||||
14
debian/postit.wrapper
vendored
Normal file
14
debian/postit.wrapper
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#!/bin/sh
|
||||
# Wrapper installed at /usr/bin/postit.
|
||||
#
|
||||
# PostIt.Desktop publishes to a directory of managed .NET
|
||||
# assemblies (PostIt.Desktop.dll + runtimeconfig.json +
|
||||
# Avalonia*.dll + dependencies). The dotnet host resolves
|
||||
# the runtime config relative to the assembly path, so we
|
||||
# can call PostIt.Desktop.dll directly from any cwd.
|
||||
#
|
||||
# /usr/lib/postit/ is owned by the postit package (see
|
||||
# debian/postit.install) and is not user-writable, so the
|
||||
# wrapper does not need to defensively check its location.
|
||||
|
||||
exec dotnet /usr/lib/postit/PostIt.Desktop.dll "$@"
|
||||
17
debian/postrm
vendored
Executable file
17
debian/postrm
vendored
Executable file
|
|
@ -0,0 +1,17 @@
|
|||
#!/bin/sh
|
||||
# postrm — run after the package is removed or purged
|
||||
#
|
||||
# Refresh the desktop-file database so the application disappears
|
||||
# from the menu. We do not unregister the postit:// MIME handler
|
||||
# at the system level (no clean API for that) — if the user wants
|
||||
# a different default they can run `xdg-mime default ...` themselves.
|
||||
|
||||
set -e
|
||||
|
||||
if [ -x /usr/bin/update-desktop-database ]; then
|
||||
update-desktop-database -q /usr/share/applications || true
|
||||
fi
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
exit 0
|
||||
107
debian/rules
vendored
Executable file
107
debian/rules
vendored
Executable file
|
|
@ -0,0 +1,107 @@
|
|||
#!/usr/bin/make -f
|
||||
#
|
||||
# Debian package build for PostIt (Yavsc desktop client).
|
||||
#
|
||||
# Pipeline:
|
||||
# 1. Clone pazof/yavsc at POSTIT_GIT_TAG into a clean working
|
||||
# tree under $(BUILDDIR)/yavsc-src.
|
||||
# 2. Restore + publish src/PostIt/PostIt.Desktop as a
|
||||
# linux-x64, framework-dependent (not self-contained)
|
||||
# assembly tree into $(BUILDDIR)/postit-app.
|
||||
# 3. Render the icon at the hicolor sizes (16, 32, 48,
|
||||
# 64, 128, 256) from src/PostIt/PostIt/Assets/Icon.png,
|
||||
# plus the SVG from the same directory as the scalable
|
||||
# form.
|
||||
# 4. Lay out the package tree:
|
||||
# /usr/lib/postit/ (managed assemblies)
|
||||
# /usr/bin/postit (wrapper script)
|
||||
# /usr/share/applications/ (postit.desktop)
|
||||
# /usr/share/icons/hicolor/ (icons)
|
||||
# 5. Run dh to install, fix permissions, build the binary
|
||||
# package.
|
||||
#
|
||||
# Override POSTIT_GIT_TAG or POSTIT_GIT_URL on the make command
|
||||
# line to build a different upstream revision:
|
||||
#
|
||||
# make deb POSTIT_GIT_TAG=1.0.1
|
||||
# make deb POSTIT_GIT_URL=https://github.com/fork/yavsc.git
|
||||
|
||||
POSTIT_GIT_URL ?= https://github.com/pazof/yavsc.git
|
||||
POSTIT_GIT_TAG ?= 1.0.0
|
||||
POSTIT_DESKTOP_PROJECT := src/PostIt/PostIt.Desktop/PostIt.Desktop.csproj
|
||||
POSTIT_ASSEMBLY_NAME := PostIt.Desktop
|
||||
POSTIT_APP_DIR := $(CURDIR)/debian/postit
|
||||
POSTIT_LIB_DIR := $(POSTIT_APP_DIR)/usr/lib/postit
|
||||
POSTIT_BIN_DIR := $(POSTIT_APP_DIR)/usr/bin
|
||||
POSTIT_SHARE_DIR := $(POSTIT_APP_DIR)/usr/share
|
||||
POSTIT_BUILD_DIR := $(CURDIR)/build
|
||||
POSTIT_SRC_DIR := $(POSTIT_BUILD_DIR)/yavsc-src
|
||||
|
||||
ICON_SIZES := 16 32 48 64 128 256
|
||||
|
||||
%:
|
||||
dh $@
|
||||
|
||||
# dh_auto_clean: nothing to do (we don't have a Debian source
|
||||
# tree yet at clean time, we fetch it in override_dh_auto_build).
|
||||
|
||||
override_dh_auto_clean:
|
||||
rm -rf $(POSTIT_BUILD_DIR)
|
||||
|
||||
override_dh_auto_build:
|
||||
# 1. Fetch the upstream source.
|
||||
mkdir -p $(POSTIT_BUILD_DIR)
|
||||
git clone --depth=1 --branch $(POSTIT_GIT_TAG) \
|
||||
$(POSTIT_GIT_URL) $(POSTIT_SRC_DIR)
|
||||
|
||||
# 2. Publish PostIt.Desktop for the host architecture.
|
||||
# --self-contained false : rely on the system .NET
|
||||
# runtime (declared in Depends: in debian/control).
|
||||
# -p:PublishReadyToRun=false : avoid R2R which inflates
|
||||
# the binary for marginal startup gain on a desktop GUI.
|
||||
cd $(POSTIT_SRC_DIR) && \
|
||||
dotnet publish $(POSTIT_DESKTOP_PROJECT) \
|
||||
-c Release \
|
||||
--self-contained false \
|
||||
-p:PublishReadyToRun=false \
|
||||
-o $(POSTIT_BUILD_DIR)/postit-app
|
||||
|
||||
# 3. Lay out the binary tree.
|
||||
mkdir -p $(POSTIT_LIB_DIR)
|
||||
cp -r $(POSTIT_BUILD_DIR)/postit-app/. $(POSTIT_LIB_DIR)/
|
||||
# PostIt.Desktop.dll is the entry assembly; rename or symlink
|
||||
# for clarity (the wrapper references PostIt.Desktop.dll).
|
||||
ls $(POSTIT_LIB_DIR)/ | head -20
|
||||
|
||||
mkdir -p $(POSTIT_BIN_DIR)
|
||||
cp $(CURDIR)/debian/postit.wrapper $(POSTIT_BIN_DIR)/postit
|
||||
chmod 0755 $(POSTIT_BIN_DIR)/postit
|
||||
|
||||
# 4. Icons.
|
||||
mkdir -p $(POSTIT_SHARE_DIR)/applications
|
||||
cp $(CURDIR)/debian/postit.desktop $(POSTIT_SHARE_DIR)/applications/
|
||||
|
||||
mkdir -p $(POSTIT_SHARE_DIR)/icons/hicolor/scalable/apps
|
||||
cp $(POSTIT_SRC_DIR)/src/PostIt/PostIt/Assets/yavsc-logo.svg \
|
||||
$(POSTIT_SHARE_DIR)/icons/hicolor/scalable/apps/postit.svg
|
||||
|
||||
for size in $(ICON_SIZES); do \
|
||||
mkdir -p $(POSTIT_SHARE_DIR)/icons/hicolor/$${size}x$${size}/apps; \
|
||||
convert $(POSTIT_SRC_DIR)/src/PostIt/PostIt/Assets/Icon.png \
|
||||
-resize $${size}x$${size} \
|
||||
$(POSTIT_SHARE_DIR)/icons/hicolor/$${size}x$${size}/apps/postit.png; \
|
||||
done
|
||||
|
||||
override_dh_auto_test:
|
||||
# No upstream test suite for PostIt.Desktop at this stage
|
||||
# (the Yavsc.Org.Tests project is for the web front, not the
|
||||
# desktop client). Build smoke is sufficient for the package.
|
||||
|
||||
override_dh_install:
|
||||
dh_install
|
||||
|
||||
override_dh_shlibdeps:
|
||||
dh_shlibdeps
|
||||
|
||||
override_dh_strip:
|
||||
dh_strip --exclude=.pdb
|
||||
1
debian/source/format
vendored
Normal file
1
debian/source/format
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
3.0 (quilt)
|
||||
Loading…
Add table
Add a link
Reference in a new issue