js-jquery-ui/create-source.sh
2021-03-11 13:47:29 +01:00

69 lines
2 KiB
Bash
Executable file

#! /bin/sh
jsname=jquery-ui
version=1.12.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
curdir=$(pwd)
tmpdir=$(mktemp -d)
cd ${tmpdir}
# The upstream source bundles a copy of jshint which has a non-free
# license and can not be distributed by Fedora. The source included in
# the srpm has the external/jshint directory removed
wget -N https://github.com/jquery/${jsname}/archive/${version}/${jsname}-${version}-nonfree.tar.gz
tar -z -x -f ${jsname}-${version}-nonfree.tar.gz
rm -rf ${jsname}-${version}/external/jshint
tar -z -c --group root --owner root -f ${curdir}/${jsname}-${version}.tar.gz ${jsname}-${version}
# We need to bundle build dependencies since they are no longer
# available in Fedora. This uses the same technique as the js-jquery
# package.
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 2016-09-14 18:31:37.000000000 +0200
+++ b/package.json 2021-02-27 15:19:34.797763841 +0100
@@ -52,23 +52,12 @@
},
"dependencies": {},
"devDependencies": {
- "commitplease": "2.3.0",
"grunt": "0.4.5",
- "grunt-bowercopy": "1.2.4",
"grunt-cli": "0.1.13",
- "grunt-compare-size": "0.4.0",
"grunt-contrib-concat": "0.5.1",
- "grunt-contrib-csslint": "0.5.0",
- "grunt-contrib-jshint": "0.12.0",
- "grunt-contrib-qunit": "1.0.1",
"grunt-contrib-requirejs": "0.4.4",
"grunt-contrib-uglify": "0.11.1",
- "grunt-git-authors": "3.1.0",
- "grunt-html": "6.0.0",
- "grunt-jscs": "2.1.0",
- "load-grunt-tasks": "3.4.0",
- "rimraf": "2.5.1",
- "testswarm": "1.1.0"
+ "load-grunt-tasks": "3.4.0"
},
"keywords": []
}
EOF
npm install --save-dev
tar -z -c --group root --owner root -f ${curdir}/${jsname}-${version}-node-modules.tar.gz node_modules
cd ${curdir}
rm -rf ${tmpdir}