Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:jayvdb:other_peoples_important_tools
nodejs-prettier
nodejs-prettier.spec
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File nodejs-prettier.spec of Package nodejs-prettier
# # spec file for package nodejs-prettier # # Copyright (c) 2024 Andreas Schneider # # 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 https://bugs.opensuse.org/ # %define pkg_name prettier Name: nodejs-prettier Version: 3.2.5 Release: 1 Summary: An opinionated code formatter License: MIT URL: https://prettier.io Source0: https://github.com/prettier/prettier/archive/refs/tags/%{version}/%{pkg_name}-%{version}.tar.gz Source1: %{pkg_name}-%{version}-vendor.tar.zst Source2: prettier-launcher.sh BuildArch: noarch BuildRequires: fdupes BuildRequires: npm >= 16 %if 0%{?suse_version} BuildRequires: yarn %else BuildRequires: yarnpkg %endif BuildRequires: zstd %description Prettier is an opinionated code formatter. It enforces a consistent style by parsing your code and re-printing it with its own rules that take the maximum line length into account, wrapping code when necessary. %prep %autosetup -p1 -n %{pkg_name}-%{version} -a1 # Use .yarn/cache which is packaged by the vendor.tar.zst sed 's/enableGlobalCache:.*/enableGlobalCache: false/' -i .yarnrc.yml %build # This will run yarn 4.1.0 which is part of the source tarball yarn install --immutable yarn build --clean %install for S in $(grep -l '#!.*node' \ dist/bin/prettier.cjs \ ) ; do SB="${S}.backup" cp ${S} ${SB} perl -p -i -e 's|#!/usr/bin/env node|#!%{_bindir}/node|g' $S diff -urN ${SB} ${S} || : rm ${SB} done install -d -m 0755 %{buildroot}%{_prefix}/lib/node_modules/%{pkg_name}/ cp -av dist/* %{buildroot}%{_prefix}/lib/node_modules/%{pkg_name}/ install -d -m 0755 %{buildroot}%{_bindir} install -m 0755 %{SOURCE2} %{buildroot}%{_bindir}/%{pkg_name} %files %license LICENSE %doc CHANGELOG.md README.md %{_bindir}/%{pkg_name} %if 0%{?suse_version} %dir %{_prefix}/lib/node_modules %endif %{_prefix}/lib/node_modules/%{pkg_name}/ %changelog
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor