1
0

Accepting request 1063173 from home:gladiac:branches:devel:languages:nodejs

- Some spec file cleanups

OBS-URL: https://build.opensuse.org/request/show/1063173
OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/element-desktop?expand=0&rev=27
This commit is contained in:
Dominik Heidler 2023-02-06 15:10:15 +00:00 committed by Git OBS Bridge
parent f0d1440fe7
commit 0b7921aa1b
2 changed files with 30 additions and 22 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Sat Feb 4 14:40:18 UTC 2023 - Andreas Schneider <asn@cryptomilk.org>
- Some spec file cleanups
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Jan 20 13:15:26 UTC 2023 - Dominik Heidler <dheidler@suse.de> Fri Jan 20 13:15:26 UTC 2023 - Dominik Heidler <dheidler@suse.de>

View File

@ -34,6 +34,7 @@ BuildRequires: jq
BuildRequires: moreutils BuildRequires: moreutils
BuildRequires: nodejs-electron-devel BuildRequires: nodejs-electron-devel
BuildRequires: yarn BuildRequires: yarn
BuildRequires: fdupes
Requires: element-web = %{version} Requires: element-web = %{version}
Requires: nodejs-electron Requires: nodejs-electron
@ -44,65 +45,67 @@ BuildArch: noarch
A glossy Matrix collaboration client - desktop A glossy Matrix collaboration client - desktop
%prep %prep
%setup -q %setup -q -a1 -a2
%autopatch -p1
SYSTEM_ELECTRON_VERSION=$(<%{_libdir}/electron/version) SYSTEM_ELECTRON_VERSION=$(<%{_libdir}/electron/version)
jq -c '.build["electronVersion"]="'$SYSTEM_ELECTRON_VERSION'" | .build["electronDist"]="%{_libdir}/electron"' < package.json | sponge package.json jq -c '.build["electronVersion"]="'$SYSTEM_ELECTRON_VERSION'" | .build["electronDist"]="%{_libdir}/electron"' < package.json | sponge package.json
jq -c '.build["linux"]["target"]="dir"' < package.json | sponge package.json jq -c '.build["linux"]["target"]="dir"' < package.json | sponge package.json
cat package.json cat package.json
jq '.piwik=false | .update_base_url=null' < element.io/release/config.json | sponge element.io/release/config.json jq '.piwik=false | .update_base_url=null' < element.io/release/config.json | sponge element.io/release/config.json
pwd
cd ..
pwd
ls -l
tar xvf %{SOURCE1}
cd element-desktop-%{version}
%build %build
echo 'yarn-offline-mirror "./npm-packages-offline-cache"' >> .yarnrc echo 'yarn-offline-mirror "./npm-packages-offline-cache"' >> .yarnrc
echo 'nodedir %{_includedir}/electron' >> .yarnrc echo 'nodedir %{_includedir}/electron' >> .yarnrc
tar xf %{SOURCE2}
ls ./npm-packages-offline-cache | head
export ELECTRON_SKIP_BINARY_DOWNLOAD=1 export ELECTRON_SKIP_BINARY_DOWNLOAD=1
export PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 export PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
yarn install --offline --pure-lockfile yarn install --offline --pure-lockfile
#tar xf %%{SOURCE6} export PATH="$(pwd)/node_modules/.bin:${PATH}"
export PATH="$PATH:node_modules/.bin"
#export ELECTRON_BUILDER_CACHE="$(pwd)/electron-builder-offline-cache/" #export ELECTRON_BUILDER_CACHE="$(pwd)/electron-builder-offline-cache/"
#yarn run build:native #yarn run build:native
yarn run build:universal yarn run build:universal
%install %install
install -d %{buildroot}{%{_datadir}/element/,%{_sysconfdir}/webapps/element}
# Install the app content, replace the webapp with a symlink to the system package # Install the app content, replace the webapp with a symlink to the system package
cp -pr dist/linux-universal-unpacked/resources/* "%{buildroot}%{_datadir}/element/" install -d -m 0755 "%{buildroot}%{_datadir}/element/"
cp -av dist/linux-universal-unpacked/resources/* "%{buildroot}%{_datadir}/element/"
ln -s %{_datadir}/webapps/element "%{buildroot}%{_datadir}/element/webapp" ln -s %{_datadir}/webapps/element "%{buildroot}%{_datadir}/element/webapp"
# Config file # Config file
install -m 0755 -d %{buildroot}%{_sysconfdir}/element
install -m 0644 element.io/release/config.json "%{buildroot}%{_sysconfdir}/element/config.json"
install -m 0755 -d %{buildroot}%{_sysconfdir}/webapps/element
ln -s %{_sysconfdir}/element/config.json "%{buildroot}%{_sysconfdir}/webapps/element/config.json" ln -s %{_sysconfdir}/element/config.json "%{buildroot}%{_sysconfdir}/webapps/element/config.json"
install -Dm644 element.io/release/config.json -t "%{buildroot}%{_sysconfdir}/element"
mkdir -p "%{buildroot}%{_datadir}/webapps/element/" install -d -m 0755 "%{buildroot}%{_datadir}/webapps/element/"
ln -s %{_sysconfdir}/webapps/element/config.json "%{buildroot}%{_datadir}/webapps/element/config.json" # moved here from element-web to make symlink check happy ln -s %{_sysconfdir}/element/config.json "%{buildroot}%{_datadir}/webapps/element/config.json" # moved here from element-web to make symlink check happy
# Required extras # Required extras
install -Dm644 %{SOURCE3} -t "%{buildroot}%{_datadir}/applications/" install -d -m 0755 "%{buildroot}%{_datadir}/applications/"
install -Dm755 %{SOURCE4} "%{buildroot}%{_bindir}/%{name}" install -m 0644 %{SOURCE3} "%{buildroot}%{_datadir}/applications/io.element.Element.desktop"
install -d -m 0755 "%{buildroot}%{_bindir}/"
install -m 0755 %{SOURCE4} "%{buildroot}%{_bindir}/%{name}"
# Icons # Icons
install -Dm644 ../element-web-%{version}/res/themes/element/img/logos/element-logo.svg "%{buildroot}%{_datadir}/icons/hicolor/scalable/apps/io.element.Element.svg" install -d -m 0755 "%{buildroot}%{_datadir}/icons/hicolor/scalable/apps/"
install -m 0644 element-web-%{version}/res/themes/element/img/logos/element-logo.svg "%{buildroot}%{_datadir}/icons/hicolor/scalable/apps/io.element.Element.svg"
for i in 16 24 48 64 96 128 256 512; do for i in 16 24 48 64 96 128 256 512; do
install -Dm644 build/icons/${i}x${i}.png "%{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps/io.element.Element.png" install -d -m 0755 "%{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps/"
install -m 0644 build/icons/${i}x${i}.png "%{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps/io.element.Element.png"
done done
%fdupes %{buildroot}%{_datadir}
%files %files
%license LICENSE %license LICENSE
%{_bindir}/%{name} %{_bindir}/%{name}
%{_datadir}/element/ %{_datadir}/element/
%config %{_sysconfdir}/element/config.json %config(noreplace) %{_sysconfdir}/element/config.json
%config %{_sysconfdir}/webapps/element/config.json %{_sysconfdir}/webapps/element/config.json
%{_datadir}/webapps/element/config.json %{_datadir}/webapps/element/config.json
%{_sysconfdir}/element/ %{_sysconfdir}/element/
%{_datadir}/applications/io.element.Element.desktop %{_datadir}/applications/io.element.Element.desktop