spec: ricerca robusta di .ts e .desktop (layout zip Gitea / clone / tarball)
This commit is contained in:
+14
-8
@@ -40,13 +40,11 @@ make %{?_smp_mflags}
|
||||
|
||||
# Catalogo di traduzione generato esplicitamente con lrelease (il template
|
||||
# sailfishapp_i18n non produce il .qm in modo affidabile sul kit 5.1).
|
||||
if [ -f %{_builddir}/../%{name}-%{version}/translations/%{name}_it.ts ]; then
|
||||
TS=%{_builddir}/../%{name}-%{version}/translations/%{name}_it.ts
|
||||
elif [ -f %{_builddir}/%{name}-%{version}/translations/%{name}_it.ts ]; then
|
||||
TS=%{_builddir}/%{name}-%{version}/translations/%{name}_it.ts
|
||||
elif [ -f %{_builddir}/translations/%{name}_it.ts ]; then
|
||||
TS=%{_builddir}/translations/%{name}_it.ts
|
||||
else
|
||||
# Il .ts viene cercato in modo robusto: sfdk usa i sorgenti live (shadow
|
||||
# build) e la directory sorgente puo' chiamarsi %{name}-%{version} (tarball),
|
||||
# %{name} (clone) o %{name}-main (zip di Gitea).
|
||||
TS=$(find %{_builddir}/.. -maxdepth 4 -name '%{name}_it.ts' 2>/dev/null | head -1)
|
||||
if [ -z "$TS" ]; then
|
||||
echo "ERROR: %{name}_it.ts not found" >&2
|
||||
exit 1
|
||||
fi
|
||||
@@ -55,7 +53,15 @@ lrelease "$TS" -qm %{_builddir}/%{name}_it.qm
|
||||
%install
|
||||
make install INSTALL_ROOT=%{buildroot}
|
||||
mkdir -p %{buildroot}%{_datadir}/applications
|
||||
install -m 0644 %{SOURCE1} %{buildroot}%{_datadir}/applications/%{name}.desktop
|
||||
# Desktop file cercato in modo robusto (stesso layout variabile di cui sopra);
|
||||
# %{SOURCE1} resta il fallback per la build da tarball classica.
|
||||
DESKTOP=$(find %{_builddir}/.. -maxdepth 4 -name '%{name}.desktop' 2>/dev/null | head -1)
|
||||
if [ -z "$DESKTOP" ] && [ -f %{SOURCE1} ]; then DESKTOP=%{SOURCE1}; fi
|
||||
if [ -z "$DESKTOP" ]; then
|
||||
echo "ERROR: %{name}.desktop not found" >&2
|
||||
exit 1
|
||||
fi
|
||||
install -m 0644 "$DESKTOP" %{buildroot}%{_datadir}/applications/%{name}.desktop
|
||||
desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop || true
|
||||
|
||||
# Traduzione italiana nel data dir dell'app (il validatore RPM rifiuta
|
||||
|
||||
Reference in New Issue
Block a user