diff --git a/build-aux/post-install.sh b/build-aux/post-install.sh new file mode 100644 index 0000000..9713074 --- /dev/null +++ b/build-aux/post-install.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +datadir=$1 + +# Package managers set this so we don't need to run +if [ -z "$DESTDIR" ]; then + echo Compiling GSettings schemas... + glib-compile-schemas ${datadir}/glib-2.0/schemas +fi + diff --git a/build-aux/resize.py b/build-aux/resize.py new file mode 100755 index 0000000..d56d78f --- /dev/null +++ b/build-aux/resize.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python3 + +import os, sys + +icon_class = [ + '16x16', + '24x24', + '32x32', + '48x48', + '256x256', + '512x512', +] + +magick = sys.argv[1] +input_file = sys.argv[2] +output = sys.argv[3] + +for iclass in icon_class: + outdir = os.path.join(output, iclass, 'apps') + outfile = os.path.join(outdir, 'net.buzzert.kordophone.png') + + os.makedirs(outdir, exist_ok=True) + os.system('{magick} {input} -resize {klass} {outfile}' + .format(magick=magick, input=input_file, klass=iclass, outfile=outfile)) + + diff --git a/dist/rpm/kordophone.spec b/dist/rpm/kordophone.spec new file mode 100644 index 0000000..044f011 --- /dev/null +++ b/dist/rpm/kordophone.spec @@ -0,0 +1,57 @@ +Name: kordophone +Version: 1.0.0 +Release: 1%{?dist} +Summary: GTK4/Libadwaita client for Kordophone + +License: GPL +URL: https://git.sr.ht/~buzzert/kordophone-2-gtk +# Source0: %{name}-%{version}.tar.gz + +BuildRequires: meson >= 0.56.0 +BuildRequires: vala +BuildRequires: gcc +BuildRequires: pkgconfig(gtk4) +BuildRequires: pkgconfig(libadwaita-1) +BuildRequires: pkgconfig(gio-2.0) +BuildRequires: pkgconfig(gee-0.8) +BuildRequires: pkgconfig(gio-unix-2.0) +BuildRequires: pkgconfig(libsecret-1) + +Requires: gtk4 +Requires: libadwaita +Requires: glib2 +Requires: libgee +Requires: libsecret +Requires: kordophoned >= 1.0.0 + +%description +A GTK4/Libadwaita Linux Client for the Kordophone client daemon. + +%prep +if [ ! -d .git ]; then + git clone --bare https://git.sr.ht/~buzzert/kordophone-2-gtk .git + git config --local --bool core.bare false + git reset --hard +fi + +%build +%meson +%meson_build + +%install +%meson_install + +%files +%{_bindir}/kordophone +%{_datadir}/applications/net.buzzert.kordophone.desktop +%{_datadir}/icons/ +%{_datadir}/icons/hicolor/16x16/apps/net.buzzert.kordophone.png +%{_datadir}/icons/hicolor/24x24/apps/net.buzzert.kordophone.png +%{_datadir}/icons/hicolor/32x32/apps/net.buzzert.kordophone.png +%{_datadir}/icons/hicolor/48x48/apps/net.buzzert.kordophone.png +%{_datadir}/icons/hicolor/256x256/apps/net.buzzert.kordophone.png +%{_datadir}/icons/hicolor/512x512/apps/net.buzzert.kordophone.png +%{_datadir}/icons/net.buzzert.kordophone.png + +%changelog +- Initial RPM package diff --git a/src/meson.build b/src/meson.build index f60fed6..f8b1e8e 100644 --- a/src/meson.build +++ b/src/meson.build @@ -8,12 +8,46 @@ dependencies = [ ] gnome = import('gnome') +kp_prefix = get_option('prefix') +datadir = join_paths(kp_prefix, get_option('datadir')) resources = gnome.compile_resources( 'kordophone-resources', 'resources/kordophone.gresource.xml', source_dir: 'resources' ) +# Icons +app_icon_dirs = [ + '16x16', + '24x24', + '32x32', + '48x48', + '256x256', + '512x512', +] + +build_tools_dir = meson.source_root() / 'build-aux' + +image_magick = find_program('magick', required : true) +resizer = find_program(build_tools_dir / 'resize.py') +icons = custom_target('icons', + output: 'hicolor', + input: 'resources/net.buzzert.kordophone.png', + command: [resizer, image_magick, '@INPUT@', '@OUTPUT@'], + install: true, + install_dir: join_paths(datadir, 'icons'), +) + +# Full res icon for Desktop Entry +install_data('resources/net.buzzert.kordophone.png', + install_dir: join_paths(datadir, 'icons'), +) + +# Desktop +install_data('resources/net.buzzert.kordophone.desktop', + install_dir: join_paths(datadir, 'applications') +) + sources = [ 'application/kordophone-application.vala', 'application/main-window.vala', @@ -49,8 +83,9 @@ sources = [ executable('kordophone', sources, resources, + icons, dependencies : dependencies, vala_args: ['--pkg', 'posix'], link_args: ['-lm'], install : true -) \ No newline at end of file +) diff --git a/src/resources/net.buzzert.kordophone.desktop b/src/resources/net.buzzert.kordophone.desktop new file mode 100644 index 0000000..025218d --- /dev/null +++ b/src/resources/net.buzzert.kordophone.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Type=Application +Encoding=UTF-8 +Name=Kordophone +Comment=Kordophone GTK Client +Exec=kordophone +Icon=net.buzzert.kordophone.png +Terminal=false + diff --git a/src/resources/net.buzzert.kordophone.png b/src/resources/net.buzzert.kordophone.png new file mode 100644 index 0000000..be1261d Binary files /dev/null and b/src/resources/net.buzzert.kordophone.png differ