diff --git a/dl-tests.sh b/dl-tests.sh new file mode 100644 index 0000000..f0cd0bf --- /dev/null +++ b/dl-tests.sh @@ -0,0 +1,123 @@ +#!/bin/bash + +tag=$(sed -n 's/^Version:\s\(.*\)$/\1/p' ./*.spec | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') +url=$(sed -n 's/^URL:\s\(.*\)$/\1/p' ./*.spec | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') +pkgdir=$(basename $url | sed -s 's/\.git$//') + +echo "tag: $tag" +echo "URL: $url" +echo "pkgdir: $pkgdir" + +set -e + +tmp=$(mktemp -d) + +trap cleanup EXIT +cleanup() { + echo Cleaning up... + set +e + [ -z "$tmp" -o ! -d "$tmp" ] || rm -rf "$tmp" +} + +unset CDPATH +pwd=$(pwd) + +pushd "$tmp" +git clone $url +cd $pkgdir +echo Finding git tag +gittag=$(git show-ref --tags | cut -d' ' -f2 | grep "${tag}$" || git show-ref --tags | cut -d' ' -f2 | sort -Vr | head -n1) +if [ -z $gittag ]; then + gittag=tags/$tag +fi +echo "Git Tag: $gittag" +if [ -d "test" ]; then + git archive --prefix='test/' --format=tar ${gittag}:test/ \ + | bzip2 > "$pwd"/tests-${tag}.tar.bz2 +elif [ -d "tests" ]; then + git archive --prefix='tests/' --format=tar ${gittag}:tests/ \ + | bzip2 > "$pwd"/tests-${tag}.tar.bz2 +elif [ -d "spec" ]; then + git archive --prefix='spec/' --format=tar ${gittag}:spec/ \ + | bzip2 > "$pwd"/tests-${tag}.tar.bz2 +else + echo "No test directory found for tag ${gittag}" +fi +if [ -d "support" ]; then + git archive --prefix='support/' --format=tar ${gittag}:support/ \ + | bzip2 > "$pwd"/support-${tag}.tar.bz2 +fi +if [ -d "fixture" ]; then + git archive --prefix='fixture/' --format=tar ${gittag}:fixture/ \ + | bzip2 > "$pwd"/fixture-${tag}.tar.bz2 +fi +if [ -d "examples" ]; then + git archive --prefix='examples/' --format=tar ${gittag}:examples/ \ + | bzip2 > "$pwd"/examples-${tag}.tar.bz2 +elif [ -d "example" ]; then + git archive --prefix='example/' --format=tar ${gittag}:example/ \ + | bzip2 > "$pwd"/examples-${tag}.tar.bz2 +fi +if [ -d "tasks" ]; then + git archive --prefix='tasks/' --format=tar ${gittag}:tasks/ \ + | bzip2 > "$pwd"/tasks-${tag}.tar.bz2 +fi +if [ -d "docs" ]; then + git archive --prefix='docs/' --format=tar ${gittag}:docs/ \ + | bzip2 > "$pwd"/docs-${tag}.tar.bz2 +elif [ -d "doc" ]; then + git archive --prefix='doc/' --format=tar ${gittag}:doc/ \ + | bzip2 > "$pwd"/docs-${tag}.tar.bz2 +fi +if [ -d "src" ]; then + git archive --prefix='src/' --format=tar ${gittag}:src/ \ + | bzip2 > "$pwd"/src-${tag}.tar.bz2 +elif [ -d "source" ]; then + git archive --prefix='source/' --format=tar ${gittag}:source/ \ + | bzip2 > "$pwd"/source-${tag}.tar.bz2 +fi +if [ -d "tools" ]; then + git archive --prefix='tools/' --format=tar ${gittag}:tools/ \ + | bzip2 > "$pwd"/tools-${tag}.tar.bz2 +fi +if [ -d "scripts" ]; then + git archive --prefix='scripts/' --format=tar ${gittag}:scripts/ \ + | bzip2 > "$pwd"/scripts-${tag}.tar.bz2 +fi +if [ -d "modules" ]; then + git archive --prefix='modules/' --format=tar ${gittag}:modules/ \ + | bzip2 > "$pwd"/modules-${tag}.tar.bz2 +fi +if [ -d "ts" ]; then + git archive --prefix='ts/' --format=tar ${gittag}:ts/ \ + | bzip2 > "$pwd"/ts-${tag}.tar.bz2 +fi +if [ -d "build" ]; then + git archive --prefix='build/' --format=tar ${gittag}:build/ \ + | bzip2 > "$pwd"/build-${tag}.tar.bz2 +fi +if [ -d "fixtures" ]; then + git archive --prefix='fixtures/' --format=tar ${gittag}:fixtures/ \ + | bzip2 > "$pwd"/fixtures-${tag}.tar.bz2 +fi +if [ -d "mocks" ]; then + git archive --prefix='mocks/' --format=tar ${gittag}:mocks/ \ + | bzip2 > "$pwd"/mocks-${tag}.tar.bz2 +fi +if [ -d "typings" ]; then + git archive --prefix='typings/' --format=tar ${gittag}:typings/ \ + | bzip2 > "$pwd"/typings-${tag}.tar.bz2 +fi +if [ -d "templates" ]; then + git archive --prefix='templates/' --format=tar ${gittag}:templates/ \ + | bzip2 > "$pwd"/templates-${tag}.tar.bz2 +fi +if [ -d "benchmark" ]; then + git archive --prefix='benchmark/' --format=tar ${gittag}:benchmark/ \ + | bzip2 > "$pwd"/benchmark-${tag}.tar.bz2 +fi +if [ -d "packages" ]; then + git archive --prefix='packages/' --format=tar ${gittag}:packages/ \ + | bzip2 > "$pwd"/packages-${tag}.tar.bz2 +fi +popd diff --git a/nodejs-which.spec b/nodejs-which.spec new file mode 100644 index 0000000..cd12e67 --- /dev/null +++ b/nodejs-which.spec @@ -0,0 +1,66 @@ +%{?nodejs_find_provides_and_requires} + +%global enable_tests 0 + +Name: nodejs-which +Version: 1.3.0 +Release: 1 +Summary: A JavaScript implementation of the 'which' command +License: MIT +URL: https://github.com/isaacs/node-which +Source0: https://registry.npmjs.org/which/-/which-%{version}.tgz +#git clone git://github.com/npm/node-which.git +#cd node-which +#git archive --prefix="test/" --format=tar tags/${tag}:test/ +# | bzip2 > "$pwd"/tests-${tag}.tar.bz2 +Source1: tests-%{version}.tar.bz2 + +BuildArch: noarch +ExclusiveArch: %{nodejs_arches} noarch + +BuildRequires: nodejs-packaging npm(isexe) + +%if 0%{?enable_tests} +BuildRequires: npm(tap) npm(mkdirp) npm(rimraf) +%endif + +%description +%{summary}. + + +%prep +%setup -q -n package +# setup the tests +%setup -q -T -D -a 1 -n package + + +%build +#nothing to do + + +%install +mkdir -p %{buildroot}%{nodejs_sitelib}/which +cp -pr bin which.js package.json %{buildroot}%{nodejs_sitelib}/which +mkdir -p %{buildroot}%{_bindir} +ln -sf ../lib/node_modules/which/bin/which %{buildroot}%{_bindir}/which-nodejs +%nodejs_symlink_deps + + +%check +%nodejs_symlink_deps --check +%__nodejs -e "require('./')" +%if 0%{?enable_tests} +%tap test/*.js +%endif + + +%files +%doc README.md +%license LICENSE +%{nodejs_sitelib}/which +%{_bindir}/which-nodejs + + +%changelog +* Tue Aug 11 2020 wangxiao - 1.3.0-1 +- package init diff --git a/nodejs-which.spec.old b/nodejs-which.spec.old new file mode 100644 index 0000000..b17e8d5 --- /dev/null +++ b/nodejs-which.spec.old @@ -0,0 +1,153 @@ +%{?nodejs_find_provides_and_requires} + +%global enable_tests 0 + +Name: nodejs-which +Version: 1.3.0 +Release: 5%{?dist} +Summary: A JavaScript implementation of the 'which' command +License: MIT +URL: https://github.com/isaacs/node-which +Source0: https://registry.npmjs.org/which/-/which-%{version}.tgz +# The test files are not included in the npm tarball. +# Source1 is generated by running Source10, which pulls from the upstream +# version control repository. +Source1: tests-%{version}.tar.bz2 +Source10: dl-tests.sh + +BuildArch: noarch +ExclusiveArch: %{nodejs_arches} noarch + +BuildRequires: nodejs-packaging + +BuildRequires: npm(isexe) + +%if 0%{?enable_tests} +BuildRequires: npm(tap) +BuildRequires: npm(mkdirp) +BuildRequires: npm(rimraf) +%endif + +%description +%{summary}. + + +%prep +%setup -q -n package +# setup the tests +%setup -q -T -D -a 1 -n package + + +%build +#nothing to do + + +%install +mkdir -p %{buildroot}%{nodejs_sitelib}/which +cp -pr bin which.js package.json %{buildroot}%{nodejs_sitelib}/which +mkdir -p %{buildroot}%{_bindir} +ln -sf ../lib/node_modules/which/bin/which %{buildroot}%{_bindir}/which-nodejs +%nodejs_symlink_deps + + +%check +%nodejs_symlink_deps --check +%__nodejs -e "require('./')" +%if 0%{?enable_tests} +%tap test/*.js +%endif + + +%files +%doc README.md +%license LICENSE +%{nodejs_sitelib}/which +%{_bindir}/which-nodejs + + +%changelog +* Fri Feb 01 2019 Fedora Release Engineering - 1.3.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Fri Jul 13 2018 Fedora Release Engineering - 1.3.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Tue May 01 2018 Jared K. Smith - 1.3.0-3 +- Fix up bogus dependencies + +* Thu Feb 08 2018 Fedora Release Engineering - 1.3.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Tue Sep 19 2017 Jared Smith - 1.3.0-1 +- Update to upstream 1.3.0 release + +* Thu Jul 27 2017 Fedora Release Engineering - 1.2.10-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Sat Feb 11 2017 Fedora Release Engineering - 1.2.10-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Wed Jul 13 2016 Jared Smith - 1.2.10-1 +- Update to upstream 1.2.10 release + +* Thu Feb 04 2016 Fedora Release Engineering - 1.2.4-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Thu Jan 28 2016 Tom Hughes - 1.2.4-1 +- Update to 1.2.4 upstream release + +* Fri Jan 22 2016 Tom Hughes - 1.2.2-1 +- Update to 1.2.2 upstream release + +* Mon Jan 18 2016 Tom Hughes - 1.2.1-2 +- Update npm(is-absolute) dependency + +* Mon Jan 18 2016 Tom Hughes - 1.2.1-1 +- Update to 1.2.1 upstream release + +* Wed Jun 17 2015 Fedora Release Engineering - 1.0.5-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Sat Jun 07 2014 Fedora Release Engineering - 1.0.5-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Sat Aug 03 2013 Fedora Release Engineering - 1.0.5-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Sat Jun 22 2013 T.C. Hollingsworth - 1.0.5-8 +- restrict to compatible arches + +* Fri May 3 2013 Stanislav Ochotnicky - 1.0.5-7 +- Fix broken symlink in bindir + +* Mon Apr 15 2013 T.C. Hollingsworth - 1.0.5-6 +- add macro for EPEL6 dependency generation + +* Thu Feb 14 2013 Fedora Release Engineering - 1.0.5-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Tue Jan 15 2013 T.C. Hollingsworth - 1.0.5-4 +- fix symlink to executable +- actually install the executable! +- rename executable to which-nodejs + +* Tue Jan 08 2013 T.C. Hollingsworth - 1.0.5-3 +- add missing build section + +* Mon Dec 31 2012 T.C. Hollingsworth - 1.0.5-2 +- Clean up for submission + +* Sun Mar 04 2012 T.C. Hollingsworth - 1.0.5-1 +- new upstream release 1.0.5 + +* Fri Feb 10 2012 T.C. Hollingsworth - 1.0.3-1 +- new upstream release 1.0.3 + +* Sun Dec 18 2011 T.C. Hollingsworth - 1.0.2-2 +- add Group to make EL5 happy + +* Tue Oct 25 2011 T.C. Hollingsworth - 1.0.2-1 +- new upstream release + +* Tue Aug 23 2011 T.C. Hollingsworth - 1.0.0-1 +- initial package diff --git a/nodejs-which.yaml b/nodejs-which.yaml new file mode 100644 index 0000000..dd0d49d --- /dev/null +++ b/nodejs-which.yaml @@ -0,0 +1,5 @@ +git_url: https://github.com/isaacs/node-which +version_control: github +src_repo: isaacs/node-which +tag_prefix: "^v" +seperator: "." diff --git a/tests-1.3.0.tar.bz2 b/tests-1.3.0.tar.bz2 new file mode 100644 index 0000000..12be00b Binary files /dev/null and b/tests-1.3.0.tar.bz2 differ diff --git a/which-1.3.0.tgz b/which-1.3.0.tgz new file mode 100644 index 0000000..2b704d2 Binary files /dev/null and b/which-1.3.0.tgz differ