mirror of
https://github.com/jahruz67/wisp-open.git
synced 2026-08-08 18:14:08 +00:00
Merge pull request #8 from jahruz67/codex/enhance-rpm-package-for-better-installation
Improve Linux package app store integration
This commit is contained in:
@@ -31,7 +31,9 @@ Install the RPM with the distribution package manager:
|
|||||||
sudo dnf install ./wis-free-v3-<version>-1.x86_64.rpm
|
sudo dnf install ./wis-free-v3-<version>-1.x86_64.rpm
|
||||||
```
|
```
|
||||||
|
|
||||||
For openSUSE, use `sudo zypper install ./wis-free-v3-<version>.x86_64.rpm`.
|
Uninstall it from a terminal with `sudo dnf remove wis-free-v3`. The RPM also ships desktop and AppStream metadata so graphical software centers such as GNOME Software can show the package as an app and offer install/uninstall actions for the local RPM.
|
||||||
|
|
||||||
|
For openSUSE, use `sudo zypper install ./wis-free-v3-<version>.x86_64.rpm` and `sudo zypper remove wis-free-v3`.
|
||||||
|
|
||||||
After installing, launch **WIS Free V3** from the application launcher or run `wis-free-v3` in a terminal. A reboot is not required.
|
After installing, launch **WIS Free V3** from the application launcher or run `wis-free-v3` in a terminal. A reboot is not required.
|
||||||
|
|
||||||
|
|||||||
@@ -196,6 +196,7 @@ rm -rf "$WORK_DIR"
|
|||||||
mkdir -p "$WORK_DIR/root/usr/bin"
|
mkdir -p "$WORK_DIR/root/usr/bin"
|
||||||
mkdir -p "$WORK_DIR/root/usr/share/applications"
|
mkdir -p "$WORK_DIR/root/usr/share/applications"
|
||||||
mkdir -p "$WORK_DIR/root/usr/share/pixmaps"
|
mkdir -p "$WORK_DIR/root/usr/share/pixmaps"
|
||||||
|
mkdir -p "$WORK_DIR/root/usr/share/metainfo"
|
||||||
mkdir -p "$WORK_DIR/root/usr/share/doc/$APP_NAME"
|
mkdir -p "$WORK_DIR/root/usr/share/doc/$APP_NAME"
|
||||||
mkdir -p "$DIST_DIR"
|
mkdir -p "$DIST_DIR"
|
||||||
|
|
||||||
@@ -221,6 +222,32 @@ Icon=$APP_NAME
|
|||||||
StartupWMClass=$APP_NAME
|
StartupWMClass=$APP_NAME
|
||||||
Terminal=false
|
Terminal=false
|
||||||
Categories=Utility;Audio;
|
Categories=Utility;Audio;
|
||||||
|
Keywords=dictation;speech;voice;transcription;whisper;
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cat > "$WORK_DIR/root/usr/share/metainfo/$APP_NAME.metainfo.xml" <<EOF
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<component type="desktop-application">
|
||||||
|
<id>$APP_NAME.desktop</id>
|
||||||
|
<metadata_license>MIT</metadata_license>
|
||||||
|
<project_license>$LICENSE</project_license>
|
||||||
|
<name>$DISPLAY_NAME</name>
|
||||||
|
<summary>$COMMENT</summary>
|
||||||
|
<description>
|
||||||
|
<p>WIS Free V3 is a desktop voice dictation app built with Go and Wails.</p>
|
||||||
|
<p>It records audio from a global shortcut, transcribes it, optionally refines the text, and types the result into the focused application.</p>
|
||||||
|
</description>
|
||||||
|
<launchable type="desktop-id">$APP_NAME.desktop</launchable>
|
||||||
|
<provides>
|
||||||
|
<binary>$APP_NAME</binary>
|
||||||
|
</provides>
|
||||||
|
<categories>
|
||||||
|
<category>Utility</category>
|
||||||
|
<category>Audio</category>
|
||||||
|
</categories>
|
||||||
|
<content_rating type="oars-1.1" />
|
||||||
|
<url type="homepage">https://github.com/Daishir0/wisp-open</url>
|
||||||
|
</component>
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
if [ -f README.md ]; then
|
if [ -f README.md ]; then
|
||||||
@@ -250,6 +277,30 @@ Description: $COMMENT
|
|||||||
On Wayland, install ydotool for direct keyboard injection.
|
On Wayland, install ydotool for direct keyboard injection.
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
cat > "$DEB_ROOT/DEBIAN/postinst" <<'EOF'
|
||||||
|
#!/usr/bin/env sh
|
||||||
|
set -e
|
||||||
|
if command -v update-desktop-database >/dev/null 2>&1; then
|
||||||
|
update-desktop-database /usr/share/applications >/dev/null 2>&1 || true
|
||||||
|
fi
|
||||||
|
if command -v appstreamcli >/dev/null 2>&1; then
|
||||||
|
appstreamcli refresh-cache --force >/dev/null 2>&1 || true
|
||||||
|
fi
|
||||||
|
exit 0
|
||||||
|
EOF
|
||||||
|
cat > "$DEB_ROOT/DEBIAN/postrm" <<'EOF'
|
||||||
|
#!/usr/bin/env sh
|
||||||
|
set -e
|
||||||
|
if command -v update-desktop-database >/dev/null 2>&1; then
|
||||||
|
update-desktop-database /usr/share/applications >/dev/null 2>&1 || true
|
||||||
|
fi
|
||||||
|
if command -v appstreamcli >/dev/null 2>&1; then
|
||||||
|
appstreamcli refresh-cache --force >/dev/null 2>&1 || true
|
||||||
|
fi
|
||||||
|
exit 0
|
||||||
|
EOF
|
||||||
|
chmod 0755 "$DEB_ROOT/DEBIAN/postinst" "$DEB_ROOT/DEBIAN/postrm"
|
||||||
|
|
||||||
dpkg-deb --build "$DEB_ROOT" "$DIST_DIR/${APP_NAME}_${PKG_VERSION}-${PKG_RELEASE}_${ARCH_DEB}.deb"
|
dpkg-deb --build "$DEB_ROOT" "$DIST_DIR/${APP_NAME}_${PKG_VERSION}-${PKG_RELEASE}_${ARCH_DEB}.deb"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -269,7 +320,10 @@ Summary: $COMMENT
|
|||||||
License: $LICENSE
|
License: $LICENSE
|
||||||
Requires: gtk3
|
Requires: gtk3
|
||||||
Requires: alsa-lib
|
Requires: alsa-lib
|
||||||
|
Requires: webkit2gtk4.1
|
||||||
|
Requires: libayatana-appindicator-gtk3
|
||||||
Recommends: ydotool
|
Recommends: ydotool
|
||||||
|
Provides: application() application($APP_NAME.desktop)
|
||||||
|
|
||||||
%description
|
%description
|
||||||
WIS Free V3 is a desktop voice dictation app built with Go and Wails.
|
WIS Free V3 is a desktop voice dictation app built with Go and Wails.
|
||||||
@@ -280,10 +334,27 @@ rm -rf %{buildroot}
|
|||||||
mkdir -p %{buildroot}
|
mkdir -p %{buildroot}
|
||||||
cp -a "$RPM_PAYLOAD"/. %{buildroot}/
|
cp -a "$RPM_PAYLOAD"/. %{buildroot}/
|
||||||
|
|
||||||
|
%post
|
||||||
|
if command -v update-desktop-database >/dev/null 2>&1; then
|
||||||
|
update-desktop-database /usr/share/applications >/dev/null 2>&1 || :
|
||||||
|
fi
|
||||||
|
if command -v appstreamcli >/dev/null 2>&1; then
|
||||||
|
appstreamcli refresh-cache --force >/dev/null 2>&1 || :
|
||||||
|
fi
|
||||||
|
|
||||||
|
%postun
|
||||||
|
if command -v update-desktop-database >/dev/null 2>&1; then
|
||||||
|
update-desktop-database /usr/share/applications >/dev/null 2>&1 || :
|
||||||
|
fi
|
||||||
|
if command -v appstreamcli >/dev/null 2>&1; then
|
||||||
|
appstreamcli refresh-cache --force >/dev/null 2>&1 || :
|
||||||
|
fi
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%attr(0755,root,root) /usr/bin/$APP_NAME
|
%attr(0755,root,root) /usr/bin/$APP_NAME
|
||||||
/usr/share/applications/$APP_NAME.desktop
|
/usr/share/applications/$APP_NAME.desktop
|
||||||
/usr/share/pixmaps/$APP_NAME.png
|
/usr/share/pixmaps/$APP_NAME.png
|
||||||
|
/usr/share/metainfo/$APP_NAME.metainfo.xml
|
||||||
/usr/share/doc/$APP_NAME/README.md
|
/usr/share/doc/$APP_NAME/README.md
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user