apm/apm.spec

128 lines
4.2 KiB
RPMSpec
Raw Permalink Normal View History

%define gittag %(echo %version | cut -d. -f1-4)
Name: apm
Version: 2.6.5.20220607git.ade8fbe1
Release: 1mamba
Summary: Atom Package Manager
Group: System/Tools
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://github.com/atom/apm
Source: https://github.com/atom/apm.git/master@%{gittag}/apm-%{version}.tar.bz2
Patch0: apm-2.6.1-no-scripts.patch
Patch1: apm-2.6.4-nodejs-17.4.0.patch
License: MIT
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
BuildRequires: libgcc
BuildRequires: libglib-devel
BuildRequires: libsecret-devel
BuildRequires: libstdc++6-devel
## AUTOBUILDREQ-END
BuildRequires: node-gyp
BuildRequires: nodejs >= 18.1.0
Requires: nodejs
%description
Atom Package Manager - Discover and install Atom packages powered by atom.io.
#% debug_package
%prep
%setup -q
#-D -T
#:<< _EOF
# From Arch Linux
# Don't download binary Node
%patch0 -p1
#%patch1 -p1 -b .nodejs-17.4.0
rm BUNDLED_NODE_VERSION script/*
%build
#:<< _EOF
npm install
npx coffee --compile --output lib src
npm uninstall coffee-script coffeelint express jasmine-focused shx node-gyp
cd node_modules/git-utils
#patch -Np1 -i "${srcdir}/git-utils.patch"
node-gyp rebuild
cd ../..
npm pack
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
install -d -m755 %{buildroot}%{_prefix}/lib/node_modules/atom-package-manager
tar -xf atom-package-manager-*.tgz --strip-components 1 \
-C %{buildroot}%{_prefix}/lib/node_modules/atom-package-manager
cp -r node_modules %{buildroot}%{_prefix}/lib/node_modules/atom-package-manager
install -d -m755 %{buildroot}%{_bindir}
ln -s \
$(realpath --relative-to=%{buildroot}%{_bindir} %{buildroot}%{_prefix}/lib/node_modules/atom-package-manager/bin/apm) \
%{buildroot}%{_bindir}
ln -s /usr/bin/node %{buildroot}%{_prefix}/lib/node_modules/atom-package-manager/bin/node
# Remove useless stuff
find %{buildroot}%{_prefix}/lib \
-name ".*" -prune -exec rm -r '{}' \; \
-or -name "*.a" -exec rm '{}' \; \
-or -name "*.bat" -exec rm '{}' \; \
-or -name "*.mk" -exec rm '{}' \; \
-or -path "*/git-utils/binding.gyp" -exec rm '{}' \; \
-or -path "*/git-utils/src/*.cc" -exec rm '{}' \; \
-or -path "*/git-utils/src/*.h" -exec rm '{}' \; \
-or -path "*/keytar/binding.gyp" -exec rm '{}' \; \
-or -path "*/keytar/src" -prune -exec rm -r '{}' \; \
-or -path "*/oniguruma/binding.gyp" -exec rm '{}' \; \
-or -path "*/oniguruma/src" -prune -exec rm -r '{}' \; \
-or -name "appveyor.yml" -exec rm '{}' \; \
-or -name "benchmark" -prune -exec rm -r '{}' \; \
-or -name "binding.Makefile" -exec rm '{}' \; \
-or -name "config.gypi" -exec rm '{}' \; \
-or -name "deps" -prune -exec rm -r '{}' \; \
-or -name "doc" -prune -exec rm -r '{}' \; \
-or -name "html" -prune -exec rm -r '{}' \; \
-or -name "Makefile" -exec rm '{}' \; \
-or -name "man" -prune -exec rm -r '{}' \; \
-or -name "obj.target" -prune -exec rm -r '{}' \; \
-or -name "samples" -prune -exec rm -r '{}' \; \
-or -name "scripts" -prune -exec rm -r '{}' \; \
-or -name "test" -prune -exec rm -r '{}' \; \
-or -name "tests" -prune -exec rm -r '{}' \;
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%files
%defattr(-,root,root)
%{_bindir}/apm
%dir %{_prefix}/lib/node_modules/atom-package-manager
%{_prefix}/lib/node_modules/atom-package-manager/*
%doc LICENSE.md
%changelog
* Tue Jun 07 2022 Silvan Calarco <silvan.calarco@mambasoft.it> 2.6.5.20220607git.ade8fbe1-1mamba
- update to 2.6.5.20220607git.ade8fbe1
* Tue May 10 2022 Silvan Calarco <silvan.calarco@mambasoft.it> 2.6.4-3mamba
- rebuilt with nodejs 18.1.0
* Sat Jan 29 2022 Silvan Calarco <silvan.calarco@mambasoft.it> 2.6.4-2mamba
- rebuilt with nodejs 17.4.0
* Wed Jun 23 2021 Automatic Build System <autodist@mambasoft.it> 2.6.4-1mamba
- automatic version update by autodist
* Fri Jun 18 2021 Automatic Build System <autodist@mambasoft.it> 2.6.3-1mamba
- automatic version update by autodist
* Tue May 04 2021 Silvan Calarco <silvan.calarco@mambasoft.it> 2.6.1-2mamba
- rebuilt with nodejs 16.0.0
* Sat Mar 20 2021 Silvan Calarco <silvan.calarco@mambasoft.it> 2.6.1-1mamba
- package created using the webbuild interface