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
|
# Catalogo di traduzione generato esplicitamente con lrelease (il template
|
||||||
# sailfishapp_i18n non produce il .qm in modo affidabile sul kit 5.1).
|
# sailfishapp_i18n non produce il .qm in modo affidabile sul kit 5.1).
|
||||||
if [ -f %{_builddir}/../%{name}-%{version}/translations/%{name}_it.ts ]; then
|
# Il .ts viene cercato in modo robusto: sfdk usa i sorgenti live (shadow
|
||||||
TS=%{_builddir}/../%{name}-%{version}/translations/%{name}_it.ts
|
# build) e la directory sorgente puo' chiamarsi %{name}-%{version} (tarball),
|
||||||
elif [ -f %{_builddir}/%{name}-%{version}/translations/%{name}_it.ts ]; then
|
# %{name} (clone) o %{name}-main (zip di Gitea).
|
||||||
TS=%{_builddir}/%{name}-%{version}/translations/%{name}_it.ts
|
TS=$(find %{_builddir}/.. -maxdepth 4 -name '%{name}_it.ts' 2>/dev/null | head -1)
|
||||||
elif [ -f %{_builddir}/translations/%{name}_it.ts ]; then
|
if [ -z "$TS" ]; then
|
||||||
TS=%{_builddir}/translations/%{name}_it.ts
|
|
||||||
else
|
|
||||||
echo "ERROR: %{name}_it.ts not found" >&2
|
echo "ERROR: %{name}_it.ts not found" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -55,7 +53,15 @@ lrelease "$TS" -qm %{_builddir}/%{name}_it.qm
|
|||||||
%install
|
%install
|
||||||
make install INSTALL_ROOT=%{buildroot}
|
make install INSTALL_ROOT=%{buildroot}
|
||||||
mkdir -p %{buildroot}%{_datadir}/applications
|
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
|
desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop || true
|
||||||
|
|
||||||
# Traduzione italiana nel data dir dell'app (il validatore RPM rifiuta
|
# Traduzione italiana nel data dir dell'app (il validatore RPM rifiuta
|
||||||
|
|||||||
Reference in New Issue
Block a user