File nodejs2rpm.spec of Package nodejs2rpm
#
# spec file for package nodejs2rpm
#
# Copyright (c) 2020 SUSE LLC
#
# 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/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: nodejs2rpm
Version: 1.0.0
Release: 1
Summary: Instantly generate valid RPM SPECs for packaging NodeJS modules
License: MIT
Group: Development/Languages/Other
URL: https://github.com/doccaz/nodejs2rpm.git
Source0: https://github.com/doccaz/nodejs2rpm/archive/%{version}.tar.gz#/%{name}-%{version}.tar.xz
BuildRequires: %{python_module Jinja2}
BuildRequires: %{python_module requests}
BuildRequires: python-rpm-macros
Requires: python-Jinja2
Requires: python-requests
BuildArch: noarch
%description
This utility is intended to generate a valid RPM SPEC for nodejs modules, much like py2pack and gem2rpm.
It fetches information for the desired module from registry.npmjs.org, and fills up a Jinja2 template.
It also generates OBS-compliant changelog files.
%prep
%autosetup
%build
%install
mkdir -p %{buildroot}/%{_bindir}
mkdir -p %{buildroot}/%{_datadir}/%{name}/templates
install -m 0755 nodejs2rpm.py %{buildroot}/%{_datadir}/%{name}
cp templates/* %{buildroot}/%{_datadir}/%{name}/templates/
ln -s %{_datadir}/%{name}/nodejs2rpm.py %{buildroot}%{_bindir}/nodejs2rpm
%files
%license LICENSE
%doc README.md
%{_bindir}/*
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/*
%changelog