js-jquery-ui/create-source.sh
2024-11-13 16:55:20 +01:00

77 lines
2.1 KiB
Bash
Executable file

#! /bin/sh
jsname=jquery-ui
version=1.14.1
[ -r ${jsname}-${version}.tar.gz ] && \
echo ${jsname}-${version}.tar.gz already exists && exit 1
[ -r ${jsname}-${version}-node-modules.tar.gz ] && \
echo ${jsname}-${version}-node-modules.tar.gz already exists && exit 1
wget -N https://github.com/jquery/${jsname}/archive/${version}/${jsname}-${version}.tar.gz
curdir=$(pwd)
tmpdir=$(mktemp -d)
cd ${tmpdir}
# We need to bundle build dependencies since they are no longer
# available in Fedora. This uses the same technique as the js-jquery
# package.
tar -z -x -f ${curdir}/${jsname}-${version}.tar.gz
cd ${jsname}-${version}
# Reduce the dev dependencies in the package.json file by removing
# stuff not needed for the build. This reduces the size of the bundled
# build dependencies considerably.
patch -p1 <<EOF
--- a/package.json
+++ b/package.json
@@ -52,31 +52,13 @@
"test": "grunt && npm run test:unit -- -h"
},
"dependencies": {
- "jquery": ">=1.12.0 <5.0.0"
},
"devDependencies": {
- "body-parser": "1.20.3",
- "browserstack-local": "1.5.5",
- "commitplease": "3.2.0",
- "diff": "5.2.0",
- "eslint-config-jquery": "3.0.2",
- "exit-hook": "4.0.0",
- "express": "4.21.1",
- "express-body-parser-error-handler": "1.0.7",
"grunt": "1.6.1",
- "grunt-bowercopy": "1.2.5",
- "grunt-compare-size": "0.4.2",
"grunt-contrib-concat": "2.1.0",
- "grunt-contrib-csslint": "2.0.0",
"grunt-contrib-requirejs": "1.0.0",
"grunt-contrib-uglify": "5.2.2",
- "grunt-eslint": "24.0.1",
- "grunt-git-authors": "3.2.0",
- "grunt-html": "17.1.0",
- "load-grunt-tasks": "5.1.0",
- "rimraf": "6.0.1",
- "selenium-webdriver": "4.26.0",
- "yargs": "17.7.2"
+ "load-grunt-tasks": "5.1.0"
},
"keywords": []
}
EOF
npm install --save-dev
# This file is not needed for the build
# It just needs to exist to avoid an error
mkdir -p node_modules/grunt-contrib-qunit/chrome
touch node_modules/grunt-contrib-qunit/chrome/bridge.js
tar -z -c --group root --owner root -f ${curdir}/${jsname}-${version}-node-modules.tar.gz node_modules
cd ${curdir}
rm -rf ${tmpdir}