diff --git a/coffee-script-1.10.0-f26d33d.tar.gz b/coffee-script-1.10.0-f26d33d.tar.gz new file mode 100644 index 0000000..dc4de75 Binary files /dev/null and b/coffee-script-1.10.0-f26d33d.tar.gz differ diff --git a/coffee-script-Cakefile.patch b/coffee-script-Cakefile.patch new file mode 100644 index 0000000..e3aeec5 --- /dev/null +++ b/coffee-script-Cakefile.patch @@ -0,0 +1,44 @@ +commit 862dba8b7d040b688f21926eceb14a6bd185fbbe +Author: Tom Hughes +Date: Sun Nov 8 11:33:04 2015 +0000 + + Some fixes for Cakefile + + - follow FHS and Fedora Node.js packaging guidelines + - support DESTDIR + - preserve timestamps when installing + +diff --git a/Cakefile b/Cakefile +index c9a675f..c361e64 100644 +--- a/Cakefile ++++ b/Cakefile +@@ -95,20 +95,21 @@ releaseHeader = (date, version, prevVersion) -> """ + option '-p', '--prefix [DIR]', 'set the installation prefix for `cake install`' + + task 'install', 'install CoffeeScript into /usr/local (or --prefix)', (options) -> ++ destdir = options.destdir or '' + base = options.prefix or '/usr/local' +- lib = "#{base}/lib/coffee-script" ++ lib = "#{base}/share/coffee-script" + bin = "#{base}/bin" +- node = "~/.node_libraries/coffee-script" ++ node = "#{base}/lib/node_modules/coffee-script" + console.log "Installing CoffeeScript to #{lib}" + console.log "Linking to #{node}" + console.log "Linking 'coffee' to #{bin}/coffee" + exec([ +- "mkdir -p #{lib} #{bin}" +- "cp -rf bin lib LICENSE README.md package.json src #{lib}" +- "ln -sfn #{lib}/bin/coffee #{bin}/coffee" +- "ln -sfn #{lib}/bin/cake #{bin}/cake" +- "mkdir -p ~/.node_libraries" +- "ln -sfn #{lib}/lib/coffee-script #{node}" ++ "mkdir -p #{destdir}/#{lib} #{destdir}/#{bin}" ++ "cp -prf bin extras lib package.json src #{destdir}/#{lib}" ++ "ln -sfn #{lib}/bin/coffee #{destdir}/#{bin}/coffee" ++ "ln -sfn #{lib}/bin/cake #{destdir}/#{bin}/cake" ++ "mkdir -p #{destdir}/#{node}" ++ "ln -sfn #{lib}/lib/coffee-script #{destdir}/#{node}" + ].join(' && '), (err, stdout, stderr) -> + if err then console.log stderr.trim() else log 'done', green + ) diff --git a/coffee-script.spec b/coffee-script.spec new file mode 100644 index 0000000..94f73dd --- /dev/null +++ b/coffee-script.spec @@ -0,0 +1,98 @@ +%global commit f26d33d418dcdcfcc6ad3ab774d9cabbf7af659c +%global shortcommit %(c=%{commit}; echo ${c:0:7}) +Name: coffee-script +Version: 1.10.0 +Release: 1 +Summary: A programming language that transcompiles to JavaScript +License: MIT +URL: http://coffeescript.org/ +Source0: https://github.com/jashkenas/coffee-script/archive/%{commit}/coffee-script-%{version}-%{shortcommit}.tar.gz +ExclusiveArch: %{nodejs_arches} noarch +Patch1: coffee-script-Cakefile.patch +BuildRequires: nodejs-packaging web-assets-devel npm(underscore) uglify-js +Requires: js-%{name} == %{version}-%{release} +BuildArch: noarch + +%description +CoffeeScript is a little language that compiles into JavaScript. Underneath all +of those embarrassing braces and semicolons, JavaScript has always had a +gorgeous object model at its heart. CoffeeScript is an attempt to expose the +good parts of JavaScript in a simple way. +The golden rule of CoffeeScript is: "It's just JavaScript". The code compiles +one-to-one into the equivalent JS, and there is no interpretation at runtime. +You can use any existing JavaScript library seamlessly (and vice-versa). The +compiled output is readable and pretty-printed, passes through JavaScript Lint +without warnings, will work in every JavaScript implementation, and tends to run +as fast or faster than the equivalent handwritten JavaScript. + +%package -n js-%{name} +Summary: A programming that transcompiles to JavaScript - core compiler +Provides: %{name}-common = %{version}-%{release} +Obsoletes: %{name}-common < 1.10.0-4 +Requires: web-assets-filesystem + +%description -n js-%{name} +This is the core compiler for the CoffeeScript language, suitable for use in +browsers or by other JavaScript implementations. +For the primary compiler and cake utility used in conjunction with Node.js, +install the 'coffee-script' package. + +%package doc +Summary: A programming language that transcompiles to JavaScript - documentation + +%description doc +The documentation for the CoffeeScript programming language. + +%prep +%setup -qn coffeescript-%{commit} +%patch1 -p1 +mv documentation html + +%build +%nodejs_symlink_deps --build +./bin/cake build +./bin/cake build:browser +mv extras/coffee-script.js extras/coffee-script.min.js +MINIFY=false ./bin/cake build:browser + +%install +mkdir -p %{buildroot}%{_jsdir}/%{name}/ +cp -pr extras/* %{buildroot}%{_jsdir}/%{name}/ +mkdir -p %{buildroot}%{_datadir}/%{name}/extras/ +ln -s %{_jsdir}/%{name}/coffee-script.js %{buildroot}%{_datadir}/%{name}/extras/ +ln -s %{_jsdir}/%{name}/coffee-script.min.js %{buildroot}%{_datadir}/%{name}/extras/ +mkdir -p %{buildroot}%{nodejs_sitelib}/%{name} +cp -pr *.js bin lib package.json %{buildroot}%{nodejs_sitelib}/%{name} +chmod 0644 %{buildroot}%{nodejs_sitelib}/%{name}/lib/coffee-script/parser.js +ln -sf %{_datadir}/%{name}/extras %{buildroot}%{nodejs_sitelib}/%{name}/extras +mkdir -p %{buildroot}%{_bindir} +ln -sf ../lib/node_modules/%{name}/bin/coffee %{buildroot}%{_bindir}/coffee +ln -sf ../lib/node_modules/%{name}/bin/cake %{buildroot}%{_bindir}/cake + +%check +./bin/cake test + +%pretrans -p +path = "%{nodejs_sitelib}/%{name}/lib" +st = posix.stat(path) +if st and st.type == "link" then + os.remove(path) +end + +%files +%{nodejs_sitelib}/%{name} +%{_bindir}/coffee +%{_bindir}/cake + +%files -n js-%{name} +%doc README.md +%license LICENSE +%{_jsdir}/%{name} +%{_datadir}/%{name} + +%files doc +%doc html + +%changelog +* Fri Aug 14 2020 leiju - 1.10.0-1 +- Package init diff --git a/coffee-script.yaml b/coffee-script.yaml new file mode 100644 index 0000000..c09c874 --- /dev/null +++ b/coffee-script.yaml @@ -0,0 +1,4 @@ +version_control: github +src_repo: jashkenas/coffee-script +tag_prefix: "^" +seperator: "."