Blame asar.spec

91b24b
#
91b24b
# spec file for package asar
91b24b
#
91b24b
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
91b24b
#
91b24b
# All modifications and additions to the file contributed by third parties
91b24b
# remain the property of their copyright owners, unless otherwise agreed
91b24b
# upon. The license for this file, and modifications and additions to the
91b24b
# file, is the same license as for the pristine package itself (unless the
91b24b
# license for the pristine package is not an Open Source License, in which
91b24b
# case the license is the MIT License). An "Open Source License" is a
91b24b
# license that conforms to the Open Source Definition (Version 1.9)
91b24b
# published by the Open Source Initiative.
91b24b
91b24b
# Please submit bugfixes or comments via http://bugs.opensuse.org/
91b24b
#
91b24b
91b24b
91b24b
Name:           asar
5810aa
Version:        3.2.2
91b24b
Release:        0
91b24b
Summary:        Creating atom-shell (electron) app packages
91b24b
License:        MIT and ISC
91b24b
Group:          Development/Languages/NodeJS
91b24b
Url:            https://github.com/electron/asar
91b24b
Source0:        https://github.com/electron/asar/archive/refs/tags/v%{version}.tar.gz
91b24b
# Created by prepare-vendor.sh
91b24b
Source1:        vendor.tar.xz
91b24b
Source2:        prepare_vendor.sh
91b24b
91b24b
BuildArch:      noarch
91b24b
91b24b
BuildRequires:  fdupes
5810aa
BuildRequires:  jq
91b24b
BuildRequires:  nodejs-packaging
91b24b
BuildRequires:  npm
91b24b
91b24b
%global __requires_exclude ^npm(.*)$
91b24b
Provides: nodejs-asar = %{version}
91b24b
%description
91b24b
Asar is a simple extensive archive format, it works like tar
91b24b
that concatenates all files together without compression, while
91b24b
having random access support.
91b24b
91b24b
91b24b
%prep
91b24b
%autosetup -p1 -a 1
91b24b
91b24b
%build
5810aa
npm rebuild --verbose --foreground-scripts
91b24b
91b24b
%install
5810aa
mkdir -pv %{buildroot}%{nodejs_sitelib}/@electron
91b24b
mkdir -pv %{buildroot}%{_bindir}
5810aa
cp -lr . %{buildroot}%{nodejs_sitelib}/@electron/asar
5810aa
ln -srv %{buildroot}%{nodejs_sitelib}/@electron/asar/bin/asar.js %{buildroot}%{_bindir}/asar
5810aa
# symlink old package name
5810aa
ln -srv %{buildroot}%{nodejs_sitelib}/{@electron/,}asar
91b24b
#fix shebang
5810aa
sed -i '1s/env //' %{buildroot}%{nodejs_sitelib}/@electron/asar/bin/asar.js
5810aa
cd %{buildroot}%{nodejs_sitelib}/asar
5810aa
5810aa
# Correct bogus version in package.json
5810aa
jq -cj '.version="%{version}"' package.json > new
5810aa
mv new package.json
91b24b
#Remove development garbage
91b24b
find -name example -print0 |xargs -r0 -- rm -rvf
91b24b
find -name test -print0 |xargs -r0 -- rm -rvf
91b24b
find -name typings -print0 |xargs -r0 -- rm -rvf
91b24b
find -name @types -print0 |xargs -r0 -- rm -rvf
91b24b
find -name .github -print0 |xargs -r0 -- rm -rvf
91b24b
find -name .circleci -print0 |xargs -r0 -- rm -rvf
91b24b
find -name '*.md' -type f -print -delete
91b24b
find -name '*.markdown' -type f -print -delete
91b24b
find -name '*.ts' -type f -print -delete
91b24b
find -name '.*.yml' -type f -print -delete
91b24b
find -name '.*ignore' -type f -print -delete
91b24b
find -name 'snapcraft*' -type f -print -delete
91b24b
find -name '.git*' -type f -print -delete
91b24b
find -name yarn.lock -type f -print -delete
91b24b
find -name '.yarn*' -type f -print -delete
91b24b
find -name '.releaserc*' -type f -print -delete
91b24b
91b24b
91b24b
%fdupes %{buildroot}
91b24b
91b24b
#%%check
91b24b
#We can't run tests, we don't have mocha available.
91b24b
91b24b
%files
91b24b
%defattr(-,root,root)
91b24b
%doc CHANGELOG.md README.md
91b24b
%license LICENSE.md
91b24b
/usr/bin/asar
5810aa
%{nodejs_sitelib}
91b24b
91b24b
%changelog