diff --git a/README.md b/README.md index 4d0e5ab..4496812 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # apm +Atom Package Manager - Discover and install Atom packages powered by atom.io. diff --git a/apm-2.6.1-no-scripts.patch b/apm-2.6.1-no-scripts.patch new file mode 100644 index 0000000..12662e9 --- /dev/null +++ b/apm-2.6.1-no-scripts.patch @@ -0,0 +1,21 @@ +--- a/package.json ++++ b/package.json +@@ -14,18 +14,6 @@ + "bin": { + "apm": "bin/apm" + }, +- "scripts": { +- "check-version": "node script/check-version.js", +- "clean:bin": "shx rm -rf bin/node_darwin_x64 bin/node.exe bin/node", +- "clean:lib": "shx rm -rf lib && shx mkdir -p lib", +- "clean": "npm run clean:lib && npm run clean:bin", +- "lint": "coffeelint src spec", +- "coffee": "coffee --compile --output lib src", +- "build": "npm run clean:lib && npm run coffee", +- "prepare": "npm run build", +- "postinstall": "node script/postinstall.js", +- "test": "npm run check-version && npm run lint && jasmine-focused --captureExceptions --coffee spec" +- }, + "dependencies": { + "@atom/plist": "0.4.4", + "asar-require": "0.3.0", diff --git a/apm.spec b/apm.spec new file mode 100644 index 0000000..9b0027c --- /dev/null +++ b/apm.spec @@ -0,0 +1,105 @@ +Name: apm +Version: 2.6.1 +Release: 1mamba +Summary: Atom Package Manager +Group: System/Tools +Vendor: openmamba +Distribution: openmamba +Packager: Silvan Calarco +URL: https://github.com/atom/apm +Source: https://github.com/atom/apm.git/v%{version}/apm-%{version}.tar.bz2 +Patch0: apm-2.6.1-no-scripts.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 +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 +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 +* Sat Mar 20 2021 Silvan Calarco 2.6.1-1mamba +- package created using the webbuild interface