diff --git a/.files b/.files new file mode 100644 index 0000000..140f4cd Binary files /dev/null and b/.files differ diff --git a/.meta b/.meta new file mode 100644 index 0000000..4f4de16 --- /dev/null +++ b/.meta @@ -0,0 +1,5 @@ + + + + + diff --git a/.rev b/.rev new file mode 100644 index 0000000..09735af --- /dev/null +++ b/.rev @@ -0,0 +1,10 @@ + + + ef4cb8fc896aaaf38e140dfd95a33172 + 3.2.0 + + dimstar_suse + new package see https://lists.opensuse.org/archives/list/factory@lists.opensuse.org/thread/FSEEJWXHXZ3ZLT3QH3IEYPLJ6DDGIHRT/ + 1001453 + + diff --git a/asar.changes b/asar.changes new file mode 100644 index 0000000..9e8433d --- /dev/null +++ b/asar.changes @@ -0,0 +1,16 @@ +------------------------------------------------------------------- +Tue Aug 16 15:09:07 UTC 2022 - Bruno Pitrus +- New upstream version 3.2.0 + * give better hints when failing due to bad links +- Use github tarball and use yarn to download vendored dependencies per yarn.lock + +------------------------------------------------------------------- +Thu Mar 03 00:00:00 UTC 2022 - Bruno Pitrus +- Resurrect package and update to 3.1.0 +- Use local-npm-registry to install dependencies + +------------------------------------------------------------------- +Sun Feb 14 15:11:12 UTC 2016 - i@marguerite.su + +- initial version 0.9.1 + diff --git a/asar.spec b/asar.spec new file mode 100644 index 0000000..be9508f --- /dev/null +++ b/asar.spec @@ -0,0 +1,90 @@ +# +# spec file for package asar +# +# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# + + +Name: asar +Version: 3.2.0 +Release: 0 +Summary: Creating atom-shell (electron) app packages +License: MIT and ISC +Group: Development/Languages/NodeJS +Url: https://github.com/electron/asar +Source0: https://github.com/electron/asar/archive/refs/tags/v%{version}.tar.gz +# Created by prepare-vendor.sh +Source1: vendor.tar.xz +Source2: prepare_vendor.sh + +BuildArch: noarch + +BuildRequires: fdupes +BuildRequires: nodejs-packaging +BuildRequires: npm + +%global __requires_exclude ^npm(.*)$ +Provides: nodejs-asar = %{version} +%description +Asar is a simple extensive archive format, it works like tar +that concatenates all files together without compression, while +having random access support. + + +%prep +%autosetup -p1 -a 1 + +%build +npm rebuild --verbose + +%install +mkdir -pv %{buildroot}%{nodejs_sitearch} +mkdir -pv %{buildroot}%{_bindir} +cp -lr . %{buildroot}%{nodejs_sitearch}/asar +ln -srv %{buildroot}%{nodejs_sitearch}/asar/bin/asar.js %{buildroot}%{_bindir}/asar +#fix shebang +sed -i '1s/env //' %{buildroot}%{nodejs_sitearch}/asar/bin/asar.js +cd %{buildroot}%{nodejs_sitearch}/asar +#Remove development garbage +find -name example -print0 |xargs -r0 -- rm -rvf +find -name test -print0 |xargs -r0 -- rm -rvf +find -name typings -print0 |xargs -r0 -- rm -rvf +find -name @types -print0 |xargs -r0 -- rm -rvf +find -name .github -print0 |xargs -r0 -- rm -rvf +find -name .circleci -print0 |xargs -r0 -- rm -rvf +find -name '*.md' -type f -print -delete +find -name '*.markdown' -type f -print -delete +find -name '*.ts' -type f -print -delete +find -name '.*.yml' -type f -print -delete +find -name '.*ignore' -type f -print -delete +find -name 'snapcraft*' -type f -print -delete +find -name '.git*' -type f -print -delete +find -name yarn.lock -type f -print -delete +find -name '.yarn*' -type f -print -delete +find -name '.releaserc*' -type f -print -delete + + +%fdupes %{buildroot} + +#%%check +#We can't run tests, we don't have mocha available. + +%files +%defattr(-,root,root) +%doc CHANGELOG.md README.md +%license LICENSE.md +/usr/bin/asar +%{nodejs_sitearch} + +%changelog \ No newline at end of file diff --git a/prepare_vendor.sh b/prepare_vendor.sh new file mode 100644 index 0000000..8766bbc --- /dev/null +++ b/prepare_vendor.sh @@ -0,0 +1,80 @@ +#!/bin/bash +# shellcheck disable=2181 + +ASAR_PKGDIR="$(pwd)" +ASAR_PKGVERSION=$(<./*.spec grep ^Version | sed -e 's/Version:[ ]*//g') +ASAR_URL="https://github.com/electron/asar/archive/refs/tags/v${ASAR_PKGVERSION}.tar.gz" +ASAR_TARBALL=v${ASAR_PKGVERSION}.tar.gz +ASAR_TMPDIR=$(mktemp --tmpdir -d asar-XXXXXXXX) +ASAR_PATH="$ASAR_TMPDIR/asar-$ASAR_PKGVERSION" + + + +echo "VERSION: $ASAR_PKGVERSION" +echo "PATH: $ASAR_PATH" + +cleanup_tmpdir() +{ + popd 2> /dev/null || exit 1 + rm -rf "$ASAR_TMPDIR" +} +trap cleanup_tmpdir SIGINT + +cleanup_and_exit() +{ + cleanup_tmpdir + if test "$1" = 0 -o -z "$1"; then + exit 0 + else + exit "$1" + fi +} + +if [ ! -w "$ASAR_TARBALL" ]; then + wget "$ASAR_URL" +fi + +tar -xf "$ASAR_TARBALL" -C "$ASAR_TMPDIR" + +pushd "$ASAR_PATH" || cleanup_and_exit 1 + + + +echo ">>>>>> Install npm modules" +yarn install --pure-lockfile --ignore-engines --ignore-scripts --production +ret=$? +if [ $ret -ne 0 ]; then + echo "ERROR: yarn install failed" + cleanup_and_exit 1 +fi + +echo ">>>>>> Cleanup object files" +find node_modules/ -name "*.node" -print -delete +find node_modules/ -name "*.jar" -print -delete +find node_modules/ -name "*.dll" -print -delete +find node_modules/ -name "*.dylib" -print -delete +find node_modules/ -name "*.so" -print -delete +find node_modules/ -name "*.o" -print -delete +find node_modules/ -name "*.a" -print -delete + + + +echo '>>>>>> Remove vendored binaries' +#We use sponge to avoid a race condition between find and rm +find . -type f| sponge |\ + xargs -P"$(nproc)" -- sh -c 'file "$@" | grep -v '\'': .*script'\'' | grep '\'': .*executable'\'' | tee /dev/stderr | sed '\''s/: .*//'\'' | xargs rm -fv' + + + +echo ">>>>>> Package vendor files" +rm -f "${ASAR_PKGDIR}/vendor.tar.xz" +XZ_OPT="-T$(nproc) -e9 -vv" tar -vvJcf "${ASAR_PKGDIR}/vendor.tar.xz" node_modules +if [ $? -ne 0 ]; then + cleanup_and_exit 1 +fi +echo "vendor $(du -sh "${ASAR_PKGDIR}/vendor.tar.xz")" + + +popd || cleanup_and_exit 1 + +cleanup_and_exit 0 diff --git a/v3.2.0.tar.gz b/v3.2.0.tar.gz new file mode 120000 index 0000000..fa097ef --- /dev/null +++ b/v3.2.0.tar.gz @@ -0,0 +1 @@ +/ipfs/bafkreifw33m424doym5z7xufk3ja53qke45dvp27eweee65jblkwk4djmu \ No newline at end of file diff --git a/vendor.tar.xz b/vendor.tar.xz new file mode 120000 index 0000000..5d6a955 --- /dev/null +++ b/vendor.tar.xz @@ -0,0 +1 @@ +/ipfs/bafkreid47vqsdzkuv5l4bnxluhc75tk22kxoqpqulbt53h6gwvalzylxjm \ No newline at end of file