diff --git a/asar.spec b/asar.spec index f6bd1a8..e06ef70 100644 --- a/asar.spec +++ b/asar.spec @@ -20,20 +20,19 @@ Name: asar Version: 3.2.0 Release: 0 Summary: Creating atom-shell (electron) app packages -License: MIT and X11 and ISC and SUSE-WTFPL-2.0 and Apache-2.0 and BSD-3-Clause +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.zst - +Source1: vendor.tar.xz BuildArch: noarch BuildRequires: fdupes BuildRequires: nodejs-packaging BuildRequires: npm -BuildRequires: zstd + %global __requires_exclude ^npm(.*)$ Provides: nodejs-asar = %{version} %description @@ -46,7 +45,6 @@ having random access support. %autosetup -p1 -a 1 %build -cd node_modules npm rebuild --verbose %install @@ -78,6 +76,9 @@ 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 diff --git a/prepare_vendor.sh b/prepare_vendor.sh index 3e91098..cf06e15 100644 --- a/prepare_vendor.sh +++ b/prepare_vendor.sh @@ -41,7 +41,7 @@ pushd "$ASAR_PATH" || cleanup_and_exit 1 echo ">>>>>> Install npm modules" -yarn install --pure-lockfile --ignore-scripts --production +yarn install --pure-lockfile --ignore-engines --ignore-scripts --production ret=$? if [ $ret -ne 0 ]; then echo "ERROR: yarn install failed" @@ -56,10 +56,7 @@ 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 -find node_modules/ -name "*.snyk-*.flag" -print -delete -find node_modules/ -name "builderror.log" -print -delete -find node_modules/ -name ".deps" -type d -print0 | xargs -0 rm -rvf -sed -i "/\.deps/d" node_modules/.yarn-integrity + echo '>>>>>> Remove vendored binaries' @@ -70,13 +67,12 @@ find . -type f| sponge |\ echo ">>>>>> Package vendor files" -#Use zst, it decompresses faster. -rm -f "${ASAR_PKGDIR}/vendor.tar.zst" -ZSTD_CLEVEL=19 ZSTD_NBTHREADS="$(nproc)" tar --zstd -vvcf "${ASAR_PKGDIR}/vendor.tar.zst" node_modules +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.zst")" +echo "vendor $(du -sh "${ASAR_PKGDIR}/vendor.tar.xz")" popd || cleanup_and_exit 1 diff --git a/vendor.tar.xz b/vendor.tar.xz new file mode 100644 index 0000000..0812515 --- /dev/null +++ b/vendor.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7cfd6121e554af57c0b6eba1c5fecd5ad2aee83e145867dd9fc6b540bce1774b +size 163336 diff --git a/vendor.tar.zst b/vendor.tar.zst deleted file mode 100644 index 8297f50..0000000 --- a/vendor.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5c59350570810f59f59a6ac284046c91ddb45bb5dd9fa6a643c142617370aa97 -size 169541