diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2021-02-23 09:25:52 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2021-02-23 09:25:52 +0900 |
commit | 1b849a1f035309c653a31f3983afbc3660604fec (patch) | |
tree | ae4bcc9884f7c05285099ac2b9fa3d42ccbdcf16 /test | |
parent | 242bd175d5c7bc46d6fbb9397c7dec2eae6283a2 (diff) | |
download | rpmlint-1b849a1f035309c653a31f3983afbc3660604fec.tar.gz rpmlint-1b849a1f035309c653a31f3983afbc3660604fec.tar.bz2 rpmlint-1b849a1f035309c653a31f3983afbc3660604fec.zip |
Imported Upstream version 1.6upstream/1.6
Diffstat (limited to 'test')
41 files changed, 4722 insertions, 9 deletions
diff --git a/test/PamCheck-0.1-1.i586.rpm b/test/binary/PamCheck-0.1-1.i586.rpm Binary files differindex 2606df9..2606df9 100644 --- a/test/PamCheck-0.1-1.i586.rpm +++ b/test/binary/PamCheck-0.1-1.i586.rpm diff --git a/test/binary/macros-nodejs010-nodejs-oauth-sign-0.2.0-2.el6_4.noarch.rpm b/test/binary/macros-nodejs010-nodejs-oauth-sign-0.2.0-2.el6_4.noarch.rpm Binary files differnew file mode 100644 index 0000000..2eeccd5 --- /dev/null +++ b/test/binary/macros-nodejs010-nodejs-oauth-sign-0.2.0-2.el6_4.noarch.rpm diff --git a/test/binary/nodejs010-nodejs-0.10.3-3.el6_4.x86_64.rpm b/test/binary/nodejs010-nodejs-0.10.3-3.el6_4.x86_64.rpm Binary files differnew file mode 100644 index 0000000..53f426b --- /dev/null +++ b/test/binary/nodejs010-nodejs-0.10.3-3.el6_4.x86_64.rpm diff --git a/test/binary/nodejs010-nodejs-oauth-sign-0.2.0-2.el6_4.noarch.rpm b/test/binary/nodejs010-nodejs-oauth-sign-0.2.0-2.el6_4.noarch.rpm Binary files differnew file mode 100644 index 0000000..59b4c37 --- /dev/null +++ b/test/binary/nodejs010-nodejs-oauth-sign-0.2.0-2.el6_4.noarch.rpm diff --git a/test/binary/nodejs010-runtime-1-7.el6_4.x86_64.rpm b/test/binary/nodejs010-runtime-1-7.el6_4.x86_64.rpm Binary files differnew file mode 100644 index 0000000..42c36d0 --- /dev/null +++ b/test/binary/nodejs010-runtime-1-7.el6_4.x86_64.rpm diff --git a/test/binary/nodejs110-nodejs-oauth-sign-0.2.0-2.el6_4.noarch.rpm b/test/binary/nodejs110-nodejs-oauth-sign-0.2.0-2.el6_4.noarch.rpm Binary files differnew file mode 100644 index 0000000..b2e6396 --- /dev/null +++ b/test/binary/nodejs110-nodejs-oauth-sign-0.2.0-2.el6_4.noarch.rpm diff --git a/test/binary/outside-nodejs010-nodejs-oauth-sign-0.2.0-2.el6_4.noarch.rpm b/test/binary/outside-nodejs010-nodejs-oauth-sign-0.2.0-2.el6_4.noarch.rpm Binary files differnew file mode 100644 index 0000000..aa907bb --- /dev/null +++ b/test/binary/outside-nodejs010-nodejs-oauth-sign-0.2.0-2.el6_4.noarch.rpm diff --git a/test/binary/python3-power-1.1-4.20121103git2cfe611.fc19.noarch.rpm b/test/binary/python3-power-1.1-4.20121103git2cfe611.fc19.noarch.rpm Binary files differnew file mode 100644 index 0000000..d84e9c1 --- /dev/null +++ b/test/binary/python3-power-1.1-4.20121103git2cfe611.fc19.noarch.rpm diff --git a/test/source/nodejs010-1-7.el6_4.src.rpm b/test/source/nodejs010-1-7.el6_4.src.rpm Binary files differnew file mode 100644 index 0000000..3523dec --- /dev/null +++ b/test/source/nodejs010-1-7.el6_4.src.rpm diff --git a/test/source/nodejs010-nodejs-0.10.3-3.el6_4.src.rpm b/test/source/nodejs010-nodejs-0.10.3-3.el6_4.src.rpm Binary files differnew file mode 100644 index 0000000..b92a568 --- /dev/null +++ b/test/source/nodejs010-nodejs-0.10.3-3.el6_4.src.rpm diff --git a/test/source/nodejs010-nodejs-forever-agent-0.2.0-2.el6_4.src.rpm b/test/source/nodejs010-nodejs-forever-agent-0.2.0-2.el6_4.src.rpm Binary files differnew file mode 100644 index 0000000..c575d0f --- /dev/null +++ b/test/source/nodejs010-nodejs-forever-agent-0.2.0-2.el6_4.src.rpm diff --git a/test/SpecCheck.spec b/test/spec/SpecCheck.spec index 14f4e6f..2958bc6 100644 --- a/test/SpecCheck.spec +++ b/test/spec/SpecCheck.spec @@ -31,7 +31,7 @@ Noarch subpackage test. %prep -%setup -q +%setup %patch1 %patch %patch -P 2 -P 4 diff --git a/test/spec/SpecCheck2.spec b/test/spec/SpecCheck2.spec new file mode 100644 index 0000000..189f522 --- /dev/null +++ b/test/spec/SpecCheck2.spec @@ -0,0 +1,42 @@ +Name: SpecCheck2 +Version: 0 +Release: 0 +Summary: None here + +Group: Undefined +License: GPLv2 +URL: http://rpmlint.zarb.org/#%{name} +Source0: Source0.tar.gz +Patch: Patch.patch +Patch1: Patch1.patch +Patch2: Patch2.patch +Patch3: Patch3.patch +Patch4: Patch4.patch +Patch5: Patch5.patch +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +%description +SpecCheck test 2. + + +%prep + %autosetup + + +%build + + +%install +rm -rf $RPM_BUILD_ROOT + + +%clean +rm -rf $RPM_BUILD_ROOT + + +%files +%defattr(-,root,root,-) +%{_libdir}/foo + + +%changelog diff --git a/test/spec/SpecCheck3.spec b/test/spec/SpecCheck3.spec new file mode 100644 index 0000000..6c5ac92 --- /dev/null +++ b/test/spec/SpecCheck3.spec @@ -0,0 +1,43 @@ +Name: SpecCheck3 +Version: 0 +Release: 0 +Summary: None here + +Group: Undefined +License: GPLv2 +URL: http://rpmlint.zarb.org/#%{name} +Source0: Source0.tar.gz +Patch: Patch.patch +Patch1: Patch1.patch +Patch2: Patch2.patch +Patch3: Patch3.patch +Patch4: Patch4.patch +Patch5: Patch5.patch +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +%description +SpecCheck test 2. + + +%prep +%autosetup -N + %autopatch + + +%build + + +%install +rm -rf $RPM_BUILD_ROOT + + +%clean +rm -rf $RPM_BUILD_ROOT + + +%files +%defattr(-,root,root,-) +%{_libdir}/foo + + +%changelog diff --git a/test/spec/nodejs-conflicts-without-prefix.spec b/test/spec/nodejs-conflicts-without-prefix.spec new file mode 100644 index 0000000..20a502e --- /dev/null +++ b/test/spec/nodejs-conflicts-without-prefix.spec @@ -0,0 +1,302 @@ +%{?scl:%scl_package nodejs} +%{!?scl:%global pkg_name %{name}} + +Name: %{?scl_prefix}nodejs +Version: 0.10.3 +Release: 3%{?dist} +Summary: JavaScript runtime +License: MIT and ASL 2.0 and ISC and BSD +Group: Development/Languages +URL: http://nodejs.org/ + +# Exclusive archs must match v8 +ExclusiveArch: %{ix86} x86_64 %{arm} + +Source0: http://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz + +# V8 presently breaks ABI at least every x.y release while never bumping SONAME, +# so we need to be more explicit until spot fixes that +%global v8_ge 1:3.14.5.7 +%global v8_lt 1:3.15 +%global v8_abi 3.14 + +%{?scl:Requires: %{scl}-runtime} +BuildRequires: %{?scl_prefix}v8-devel >= %{v8_ge} +BuildRequires: %{?scl_prefix}http-parser-devel >= 2.0 +BuildRequires: %{?scl_prefix}libuv-devel +BuildRequires: %{?scl_prefix}c-ares-devel +BuildRequires: zlib-devel +# Node.js requires some features from openssl 1.0.1 for SPDY support +BuildRequires: openssl-devel + +Requires: %{?scl_prefix}v8%{?isa} >= %{v8_ge} +Requires: %{?scl_prefix}v8%{?isa} < %{v8_lt} + +#we need ABI virtual provides where SONAMEs aren't enough/not present so deps +#break when binary compatibility is broken +%global nodejs_abi 0.10 +Provides: %{?scl_prefix}nodejs(abi) = %{nodejs_abi} +Provides: %{?scl_prefix}nodejs(v8-abi) = %{v8_abi} + +#this corresponds to the "engine" requirement in package.json +Provides: %{?scl_prefix}nodejs(engine) = %{version} + +# Node.js currently has a conflict with the 'node' package in Fedora +# The ham-radio group has agreed to rename their binary for us, but +# in the meantime, we're setting an explicit Conflicts: %{?scl_prefix}here +Conflicts: node <= 0.3.2-11 + +%description +Node.js is a platform built on Chrome's JavaScript runtime +for easily building fast, scalable network applications. +Node.js uses an event-driven, non-blocking I/O model that +makes it lightweight and efficient, perfect for data-intensive +real-time applications that run across distributed devices. + +%package devel +Summary: JavaScript runtime - development headers +Group: Development/Languages +Requires: %{name} = %{version}-%{release} +Requires: %{?scl_prefix}libuv-devel %{?scl_prefix}http-parser-devel openssl-devel %{?scl_prefix}c-ares-devel zlib-devel + +%description devel +Development headers for the Node.js JavaScript runtime. + +%package docs +Summary: Node.js API documentation +Group: Documentation + +%description docs +The API documentation for the Node.js JavaScript runtime. + +%prep +%setup -q -n node-v%{version} + +# Make sure nothing gets included from bundled deps: +# We only delete the source and header files, because +# the remaining build scripts are still used. + +find deps/cares -name "*.c" -exec rm -f {} \; +find deps/cares -name "*.h" -exec rm -f {} \; + +find deps/npm -name "*.c" -exec rm -f {} \; +find deps/npm -name "*.h" -exec rm -f {} \; + +find deps/zlib -name "*.c" -exec rm -f {} \; +find deps/zlib -name "*.h" -exec rm -f {} \; + +find deps/v8 -name "*.c" -exec rm -f {} \; +find deps/v8 -name "*.h" -exec rm -f {} \; + +find deps/http_parser -name "*.c" -exec rm -f {} \; +find deps/http_parser -name "*.h" -exec rm -f {} \; + +find deps/openssl -name "*.c" -exec rm -f {} \; +find deps/openssl -name "*.h" -exec rm -f {} \; + +find deps/uv -name "*.c" -exec rm -f {} \; +find deps/uv -name "*.h" -exec rm -f {} \; + + +%build +# build with debugging symbols and add defines from libuv (#892601) +export CFLAGS='%{optflags} -g -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \ + -I%{_includedir}' +export CXXFLAGS='%{optflags} -g -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \ + -I%{_includedir}' +export LDFLAGS='%{optflags} -L%{_libdir}' + +./configure --prefix=%{_prefix} \ + --shared-v8 \ + --shared-openssl \ + --shared-zlib \ + --shared-cares \ + --shared-libuv \ + --shared-http-parser \ + --without-npm \ + --without-dtrace + +# Setting BUILDTYPE=Debug builds both release and debug binaries +make BUILDTYPE=Debug %{?_smp_mflags} + +%install +rm -rf %{buildroot} + +./tools/install.py install %{buildroot} + +# and remove dtrace file again +rm -rf %{buildroot}/%{_prefix}/lib/dtrace + +# Set the binary permissions properly +chmod 0755 %{buildroot}/%{_bindir}/node + +# Install the debug binary and set its permissions +install -Dpm0755 out/Debug/node %{buildroot}/%{_bindir}/node_g + +# own the sitelib directory +mkdir -p %{buildroot}%{_prefix}/lib/node_modules + +#install documentation +mkdir -p %{buildroot}%{_defaultdocdir}/%{pkg_name}-docs-%{version}/html +cp -pr doc/* %{buildroot}%{_defaultdocdir}/%{pkg_name}-docs-%{version}/html +rm -f %{_defaultdocdir}/%{pkg_name}-docs-%{version}/html/nodejs.1 +cp -p LICENSE %{buildroot}%{_defaultdocdir}/%{pkg_name}-docs-%{version}/ + +#install development headers +#FIXME: we probably don't really need *.h but node-gyp downloads the whole +#freaking source tree so I can't be sure ATM +mkdir -p %{buildroot}%{_includedir}/node +cp -p src/*.h %{buildroot}%{_includedir}/node + +#node-gyp needs common.gypi too +mkdir -p %{buildroot}%{_datadir}/node +cp -p common.gypi %{buildroot}%{_datadir}/node + +%files +%doc ChangeLog LICENSE README.md AUTHORS +%{_bindir}/node +%{_mandir}/man1/node.* +%dir %{_prefix}/lib/node_modules + +%files devel +%{_bindir}/node_g +%{_includedir}/node +%{_datadir}/node + +%files docs +%{_defaultdocdir}/%{pkg_name}-docs-%{version} + +%changelog +* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 0.10.3-3 +- Add support for software collections +- Move rpm macros and tooling to separate package + +* Thu Apr 04 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.3-2 +- nodejs-symlink-deps: symlink unconditionally in the buildroot + +* Wed Apr 03 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.3-1 +- new upstream release 0.10.3 + http://blog.nodejs.org/2013/04/03/node-v0-10-3-stable/ +- nodejs-symlink-deps: only create symlink if target exists +- nodejs-symlink-deps: symlink devDependencies when --check is used + +* Sun Mar 31 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.2-1 +- new upstream release 0.10.2 + http://blog.nodejs.org/2013/03/28/node-v0-10-2-stable/ +- remove %%nodejs_arches macro since it will only be useful if it is present in + the redhat-rpm-config package +- add default filtering macro to remove unwanted Provides from native modules +- nodejs-symlink-deps now supports multiple modules in one SRPM properly +- nodejs-symlink-deps also now supports a --check argument that works in the + current working directry instead of the buildroot + +* Fri Mar 22 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.1-1 +- new upstream release 0.10.1 + http://blog.nodejs.org/2013/03/21/node-v0-10-1-stable/ + +* Wed Mar 20 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.0-4 +- fix escaping in dependency generator regular expressions (RHBZ#923941) + +* Wed Mar 13 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.0-3 +- add virtual ABI provides for node and v8 so binary module's deps break when + binary compatibility is broken +- automatically add matching Requires to nodejs binary modules +- add %%nodejs_arches macro to future-proof ExcluseArch stanza in dependent + packages + +* Tue Mar 12 2013 Stephen Gallagher <sgallagh@redhat.com> - 0.10.0-2 +- Fix up documentation subpackage + +* Mon Mar 11 2013 Stephen Gallagher <sgallagh@redhat.com> - 0.10.0-1 +- Update to stable 0.10.0 release +- https://raw.github.com/joyent/node/v0.10.0/ChangeLog + +* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.5-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Tue Jan 22 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-10 +- minor bugfixes to RPM magic + - nodejs-symlink-deps: don't create an empty node_modules dir when a module + has no dependencies + - nodes-fixdep: support adding deps when none exist +- Add the full set of headers usually bundled with node as deps to nodejs-devel. + This way `npm install` for native modules that assume the stuff bundled with + node exists will usually "just work". +-move RPM magic to nodejs-devel as requested by FPC + +* Sat Jan 12 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-9 +- fix brown paper bag bug in requires generation script + +* Thu Jan 10 2013 Stephen Gallagher <sgallagh@redhat.com> - 0.9.5-8 +- Build debug binary and install it in the nodejs-devel subpackage + +* Thu Jan 10 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-7 +- don't use make install since it rebuilds everything + +* Thu Jan 10 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-6 +- add %%{?isa}, epoch to v8 deps + +* Wed Jan 09 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-5 +- add defines to match libuv (#892601) +- make v8 dependency explicit (and thus more accurate) +- add -g to $C(XX)FLAGS instead of patching configure to add it +- don't write pointless 'npm(foo) > 0' deps + +* Sat Jan 05 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-4 +- install development headers +- add nodejs_sitearch macro + +* Wed Jan 02 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-3 +- make nodejs-symlink-deps actually work + +* Tue Jan 01 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-2 +- provide nodejs-devel so modules can BuildRequire it (and be consistent + with other interpreted languages in the distro) + +* Tue Jan 01 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-1 +- new upstream release 0.9.5 +- provide nodejs-devel for the moment +- fix minor bugs in RPM magic +- add nodejs_fixdep macro so packagers can easily adjust dependencies in + package.json files + +* Wed Dec 26 2012 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.4-1 +- new upstream release 0.9.4 +- system library patches are now upstream +- respect optflags +- include documentation in subpackage +- add RPM dependency generation and related magic +- guard libuv depedency so it always gets bumped when nodejs does +- add -devel subpackage with enough to make node-gyp happy + +* Wed Dec 19 2012 Dan HorĂ¡k <dan[at]danny.cz> - 0.9.3-8 +- set exclusive arch list to match v8 + +* Tue Dec 18 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-7 +- Add remaining changes from code review +- Remove unnecessary BuildRequires on findutils +- Remove %%clean section + +* Fri Dec 14 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-6 +- Fixes from code review +- Fix executable permissions +- Correct the License field +- Build debuginfo properly + +* Thu Dec 13 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-5 +- Return back to using the standard binary name +- Temporarily adding a conflict against the ham radio node package until they + complete an agreed rename of their binary. + +* Wed Nov 28 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-4 +- Rename binary and manpage to nodejs + +* Mon Nov 19 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-3 +- Update to latest upstream development release 0.9.3 +- Include upstreamed patches to unbundle dependent libraries + +* Tue Oct 23 2012 Adrian Alves <alvesadrian@fedoraproject.org> 0.8.12-1 +- Fixes and Patches suggested by Matthias Runge + +* Mon Apr 09 2012 Adrian Alves <alvesadrian@fedoraproject.org> 0.6.5 +- First build. diff --git a/test/spec/nodejs-good.spec b/test/spec/nodejs-good.spec new file mode 100644 index 0000000..4f1d8dc --- /dev/null +++ b/test/spec/nodejs-good.spec @@ -0,0 +1,302 @@ +%{?scl:%scl_package nodejs} +%{!?scl:%global pkg_name %{name}} + +Name: %{?scl_prefix}nodejs +Version: 0.10.3 +Release: 3%{?dist} +Summary: JavaScript runtime +License: MIT and ASL 2.0 and ISC and BSD +Group: Development/Languages +URL: http://nodejs.org/ + +# Exclusive archs must match v8 +ExclusiveArch: %{ix86} x86_64 %{arm} + +Source0: http://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz + +# V8 presently breaks ABI at least every x.y release while never bumping SONAME, +# so we need to be more explicit until spot fixes that +%global v8_ge 1:3.14.5.7 +%global v8_lt 1:3.15 +%global v8_abi 3.14 + +%{?scl:Requires: %{scl}-runtime} +BuildRequires: %{?scl_prefix}v8-devel >= %{v8_ge} +BuildRequires: %{?scl_prefix}http-parser-devel >= 2.0 +BuildRequires: %{?scl_prefix}libuv-devel +BuildRequires: %{?scl_prefix}c-ares-devel +BuildRequires: zlib-devel +# Node.js requires some features from openssl 1.0.1 for SPDY support +BuildRequires: openssl-devel + +Requires: %{?scl_prefix}v8%{?isa} >= %{v8_ge} +Requires: %{?scl_prefix}v8%{?isa} < %{v8_lt} + +#we need ABI virtual provides where SONAMEs aren't enough/not present so deps +#break when binary compatibility is broken +%global nodejs_abi 0.10 +Provides: %{?scl_prefix}nodejs(abi) = %{nodejs_abi} +Provides: %{?scl_prefix}nodejs(v8-abi) = %{v8_abi} + +#this corresponds to the "engine" requirement in package.json +Provides: %{?scl_prefix}nodejs(engine) = %{version} + +# Node.js currently has a conflict with the 'node' package in Fedora +# The ham-radio group has agreed to rename their binary for us, but +# in the meantime, we're setting an explicit Conflicts: %{?scl_prefix}here +Conflicts: %{?scl_prefix}node <= 0.3.2-11 + +%description +Node.js is a platform built on Chrome's JavaScript runtime +for easily building fast, scalable network applications. +Node.js uses an event-driven, non-blocking I/O model that +makes it lightweight and efficient, perfect for data-intensive +real-time applications that run across distributed devices. + +%package devel +Summary: JavaScript runtime - development headers +Group: Development/Languages +Requires: %{name} = %{version}-%{release} +Requires: %{?scl_prefix}libuv-devel %{?scl_prefix}http-parser-devel openssl-devel %{?scl_prefix}c-ares-devel zlib-devel + +%description devel +Development headers for the Node.js JavaScript runtime. + +%package docs +Summary: Node.js API documentation +Group: Documentation + +%description docs +The API documentation for the Node.js JavaScript runtime. + +%prep +%setup -q -n node-v%{version} + +# Make sure nothing gets included from bundled deps: +# We only delete the source and header files, because +# the remaining build scripts are still used. + +find deps/cares -name "*.c" -exec rm -f {} \; +find deps/cares -name "*.h" -exec rm -f {} \; + +find deps/npm -name "*.c" -exec rm -f {} \; +find deps/npm -name "*.h" -exec rm -f {} \; + +find deps/zlib -name "*.c" -exec rm -f {} \; +find deps/zlib -name "*.h" -exec rm -f {} \; + +find deps/v8 -name "*.c" -exec rm -f {} \; +find deps/v8 -name "*.h" -exec rm -f {} \; + +find deps/http_parser -name "*.c" -exec rm -f {} \; +find deps/http_parser -name "*.h" -exec rm -f {} \; + +find deps/openssl -name "*.c" -exec rm -f {} \; +find deps/openssl -name "*.h" -exec rm -f {} \; + +find deps/uv -name "*.c" -exec rm -f {} \; +find deps/uv -name "*.h" -exec rm -f {} \; + + +%build +# build with debugging symbols and add defines from libuv (#892601) +export CFLAGS='%{optflags} -g -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \ + -I%{_includedir}' +export CXXFLAGS='%{optflags} -g -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \ + -I%{_includedir}' +export LDFLAGS='%{optflags} -L%{_libdir}' + +./configure --prefix=%{_prefix} \ + --shared-v8 \ + --shared-openssl \ + --shared-zlib \ + --shared-cares \ + --shared-libuv \ + --shared-http-parser \ + --without-npm \ + --without-dtrace + +# Setting BUILDTYPE=Debug builds both release and debug binaries +make BUILDTYPE=Debug %{?_smp_mflags} + +%install +rm -rf %{buildroot} + +./tools/install.py install %{buildroot} + +# and remove dtrace file again +rm -rf %{buildroot}/%{_prefix}/lib/dtrace + +# Set the binary permissions properly +chmod 0755 %{buildroot}/%{_bindir}/node + +# Install the debug binary and set its permissions +install -Dpm0755 out/Debug/node %{buildroot}/%{_bindir}/node_g + +# own the sitelib directory +mkdir -p %{buildroot}%{_prefix}/lib/node_modules + +#install documentation +mkdir -p %{buildroot}%{_defaultdocdir}/%{pkg_name}-docs-%{version}/html +cp -pr doc/* %{buildroot}%{_defaultdocdir}/%{pkg_name}-docs-%{version}/html +rm -f %{_defaultdocdir}/%{pkg_name}-docs-%{version}/html/nodejs.1 +cp -p LICENSE %{buildroot}%{_defaultdocdir}/%{pkg_name}-docs-%{version}/ + +#install development headers +#FIXME: we probably don't really need *.h but node-gyp downloads the whole +#freaking source tree so I can't be sure ATM +mkdir -p %{buildroot}%{_includedir}/node +cp -p src/*.h %{buildroot}%{_includedir}/node + +#node-gyp needs common.gypi too +mkdir -p %{buildroot}%{_datadir}/node +cp -p common.gypi %{buildroot}%{_datadir}/node + +%files +%doc ChangeLog LICENSE README.md AUTHORS +%{_bindir}/node +%{_mandir}/man1/node.* +%dir %{_prefix}/lib/node_modules + +%files devel +%{_bindir}/node_g +%{_includedir}/node +%{_datadir}/node + +%files docs +%{_defaultdocdir}/%{pkg_name}-docs-%{version} + +%changelog +* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 0.10.3-3 +- Add support for software collections +- Move rpm macros and tooling to separate package + +* Thu Apr 04 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.3-2 +- nodejs-symlink-deps: symlink unconditionally in the buildroot + +* Wed Apr 03 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.3-1 +- new upstream release 0.10.3 + http://blog.nodejs.org/2013/04/03/node-v0-10-3-stable/ +- nodejs-symlink-deps: only create symlink if target exists +- nodejs-symlink-deps: symlink devDependencies when --check is used + +* Sun Mar 31 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.2-1 +- new upstream release 0.10.2 + http://blog.nodejs.org/2013/03/28/node-v0-10-2-stable/ +- remove %%nodejs_arches macro since it will only be useful if it is present in + the redhat-rpm-config package +- add default filtering macro to remove unwanted Provides from native modules +- nodejs-symlink-deps now supports multiple modules in one SRPM properly +- nodejs-symlink-deps also now supports a --check argument that works in the + current working directry instead of the buildroot + +* Fri Mar 22 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.1-1 +- new upstream release 0.10.1 + http://blog.nodejs.org/2013/03/21/node-v0-10-1-stable/ + +* Wed Mar 20 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.0-4 +- fix escaping in dependency generator regular expressions (RHBZ#923941) + +* Wed Mar 13 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.0-3 +- add virtual ABI provides for node and v8 so binary module's deps break when + binary compatibility is broken +- automatically add matching Requires to nodejs binary modules +- add %%nodejs_arches macro to future-proof ExcluseArch stanza in dependent + packages + +* Tue Mar 12 2013 Stephen Gallagher <sgallagh@redhat.com> - 0.10.0-2 +- Fix up documentation subpackage + +* Mon Mar 11 2013 Stephen Gallagher <sgallagh@redhat.com> - 0.10.0-1 +- Update to stable 0.10.0 release +- https://raw.github.com/joyent/node/v0.10.0/ChangeLog + +* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.5-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Tue Jan 22 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-10 +- minor bugfixes to RPM magic + - nodejs-symlink-deps: don't create an empty node_modules dir when a module + has no dependencies + - nodes-fixdep: support adding deps when none exist +- Add the full set of headers usually bundled with node as deps to nodejs-devel. + This way `npm install` for native modules that assume the stuff bundled with + node exists will usually "just work". +-move RPM magic to nodejs-devel as requested by FPC + +* Sat Jan 12 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-9 +- fix brown paper bag bug in requires generation script + +* Thu Jan 10 2013 Stephen Gallagher <sgallagh@redhat.com> - 0.9.5-8 +- Build debug binary and install it in the nodejs-devel subpackage + +* Thu Jan 10 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-7 +- don't use make install since it rebuilds everything + +* Thu Jan 10 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-6 +- add %%{?isa}, epoch to v8 deps + +* Wed Jan 09 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-5 +- add defines to match libuv (#892601) +- make v8 dependency explicit (and thus more accurate) +- add -g to $C(XX)FLAGS instead of patching configure to add it +- don't write pointless 'npm(foo) > 0' deps + +* Sat Jan 05 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-4 +- install development headers +- add nodejs_sitearch macro + +* Wed Jan 02 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-3 +- make nodejs-symlink-deps actually work + +* Tue Jan 01 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-2 +- provide nodejs-devel so modules can BuildRequire it (and be consistent + with other interpreted languages in the distro) + +* Tue Jan 01 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-1 +- new upstream release 0.9.5 +- provide nodejs-devel for the moment +- fix minor bugs in RPM magic +- add nodejs_fixdep macro so packagers can easily adjust dependencies in + package.json files + +* Wed Dec 26 2012 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.4-1 +- new upstream release 0.9.4 +- system library patches are now upstream +- respect optflags +- include documentation in subpackage +- add RPM dependency generation and related magic +- guard libuv depedency so it always gets bumped when nodejs does +- add -devel subpackage with enough to make node-gyp happy + +* Wed Dec 19 2012 Dan HorĂ¡k <dan[at]danny.cz> - 0.9.3-8 +- set exclusive arch list to match v8 + +* Tue Dec 18 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-7 +- Add remaining changes from code review +- Remove unnecessary BuildRequires on findutils +- Remove %%clean section + +* Fri Dec 14 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-6 +- Fixes from code review +- Fix executable permissions +- Correct the License field +- Build debuginfo properly + +* Thu Dec 13 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-5 +- Return back to using the standard binary name +- Temporarily adding a conflict against the ham radio node package until they + complete an agreed rename of their binary. + +* Wed Nov 28 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-4 +- Rename binary and manpage to nodejs + +* Mon Nov 19 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-3 +- Update to latest upstream development release 0.9.3 +- Include upstreamed patches to unbundle dependent libraries + +* Tue Oct 23 2012 Adrian Alves <alvesadrian@fedoraproject.org> 0.8.12-1 +- Fixes and Patches suggested by Matthias Runge + +* Mon Apr 09 2012 Adrian Alves <alvesadrian@fedoraproject.org> 0.6.5 +- First build. diff --git a/test/spec/nodejs-n-noprefix.spec b/test/spec/nodejs-n-noprefix.spec new file mode 100644 index 0000000..128d08b --- /dev/null +++ b/test/spec/nodejs-n-noprefix.spec @@ -0,0 +1,302 @@ +%{?scl:%scl_package nodejs} +%{!?scl:%global pkg_name %{name}} + +Name: %{?scl_prefix}nodejs +Version: 0.10.3 +Release: 3%{?dist} +Summary: JavaScript runtime +License: MIT and ASL 2.0 and ISC and BSD +Group: Development/Languages +URL: http://nodejs.org/ + +# Exclusive archs must match v8 +ExclusiveArch: %{ix86} x86_64 %{arm} + +Source0: http://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz + +# V8 presently breaks ABI at least every x.y release while never bumping SONAME, +# so we need to be more explicit until spot fixes that +%global v8_ge 1:3.14.5.7 +%global v8_lt 1:3.15 +%global v8_abi 3.14 + +%{?scl:Requires: %{scl}-runtime} +BuildRequires: %{?scl_prefix}v8-devel >= %{v8_ge} +BuildRequires: %{?scl_prefix}http-parser-devel >= 2.0 +BuildRequires: %{?scl_prefix}libuv-devel +BuildRequires: %{?scl_prefix}c-ares-devel +BuildRequires: zlib-devel +# Node.js requires some features from openssl 1.0.1 for SPDY support +BuildRequires: openssl-devel + +Requires: %{?scl_prefix}v8%{?isa} >= %{v8_ge} +Requires: %{?scl_prefix}v8%{?isa} < %{v8_lt} + +#we need ABI virtual provides where SONAMEs aren't enough/not present so deps +#break when binary compatibility is broken +%global nodejs_abi 0.10 +Provides: %{?scl_prefix}nodejs(abi) = %{nodejs_abi} +Provides: %{?scl_prefix}nodejs(v8-abi) = %{v8_abi} + +#this corresponds to the "engine" requirement in package.json +Provides: %{?scl_prefix}nodejs(engine) = %{version} + +# Node.js currently has a conflict with the 'node' package in Fedora +# The ham-radio group has agreed to rename their binary for us, but +# in the meantime, we're setting an explicit Conflicts: %{?scl_prefix}here +Conflicts: %{?scl_prefix}node <= 0.3.2-11 + +%description +Node.js is a platform built on Chrome's JavaScript runtime +for easily building fast, scalable network applications. +Node.js uses an event-driven, non-blocking I/O model that +makes it lightweight and efficient, perfect for data-intensive +real-time applications that run across distributed devices. + +%package -n nodejs-devel +Summary: JavaScript runtime - development headers +Group: Development/Languages +Requires: %{name} = %{version}-%{release} +Requires: %{?scl_prefix}libuv-devel %{?scl_prefix}http-parser-devel openssl-devel %{?scl_prefix}c-ares-devel zlib-devel + +%description devel +Development headers for the Node.js JavaScript runtime. + +%package docs +Summary: Node.js API documentation +Group: Documentation + +%description docs +The API documentation for the Node.js JavaScript runtime. + +%prep +%setup -q -n node-v%{version} + +# Make sure nothing gets included from bundled deps: +# We only delete the source and header files, because +# the remaining build scripts are still used. + +find deps/cares -name "*.c" -exec rm -f {} \; +find deps/cares -name "*.h" -exec rm -f {} \; + +find deps/npm -name "*.c" -exec rm -f {} \; +find deps/npm -name "*.h" -exec rm -f {} \; + +find deps/zlib -name "*.c" -exec rm -f {} \; +find deps/zlib -name "*.h" -exec rm -f {} \; + +find deps/v8 -name "*.c" -exec rm -f {} \; +find deps/v8 -name "*.h" -exec rm -f {} \; + +find deps/http_parser -name "*.c" -exec rm -f {} \; +find deps/http_parser -name "*.h" -exec rm -f {} \; + +find deps/openssl -name "*.c" -exec rm -f {} \; +find deps/openssl -name "*.h" -exec rm -f {} \; + +find deps/uv -name "*.c" -exec rm -f {} \; +find deps/uv -name "*.h" -exec rm -f {} \; + + +%build +# build with debugging symbols and add defines from libuv (#892601) +export CFLAGS='%{optflags} -g -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \ + -I%{_includedir}' +export CXXFLAGS='%{optflags} -g -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \ + -I%{_includedir}' +export LDFLAGS='%{optflags} -L%{_libdir}' + +./configure --prefix=%{_prefix} \ + --shared-v8 \ + --shared-openssl \ + --shared-zlib \ + --shared-cares \ + --shared-libuv \ + --shared-http-parser \ + --without-npm \ + --without-dtrace + +# Setting BUILDTYPE=Debug builds both release and debug binaries +make BUILDTYPE=Debug %{?_smp_mflags} + +%install +rm -rf %{buildroot} + +./tools/install.py install %{buildroot} + +# and remove dtrace file again +rm -rf %{buildroot}/%{_prefix}/lib/dtrace + +# Set the binary permissions properly +chmod 0755 %{buildroot}/%{_bindir}/node + +# Install the debug binary and set its permissions +install -Dpm0755 out/Debug/node %{buildroot}/%{_bindir}/node_g + +# own the sitelib directory +mkdir -p %{buildroot}%{_prefix}/lib/node_modules + +#install documentation +mkdir -p %{buildroot}%{_defaultdocdir}/%{pkg_name}-docs-%{version}/html +cp -pr doc/* %{buildroot}%{_defaultdocdir}/%{pkg_name}-docs-%{version}/html +rm -f %{_defaultdocdir}/%{pkg_name}-docs-%{version}/html/nodejs.1 +cp -p LICENSE %{buildroot}%{_defaultdocdir}/%{pkg_name}-docs-%{version}/ + +#install development headers +#FIXME: we probably don't really need *.h but node-gyp downloads the whole +#freaking source tree so I can't be sure ATM +mkdir -p %{buildroot}%{_includedir}/node +cp -p src/*.h %{buildroot}%{_includedir}/node + +#node-gyp needs common.gypi too +mkdir -p %{buildroot}%{_datadir}/node +cp -p common.gypi %{buildroot}%{_datadir}/node + +%files +%doc ChangeLog LICENSE README.md AUTHORS +%{_bindir}/node +%{_mandir}/man1/node.* +%dir %{_prefix}/lib/node_modules + +%files devel +%{_bindir}/node_g +%{_includedir}/node +%{_datadir}/node + +%files docs +%{_defaultdocdir}/%{pkg_name}-docs-%{version} + +%changelog +* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 0.10.3-3 +- Add support for software collections +- Move rpm macros and tooling to separate package + +* Thu Apr 04 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.3-2 +- nodejs-symlink-deps: symlink unconditionally in the buildroot + +* Wed Apr 03 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.3-1 +- new upstream release 0.10.3 + http://blog.nodejs.org/2013/04/03/node-v0-10-3-stable/ +- nodejs-symlink-deps: only create symlink if target exists +- nodejs-symlink-deps: symlink devDependencies when --check is used + +* Sun Mar 31 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.2-1 +- new upstream release 0.10.2 + http://blog.nodejs.org/2013/03/28/node-v0-10-2-stable/ +- remove %%nodejs_arches macro since it will only be useful if it is present in + the redhat-rpm-config package +- add default filtering macro to remove unwanted Provides from native modules +- nodejs-symlink-deps now supports multiple modules in one SRPM properly +- nodejs-symlink-deps also now supports a --check argument that works in the + current working directry instead of the buildroot + +* Fri Mar 22 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.1-1 +- new upstream release 0.10.1 + http://blog.nodejs.org/2013/03/21/node-v0-10-1-stable/ + +* Wed Mar 20 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.0-4 +- fix escaping in dependency generator regular expressions (RHBZ#923941) + +* Wed Mar 13 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.0-3 +- add virtual ABI provides for node and v8 so binary module's deps break when + binary compatibility is broken +- automatically add matching Requires to nodejs binary modules +- add %%nodejs_arches macro to future-proof ExcluseArch stanza in dependent + packages + +* Tue Mar 12 2013 Stephen Gallagher <sgallagh@redhat.com> - 0.10.0-2 +- Fix up documentation subpackage + +* Mon Mar 11 2013 Stephen Gallagher <sgallagh@redhat.com> - 0.10.0-1 +- Update to stable 0.10.0 release +- https://raw.github.com/joyent/node/v0.10.0/ChangeLog + +* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.5-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Tue Jan 22 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-10 +- minor bugfixes to RPM magic + - nodejs-symlink-deps: don't create an empty node_modules dir when a module + has no dependencies + - nodes-fixdep: support adding deps when none exist +- Add the full set of headers usually bundled with node as deps to nodejs-devel. + This way `npm install` for native modules that assume the stuff bundled with + node exists will usually "just work". +-move RPM magic to nodejs-devel as requested by FPC + +* Sat Jan 12 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-9 +- fix brown paper bag bug in requires generation script + +* Thu Jan 10 2013 Stephen Gallagher <sgallagh@redhat.com> - 0.9.5-8 +- Build debug binary and install it in the nodejs-devel subpackage + +* Thu Jan 10 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-7 +- don't use make install since it rebuilds everything + +* Thu Jan 10 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-6 +- add %%{?isa}, epoch to v8 deps + +* Wed Jan 09 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-5 +- add defines to match libuv (#892601) +- make v8 dependency explicit (and thus more accurate) +- add -g to $C(XX)FLAGS instead of patching configure to add it +- don't write pointless 'npm(foo) > 0' deps + +* Sat Jan 05 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-4 +- install development headers +- add nodejs_sitearch macro + +* Wed Jan 02 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-3 +- make nodejs-symlink-deps actually work + +* Tue Jan 01 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-2 +- provide nodejs-devel so modules can BuildRequire it (and be consistent + with other interpreted languages in the distro) + +* Tue Jan 01 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-1 +- new upstream release 0.9.5 +- provide nodejs-devel for the moment +- fix minor bugs in RPM magic +- add nodejs_fixdep macro so packagers can easily adjust dependencies in + package.json files + +* Wed Dec 26 2012 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.4-1 +- new upstream release 0.9.4 +- system library patches are now upstream +- respect optflags +- include documentation in subpackage +- add RPM dependency generation and related magic +- guard libuv depedency so it always gets bumped when nodejs does +- add -devel subpackage with enough to make node-gyp happy + +* Wed Dec 19 2012 Dan HorĂ¡k <dan[at]danny.cz> - 0.9.3-8 +- set exclusive arch list to match v8 + +* Tue Dec 18 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-7 +- Add remaining changes from code review +- Remove unnecessary BuildRequires on findutils +- Remove %%clean section + +* Fri Dec 14 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-6 +- Fixes from code review +- Fix executable permissions +- Correct the License field +- Build debuginfo properly + +* Thu Dec 13 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-5 +- Return back to using the standard binary name +- Temporarily adding a conflict against the ham radio node package until they + complete an agreed rename of their binary. + +* Wed Nov 28 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-4 +- Rename binary and manpage to nodejs + +* Mon Nov 19 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-3 +- Update to latest upstream development release 0.9.3 +- Include upstreamed patches to unbundle dependent libraries + +* Tue Oct 23 2012 Adrian Alves <alvesadrian@fedoraproject.org> 0.8.12-1 +- Fixes and Patches suggested by Matthias Runge + +* Mon Apr 09 2012 Adrian Alves <alvesadrian@fedoraproject.org> 0.6.5 +- First build. diff --git a/test/spec/nodejs-name-with-noncondition-prefix.spec b/test/spec/nodejs-name-with-noncondition-prefix.spec new file mode 100644 index 0000000..c52a103 --- /dev/null +++ b/test/spec/nodejs-name-with-noncondition-prefix.spec @@ -0,0 +1,302 @@ +%{?scl:%scl_package nodejs} +%{!?scl:%global pkg_name %{name}} + +Name: %{scl_prefix}nodejs +Version: 0.10.3 +Release: 3%{?dist} +Summary: JavaScript runtime +License: MIT and ASL 2.0 and ISC and BSD +Group: Development/Languages +URL: http://nodejs.org/ + +# Exclusive archs must match v8 +ExclusiveArch: %{ix86} x86_64 %{arm} + +Source0: http://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz + +# V8 presently breaks ABI at least every x.y release while never bumping SONAME, +# so we need to be more explicit until spot fixes that +%global v8_ge 1:3.14.5.7 +%global v8_lt 1:3.15 +%global v8_abi 3.14 + +%{?scl:Requires: %{scl}-runtime} +BuildRequires: %{?scl_prefix}v8-devel >= %{v8_ge} +BuildRequires: %{?scl_prefix}http-parser-devel >= 2.0 +BuildRequires: %{?scl_prefix}libuv-devel +BuildRequires: %{?scl_prefix}c-ares-devel +BuildRequires: zlib-devel +# Node.js requires some features from openssl 1.0.1 for SPDY support +BuildRequires: openssl-devel + +Requires: %{?scl_prefix}v8%{?isa} >= %{v8_ge} +Requires: %{?scl_prefix}v8%{?isa} < %{v8_lt} + +#we need ABI virtual provides where SONAMEs aren't enough/not present so deps +#break when binary compatibility is broken +%global nodejs_abi 0.10 +Provides: %{?scl_prefix}nodejs(abi) = %{nodejs_abi} +Provides: %{?scl_prefix}nodejs(v8-abi) = %{v8_abi} + +#this corresponds to the "engine" requirement in package.json +Provides: %{?scl_prefix}nodejs(engine) = %{version} + +# Node.js currently has a conflict with the 'node' package in Fedora +# The ham-radio group has agreed to rename their binary for us, but +# in the meantime, we're setting an explicit Conflicts: %{?scl_prefix}here +Conflicts: %{?scl_prefix}node <= 0.3.2-11 + +%description +Node.js is a platform built on Chrome's JavaScript runtime +for easily building fast, scalable network applications. +Node.js uses an event-driven, non-blocking I/O model that +makes it lightweight and efficient, perfect for data-intensive +real-time applications that run across distributed devices. + +%package devel +Summary: JavaScript runtime - development headers +Group: Development/Languages +Requires: %{name} = %{version}-%{release} +Requires: %{?scl_prefix}libuv-devel %{?scl_prefix}http-parser-devel openssl-devel %{?scl_prefix}c-ares-devel zlib-devel + +%description devel +Development headers for the Node.js JavaScript runtime. + +%package docs +Summary: Node.js API documentation +Group: Documentation + +%description docs +The API documentation for the Node.js JavaScript runtime. + +%prep +%setup -q -n node-v%{version} + +# Make sure nothing gets included from bundled deps: +# We only delete the source and header files, because +# the remaining build scripts are still used. + +find deps/cares -name "*.c" -exec rm -f {} \; +find deps/cares -name "*.h" -exec rm -f {} \; + +find deps/npm -name "*.c" -exec rm -f {} \; +find deps/npm -name "*.h" -exec rm -f {} \; + +find deps/zlib -name "*.c" -exec rm -f {} \; +find deps/zlib -name "*.h" -exec rm -f {} \; + +find deps/v8 -name "*.c" -exec rm -f {} \; +find deps/v8 -name "*.h" -exec rm -f {} \; + +find deps/http_parser -name "*.c" -exec rm -f {} \; +find deps/http_parser -name "*.h" -exec rm -f {} \; + +find deps/openssl -name "*.c" -exec rm -f {} \; +find deps/openssl -name "*.h" -exec rm -f {} \; + +find deps/uv -name "*.c" -exec rm -f {} \; +find deps/uv -name "*.h" -exec rm -f {} \; + + +%build +# build with debugging symbols and add defines from libuv (#892601) +export CFLAGS='%{optflags} -g -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \ + -I%{_includedir}' +export CXXFLAGS='%{optflags} -g -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \ + -I%{_includedir}' +export LDFLAGS='%{optflags} -L%{_libdir}' + +./configure --prefix=%{_prefix} \ + --shared-v8 \ + --shared-openssl \ + --shared-zlib \ + --shared-cares \ + --shared-libuv \ + --shared-http-parser \ + --without-npm \ + --without-dtrace + +# Setting BUILDTYPE=Debug builds both release and debug binaries +make BUILDTYPE=Debug %{?_smp_mflags} + +%install +rm -rf %{buildroot} + +./tools/install.py install %{buildroot} + +# and remove dtrace file again +rm -rf %{buildroot}/%{_prefix}/lib/dtrace + +# Set the binary permissions properly +chmod 0755 %{buildroot}/%{_bindir}/node + +# Install the debug binary and set its permissions +install -Dpm0755 out/Debug/node %{buildroot}/%{_bindir}/node_g + +# own the sitelib directory +mkdir -p %{buildroot}%{_prefix}/lib/node_modules + +#install documentation +mkdir -p %{buildroot}%{_defaultdocdir}/%{pkg_name}-docs-%{version}/html +cp -pr doc/* %{buildroot}%{_defaultdocdir}/%{pkg_name}-docs-%{version}/html +rm -f %{_defaultdocdir}/%{pkg_name}-docs-%{version}/html/nodejs.1 +cp -p LICENSE %{buildroot}%{_defaultdocdir}/%{pkg_name}-docs-%{version}/ + +#install development headers +#FIXME: we probably don't really need *.h but node-gyp downloads the whole +#freaking source tree so I can't be sure ATM +mkdir -p %{buildroot}%{_includedir}/node +cp -p src/*.h %{buildroot}%{_includedir}/node + +#node-gyp needs common.gypi too +mkdir -p %{buildroot}%{_datadir}/node +cp -p common.gypi %{buildroot}%{_datadir}/node + +%files +%doc ChangeLog LICENSE README.md AUTHORS +%{_bindir}/node +%{_mandir}/man1/node.* +%dir %{_prefix}/lib/node_modules + +%files devel +%{_bindir}/node_g +%{_includedir}/node +%{_datadir}/node + +%files docs +%{_defaultdocdir}/%{pkg_name}-docs-%{version} + +%changelog +* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 0.10.3-3 +- Add support for software collections +- Move rpm macros and tooling to separate package + +* Thu Apr 04 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.3-2 +- nodejs-symlink-deps: symlink unconditionally in the buildroot + +* Wed Apr 03 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.3-1 +- new upstream release 0.10.3 + http://blog.nodejs.org/2013/04/03/node-v0-10-3-stable/ +- nodejs-symlink-deps: only create symlink if target exists +- nodejs-symlink-deps: symlink devDependencies when --check is used + +* Sun Mar 31 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.2-1 +- new upstream release 0.10.2 + http://blog.nodejs.org/2013/03/28/node-v0-10-2-stable/ +- remove %%nodejs_arches macro since it will only be useful if it is present in + the redhat-rpm-config package +- add default filtering macro to remove unwanted Provides from native modules +- nodejs-symlink-deps now supports multiple modules in one SRPM properly +- nodejs-symlink-deps also now supports a --check argument that works in the + current working directry instead of the buildroot + +* Fri Mar 22 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.1-1 +- new upstream release 0.10.1 + http://blog.nodejs.org/2013/03/21/node-v0-10-1-stable/ + +* Wed Mar 20 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.0-4 +- fix escaping in dependency generator regular expressions (RHBZ#923941) + +* Wed Mar 13 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.0-3 +- add virtual ABI provides for node and v8 so binary module's deps break when + binary compatibility is broken +- automatically add matching Requires to nodejs binary modules +- add %%nodejs_arches macro to future-proof ExcluseArch stanza in dependent + packages + +* Tue Mar 12 2013 Stephen Gallagher <sgallagh@redhat.com> - 0.10.0-2 +- Fix up documentation subpackage + +* Mon Mar 11 2013 Stephen Gallagher <sgallagh@redhat.com> - 0.10.0-1 +- Update to stable 0.10.0 release +- https://raw.github.com/joyent/node/v0.10.0/ChangeLog + +* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.5-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Tue Jan 22 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-10 +- minor bugfixes to RPM magic + - nodejs-symlink-deps: don't create an empty node_modules dir when a module + has no dependencies + - nodes-fixdep: support adding deps when none exist +- Add the full set of headers usually bundled with node as deps to nodejs-devel. + This way `npm install` for native modules that assume the stuff bundled with + node exists will usually "just work". +-move RPM magic to nodejs-devel as requested by FPC + +* Sat Jan 12 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-9 +- fix brown paper bag bug in requires generation script + +* Thu Jan 10 2013 Stephen Gallagher <sgallagh@redhat.com> - 0.9.5-8 +- Build debug binary and install it in the nodejs-devel subpackage + +* Thu Jan 10 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-7 +- don't use make install since it rebuilds everything + +* Thu Jan 10 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-6 +- add %%{?isa}, epoch to v8 deps + +* Wed Jan 09 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-5 +- add defines to match libuv (#892601) +- make v8 dependency explicit (and thus more accurate) +- add -g to $C(XX)FLAGS instead of patching configure to add it +- don't write pointless 'npm(foo) > 0' deps + +* Sat Jan 05 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-4 +- install development headers +- add nodejs_sitearch macro + +* Wed Jan 02 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-3 +- make nodejs-symlink-deps actually work + +* Tue Jan 01 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-2 +- provide nodejs-devel so modules can BuildRequire it (and be consistent + with other interpreted languages in the distro) + +* Tue Jan 01 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-1 +- new upstream release 0.9.5 +- provide nodejs-devel for the moment +- fix minor bugs in RPM magic +- add nodejs_fixdep macro so packagers can easily adjust dependencies in + package.json files + +* Wed Dec 26 2012 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.4-1 +- new upstream release 0.9.4 +- system library patches are now upstream +- respect optflags +- include documentation in subpackage +- add RPM dependency generation and related magic +- guard libuv depedency so it always gets bumped when nodejs does +- add -devel subpackage with enough to make node-gyp happy + +* Wed Dec 19 2012 Dan HorĂ¡k <dan[at]danny.cz> - 0.9.3-8 +- set exclusive arch list to match v8 + +* Tue Dec 18 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-7 +- Add remaining changes from code review +- Remove unnecessary BuildRequires on findutils +- Remove %%clean section + +* Fri Dec 14 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-6 +- Fixes from code review +- Fix executable permissions +- Correct the License field +- Build debuginfo properly + +* Thu Dec 13 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-5 +- Return back to using the standard binary name +- Temporarily adding a conflict against the ham radio node package until they + complete an agreed rename of their binary. + +* Wed Nov 28 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-4 +- Rename binary and manpage to nodejs + +* Mon Nov 19 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-3 +- Update to latest upstream development release 0.9.3 +- Include upstreamed patches to unbundle dependent libraries + +* Tue Oct 23 2012 Adrian Alves <alvesadrian@fedoraproject.org> 0.8.12-1 +- Fixes and Patches suggested by Matthias Runge + +* Mon Apr 09 2012 Adrian Alves <alvesadrian@fedoraproject.org> 0.6.5 +- First build. diff --git a/test/spec/nodejs-name-without-prefix.spec b/test/spec/nodejs-name-without-prefix.spec new file mode 100644 index 0000000..429a209 --- /dev/null +++ b/test/spec/nodejs-name-without-prefix.spec @@ -0,0 +1,302 @@ +%{?scl:%scl_package nodejs} +%{!?scl:%global pkg_name %{name}} + +Name: nodejs +Version: 0.10.3 +Release: 3%{?dist} +Summary: JavaScript runtime +License: MIT and ASL 2.0 and ISC and BSD +Group: Development/Languages +URL: http://nodejs.org/ + +# Exclusive archs must match v8 +ExclusiveArch: %{ix86} x86_64 %{arm} + +Source0: http://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz + +# V8 presently breaks ABI at least every x.y release while never bumping SONAME, +# so we need to be more explicit until spot fixes that +%global v8_ge 1:3.14.5.7 +%global v8_lt 1:3.15 +%global v8_abi 3.14 + +%{?scl:Requires: %{scl}-runtime} +BuildRequires: %{?scl_prefix}v8-devel >= %{v8_ge} +BuildRequires: %{?scl_prefix}http-parser-devel >= 2.0 +BuildRequires: %{?scl_prefix}libuv-devel +BuildRequires: %{?scl_prefix}c-ares-devel +BuildRequires: zlib-devel +# Node.js requires some features from openssl 1.0.1 for SPDY support +BuildRequires: openssl-devel + +Requires: %{?scl_prefix}v8%{?isa} >= %{v8_ge} +Requires: %{?scl_prefix}v8%{?isa} < %{v8_lt} + +#we need ABI virtual provides where SONAMEs aren't enough/not present so deps +#break when binary compatibility is broken +%global nodejs_abi 0.10 +Provides: %{?scl_prefix}nodejs(abi) = %{nodejs_abi} +Provides: %{?scl_prefix}nodejs(v8-abi) = %{v8_abi} + +#this corresponds to the "engine" requirement in package.json +Provides: %{?scl_prefix}nodejs(engine) = %{version} + +# Node.js currently has a conflict with the 'node' package in Fedora +# The ham-radio group has agreed to rename their binary for us, but +# in the meantime, we're setting an explicit Conflicts: %{?scl_prefix}here +Conflicts: %{?scl_prefix}node <= 0.3.2-11 + +%description +Node.js is a platform built on Chrome's JavaScript runtime +for easily building fast, scalable network applications. +Node.js uses an event-driven, non-blocking I/O model that +makes it lightweight and efficient, perfect for data-intensive +real-time applications that run across distributed devices. + +%package devel +Summary: JavaScript runtime - development headers +Group: Development/Languages +Requires: %{name} = %{version}-%{release} +Requires: %{?scl_prefix}libuv-devel %{?scl_prefix}http-parser-devel openssl-devel %{?scl_prefix}c-ares-devel zlib-devel + +%description devel +Development headers for the Node.js JavaScript runtime. + +%package docs +Summary: Node.js API documentation +Group: Documentation + +%description docs +The API documentation for the Node.js JavaScript runtime. + +%prep +%setup -q -n node-v%{version} + +# Make sure nothing gets included from bundled deps: +# We only delete the source and header files, because +# the remaining build scripts are still used. + +find deps/cares -name "*.c" -exec rm -f {} \; +find deps/cares -name "*.h" -exec rm -f {} \; + +find deps/npm -name "*.c" -exec rm -f {} \; +find deps/npm -name "*.h" -exec rm -f {} \; + +find deps/zlib -name "*.c" -exec rm -f {} \; +find deps/zlib -name "*.h" -exec rm -f {} \; + +find deps/v8 -name "*.c" -exec rm -f {} \; +find deps/v8 -name "*.h" -exec rm -f {} \; + +find deps/http_parser -name "*.c" -exec rm -f {} \; +find deps/http_parser -name "*.h" -exec rm -f {} \; + +find deps/openssl -name "*.c" -exec rm -f {} \; +find deps/openssl -name "*.h" -exec rm -f {} \; + +find deps/uv -name "*.c" -exec rm -f {} \; +find deps/uv -name "*.h" -exec rm -f {} \; + + +%build +# build with debugging symbols and add defines from libuv (#892601) +export CFLAGS='%{optflags} -g -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \ + -I%{_includedir}' +export CXXFLAGS='%{optflags} -g -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \ + -I%{_includedir}' +export LDFLAGS='%{optflags} -L%{_libdir}' + +./configure --prefix=%{_prefix} \ + --shared-v8 \ + --shared-openssl \ + --shared-zlib \ + --shared-cares \ + --shared-libuv \ + --shared-http-parser \ + --without-npm \ + --without-dtrace + +# Setting BUILDTYPE=Debug builds both release and debug binaries +make BUILDTYPE=Debug %{?_smp_mflags} + +%install +rm -rf %{buildroot} + +./tools/install.py install %{buildroot} + +# and remove dtrace file again +rm -rf %{buildroot}/%{_prefix}/lib/dtrace + +# Set the binary permissions properly +chmod 0755 %{buildroot}/%{_bindir}/node + +# Install the debug binary and set its permissions +install -Dpm0755 out/Debug/node %{buildroot}/%{_bindir}/node_g + +# own the sitelib directory +mkdir -p %{buildroot}%{_prefix}/lib/node_modules + +#install documentation +mkdir -p %{buildroot}%{_defaultdocdir}/%{pkg_name}-docs-%{version}/html +cp -pr doc/* %{buildroot}%{_defaultdocdir}/%{pkg_name}-docs-%{version}/html +rm -f %{_defaultdocdir}/%{pkg_name}-docs-%{version}/html/nodejs.1 +cp -p LICENSE %{buildroot}%{_defaultdocdir}/%{pkg_name}-docs-%{version}/ + +#install development headers +#FIXME: we probably don't really need *.h but node-gyp downloads the whole +#freaking source tree so I can't be sure ATM +mkdir -p %{buildroot}%{_includedir}/node +cp -p src/*.h %{buildroot}%{_includedir}/node + +#node-gyp needs common.gypi too +mkdir -p %{buildroot}%{_datadir}/node +cp -p common.gypi %{buildroot}%{_datadir}/node + +%files +%doc ChangeLog LICENSE README.md AUTHORS +%{_bindir}/node +%{_mandir}/man1/node.* +%dir %{_prefix}/lib/node_modules + +%files devel +%{_bindir}/node_g +%{_includedir}/node +%{_datadir}/node + +%files docs +%{_defaultdocdir}/%{pkg_name}-docs-%{version} + +%changelog +* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 0.10.3-3 +- Add support for software collections +- Move rpm macros and tooling to separate package + +* Thu Apr 04 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.3-2 +- nodejs-symlink-deps: symlink unconditionally in the buildroot + +* Wed Apr 03 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.3-1 +- new upstream release 0.10.3 + http://blog.nodejs.org/2013/04/03/node-v0-10-3-stable/ +- nodejs-symlink-deps: only create symlink if target exists +- nodejs-symlink-deps: symlink devDependencies when --check is used + +* Sun Mar 31 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.2-1 +- new upstream release 0.10.2 + http://blog.nodejs.org/2013/03/28/node-v0-10-2-stable/ +- remove %%nodejs_arches macro since it will only be useful if it is present in + the redhat-rpm-config package +- add default filtering macro to remove unwanted Provides from native modules +- nodejs-symlink-deps now supports multiple modules in one SRPM properly +- nodejs-symlink-deps also now supports a --check argument that works in the + current working directry instead of the buildroot + +* Fri Mar 22 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.1-1 +- new upstream release 0.10.1 + http://blog.nodejs.org/2013/03/21/node-v0-10-1-stable/ + +* Wed Mar 20 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.0-4 +- fix escaping in dependency generator regular expressions (RHBZ#923941) + +* Wed Mar 13 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.0-3 +- add virtual ABI provides for node and v8 so binary module's deps break when + binary compatibility is broken +- automatically add matching Requires to nodejs binary modules +- add %%nodejs_arches macro to future-proof ExcluseArch stanza in dependent + packages + +* Tue Mar 12 2013 Stephen Gallagher <sgallagh@redhat.com> - 0.10.0-2 +- Fix up documentation subpackage + +* Mon Mar 11 2013 Stephen Gallagher <sgallagh@redhat.com> - 0.10.0-1 +- Update to stable 0.10.0 release +- https://raw.github.com/joyent/node/v0.10.0/ChangeLog + +* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.5-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Tue Jan 22 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-10 +- minor bugfixes to RPM magic + - nodejs-symlink-deps: don't create an empty node_modules dir when a module + has no dependencies + - nodes-fixdep: support adding deps when none exist +- Add the full set of headers usually bundled with node as deps to nodejs-devel. + This way `npm install` for native modules that assume the stuff bundled with + node exists will usually "just work". +-move RPM magic to nodejs-devel as requested by FPC + +* Sat Jan 12 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-9 +- fix brown paper bag bug in requires generation script + +* Thu Jan 10 2013 Stephen Gallagher <sgallagh@redhat.com> - 0.9.5-8 +- Build debug binary and install it in the nodejs-devel subpackage + +* Thu Jan 10 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-7 +- don't use make install since it rebuilds everything + +* Thu Jan 10 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-6 +- add %%{?isa}, epoch to v8 deps + +* Wed Jan 09 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-5 +- add defines to match libuv (#892601) +- make v8 dependency explicit (and thus more accurate) +- add -g to $C(XX)FLAGS instead of patching configure to add it +- don't write pointless 'npm(foo) > 0' deps + +* Sat Jan 05 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-4 +- install development headers +- add nodejs_sitearch macro + +* Wed Jan 02 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-3 +- make nodejs-symlink-deps actually work + +* Tue Jan 01 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-2 +- provide nodejs-devel so modules can BuildRequire it (and be consistent + with other interpreted languages in the distro) + +* Tue Jan 01 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-1 +- new upstream release 0.9.5 +- provide nodejs-devel for the moment +- fix minor bugs in RPM magic +- add nodejs_fixdep macro so packagers can easily adjust dependencies in + package.json files + +* Wed Dec 26 2012 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.4-1 +- new upstream release 0.9.4 +- system library patches are now upstream +- respect optflags +- include documentation in subpackage +- add RPM dependency generation and related magic +- guard libuv depedency so it always gets bumped when nodejs does +- add -devel subpackage with enough to make node-gyp happy + +* Wed Dec 19 2012 Dan HorĂ¡k <dan[at]danny.cz> - 0.9.3-8 +- set exclusive arch list to match v8 + +* Tue Dec 18 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-7 +- Add remaining changes from code review +- Remove unnecessary BuildRequires on findutils +- Remove %%clean section + +* Fri Dec 14 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-6 +- Fixes from code review +- Fix executable permissions +- Correct the License field +- Build debuginfo properly + +* Thu Dec 13 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-5 +- Return back to using the standard binary name +- Temporarily adding a conflict against the ham radio node package until they + complete an agreed rename of their binary. + +* Wed Nov 28 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-4 +- Rename binary and manpage to nodejs + +* Mon Nov 19 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-3 +- Update to latest upstream development release 0.9.3 +- Include upstreamed patches to unbundle dependent libraries + +* Tue Oct 23 2012 Adrian Alves <alvesadrian@fedoraproject.org> 0.8.12-1 +- Fixes and Patches suggested by Matthias Runge + +* Mon Apr 09 2012 Adrian Alves <alvesadrian@fedoraproject.org> 0.6.5 +- First build. diff --git a/test/spec/nodejs-no-pkg_name.spec b/test/spec/nodejs-no-pkg_name.spec new file mode 100644 index 0000000..174d709 --- /dev/null +++ b/test/spec/nodejs-no-pkg_name.spec @@ -0,0 +1,301 @@ +%{?scl:%scl_package nodejs} + +Name: %{?scl_prefix}nodejs +Version: 0.10.3 +Release: 3%{?dist} +Summary: JavaScript runtime +License: MIT and ASL 2.0 and ISC and BSD +Group: Development/Languages +URL: http://nodejs.org/ + +# Exclusive archs must match v8 +ExclusiveArch: %{ix86} x86_64 %{arm} + +Source0: http://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz + +# V8 presently breaks ABI at least every x.y release while never bumping SONAME, +# so we need to be more explicit until spot fixes that +%global v8_ge 1:3.14.5.7 +%global v8_lt 1:3.15 +%global v8_abi 3.14 + +%{?scl:Requires: %{scl}-runtime} +BuildRequires: %{?scl_prefix}v8-devel >= %{v8_ge} +BuildRequires: %{?scl_prefix}http-parser-devel >= 2.0 +BuildRequires: %{?scl_prefix}libuv-devel +BuildRequires: %{?scl_prefix}c-ares-devel +BuildRequires: zlib-devel +# Node.js requires some features from openssl 1.0.1 for SPDY support +BuildRequires: openssl-devel + +Requires: %{?scl_prefix}v8%{?isa} >= %{v8_ge} +Requires: %{?scl_prefix}v8%{?isa} < %{v8_lt} + +#we need ABI virtual provides where SONAMEs aren't enough/not present so deps +#break when binary compatibility is broken +%global nodejs_abi 0.10 +Provides: %{?scl_prefix}nodejs(abi) = %{nodejs_abi} +Provides: %{?scl_prefix}nodejs(v8-abi) = %{v8_abi} + +#this corresponds to the "engine" requirement in package.json +Provides: %{?scl_prefix}nodejs(engine) = %{version} + +# Node.js currently has a conflict with the 'node' package in Fedora +# The ham-radio group has agreed to rename their binary for us, but +# in the meantime, we're setting an explicit Conflicts: %{?scl_prefix}here +Conflicts: %{?scl_prefix}node <= 0.3.2-11 + +%description +Node.js is a platform built on Chrome's JavaScript runtime +for easily building fast, scalable network applications. +Node.js uses an event-driven, non-blocking I/O model that +makes it lightweight and efficient, perfect for data-intensive +real-time applications that run across distributed devices. + +%package devel +Summary: JavaScript runtime - development headers +Group: Development/Languages +Requires: %{name} = %{version}-%{release} +Requires: %{?scl_prefix}libuv-devel %{?scl_prefix}http-parser-devel openssl-devel %{?scl_prefix}c-ares-devel zlib-devel + +%description devel +Development headers for the Node.js JavaScript runtime. + +%package docs +Summary: Node.js API documentation +Group: Documentation + +%description docs +The API documentation for the Node.js JavaScript runtime. + +%prep +%setup -q -n node-v%{version} + +# Make sure nothing gets included from bundled deps: +# We only delete the source and header files, because +# the remaining build scripts are still used. + +find deps/cares -name "*.c" -exec rm -f {} \; +find deps/cares -name "*.h" -exec rm -f {} \; + +find deps/npm -name "*.c" -exec rm -f {} \; +find deps/npm -name "*.h" -exec rm -f {} \; + +find deps/zlib -name "*.c" -exec rm -f {} \; +find deps/zlib -name "*.h" -exec rm -f {} \; + +find deps/v8 -name "*.c" -exec rm -f {} \; +find deps/v8 -name "*.h" -exec rm -f {} \; + +find deps/http_parser -name "*.c" -exec rm -f {} \; +find deps/http_parser -name "*.h" -exec rm -f {} \; + +find deps/openssl -name "*.c" -exec rm -f {} \; +find deps/openssl -name "*.h" -exec rm -f {} \; + +find deps/uv -name "*.c" -exec rm -f {} \; +find deps/uv -name "*.h" -exec rm -f {} \; + + +%build +# build with debugging symbols and add defines from libuv (#892601) +export CFLAGS='%{optflags} -g -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \ + -I%{_includedir}' +export CXXFLAGS='%{optflags} -g -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \ + -I%{_includedir}' +export LDFLAGS='%{optflags} -L%{_libdir}' + +./configure --prefix=%{_prefix} \ + --shared-v8 \ + --shared-openssl \ + --shared-zlib \ + --shared-cares \ + --shared-libuv \ + --shared-http-parser \ + --without-npm \ + --without-dtrace + +# Setting BUILDTYPE=Debug builds both release and debug binaries +make BUILDTYPE=Debug %{?_smp_mflags} + +%install +rm -rf %{buildroot} + +./tools/install.py install %{buildroot} + +# and remove dtrace file again +rm -rf %{buildroot}/%{_prefix}/lib/dtrace + +# Set the binary permissions properly +chmod 0755 %{buildroot}/%{_bindir}/node + +# Install the debug binary and set its permissions +install -Dpm0755 out/Debug/node %{buildroot}/%{_bindir}/node_g + +# own the sitelib directory +mkdir -p %{buildroot}%{_prefix}/lib/node_modules + +#install documentation +mkdir -p %{buildroot}%{_defaultdocdir}/%{pkg_name}-docs-%{version}/html +cp -pr doc/* %{buildroot}%{_defaultdocdir}/%{pkg_name}-docs-%{version}/html +rm -f %{_defaultdocdir}/%{pkg_name}-docs-%{version}/html/nodejs.1 +cp -p LICENSE %{buildroot}%{_defaultdocdir}/%{pkg_name}-docs-%{version}/ + +#install development headers +#FIXME: we probably don't really need *.h but node-gyp downloads the whole +#freaking source tree so I can't be sure ATM +mkdir -p %{buildroot}%{_includedir}/node +cp -p src/*.h %{buildroot}%{_includedir}/node + +#node-gyp needs common.gypi too +mkdir -p %{buildroot}%{_datadir}/node +cp -p common.gypi %{buildroot}%{_datadir}/node + +%files +%doc ChangeLog LICENSE README.md AUTHORS +%{_bindir}/node +%{_mandir}/man1/node.* +%dir %{_prefix}/lib/node_modules + +%files devel +%{_bindir}/node_g +%{_includedir}/node +%{_datadir}/node + +%files docs +%{_defaultdocdir}/%{pkg_name}-docs-%{version} + +%changelog +* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 0.10.3-3 +- Add support for software collections +- Move rpm macros and tooling to separate package + +* Thu Apr 04 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.3-2 +- nodejs-symlink-deps: symlink unconditionally in the buildroot + +* Wed Apr 03 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.3-1 +- new upstream release 0.10.3 + http://blog.nodejs.org/2013/04/03/node-v0-10-3-stable/ +- nodejs-symlink-deps: only create symlink if target exists +- nodejs-symlink-deps: symlink devDependencies when --check is used + +* Sun Mar 31 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.2-1 +- new upstream release 0.10.2 + http://blog.nodejs.org/2013/03/28/node-v0-10-2-stable/ +- remove %%nodejs_arches macro since it will only be useful if it is present in + the redhat-rpm-config package +- add default filtering macro to remove unwanted Provides from native modules +- nodejs-symlink-deps now supports multiple modules in one SRPM properly +- nodejs-symlink-deps also now supports a --check argument that works in the + current working directry instead of the buildroot + +* Fri Mar 22 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.1-1 +- new upstream release 0.10.1 + http://blog.nodejs.org/2013/03/21/node-v0-10-1-stable/ + +* Wed Mar 20 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.0-4 +- fix escaping in dependency generator regular expressions (RHBZ#923941) + +* Wed Mar 13 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.0-3 +- add virtual ABI provides for node and v8 so binary module's deps break when + binary compatibility is broken +- automatically add matching Requires to nodejs binary modules +- add %%nodejs_arches macro to future-proof ExcluseArch stanza in dependent + packages + +* Tue Mar 12 2013 Stephen Gallagher <sgallagh@redhat.com> - 0.10.0-2 +- Fix up documentation subpackage + +* Mon Mar 11 2013 Stephen Gallagher <sgallagh@redhat.com> - 0.10.0-1 +- Update to stable 0.10.0 release +- https://raw.github.com/joyent/node/v0.10.0/ChangeLog + +* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.5-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Tue Jan 22 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-10 +- minor bugfixes to RPM magic + - nodejs-symlink-deps: don't create an empty node_modules dir when a module + has no dependencies + - nodes-fixdep: support adding deps when none exist +- Add the full set of headers usually bundled with node as deps to nodejs-devel. + This way `npm install` for native modules that assume the stuff bundled with + node exists will usually "just work". +-move RPM magic to nodejs-devel as requested by FPC + +* Sat Jan 12 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-9 +- fix brown paper bag bug in requires generation script + +* Thu Jan 10 2013 Stephen Gallagher <sgallagh@redhat.com> - 0.9.5-8 +- Build debug binary and install it in the nodejs-devel subpackage + +* Thu Jan 10 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-7 +- don't use make install since it rebuilds everything + +* Thu Jan 10 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-6 +- add %%{?isa}, epoch to v8 deps + +* Wed Jan 09 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-5 +- add defines to match libuv (#892601) +- make v8 dependency explicit (and thus more accurate) +- add -g to $C(XX)FLAGS instead of patching configure to add it +- don't write pointless 'npm(foo) > 0' deps + +* Sat Jan 05 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-4 +- install development headers +- add nodejs_sitearch macro + +* Wed Jan 02 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-3 +- make nodejs-symlink-deps actually work + +* Tue Jan 01 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-2 +- provide nodejs-devel so modules can BuildRequire it (and be consistent + with other interpreted languages in the distro) + +* Tue Jan 01 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-1 +- new upstream release 0.9.5 +- provide nodejs-devel for the moment +- fix minor bugs in RPM magic +- add nodejs_fixdep macro so packagers can easily adjust dependencies in + package.json files + +* Wed Dec 26 2012 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.4-1 +- new upstream release 0.9.4 +- system library patches are now upstream +- respect optflags +- include documentation in subpackage +- add RPM dependency generation and related magic +- guard libuv depedency so it always gets bumped when nodejs does +- add -devel subpackage with enough to make node-gyp happy + +* Wed Dec 19 2012 Dan HorĂ¡k <dan[at]danny.cz> - 0.9.3-8 +- set exclusive arch list to match v8 + +* Tue Dec 18 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-7 +- Add remaining changes from code review +- Remove unnecessary BuildRequires on findutils +- Remove %%clean section + +* Fri Dec 14 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-6 +- Fixes from code review +- Fix executable permissions +- Correct the License field +- Build debuginfo properly + +* Thu Dec 13 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-5 +- Return back to using the standard binary name +- Temporarily adding a conflict against the ham radio node package until they + complete an agreed rename of their binary. + +* Wed Nov 28 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-4 +- Rename binary and manpage to nodejs + +* Mon Nov 19 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-3 +- Update to latest upstream development release 0.9.3 +- Include upstreamed patches to unbundle dependent libraries + +* Tue Oct 23 2012 Adrian Alves <alvesadrian@fedoraproject.org> 0.8.12-1 +- Fixes and Patches suggested by Matthias Runge + +* Mon Apr 09 2012 Adrian Alves <alvesadrian@fedoraproject.org> 0.6.5 +- First build. diff --git a/test/spec/nodejs-norequire.spec b/test/spec/nodejs-norequire.spec new file mode 100644 index 0000000..e2e5740 --- /dev/null +++ b/test/spec/nodejs-norequire.spec @@ -0,0 +1,300 @@ +%{?scl:%scl_package nodejs} +%{!?scl:%global pkg_name %{name}} + +Name: %{?scl_prefix}nodejs +Version: 0.10.3 +Release: 3%{?dist} +Summary: JavaScript runtime +License: MIT and ASL 2.0 and ISC and BSD +Group: Development/Languages +URL: http://nodejs.org/ + +# Exclusive archs must match v8 +ExclusiveArch: %{ix86} x86_64 %{arm} + +Source0: http://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz + +# V8 presently breaks ABI at least every x.y release while never bumping SONAME, +# so we need to be more explicit until spot fixes that +%global v8_ge 1:3.14.5.7 +%global v8_lt 1:3.15 +%global v8_abi 3.14 + +BuildRequires: %{?scl_prefix}v8-devel >= %{v8_ge} +BuildRequires: %{?scl_prefix}http-parser-devel >= 2.0 +BuildRequires: %{?scl_prefix}libuv-devel +BuildRequires: %{?scl_prefix}c-ares-devel +BuildRequires: zlib-devel +# Node.js requires some features from openssl 1.0.1 for SPDY support +BuildRequires: openssl-devel + +Requires: libfoo + +#we need ABI virtual provides where SONAMEs aren't enough/not present so deps +#break when binary compatibility is broken +%global nodejs_abi 0.10 +Provides: %{?scl_prefix}nodejs(abi) = %{nodejs_abi} +Provides: %{?scl_prefix}nodejs(v8-abi) = %{v8_abi} + +#this corresponds to the "engine" requirement in package.json +Provides: %{?scl_prefix}nodejs(engine) = %{version} + +# Node.js currently has a conflict with the 'node' package in Fedora +# The ham-radio group has agreed to rename their binary for us, but +# in the meantime, we're setting an explicit Conflicts: %{?scl_prefix}here +Conflicts: %{?scl_prefix}node <= 0.3.2-11 + +%description +Node.js is a platform built on Chrome's JavaScript runtime +for easily building fast, scalable network applications. +Node.js uses an event-driven, non-blocking I/O model that +makes it lightweight and efficient, perfect for data-intensive +real-time applications that run across distributed devices. + +%package devel +Summary: JavaScript runtime - development headers +Group: Development/Languages +Requires: %{name} = %{version}-%{release} +Requires: %{?scl_prefix}libuv-devel %{?scl_prefix}http-parser-devel openssl-devel %{?scl_prefix}c-ares-devel zlib-devel + +%description devel +Development headers for the Node.js JavaScript runtime. + +%package docs +Summary: Node.js API documentation +Group: Documentation + +%description docs +The API documentation for the Node.js JavaScript runtime. + +%prep +%setup -q -n node-v%{version} + +# Make sure nothing gets included from bundled deps: +# We only delete the source and header files, because +# the remaining build scripts are still used. + +find deps/cares -name "*.c" -exec rm -f {} \; +find deps/cares -name "*.h" -exec rm -f {} \; + +find deps/npm -name "*.c" -exec rm -f {} \; +find deps/npm -name "*.h" -exec rm -f {} \; + +find deps/zlib -name "*.c" -exec rm -f {} \; +find deps/zlib -name "*.h" -exec rm -f {} \; + +find deps/v8 -name "*.c" -exec rm -f {} \; +find deps/v8 -name "*.h" -exec rm -f {} \; + +find deps/http_parser -name "*.c" -exec rm -f {} \; +find deps/http_parser -name "*.h" -exec rm -f {} \; + +find deps/openssl -name "*.c" -exec rm -f {} \; +find deps/openssl -name "*.h" -exec rm -f {} \; + +find deps/uv -name "*.c" -exec rm -f {} \; +find deps/uv -name "*.h" -exec rm -f {} \; + + +%build +# build with debugging symbols and add defines from libuv (#892601) +export CFLAGS='%{optflags} -g -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \ + -I%{_includedir}' +export CXXFLAGS='%{optflags} -g -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \ + -I%{_includedir}' +export LDFLAGS='%{optflags} -L%{_libdir}' + +./configure --prefix=%{_prefix} \ + --shared-v8 \ + --shared-openssl \ + --shared-zlib \ + --shared-cares \ + --shared-libuv \ + --shared-http-parser \ + --without-npm \ + --without-dtrace + +# Setting BUILDTYPE=Debug builds both release and debug binaries +make BUILDTYPE=Debug %{?_smp_mflags} + +%install +rm -rf %{buildroot} + +./tools/install.py install %{buildroot} + +# and remove dtrace file again +rm -rf %{buildroot}/%{_prefix}/lib/dtrace + +# Set the binary permissions properly +chmod 0755 %{buildroot}/%{_bindir}/node + +# Install the debug binary and set its permissions +install -Dpm0755 out/Debug/node %{buildroot}/%{_bindir}/node_g + +# own the sitelib directory +mkdir -p %{buildroot}%{_prefix}/lib/node_modules + +#install documentation +mkdir -p %{buildroot}%{_defaultdocdir}/%{pkg_name}-docs-%{version}/html +cp -pr doc/* %{buildroot}%{_defaultdocdir}/%{pkg_name}-docs-%{version}/html +rm -f %{_defaultdocdir}/%{pkg_name}-docs-%{version}/html/nodejs.1 +cp -p LICENSE %{buildroot}%{_defaultdocdir}/%{pkg_name}-docs-%{version}/ + +#install development headers +#FIXME: we probably don't really need *.h but node-gyp downloads the whole +#freaking source tree so I can't be sure ATM +mkdir -p %{buildroot}%{_includedir}/node +cp -p src/*.h %{buildroot}%{_includedir}/node + +#node-gyp needs common.gypi too +mkdir -p %{buildroot}%{_datadir}/node +cp -p common.gypi %{buildroot}%{_datadir}/node + +%files +%doc ChangeLog LICENSE README.md AUTHORS +%{_bindir}/node +%{_mandir}/man1/node.* +%dir %{_prefix}/lib/node_modules + +%files devel +%{_bindir}/node_g +%{_includedir}/node +%{_datadir}/node + +%files docs +%{_defaultdocdir}/%{pkg_name}-docs-%{version} + +%changelog +* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 0.10.3-3 +- Add support for software collections +- Move rpm macros and tooling to separate package + +* Thu Apr 04 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.3-2 +- nodejs-symlink-deps: symlink unconditionally in the buildroot + +* Wed Apr 03 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.3-1 +- new upstream release 0.10.3 + http://blog.nodejs.org/2013/04/03/node-v0-10-3-stable/ +- nodejs-symlink-deps: only create symlink if target exists +- nodejs-symlink-deps: symlink devDependencies when --check is used + +* Sun Mar 31 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.2-1 +- new upstream release 0.10.2 + http://blog.nodejs.org/2013/03/28/node-v0-10-2-stable/ +- remove %%nodejs_arches macro since it will only be useful if it is present in + the redhat-rpm-config package +- add default filtering macro to remove unwanted Provides from native modules +- nodejs-symlink-deps now supports multiple modules in one SRPM properly +- nodejs-symlink-deps also now supports a --check argument that works in the + current working directry instead of the buildroot + +* Fri Mar 22 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.1-1 +- new upstream release 0.10.1 + http://blog.nodejs.org/2013/03/21/node-v0-10-1-stable/ + +* Wed Mar 20 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.0-4 +- fix escaping in dependency generator regular expressions (RHBZ#923941) + +* Wed Mar 13 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.0-3 +- add virtual ABI provides for node and v8 so binary module's deps break when + binary compatibility is broken +- automatically add matching Requires to nodejs binary modules +- add %%nodejs_arches macro to future-proof ExcluseArch stanza in dependent + packages + +* Tue Mar 12 2013 Stephen Gallagher <sgallagh@redhat.com> - 0.10.0-2 +- Fix up documentation subpackage + +* Mon Mar 11 2013 Stephen Gallagher <sgallagh@redhat.com> - 0.10.0-1 +- Update to stable 0.10.0 release +- https://raw.github.com/joyent/node/v0.10.0/ChangeLog + +* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.5-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Tue Jan 22 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-10 +- minor bugfixes to RPM magic + - nodejs-symlink-deps: don't create an empty node_modules dir when a module + has no dependencies + - nodes-fixdep: support adding deps when none exist +- Add the full set of headers usually bundled with node as deps to nodejs-devel. + This way `npm install` for native modules that assume the stuff bundled with + node exists will usually "just work". +-move RPM magic to nodejs-devel as requested by FPC + +* Sat Jan 12 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-9 +- fix brown paper bag bug in requires generation script + +* Thu Jan 10 2013 Stephen Gallagher <sgallagh@redhat.com> - 0.9.5-8 +- Build debug binary and install it in the nodejs-devel subpackage + +* Thu Jan 10 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-7 +- don't use make install since it rebuilds everything + +* Thu Jan 10 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-6 +- add %%{?isa}, epoch to v8 deps + +* Wed Jan 09 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-5 +- add defines to match libuv (#892601) +- make v8 dependency explicit (and thus more accurate) +- add -g to $C(XX)FLAGS instead of patching configure to add it +- don't write pointless 'npm(foo) > 0' deps + +* Sat Jan 05 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-4 +- install development headers +- add nodejs_sitearch macro + +* Wed Jan 02 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-3 +- make nodejs-symlink-deps actually work + +* Tue Jan 01 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-2 +- provide nodejs-devel so modules can BuildRequire it (and be consistent + with other interpreted languages in the distro) + +* Tue Jan 01 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-1 +- new upstream release 0.9.5 +- provide nodejs-devel for the moment +- fix minor bugs in RPM magic +- add nodejs_fixdep macro so packagers can easily adjust dependencies in + package.json files + +* Wed Dec 26 2012 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.4-1 +- new upstream release 0.9.4 +- system library patches are now upstream +- respect optflags +- include documentation in subpackage +- add RPM dependency generation and related magic +- guard libuv depedency so it always gets bumped when nodejs does +- add -devel subpackage with enough to make node-gyp happy + +* Wed Dec 19 2012 Dan HorĂ¡k <dan[at]danny.cz> - 0.9.3-8 +- set exclusive arch list to match v8 + +* Tue Dec 18 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-7 +- Add remaining changes from code review +- Remove unnecessary BuildRequires on findutils +- Remove %%clean section + +* Fri Dec 14 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-6 +- Fixes from code review +- Fix executable permissions +- Correct the License field +- Build debuginfo properly + +* Thu Dec 13 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-5 +- Return back to using the standard binary name +- Temporarily adding a conflict against the ham radio node package until they + complete an agreed rename of their binary. + +* Wed Nov 28 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-4 +- Rename binary and manpage to nodejs + +* Mon Nov 19 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-3 +- Update to latest upstream development release 0.9.3 +- Include upstreamed patches to unbundle dependent libraries + +* Tue Oct 23 2012 Adrian Alves <alvesadrian@fedoraproject.org> 0.8.12-1 +- Fixes and Patches suggested by Matthias Runge + +* Mon Apr 09 2012 Adrian Alves <alvesadrian@fedoraproject.org> 0.6.5 +- First build. diff --git a/test/spec/nodejs-provides-without-prefix.spec b/test/spec/nodejs-provides-without-prefix.spec new file mode 100644 index 0000000..332b3f1 --- /dev/null +++ b/test/spec/nodejs-provides-without-prefix.spec @@ -0,0 +1,302 @@ +%{?scl:%scl_package nodejs} +%{!?scl:%global pkg_name %{name}} + +Name: %{?scl_prefix}nodejs +Version: 0.10.3 +Release: 3%{?dist} +Summary: JavaScript runtime +License: MIT and ASL 2.0 and ISC and BSD +Group: Development/Languages +URL: http://nodejs.org/ + +# Exclusive archs must match v8 +ExclusiveArch: %{ix86} x86_64 %{arm} + +Source0: http://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz + +# V8 presently breaks ABI at least every x.y release while never bumping SONAME, +# so we need to be more explicit until spot fixes that +%global v8_ge 1:3.14.5.7 +%global v8_lt 1:3.15 +%global v8_abi 3.14 + +%{?scl:Requires: %{scl}-runtime} +BuildRequires: %{?scl_prefix}v8-devel >= %{v8_ge} +BuildRequires: %{?scl_prefix}http-parser-devel >= 2.0 +BuildRequires: %{?scl_prefix}libuv-devel +BuildRequires: %{?scl_prefix}c-ares-devel +BuildRequires: zlib-devel +# Node.js requires some features from openssl 1.0.1 for SPDY support +BuildRequires: openssl-devel + +Requires: %{?scl_prefix}v8%{?isa} >= %{v8_ge} +Requires: %{?scl_prefix}v8%{?isa} < %{v8_lt} + +#we need ABI virtual provides where SONAMEs aren't enough/not present so deps +#break when binary compatibility is broken +%global nodejs_abi 0.10 +Provides: nodejs(abi) = %{nodejs_abi} +Provides: nodejs(v8-abi) = %{v8_abi} + +#this corresponds to the "engine" requirement in package.json +Provides: %{?scl_prefix}nodejs(engine) = %{version} + +# Node.js currently has a conflict with the 'node' package in Fedora +# The ham-radio group has agreed to rename their binary for us, but +# in the meantime, we're setting an explicit Conflicts: %{?scl_prefix}here +Conflicts: %{?scl_prefix}node <= 0.3.2-11 + +%description +Node.js is a platform built on Chrome's JavaScript runtime +for easily building fast, scalable network applications. +Node.js uses an event-driven, non-blocking I/O model that +makes it lightweight and efficient, perfect for data-intensive +real-time applications that run across distributed devices. + +%package devel +Summary: JavaScript runtime - development headers +Group: Development/Languages +Requires: %{name} = %{version}-%{release} +Requires: %{?scl_prefix}libuv-devel %{?scl_prefix}http-parser-devel openssl-devel %{?scl_prefix}c-ares-devel zlib-devel + +%description devel +Development headers for the Node.js JavaScript runtime. + +%package docs +Summary: Node.js API documentation +Group: Documentation + +%description docs +The API documentation for the Node.js JavaScript runtime. + +%prep +%setup -q -n node-v%{version} + +# Make sure nothing gets included from bundled deps: +# We only delete the source and header files, because +# the remaining build scripts are still used. + +find deps/cares -name "*.c" -exec rm -f {} \; +find deps/cares -name "*.h" -exec rm -f {} \; + +find deps/npm -name "*.c" -exec rm -f {} \; +find deps/npm -name "*.h" -exec rm -f {} \; + +find deps/zlib -name "*.c" -exec rm -f {} \; +find deps/zlib -name "*.h" -exec rm -f {} \; + +find deps/v8 -name "*.c" -exec rm -f {} \; +find deps/v8 -name "*.h" -exec rm -f {} \; + +find deps/http_parser -name "*.c" -exec rm -f {} \; +find deps/http_parser -name "*.h" -exec rm -f {} \; + +find deps/openssl -name "*.c" -exec rm -f {} \; +find deps/openssl -name "*.h" -exec rm -f {} \; + +find deps/uv -name "*.c" -exec rm -f {} \; +find deps/uv -name "*.h" -exec rm -f {} \; + + +%build +# build with debugging symbols and add defines from libuv (#892601) +export CFLAGS='%{optflags} -g -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \ + -I%{_includedir}' +export CXXFLAGS='%{optflags} -g -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \ + -I%{_includedir}' +export LDFLAGS='%{optflags} -L%{_libdir}' + +./configure --prefix=%{_prefix} \ + --shared-v8 \ + --shared-openssl \ + --shared-zlib \ + --shared-cares \ + --shared-libuv \ + --shared-http-parser \ + --without-npm \ + --without-dtrace + +# Setting BUILDTYPE=Debug builds both release and debug binaries +make BUILDTYPE=Debug %{?_smp_mflags} + +%install +rm -rf %{buildroot} + +./tools/install.py install %{buildroot} + +# and remove dtrace file again +rm -rf %{buildroot}/%{_prefix}/lib/dtrace + +# Set the binary permissions properly +chmod 0755 %{buildroot}/%{_bindir}/node + +# Install the debug binary and set its permissions +install -Dpm0755 out/Debug/node %{buildroot}/%{_bindir}/node_g + +# own the sitelib directory +mkdir -p %{buildroot}%{_prefix}/lib/node_modules + +#install documentation +mkdir -p %{buildroot}%{_defaultdocdir}/%{pkg_name}-docs-%{version}/html +cp -pr doc/* %{buildroot}%{_defaultdocdir}/%{pkg_name}-docs-%{version}/html +rm -f %{_defaultdocdir}/%{pkg_name}-docs-%{version}/html/nodejs.1 +cp -p LICENSE %{buildroot}%{_defaultdocdir}/%{pkg_name}-docs-%{version}/ + +#install development headers +#FIXME: we probably don't really need *.h but node-gyp downloads the whole +#freaking source tree so I can't be sure ATM +mkdir -p %{buildroot}%{_includedir}/node +cp -p src/*.h %{buildroot}%{_includedir}/node + +#node-gyp needs common.gypi too +mkdir -p %{buildroot}%{_datadir}/node +cp -p common.gypi %{buildroot}%{_datadir}/node + +%files +%doc ChangeLog LICENSE README.md AUTHORS +%{_bindir}/node +%{_mandir}/man1/node.* +%dir %{_prefix}/lib/node_modules + +%files devel +%{_bindir}/node_g +%{_includedir}/node +%{_datadir}/node + +%files docs +%{_defaultdocdir}/%{pkg_name}-docs-%{version} + +%changelog +* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 0.10.3-3 +- Add support for software collections +- Move rpm macros and tooling to separate package + +* Thu Apr 04 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.3-2 +- nodejs-symlink-deps: symlink unconditionally in the buildroot + +* Wed Apr 03 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.3-1 +- new upstream release 0.10.3 + http://blog.nodejs.org/2013/04/03/node-v0-10-3-stable/ +- nodejs-symlink-deps: only create symlink if target exists +- nodejs-symlink-deps: symlink devDependencies when --check is used + +* Sun Mar 31 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.2-1 +- new upstream release 0.10.2 + http://blog.nodejs.org/2013/03/28/node-v0-10-2-stable/ +- remove %%nodejs_arches macro since it will only be useful if it is present in + the redhat-rpm-config package +- add default filtering macro to remove unwanted Provides from native modules +- nodejs-symlink-deps now supports multiple modules in one SRPM properly +- nodejs-symlink-deps also now supports a --check argument that works in the + current working directry instead of the buildroot + +* Fri Mar 22 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.1-1 +- new upstream release 0.10.1 + http://blog.nodejs.org/2013/03/21/node-v0-10-1-stable/ + +* Wed Mar 20 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.0-4 +- fix escaping in dependency generator regular expressions (RHBZ#923941) + +* Wed Mar 13 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.0-3 +- add virtual ABI provides for node and v8 so binary module's deps break when + binary compatibility is broken +- automatically add matching Requires to nodejs binary modules +- add %%nodejs_arches macro to future-proof ExcluseArch stanza in dependent + packages + +* Tue Mar 12 2013 Stephen Gallagher <sgallagh@redhat.com> - 0.10.0-2 +- Fix up documentation subpackage + +* Mon Mar 11 2013 Stephen Gallagher <sgallagh@redhat.com> - 0.10.0-1 +- Update to stable 0.10.0 release +- https://raw.github.com/joyent/node/v0.10.0/ChangeLog + +* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.5-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Tue Jan 22 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-10 +- minor bugfixes to RPM magic + - nodejs-symlink-deps: don't create an empty node_modules dir when a module + has no dependencies + - nodes-fixdep: support adding deps when none exist +- Add the full set of headers usually bundled with node as deps to nodejs-devel. + This way `npm install` for native modules that assume the stuff bundled with + node exists will usually "just work". +-move RPM magic to nodejs-devel as requested by FPC + +* Sat Jan 12 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-9 +- fix brown paper bag bug in requires generation script + +* Thu Jan 10 2013 Stephen Gallagher <sgallagh@redhat.com> - 0.9.5-8 +- Build debug binary and install it in the nodejs-devel subpackage + +* Thu Jan 10 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-7 +- don't use make install since it rebuilds everything + +* Thu Jan 10 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-6 +- add %%{?isa}, epoch to v8 deps + +* Wed Jan 09 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-5 +- add defines to match libuv (#892601) +- make v8 dependency explicit (and thus more accurate) +- add -g to $C(XX)FLAGS instead of patching configure to add it +- don't write pointless 'npm(foo) > 0' deps + +* Sat Jan 05 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-4 +- install development headers +- add nodejs_sitearch macro + +* Wed Jan 02 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-3 +- make nodejs-symlink-deps actually work + +* Tue Jan 01 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-2 +- provide nodejs-devel so modules can BuildRequire it (and be consistent + with other interpreted languages in the distro) + +* Tue Jan 01 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-1 +- new upstream release 0.9.5 +- provide nodejs-devel for the moment +- fix minor bugs in RPM magic +- add nodejs_fixdep macro so packagers can easily adjust dependencies in + package.json files + +* Wed Dec 26 2012 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.4-1 +- new upstream release 0.9.4 +- system library patches are now upstream +- respect optflags +- include documentation in subpackage +- add RPM dependency generation and related magic +- guard libuv depedency so it always gets bumped when nodejs does +- add -devel subpackage with enough to make node-gyp happy + +* Wed Dec 19 2012 Dan HorĂ¡k <dan[at]danny.cz> - 0.9.3-8 +- set exclusive arch list to match v8 + +* Tue Dec 18 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-7 +- Add remaining changes from code review +- Remove unnecessary BuildRequires on findutils +- Remove %%clean section + +* Fri Dec 14 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-6 +- Fixes from code review +- Fix executable permissions +- Correct the License field +- Build debuginfo properly + +* Thu Dec 13 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-5 +- Return back to using the standard binary name +- Temporarily adding a conflict against the ham radio node package until they + complete an agreed rename of their binary. + +* Wed Nov 28 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-4 +- Rename binary and manpage to nodejs + +* Mon Nov 19 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-3 +- Update to latest upstream development release 0.9.3 +- Include upstreamed patches to unbundle dependent libraries + +* Tue Oct 23 2012 Adrian Alves <alvesadrian@fedoraproject.org> 0.8.12-1 +- Fixes and Patches suggested by Matthias Runge + +* Mon Apr 09 2012 Adrian Alves <alvesadrian@fedoraproject.org> 0.6.5 +- First build. diff --git a/test/spec/nodejs-setup-no-n.spec b/test/spec/nodejs-setup-no-n.spec new file mode 100644 index 0000000..9c4ac4c --- /dev/null +++ b/test/spec/nodejs-setup-no-n.spec @@ -0,0 +1,302 @@ +%{?scl:%scl_package nodejs} +%{!?scl:%global pkg_name %{name}} + +Name: %{?scl_prefix}nodejs +Version: 0.10.3 +Release: 3%{?dist} +Summary: JavaScript runtime +License: MIT and ASL 2.0 and ISC and BSD +Group: Development/Languages +URL: http://nodejs.org/ + +# Exclusive archs must match v8 +ExclusiveArch: %{ix86} x86_64 %{arm} + +Source0: http://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz + +# V8 presently breaks ABI at least every x.y release while never bumping SONAME, +# so we need to be more explicit until spot fixes that +%global v8_ge 1:3.14.5.7 +%global v8_lt 1:3.15 +%global v8_abi 3.14 + +%{?scl:Requires: %{scl}-runtime} +BuildRequires: %{?scl_prefix}v8-devel >= %{v8_ge} +BuildRequires: %{?scl_prefix}http-parser-devel >= 2.0 +BuildRequires: %{?scl_prefix}libuv-devel +BuildRequires: %{?scl_prefix}c-ares-devel +BuildRequires: zlib-devel +# Node.js requires some features from openssl 1.0.1 for SPDY support +BuildRequires: openssl-devel + +Requires: %{?scl_prefix}v8%{?isa} >= %{v8_ge} +Requires: %{?scl_prefix}v8%{?isa} < %{v8_lt} + +#we need ABI virtual provides where SONAMEs aren't enough/not present so deps +#break when binary compatibility is broken +%global nodejs_abi 0.10 +Provides: %{?scl_prefix}nodejs(abi) = %{nodejs_abi} +Provides: %{?scl_prefix}nodejs(v8-abi) = %{v8_abi} + +#this corresponds to the "engine" requirement in package.json +Provides: %{?scl_prefix}nodejs(engine) = %{version} + +# Node.js currently has a conflict with the 'node' package in Fedora +# The ham-radio group has agreed to rename their binary for us, but +# in the meantime, we're setting an explicit Conflicts: %{?scl_prefix}here +Conflicts: %{?scl_prefix}node <= 0.3.2-11 + +%description +Node.js is a platform built on Chrome's JavaScript runtime +for easily building fast, scalable network applications. +Node.js uses an event-driven, non-blocking I/O model that +makes it lightweight and efficient, perfect for data-intensive +real-time applications that run across distributed devices. + +%package devel +Summary: JavaScript runtime - development headers +Group: Development/Languages +Requires: %{name} = %{version}-%{release} +Requires: %{?scl_prefix}libuv-devel %{?scl_prefix}http-parser-devel openssl-devel %{?scl_prefix}c-ares-devel zlib-devel + +%description devel +Development headers for the Node.js JavaScript runtime. + +%package docs +Summary: Node.js API documentation +Group: Documentation + +%description docs +The API documentation for the Node.js JavaScript runtime. + +%prep +%setup -q + +# Make sure nothing gets included from bundled deps: +# We only delete the source and header files, because +# the remaining build scripts are still used. + +find deps/cares -name "*.c" -exec rm -f {} \; +find deps/cares -name "*.h" -exec rm -f {} \; + +find deps/npm -name "*.c" -exec rm -f {} \; +find deps/npm -name "*.h" -exec rm -f {} \; + +find deps/zlib -name "*.c" -exec rm -f {} \; +find deps/zlib -name "*.h" -exec rm -f {} \; + +find deps/v8 -name "*.c" -exec rm -f {} \; +find deps/v8 -name "*.h" -exec rm -f {} \; + +find deps/http_parser -name "*.c" -exec rm -f {} \; +find deps/http_parser -name "*.h" -exec rm -f {} \; + +find deps/openssl -name "*.c" -exec rm -f {} \; +find deps/openssl -name "*.h" -exec rm -f {} \; + +find deps/uv -name "*.c" -exec rm -f {} \; +find deps/uv -name "*.h" -exec rm -f {} \; + + +%build +# build with debugging symbols and add defines from libuv (#892601) +export CFLAGS='%{optflags} -g -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \ + -I%{_includedir}' +export CXXFLAGS='%{optflags} -g -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \ + -I%{_includedir}' +export LDFLAGS='%{optflags} -L%{_libdir}' + +./configure --prefix=%{_prefix} \ + --shared-v8 \ + --shared-openssl \ + --shared-zlib \ + --shared-cares \ + --shared-libuv \ + --shared-http-parser \ + --without-npm \ + --without-dtrace + +# Setting BUILDTYPE=Debug builds both release and debug binaries +make BUILDTYPE=Debug %{?_smp_mflags} + +%install +rm -rf %{buildroot} + +./tools/install.py install %{buildroot} + +# and remove dtrace file again +rm -rf %{buildroot}/%{_prefix}/lib/dtrace + +# Set the binary permissions properly +chmod 0755 %{buildroot}/%{_bindir}/node + +# Install the debug binary and set its permissions +install -Dpm0755 out/Debug/node %{buildroot}/%{_bindir}/node_g + +# own the sitelib directory +mkdir -p %{buildroot}%{_prefix}/lib/node_modules + +#install documentation +mkdir -p %{buildroot}%{_defaultdocdir}/%{pkg_name}-docs-%{version}/html +cp -pr doc/* %{buildroot}%{_defaultdocdir}/%{pkg_name}-docs-%{version}/html +rm -f %{_defaultdocdir}/%{pkg_name}-docs-%{version}/html/nodejs.1 +cp -p LICENSE %{buildroot}%{_defaultdocdir}/%{pkg_name}-docs-%{version}/ + +#install development headers +#FIXME: we probably don't really need *.h but node-gyp downloads the whole +#freaking source tree so I can't be sure ATM +mkdir -p %{buildroot}%{_includedir}/node +cp -p src/*.h %{buildroot}%{_includedir}/node + +#node-gyp needs common.gypi too +mkdir -p %{buildroot}%{_datadir}/node +cp -p common.gypi %{buildroot}%{_datadir}/node + +%files +%doc ChangeLog LICENSE README.md AUTHORS +%{_bindir}/node +%{_mandir}/man1/node.* +%dir %{_prefix}/lib/node_modules + +%files devel +%{_bindir}/node_g +%{_includedir}/node +%{_datadir}/node + +%files docs +%{_defaultdocdir}/%{pkg_name}-docs-%{version} + +%changelog +* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 0.10.3-3 +- Add support for software collections +- Move rpm macros and tooling to separate package + +* Thu Apr 04 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.3-2 +- nodejs-symlink-deps: symlink unconditionally in the buildroot + +* Wed Apr 03 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.3-1 +- new upstream release 0.10.3 + http://blog.nodejs.org/2013/04/03/node-v0-10-3-stable/ +- nodejs-symlink-deps: only create symlink if target exists +- nodejs-symlink-deps: symlink devDependencies when --check is used + +* Sun Mar 31 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.2-1 +- new upstream release 0.10.2 + http://blog.nodejs.org/2013/03/28/node-v0-10-2-stable/ +- remove %%nodejs_arches macro since it will only be useful if it is present in + the redhat-rpm-config package +- add default filtering macro to remove unwanted Provides from native modules +- nodejs-symlink-deps now supports multiple modules in one SRPM properly +- nodejs-symlink-deps also now supports a --check argument that works in the + current working directry instead of the buildroot + +* Fri Mar 22 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.1-1 +- new upstream release 0.10.1 + http://blog.nodejs.org/2013/03/21/node-v0-10-1-stable/ + +* Wed Mar 20 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.0-4 +- fix escaping in dependency generator regular expressions (RHBZ#923941) + +* Wed Mar 13 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.0-3 +- add virtual ABI provides for node and v8 so binary module's deps break when + binary compatibility is broken +- automatically add matching Requires to nodejs binary modules +- add %%nodejs_arches macro to future-proof ExcluseArch stanza in dependent + packages + +* Tue Mar 12 2013 Stephen Gallagher <sgallagh@redhat.com> - 0.10.0-2 +- Fix up documentation subpackage + +* Mon Mar 11 2013 Stephen Gallagher <sgallagh@redhat.com> - 0.10.0-1 +- Update to stable 0.10.0 release +- https://raw.github.com/joyent/node/v0.10.0/ChangeLog + +* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.5-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Tue Jan 22 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-10 +- minor bugfixes to RPM magic + - nodejs-symlink-deps: don't create an empty node_modules dir when a module + has no dependencies + - nodes-fixdep: support adding deps when none exist +- Add the full set of headers usually bundled with node as deps to nodejs-devel. + This way `npm install` for native modules that assume the stuff bundled with + node exists will usually "just work". +-move RPM magic to nodejs-devel as requested by FPC + +* Sat Jan 12 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-9 +- fix brown paper bag bug in requires generation script + +* Thu Jan 10 2013 Stephen Gallagher <sgallagh@redhat.com> - 0.9.5-8 +- Build debug binary and install it in the nodejs-devel subpackage + +* Thu Jan 10 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-7 +- don't use make install since it rebuilds everything + +* Thu Jan 10 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-6 +- add %%{?isa}, epoch to v8 deps + +* Wed Jan 09 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-5 +- add defines to match libuv (#892601) +- make v8 dependency explicit (and thus more accurate) +- add -g to $C(XX)FLAGS instead of patching configure to add it +- don't write pointless 'npm(foo) > 0' deps + +* Sat Jan 05 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-4 +- install development headers +- add nodejs_sitearch macro + +* Wed Jan 02 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-3 +- make nodejs-symlink-deps actually work + +* Tue Jan 01 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-2 +- provide nodejs-devel so modules can BuildRequire it (and be consistent + with other interpreted languages in the distro) + +* Tue Jan 01 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-1 +- new upstream release 0.9.5 +- provide nodejs-devel for the moment +- fix minor bugs in RPM magic +- add nodejs_fixdep macro so packagers can easily adjust dependencies in + package.json files + +* Wed Dec 26 2012 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.4-1 +- new upstream release 0.9.4 +- system library patches are now upstream +- respect optflags +- include documentation in subpackage +- add RPM dependency generation and related magic +- guard libuv depedency so it always gets bumped when nodejs does +- add -devel subpackage with enough to make node-gyp happy + +* Wed Dec 19 2012 Dan HorĂ¡k <dan[at]danny.cz> - 0.9.3-8 +- set exclusive arch list to match v8 + +* Tue Dec 18 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-7 +- Add remaining changes from code review +- Remove unnecessary BuildRequires on findutils +- Remove %%clean section + +* Fri Dec 14 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-6 +- Fixes from code review +- Fix executable permissions +- Correct the License field +- Build debuginfo properly + +* Thu Dec 13 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-5 +- Return back to using the standard binary name +- Temporarily adding a conflict against the ham radio node package until they + complete an agreed rename of their binary. + +* Wed Nov 28 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-4 +- Rename binary and manpage to nodejs + +* Mon Nov 19 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-3 +- Update to latest upstream development release 0.9.3 +- Include upstreamed patches to unbundle dependent libraries + +* Tue Oct 23 2012 Adrian Alves <alvesadrian@fedoraproject.org> 0.8.12-1 +- Fixes and Patches suggested by Matthias Runge + +* Mon Apr 09 2012 Adrian Alves <alvesadrian@fedoraproject.org> 0.6.5 +- First build. diff --git a/test/spec/nodejs-undeclared.spec b/test/spec/nodejs-undeclared.spec new file mode 100644 index 0000000..7c2ee5d --- /dev/null +++ b/test/spec/nodejs-undeclared.spec @@ -0,0 +1,301 @@ +%{!?scl:%global pkg_name %{name}} + +Name: %{?scl_prefix}nodejs +Version: 0.10.3 +Release: 3%{?dist} +Summary: JavaScript runtime +License: MIT and ASL 2.0 and ISC and BSD +Group: Development/Languages +URL: http://nodejs.org/ + +# Exclusive archs must match v8 +ExclusiveArch: %{ix86} x86_64 %{arm} + +Source0: http://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz + +# V8 presently breaks ABI at least every x.y release while never bumping SONAME, +# so we need to be more explicit until spot fixes that +%global v8_ge 1:3.14.5.7 +%global v8_lt 1:3.15 +%global v8_abi 3.14 + +%{?scl:Requires: %{scl}-runtime} +BuildRequires: %{?scl_prefix}v8-devel >= %{v8_ge} +BuildRequires: %{?scl_prefix}http-parser-devel >= 2.0 +BuildRequires: %{?scl_prefix}libuv-devel +BuildRequires: %{?scl_prefix}c-ares-devel +BuildRequires: zlib-devel +# Node.js requires some features from openssl 1.0.1 for SPDY support +BuildRequires: openssl-devel + +Requires: %{?scl_prefix}v8%{?isa} >= %{v8_ge} +Requires: %{?scl_prefix}v8%{?isa} < %{v8_lt} + +#we need ABI virtual provides where SONAMEs aren't enough/not present so deps +#break when binary compatibility is broken +%global nodejs_abi 0.10 +Provides: %{?scl_prefix}nodejs(abi) = %{nodejs_abi} +Provides: %{?scl_prefix}nodejs(v8-abi) = %{v8_abi} + +#this corresponds to the "engine" requirement in package.json +Provides: %{?scl_prefix}nodejs(engine) = %{version} + +# Node.js currently has a conflict with the 'node' package in Fedora +# The ham-radio group has agreed to rename their binary for us, but +# in the meantime, we're setting an explicit Conflicts: %{?scl_prefix}here +Conflicts: %{?scl_prefix}node <= 0.3.2-11 + +%description +Node.js is a platform built on Chrome's JavaScript runtime +for easily building fast, scalable network applications. +Node.js uses an event-driven, non-blocking I/O model that +makes it lightweight and efficient, perfect for data-intensive +real-time applications that run across distributed devices. + +%package devel +Summary: JavaScript runtime - development headers +Group: Development/Languages +Requires: %{name} = %{version}-%{release} +Requires: %{?scl_prefix}libuv-devel %{?scl_prefix}http-parser-devel openssl-devel %{?scl_prefix}c-ares-devel zlib-devel + +%description devel +Development headers for the Node.js JavaScript runtime. + +%package docs +Summary: Node.js API documentation +Group: Documentation + +%description docs +The API documentation for the Node.js JavaScript runtime. + +%prep +%setup -q -n node-v%{version} + +# Make sure nothing gets included from bundled deps: +# We only delete the source and header files, because +# the remaining build scripts are still used. + +find deps/cares -name "*.c" -exec rm -f {} \; +find deps/cares -name "*.h" -exec rm -f {} \; + +find deps/npm -name "*.c" -exec rm -f {} \; +find deps/npm -name "*.h" -exec rm -f {} \; + +find deps/zlib -name "*.c" -exec rm -f {} \; +find deps/zlib -name "*.h" -exec rm -f {} \; + +find deps/v8 -name "*.c" -exec rm -f {} \; +find deps/v8 -name "*.h" -exec rm -f {} \; + +find deps/http_parser -name "*.c" -exec rm -f {} \; +find deps/http_parser -name "*.h" -exec rm -f {} \; + +find deps/openssl -name "*.c" -exec rm -f {} \; +find deps/openssl -name "*.h" -exec rm -f {} \; + +find deps/uv -name "*.c" -exec rm -f {} \; +find deps/uv -name "*.h" -exec rm -f {} \; + + +%build +# build with debugging symbols and add defines from libuv (#892601) +export CFLAGS='%{optflags} -g -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \ + -I%{_includedir}' +export CXXFLAGS='%{optflags} -g -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \ + -I%{_includedir}' +export LDFLAGS='%{optflags} -L%{_libdir}' + +./configure --prefix=%{_prefix} \ + --shared-v8 \ + --shared-openssl \ + --shared-zlib \ + --shared-cares \ + --shared-libuv \ + --shared-http-parser \ + --without-npm \ + --without-dtrace + +# Setting BUILDTYPE=Debug builds both release and debug binaries +make BUILDTYPE=Debug %{?_smp_mflags} + +%install +rm -rf %{buildroot} + +./tools/install.py install %{buildroot} + +# and remove dtrace file again +rm -rf %{buildroot}/%{_prefix}/lib/dtrace + +# Set the binary permissions properly +chmod 0755 %{buildroot}/%{_bindir}/node + +# Install the debug binary and set its permissions +install -Dpm0755 out/Debug/node %{buildroot}/%{_bindir}/node_g + +# own the sitelib directory +mkdir -p %{buildroot}%{_prefix}/lib/node_modules + +#install documentation +mkdir -p %{buildroot}%{_defaultdocdir}/%{pkg_name}-docs-%{version}/html +cp -pr doc/* %{buildroot}%{_defaultdocdir}/%{pkg_name}-docs-%{version}/html +rm -f %{_defaultdocdir}/%{pkg_name}-docs-%{version}/html/nodejs.1 +cp -p LICENSE %{buildroot}%{_defaultdocdir}/%{pkg_name}-docs-%{version}/ + +#install development headers +#FIXME: we probably don't really need *.h but node-gyp downloads the whole +#freaking source tree so I can't be sure ATM +mkdir -p %{buildroot}%{_includedir}/node +cp -p src/*.h %{buildroot}%{_includedir}/node + +#node-gyp needs common.gypi too +mkdir -p %{buildroot}%{_datadir}/node +cp -p common.gypi %{buildroot}%{_datadir}/node + +%files +%doc ChangeLog LICENSE README.md AUTHORS +%{_bindir}/node +%{_mandir}/man1/node.* +%dir %{_prefix}/lib/node_modules + +%files devel +%{_bindir}/node_g +%{_includedir}/node +%{_datadir}/node + +%files docs +%{_defaultdocdir}/%{pkg_name}-docs-%{version} + +%changelog +* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 0.10.3-3 +- Add support for software collections +- Move rpm macros and tooling to separate package + +* Thu Apr 04 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.3-2 +- nodejs-symlink-deps: symlink unconditionally in the buildroot + +* Wed Apr 03 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.3-1 +- new upstream release 0.10.3 + http://blog.nodejs.org/2013/04/03/node-v0-10-3-stable/ +- nodejs-symlink-deps: only create symlink if target exists +- nodejs-symlink-deps: symlink devDependencies when --check is used + +* Sun Mar 31 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.2-1 +- new upstream release 0.10.2 + http://blog.nodejs.org/2013/03/28/node-v0-10-2-stable/ +- remove %%nodejs_arches macro since it will only be useful if it is present in + the redhat-rpm-config package +- add default filtering macro to remove unwanted Provides from native modules +- nodejs-symlink-deps now supports multiple modules in one SRPM properly +- nodejs-symlink-deps also now supports a --check argument that works in the + current working directry instead of the buildroot + +* Fri Mar 22 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.1-1 +- new upstream release 0.10.1 + http://blog.nodejs.org/2013/03/21/node-v0-10-1-stable/ + +* Wed Mar 20 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.0-4 +- fix escaping in dependency generator regular expressions (RHBZ#923941) + +* Wed Mar 13 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.10.0-3 +- add virtual ABI provides for node and v8 so binary module's deps break when + binary compatibility is broken +- automatically add matching Requires to nodejs binary modules +- add %%nodejs_arches macro to future-proof ExcluseArch stanza in dependent + packages + +* Tue Mar 12 2013 Stephen Gallagher <sgallagh@redhat.com> - 0.10.0-2 +- Fix up documentation subpackage + +* Mon Mar 11 2013 Stephen Gallagher <sgallagh@redhat.com> - 0.10.0-1 +- Update to stable 0.10.0 release +- https://raw.github.com/joyent/node/v0.10.0/ChangeLog + +* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.5-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Tue Jan 22 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-10 +- minor bugfixes to RPM magic + - nodejs-symlink-deps: don't create an empty node_modules dir when a module + has no dependencies + - nodes-fixdep: support adding deps when none exist +- Add the full set of headers usually bundled with node as deps to nodejs-devel. + This way `npm install` for native modules that assume the stuff bundled with + node exists will usually "just work". +-move RPM magic to nodejs-devel as requested by FPC + +* Sat Jan 12 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-9 +- fix brown paper bag bug in requires generation script + +* Thu Jan 10 2013 Stephen Gallagher <sgallagh@redhat.com> - 0.9.5-8 +- Build debug binary and install it in the nodejs-devel subpackage + +* Thu Jan 10 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-7 +- don't use make install since it rebuilds everything + +* Thu Jan 10 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-6 +- add %%{?isa}, epoch to v8 deps + +* Wed Jan 09 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-5 +- add defines to match libuv (#892601) +- make v8 dependency explicit (and thus more accurate) +- add -g to $C(XX)FLAGS instead of patching configure to add it +- don't write pointless 'npm(foo) > 0' deps + +* Sat Jan 05 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-4 +- install development headers +- add nodejs_sitearch macro + +* Wed Jan 02 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-3 +- make nodejs-symlink-deps actually work + +* Tue Jan 01 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-2 +- provide nodejs-devel so modules can BuildRequire it (and be consistent + with other interpreted languages in the distro) + +* Tue Jan 01 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-1 +- new upstream release 0.9.5 +- provide nodejs-devel for the moment +- fix minor bugs in RPM magic +- add nodejs_fixdep macro so packagers can easily adjust dependencies in + package.json files + +* Wed Dec 26 2012 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.4-1 +- new upstream release 0.9.4 +- system library patches are now upstream +- respect optflags +- include documentation in subpackage +- add RPM dependency generation and related magic +- guard libuv depedency so it always gets bumped when nodejs does +- add -devel subpackage with enough to make node-gyp happy + +* Wed Dec 19 2012 Dan HorĂ¡k <dan[at]danny.cz> - 0.9.3-8 +- set exclusive arch list to match v8 + +* Tue Dec 18 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-7 +- Add remaining changes from code review +- Remove unnecessary BuildRequires on findutils +- Remove %%clean section + +* Fri Dec 14 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-6 +- Fixes from code review +- Fix executable permissions +- Correct the License field +- Build debuginfo properly + +* Thu Dec 13 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-5 +- Return back to using the standard binary name +- Temporarily adding a conflict against the ham radio node package until they + complete an agreed rename of their binary. + +* Wed Nov 28 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-4 +- Rename binary and manpage to nodejs + +* Mon Nov 19 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-3 +- Update to latest upstream development release 0.9.3 +- Include upstreamed patches to unbundle dependent libraries + +* Tue Oct 23 2012 Adrian Alves <alvesadrian@fedoraproject.org> 0.8.12-1 +- Fixes and Patches suggested by Matthias Runge + +* Mon Apr 09 2012 Adrian Alves <alvesadrian@fedoraproject.org> 0.6.5 +- First build. diff --git a/test/spec/nodejs010-alien-subpackage-n.spec b/test/spec/nodejs010-alien-subpackage-n.spec new file mode 100644 index 0000000..6f432f9 --- /dev/null +++ b/test/spec/nodejs010-alien-subpackage-n.spec @@ -0,0 +1,131 @@ +%global scl nodejs010 +%scl_package %scl +%global install_scl 1 + +Summary: %scl Software Collection +Name: %scl_name +Version: 1 +Release: 7%{?dist} + +Source1: macros.nodejs +Source2: nodejs.attr +Source3: nodejs.prov +Source4: nodejs.req +Source5: nodejs-symlink-deps +Source6: nodejs-fixdep +Source7: nodejs_native.attr + +License: GPLv2+ + +%if 0%{?install_scl} +Requires: %{scl_prefix}nodejs +%endif + +BuildRequires: scl-utils-build +BuildRequires: python-devel + +%description +This is the main package for %scl Software Collection. + +%package runtime +Summary: Package that handles %scl Software Collection. +Requires: scl-utils + +%description runtime +Package shipping essential scripts to work with %scl Software Collection. + +%package -n hehe +Summary: Package that should not be here +Requires: bullshit + +%description hehe +This package should not be in SCL metapackage. + +%package build +Summary: Package shipping basic build configuration +Requires: scl-utils-build + +%description build +Package shipping essential configuration macros to build %scl Software Collection. + +%prep +%setup -c -T + +%install +rm -rf %{buildroot} +mkdir -p %{buildroot}%{_scl_scripts}/root +cat >> %{buildroot}%{_scl_scripts}/enable << EOF +export PATH=%{_bindir}:\$PATH +export LD_LIBRARY_PATH=%{_libdir}:\$LD_LIBRARY_PATH +export PYTHONPATH=%{_scl_root}%{python_sitelib}:\$PYTHONPATH +EOF + +# install rpm magic +install -Dpm0644 %{SOURCE1} %{buildroot}%{_root_sysconfdir}/rpm/macros.%{name} +install -Dpm0644 %{SOURCE2} %{buildroot}%{_rpmconfigdir}/fileattrs/%{name}.attr +install -pm0755 %{SOURCE3} %{buildroot}%{_rpmconfigdir}/%{name}.prov +install -pm0755 %{SOURCE4} %{buildroot}%{_rpmconfigdir}/%{name}.req +install -pm0755 %{SOURCE5} %{buildroot}%{_rpmconfigdir}/%{name}-symlink-deps +install -pm0755 %{SOURCE6} %{buildroot}%{_rpmconfigdir}/%{name}-fixdep +install -Dpm0644 %{SOURCE7} %{buildroot}%{_rpmconfigdir}/fileattrs/%{name}_native.attr + + +# ensure Requires are added to every native module that match the Provides from +# the nodejs build in the buildroot +cat << EOF > %{buildroot}%{_rpmconfigdir}/%{name}_native.req +#!/bin/sh +echo 'nodejs010-nodejs(abi) = %nodejs_abi' +echo 'nodejs010-nodejs(v8-abi) = %v8_abi' +EOF +chmod 0755 %{buildroot}%{_rpmconfigdir}/%{name}_native.req + +cat << EOF > %{buildroot}%{_rpmconfigdir}/%{name}-require.sh +#!/bin/sh +%{_rpmconfigdir}/%{name}.req $* +%{_rpmconfigdir}/find-requires $* +EOF +chmod 0755 %{buildroot}%{_rpmconfigdir}/%{name}-require.sh + +cat << EOF > %{buildroot}%{_rpmconfigdir}/%{name}-provide.sh +#!/bin/sh +%{_rpmconfigdir}/%{name}.prov $* +%{_rpmconfigdir}/find-provides $* +EOF +chmod 0755 %{buildroot}%{_rpmconfigdir}/%{name}-provide.sh + +%scl_install + +%files + +%files runtime +%scl_files + +%files build +%{_root_sysconfdir}/rpm/macros.%{scl}-config +%{_root_sysconfdir}/rpm/macros.%{name} +%{_rpmconfigdir}/fileattrs/%{name}*.attr +%{_rpmconfigdir}/%{name}* + + +%changelog +* Mon Apr 15 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-7 +- Update macros and requires/provides generator to latest + +* Wed Apr 10 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-6 +- Fix rpm requires/provides generator paths +- Add requires to main meta package + +* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-5 +- Make package architecture specific for libdir usage + +* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-4 +- Add rpm macros and tooling + +* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-3 +- Add proper scl-utils-build requires + +* Fri Apr 05 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-2 +- Add PYTHONPATH to configuration + +* Tue Mar 26 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-1 +- Initial version of the Node.js Software Collection diff --git a/test/spec/nodejs010-alien-subpackage.spec b/test/spec/nodejs010-alien-subpackage.spec new file mode 100644 index 0000000..813ede9 --- /dev/null +++ b/test/spec/nodejs010-alien-subpackage.spec @@ -0,0 +1,131 @@ +%global scl nodejs010 +%scl_package %scl +%global install_scl 1 + +Summary: %scl Software Collection +Name: %scl_name +Version: 1 +Release: 7%{?dist} + +Source1: macros.nodejs +Source2: nodejs.attr +Source3: nodejs.prov +Source4: nodejs.req +Source5: nodejs-symlink-deps +Source6: nodejs-fixdep +Source7: nodejs_native.attr + +License: GPLv2+ + +%if 0%{?install_scl} +Requires: %{scl_prefix}nodejs +%endif + +BuildRequires: scl-utils-build +BuildRequires: python-devel + +%description +This is the main package for %scl Software Collection. + +%package runtime +Summary: Package that handles %scl Software Collection. +Requires: scl-utils + +%description runtime +Package shipping essential scripts to work with %scl Software Collection. + +%package hehe +Summary: Package that should not be here +Requires: bullshit + +%description hehe +This package should not be in SCL metapackage. + +%package build +Summary: Package shipping basic build configuration +Requires: scl-utils-build + +%description build +Package shipping essential configuration macros to build %scl Software Collection. + +%prep +%setup -c -T + +%install +rm -rf %{buildroot} +mkdir -p %{buildroot}%{_scl_scripts}/root +cat >> %{buildroot}%{_scl_scripts}/enable << EOF +export PATH=%{_bindir}:\$PATH +export LD_LIBRARY_PATH=%{_libdir}:\$LD_LIBRARY_PATH +export PYTHONPATH=%{_scl_root}%{python_sitelib}:\$PYTHONPATH +EOF + +# install rpm magic +install -Dpm0644 %{SOURCE1} %{buildroot}%{_root_sysconfdir}/rpm/macros.%{name} +install -Dpm0644 %{SOURCE2} %{buildroot}%{_rpmconfigdir}/fileattrs/%{name}.attr +install -pm0755 %{SOURCE3} %{buildroot}%{_rpmconfigdir}/%{name}.prov +install -pm0755 %{SOURCE4} %{buildroot}%{_rpmconfigdir}/%{name}.req +install -pm0755 %{SOURCE5} %{buildroot}%{_rpmconfigdir}/%{name}-symlink-deps +install -pm0755 %{SOURCE6} %{buildroot}%{_rpmconfigdir}/%{name}-fixdep +install -Dpm0644 %{SOURCE7} %{buildroot}%{_rpmconfigdir}/fileattrs/%{name}_native.attr + + +# ensure Requires are added to every native module that match the Provides from +# the nodejs build in the buildroot +cat << EOF > %{buildroot}%{_rpmconfigdir}/%{name}_native.req +#!/bin/sh +echo 'nodejs010-nodejs(abi) = %nodejs_abi' +echo 'nodejs010-nodejs(v8-abi) = %v8_abi' +EOF +chmod 0755 %{buildroot}%{_rpmconfigdir}/%{name}_native.req + +cat << EOF > %{buildroot}%{_rpmconfigdir}/%{name}-require.sh +#!/bin/sh +%{_rpmconfigdir}/%{name}.req $* +%{_rpmconfigdir}/find-requires $* +EOF +chmod 0755 %{buildroot}%{_rpmconfigdir}/%{name}-require.sh + +cat << EOF > %{buildroot}%{_rpmconfigdir}/%{name}-provide.sh +#!/bin/sh +%{_rpmconfigdir}/%{name}.prov $* +%{_rpmconfigdir}/find-provides $* +EOF +chmod 0755 %{buildroot}%{_rpmconfigdir}/%{name}-provide.sh + +%scl_install + +%files + +%files runtime +%scl_files + +%files build +%{_root_sysconfdir}/rpm/macros.%{scl}-config +%{_root_sysconfdir}/rpm/macros.%{name} +%{_rpmconfigdir}/fileattrs/%{name}*.attr +%{_rpmconfigdir}/%{name}* + + +%changelog +* Mon Apr 15 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-7 +- Update macros and requires/provides generator to latest + +* Wed Apr 10 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-6 +- Fix rpm requires/provides generator paths +- Add requires to main meta package + +* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-5 +- Make package architecture specific for libdir usage + +* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-4 +- Add rpm macros and tooling + +* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-3 +- Add proper scl-utils-build requires + +* Fri Apr 05 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-2 +- Add PYTHONPATH to configuration + +* Tue Mar 26 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-1 +- Initial version of the Node.js Software Collection diff --git a/test/spec/nodejs010-badfiles.spec b/test/spec/nodejs010-badfiles.spec new file mode 100644 index 0000000..f4d5b61 --- /dev/null +++ b/test/spec/nodejs010-badfiles.spec @@ -0,0 +1,123 @@ +%global scl nodejs010 +%scl_package %scl +%global install_scl 1 + +Summary: %scl Software Collection +Name: %scl_name +Version: 1 +Release: 7%{?dist} + +Source1: macros.nodejs +Source2: nodejs.attr +Source3: nodejs.prov +Source4: nodejs.req +Source5: nodejs-symlink-deps +Source6: nodejs-fixdep +Source7: nodejs_native.attr + +License: GPLv2+ + +%if 0%{?install_scl} +Requires: %{scl_prefix}nodejs +%endif + +BuildRequires: scl-utils-build +BuildRequires: python-devel + +%description +This is the main package for %scl Software Collection. + +%package runtime +Summary: Package that handles %scl Software Collection. +Requires: scl-utils + +%description runtime +Package shipping essential scripts to work with %scl Software Collection. + +%package build +Summary: Package shipping basic build configuration +Requires: scl-utils-build + +%description build +Package shipping essential configuration macros to build %scl Software Collection. + +%prep +%setup -c -T + +%install +rm -rf %{buildroot} +mkdir -p %{buildroot}%{_scl_scripts}/root +cat >> %{buildroot}%{_scl_scripts}/enable << EOF +export PATH=%{_bindir}:\$PATH +export LD_LIBRARY_PATH=%{_libdir}:\$LD_LIBRARY_PATH +export PYTHONPATH=%{_scl_root}%{python_sitelib}:\$PYTHONPATH +EOF + +# install rpm magic +install -Dpm0644 %{SOURCE1} %{buildroot}%{_root_sysconfdir}/rpm/macros.%{name} +install -Dpm0644 %{SOURCE2} %{buildroot}%{_rpmconfigdir}/fileattrs/%{name}.attr +install -pm0755 %{SOURCE3} %{buildroot}%{_rpmconfigdir}/%{name}.prov +install -pm0755 %{SOURCE4} %{buildroot}%{_rpmconfigdir}/%{name}.req +install -pm0755 %{SOURCE5} %{buildroot}%{_rpmconfigdir}/%{name}-symlink-deps +install -pm0755 %{SOURCE6} %{buildroot}%{_rpmconfigdir}/%{name}-fixdep +install -Dpm0644 %{SOURCE7} %{buildroot}%{_rpmconfigdir}/fileattrs/%{name}_native.attr + + +# ensure Requires are added to every native module that match the Provides from +# the nodejs build in the buildroot +cat << EOF > %{buildroot}%{_rpmconfigdir}/%{name}_native.req +#!/bin/sh +echo 'nodejs010-nodejs(abi) = %nodejs_abi' +echo 'nodejs010-nodejs(v8-abi) = %v8_abi' +EOF +chmod 0755 %{buildroot}%{_rpmconfigdir}/%{name}_native.req + +cat << EOF > %{buildroot}%{_rpmconfigdir}/%{name}-require.sh +#!/bin/sh +%{_rpmconfigdir}/%{name}.req $* +%{_rpmconfigdir}/find-requires $* +EOF +chmod 0755 %{buildroot}%{_rpmconfigdir}/%{name}-require.sh + +cat << EOF > %{buildroot}%{_rpmconfigdir}/%{name}-provide.sh +#!/bin/sh +%{_rpmconfigdir}/%{name}.prov $* +%{_rpmconfigdir}/find-provides $* +EOF +chmod 0755 %{buildroot}%{_rpmconfigdir}/%{name}-provide.sh + +%scl_install + +%files +%scl_files + +%files runtime + +%files build +%{_rpmconfigdir}/rpm/macros.%{name} +%{_rpmconfigdir}/fileattrs/%{name}*.attr +%{_rpmconfigdir}/%{name}* + + +%changelog +* Mon Apr 15 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-7 +- Update macros and requires/provides generator to latest + +* Wed Apr 10 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-6 +- Fix rpm requires/provides generator paths +- Add requires to main meta package + +* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-5 +- Make package architecture specific for libdir usage + +* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-4 +- Add rpm macros and tooling + +* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-3 +- Add proper scl-utils-build requires + +* Fri Apr 05 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-2 +- Add PYTHONPATH to configuration + +* Tue Mar 26 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-1 +- Initial version of the Node.js Software Collection diff --git a/test/spec/nodejs010-missing-requires.spec b/test/spec/nodejs010-missing-requires.spec new file mode 100644 index 0000000..ec42b21 --- /dev/null +++ b/test/spec/nodejs010-missing-requires.spec @@ -0,0 +1,121 @@ +%global scl nodejs010 +%scl_package %scl +%global install_scl 1 + +Summary: %scl Software Collection +Name: %scl_name +Version: 1 +Release: 7%{?dist} + +Source1: macros.nodejs +Source2: nodejs.attr +Source3: nodejs.prov +Source4: nodejs.req +Source5: nodejs-symlink-deps +Source6: nodejs-fixdep +Source7: nodejs_native.attr + +License: GPLv2+ + +%if 0%{?install_scl} +Requires: %{scl_prefix}nodejs +%endif + +BuildRequires: python-devel + +%description +This is the main package for %scl Software Collection. + +%package runtime +Summary: Package that handles %scl Software Collection. + +%description runtime +Package shipping essential scripts to work with %scl Software Collection. + +%package build +Summary: Package shipping basic build configuration + +%description build +Package shipping essential configuration macros to build %scl Software Collection. + +%prep +%setup -c -T + +%install +rm -rf %{buildroot} +mkdir -p %{buildroot}%{_scl_scripts}/root +cat >> %{buildroot}%{_scl_scripts}/enable << EOF +export PATH=%{_bindir}:\$PATH +export LD_LIBRARY_PATH=%{_libdir}:\$LD_LIBRARY_PATH +export PYTHONPATH=%{_scl_root}%{python_sitelib}:\$PYTHONPATH +EOF + +# install rpm magic +install -Dpm0644 %{SOURCE1} %{buildroot}%{_root_sysconfdir}/rpm/macros.%{name} +install -Dpm0644 %{SOURCE2} %{buildroot}%{_rpmconfigdir}/fileattrs/%{name}.attr +install -pm0755 %{SOURCE3} %{buildroot}%{_rpmconfigdir}/%{name}.prov +install -pm0755 %{SOURCE4} %{buildroot}%{_rpmconfigdir}/%{name}.req +install -pm0755 %{SOURCE5} %{buildroot}%{_rpmconfigdir}/%{name}-symlink-deps +install -pm0755 %{SOURCE6} %{buildroot}%{_rpmconfigdir}/%{name}-fixdep +install -Dpm0644 %{SOURCE7} %{buildroot}%{_rpmconfigdir}/fileattrs/%{name}_native.attr + + +# ensure Requires are added to every native module that match the Provides from +# the nodejs build in the buildroot +cat << EOF > %{buildroot}%{_rpmconfigdir}/%{name}_native.req +#!/bin/sh +echo 'nodejs010-nodejs(abi) = %nodejs_abi' +echo 'nodejs010-nodejs(v8-abi) = %v8_abi' +EOF +chmod 0755 %{buildroot}%{_rpmconfigdir}/%{name}_native.req + +cat << EOF > %{buildroot}%{_rpmconfigdir}/%{name}-require.sh +#!/bin/sh +%{_rpmconfigdir}/%{name}.req $* +%{_rpmconfigdir}/find-requires $* +EOF +chmod 0755 %{buildroot}%{_rpmconfigdir}/%{name}-require.sh + +cat << EOF > %{buildroot}%{_rpmconfigdir}/%{name}-provide.sh +#!/bin/sh +%{_rpmconfigdir}/%{name}.prov $* +%{_rpmconfigdir}/find-provides $* +EOF +chmod 0755 %{buildroot}%{_rpmconfigdir}/%{name}-provide.sh + +%scl_install + +%files + +%files runtime +%scl_files + +%files build +%{_root_sysconfdir}/rpm/macros.%{scl}-config +%{_root_sysconfdir}/rpm/macros.%{name} +%{_rpmconfigdir}/fileattrs/%{name}*.attr +%{_rpmconfigdir}/%{name}* + + +%changelog +* Mon Apr 15 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-7 +- Update macros and requires/provides generator to latest + +* Wed Apr 10 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-6 +- Fix rpm requires/provides generator paths +- Add requires to main meta package + +* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-5 +- Make package architecture specific for libdir usage + +* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-4 +- Add rpm macros and tooling + +* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-3 +- Add proper scl-utils-build requires + +* Fri Apr 05 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-2 +- Add PYTHONPATH to configuration + +* Tue Mar 26 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-1 +- Initial version of the Node.js Software Collection diff --git a/test/spec/nodejs010-noarch-good.spec b/test/spec/nodejs010-noarch-good.spec new file mode 100644 index 0000000..22c4177 --- /dev/null +++ b/test/spec/nodejs010-noarch-good.spec @@ -0,0 +1,124 @@ +%global scl nodejs010 +%scl_package %scl +%global install_scl 1 + +Summary: %scl Software Collection +Name: %scl_name +Version: 1 +Release: 7%{?dist} + +Source1: macros.nodejs +Source2: nodejs.attr +Source3: nodejs.prov +Source4: nodejs.req +Source5: nodejs-symlink-deps +Source6: nodejs-fixdep +Source7: nodejs_native.attr + +License: GPLv2+ +BuildArch: noarch + +%if 0%{?install_scl} +Requires: %{scl_prefix}nodejs +%endif + +BuildRequires: scl-utils-build +BuildRequires: python-devel + +%description +This is the main package for %scl Software Collection. + +%package runtime +Summary: Package that handles %scl Software Collection. +Requires: scl-utils + +%description runtime +Package shipping essential scripts to work with %scl Software Collection. + +%package build +Summary: Package shipping basic build configuration +Requires: scl-utils-build + +%description build +Package shipping essential configuration macros to build %scl Software Collection. + +%prep +%setup -c -T + +%install +rm -rf %{buildroot} +mkdir -p %{buildroot}%{_scl_scripts}/root +cat >> %{buildroot}%{_scl_scripts}/enable << EOF +export PATH=%{_bindir}:\$PATH +export PYTHONPATH=%{_scl_root}%{python_sitelib}:\$PYTHONPATH +EOF + +# install rpm magic +install -Dpm0644 %{SOURCE1} %{buildroot}%{_root_sysconfdir}/rpm/macros.%{name} +install -Dpm0644 %{SOURCE2} %{buildroot}%{_rpmconfigdir}/fileattrs/%{name}.attr +install -pm0755 %{SOURCE3} %{buildroot}%{_rpmconfigdir}/%{name}.prov +install -pm0755 %{SOURCE4} %{buildroot}%{_rpmconfigdir}/%{name}.req +install -pm0755 %{SOURCE5} %{buildroot}%{_rpmconfigdir}/%{name}-symlink-deps +install -pm0755 %{SOURCE6} %{buildroot}%{_rpmconfigdir}/%{name}-fixdep +install -Dpm0644 %{SOURCE7} %{buildroot}%{_rpmconfigdir}/fileattrs/%{name}_native.attr + + +# ensure Requires are added to every native module that match the Provides from +# the nodejs build in the buildroot +cat << EOF > %{buildroot}%{_rpmconfigdir}/%{name}_native.req +#!/bin/sh +echo 'nodejs010-nodejs(abi) = %nodejs_abi' +echo 'nodejs010-nodejs(v8-abi) = %v8_abi' +EOF +chmod 0755 %{buildroot}%{_rpmconfigdir}/%{name}_native.req + +cat << EOF > %{buildroot}%{_rpmconfigdir}/%{name}-require.sh +#!/bin/sh +%{_rpmconfigdir}/%{name}.req $* +%{_rpmconfigdir}/find-requires $* +EOF +chmod 0755 %{buildroot}%{_rpmconfigdir}/%{name}-require.sh + +cat << EOF > %{buildroot}%{_rpmconfigdir}/%{name}-provide.sh +#!/bin/sh +%{_rpmconfigdir}/%{name}.prov $* +%{_rpmconfigdir}/find-provides $* +EOF +chmod 0755 %{buildroot}%{_rpmconfigdir}/%{name}-provide.sh + +%scl_install + +%files + +%files runtime +%scl_files + +%files build +%{_root_sysconfdir}/rpm/macros.%{scl}-config +%{_root_sysconfdir}/rpm/macros.%{name} +%{_rpmconfigdir}/fileattrs/%{name}*.attr +%{_rpmconfigdir}/%{name}* + + +%changelog +* Mon Apr 15 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-7 +- Update macros and requires/provides generator to latest + +* Wed Apr 10 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-6 +- Fix rpm requires/provides generator paths +- Add requires to main meta package + +* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-5 +- Make package architecture specific for libdir usage + +* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-4 +- Add rpm macros and tooling + +* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-3 +- Add proper scl-utils-build requires + +* Fri Apr 05 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-2 +- Add PYTHONPATH to configuration + +* Tue Mar 26 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-1 +- Initial version of the Node.js Software Collection diff --git a/test/spec/nodejs010-noarch-libdir.spec b/test/spec/nodejs010-noarch-libdir.spec new file mode 100644 index 0000000..041dc47 --- /dev/null +++ b/test/spec/nodejs010-noarch-libdir.spec @@ -0,0 +1,125 @@ +%global scl nodejs010 +%scl_package %scl +%global install_scl 1 + +Summary: %scl Software Collection +Name: %scl_name +Version: 1 +Release: 7%{?dist} + +Source1: macros.nodejs +Source2: nodejs.attr +Source3: nodejs.prov +Source4: nodejs.req +Source5: nodejs-symlink-deps +Source6: nodejs-fixdep +Source7: nodejs_native.attr + +License: GPLv2+ +BuildArch: noarch + +%if 0%{?install_scl} +Requires: %{scl_prefix}nodejs +%endif + +BuildRequires: scl-utils-build +BuildRequires: python-devel + +%description +This is the main package for %scl Software Collection. + +%package runtime +Summary: Package that handles %scl Software Collection. +Requires: scl-utils + +%description runtime +Package shipping essential scripts to work with %scl Software Collection. + +%package build +Summary: Package shipping basic build configuration +Requires: scl-utils-build + +%description build +Package shipping essential configuration macros to build %scl Software Collection. + +%prep +%setup -c -T + +%install +rm -rf %{buildroot} +mkdir -p %{buildroot}%{_scl_scripts}/root +cat >> %{buildroot}%{_scl_scripts}/enable << EOF +export PATH=%{_bindir}:\$PATH +export LD_LIBRARY_PATH=%{_libdir}:\$LD_LIBRARY_PATH +export PYTHONPATH=%{_scl_root}%{python_sitelib}:\$PYTHONPATH +EOF + +# install rpm magic +install -Dpm0644 %{SOURCE1} %{buildroot}%{_root_sysconfdir}/rpm/macros.%{name} +install -Dpm0644 %{SOURCE2} %{buildroot}%{_rpmconfigdir}/fileattrs/%{name}.attr +install -pm0755 %{SOURCE3} %{buildroot}%{_rpmconfigdir}/%{name}.prov +install -pm0755 %{SOURCE4} %{buildroot}%{_rpmconfigdir}/%{name}.req +install -pm0755 %{SOURCE5} %{buildroot}%{_rpmconfigdir}/%{name}-symlink-deps +install -pm0755 %{SOURCE6} %{buildroot}%{_rpmconfigdir}/%{name}-fixdep +install -Dpm0644 %{SOURCE7} %{buildroot}%{_rpmconfigdir}/fileattrs/%{name}_native.attr + + +# ensure Requires are added to every native module that match the Provides from +# the nodejs build in the buildroot +cat << EOF > %{buildroot}%{_rpmconfigdir}/%{name}_native.req +#!/bin/sh +echo 'nodejs010-nodejs(abi) = %nodejs_abi' +echo 'nodejs010-nodejs(v8-abi) = %v8_abi' +EOF +chmod 0755 %{buildroot}%{_rpmconfigdir}/%{name}_native.req + +cat << EOF > %{buildroot}%{_rpmconfigdir}/%{name}-require.sh +#!/bin/sh +%{_rpmconfigdir}/%{name}.req $* +%{_rpmconfigdir}/find-requires $* +EOF +chmod 0755 %{buildroot}%{_rpmconfigdir}/%{name}-require.sh + +cat << EOF > %{buildroot}%{_rpmconfigdir}/%{name}-provide.sh +#!/bin/sh +%{_rpmconfigdir}/%{name}.prov $* +%{_rpmconfigdir}/find-provides $* +EOF +chmod 0755 %{buildroot}%{_rpmconfigdir}/%{name}-provide.sh + +%scl_install + +%files + +%files runtime +%scl_files + +%files build +%{_root_sysconfdir}/rpm/macros.%{scl}-config +%{_root_sysconfdir}/rpm/macros.%{name} +%{_rpmconfigdir}/fileattrs/%{name}*.attr +%{_rpmconfigdir}/%{name}* + + +%changelog +* Mon Apr 15 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-7 +- Update macros and requires/provides generator to latest + +* Wed Apr 10 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-6 +- Fix rpm requires/provides generator paths +- Add requires to main meta package + +* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-5 +- Make package architecture specific for libdir usage + +* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-4 +- Add rpm macros and tooling + +* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-3 +- Add proper scl-utils-build requires + +* Fri Apr 05 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-2 +- Add PYTHONPATH to configuration + +* Tue Mar 26 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-1 +- Initial version of the Node.js Software Collection diff --git a/test/spec/nodejs010-nobuild.spec b/test/spec/nodejs010-nobuild.spec new file mode 100644 index 0000000..a610e99 --- /dev/null +++ b/test/spec/nodejs010-nobuild.spec @@ -0,0 +1,115 @@ +%global scl nodejs010 +%scl_package %scl +%global install_scl 1 + +Summary: %scl Software Collection +Name: %scl_name +Version: 1 +Release: 7%{?dist} + +Source1: macros.nodejs +Source2: nodejs.attr +Source3: nodejs.prov +Source4: nodejs.req +Source5: nodejs-symlink-deps +Source6: nodejs-fixdep +Source7: nodejs_native.attr + +License: GPLv2+ + +%if 0%{?install_scl} +Requires: %{scl_prefix}nodejs +%endif + +BuildRequires: scl-utils-build +BuildRequires: python-devel + +%description +This is the main package for %scl Software Collection. + +%package runtime +Summary: Package that handles %scl Software Collection. +Requires: scl-utils + +%description runtime +Package shipping essential scripts to work with %scl Software Collection. + +%prep +%setup -c -T + +%install +rm -rf %{buildroot} +mkdir -p %{buildroot}%{_scl_scripts}/root +cat >> %{buildroot}%{_scl_scripts}/enable << EOF +export PATH=%{_bindir}:\$PATH +export LD_LIBRARY_PATH=%{_libdir}:\$LD_LIBRARY_PATH +export PYTHONPATH=%{_scl_root}%{python_sitelib}:\$PYTHONPATH +EOF + +# install rpm magic +install -Dpm0644 %{SOURCE1} %{buildroot}%{_root_sysconfdir}/rpm/macros.%{name} +install -Dpm0644 %{SOURCE2} %{buildroot}%{_rpmconfigdir}/fileattrs/%{name}.attr +install -pm0755 %{SOURCE3} %{buildroot}%{_rpmconfigdir}/%{name}.prov +install -pm0755 %{SOURCE4} %{buildroot}%{_rpmconfigdir}/%{name}.req +install -pm0755 %{SOURCE5} %{buildroot}%{_rpmconfigdir}/%{name}-symlink-deps +install -pm0755 %{SOURCE6} %{buildroot}%{_rpmconfigdir}/%{name}-fixdep +install -Dpm0644 %{SOURCE7} %{buildroot}%{_rpmconfigdir}/fileattrs/%{name}_native.attr + + +# ensure Requires are added to every native module that match the Provides from +# the nodejs build in the buildroot +cat << EOF > %{buildroot}%{_rpmconfigdir}/%{name}_native.req +#!/bin/sh +echo 'nodejs010-nodejs(abi) = %nodejs_abi' +echo 'nodejs010-nodejs(v8-abi) = %v8_abi' +EOF +chmod 0755 %{buildroot}%{_rpmconfigdir}/%{name}_native.req + +cat << EOF > %{buildroot}%{_rpmconfigdir}/%{name}-require.sh +#!/bin/sh +%{_rpmconfigdir}/%{name}.req $* +%{_rpmconfigdir}/find-requires $* +EOF +chmod 0755 %{buildroot}%{_rpmconfigdir}/%{name}-require.sh + +cat << EOF > %{buildroot}%{_rpmconfigdir}/%{name}-provide.sh +#!/bin/sh +%{_rpmconfigdir}/%{name}.prov $* +%{_rpmconfigdir}/find-provides $* +EOF +chmod 0755 %{buildroot}%{_rpmconfigdir}/%{name}-provide.sh + +%scl_install + +%files + +%files runtime +%scl_files +%{_root_sysconfdir}/rpm/macros.%{scl}-config +%{_root_sysconfdir}/rpm/macros.%{name} +%{_rpmconfigdir}/fileattrs/%{name}*.attr +%{_rpmconfigdir}/%{name}* + + +%changelog +* Mon Apr 15 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-7 +- Update macros and requires/provides generator to latest + +* Wed Apr 10 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-6 +- Fix rpm requires/provides generator paths +- Add requires to main meta package + +* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-5 +- Make package architecture specific for libdir usage + +* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-4 +- Add rpm macros and tooling + +* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-3 +- Add proper scl-utils-build requires + +* Fri Apr 05 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-2 +- Add PYTHONPATH to configuration + +* Tue Mar 26 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-1 +- Initial version of the Node.js Software Collection diff --git a/test/spec/nodejs010-noruntime.spec b/test/spec/nodejs010-noruntime.spec new file mode 100644 index 0000000..0f8b5ec --- /dev/null +++ b/test/spec/nodejs010-noruntime.spec @@ -0,0 +1,115 @@ +%global scl nodejs010 +%scl_package %scl +%global install_scl 1 + +Summary: %scl Software Collection +Name: %scl_name +Version: 1 +Release: 7%{?dist} + +Source1: macros.nodejs +Source2: nodejs.attr +Source3: nodejs.prov +Source4: nodejs.req +Source5: nodejs-symlink-deps +Source6: nodejs-fixdep +Source7: nodejs_native.attr + +License: GPLv2+ + +%if 0%{?install_scl} +Requires: %{scl_prefix}nodejs +%endif + +BuildRequires: scl-utils-build +BuildRequires: python-devel + +%description +This is the main package for %scl Software Collection. + +%package build +Summary: Package shipping basic build configuration +Requires: scl-utils-build + +%description build +Package shipping essential configuration macros to build %scl Software Collection. + +%prep +%setup -c -T + +%install +rm -rf %{buildroot} +mkdir -p %{buildroot}%{_scl_scripts}/root +cat >> %{buildroot}%{_scl_scripts}/enable << EOF +export PATH=%{_bindir}:\$PATH +export LD_LIBRARY_PATH=%{_libdir}:\$LD_LIBRARY_PATH +export PYTHONPATH=%{_scl_root}%{python_sitelib}:\$PYTHONPATH +EOF + +# install rpm magic +install -Dpm0644 %{SOURCE1} %{buildroot}%{_root_sysconfdir}/rpm/macros.%{name} +install -Dpm0644 %{SOURCE2} %{buildroot}%{_rpmconfigdir}/fileattrs/%{name}.attr +install -pm0755 %{SOURCE3} %{buildroot}%{_rpmconfigdir}/%{name}.prov +install -pm0755 %{SOURCE4} %{buildroot}%{_rpmconfigdir}/%{name}.req +install -pm0755 %{SOURCE5} %{buildroot}%{_rpmconfigdir}/%{name}-symlink-deps +install -pm0755 %{SOURCE6} %{buildroot}%{_rpmconfigdir}/%{name}-fixdep +install -Dpm0644 %{SOURCE7} %{buildroot}%{_rpmconfigdir}/fileattrs/%{name}_native.attr + + +# ensure Requires are added to every native module that match the Provides from +# the nodejs build in the buildroot +cat << EOF > %{buildroot}%{_rpmconfigdir}/%{name}_native.req +#!/bin/sh +echo 'nodejs010-nodejs(abi) = %nodejs_abi' +echo 'nodejs010-nodejs(v8-abi) = %v8_abi' +EOF +chmod 0755 %{buildroot}%{_rpmconfigdir}/%{name}_native.req + +cat << EOF > %{buildroot}%{_rpmconfigdir}/%{name}-require.sh +#!/bin/sh +%{_rpmconfigdir}/%{name}.req $* +%{_rpmconfigdir}/find-requires $* +EOF +chmod 0755 %{buildroot}%{_rpmconfigdir}/%{name}-require.sh + +cat << EOF > %{buildroot}%{_rpmconfigdir}/%{name}-provide.sh +#!/bin/sh +%{_rpmconfigdir}/%{name}.prov $* +%{_rpmconfigdir}/find-provides $* +EOF +chmod 0755 %{buildroot}%{_rpmconfigdir}/%{name}-provide.sh + +%scl_install + +%files +%scl_files + +%files build +%{_root_sysconfdir}/rpm/macros.%{scl}-config +%{_root_sysconfdir}/rpm/macros.%{name} +%{_rpmconfigdir}/fileattrs/%{name}*.attr +%{_rpmconfigdir}/%{name}* + + +%changelog +* Mon Apr 15 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-7 +- Update macros and requires/provides generator to latest + +* Wed Apr 10 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-6 +- Fix rpm requires/provides generator paths +- Add requires to main meta package + +* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-5 +- Make package architecture specific for libdir usage + +* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-4 +- Add rpm macros and tooling + +* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-3 +- Add proper scl-utils-build requires + +* Fri Apr 05 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-2 +- Add PYTHONPATH to configuration + +* Tue Mar 26 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-1 +- Initial version of the Node.js Software Collection diff --git a/test/spec/nodejs010-nosclinstall.spec b/test/spec/nodejs010-nosclinstall.spec new file mode 100644 index 0000000..313c94c --- /dev/null +++ b/test/spec/nodejs010-nosclinstall.spec @@ -0,0 +1,122 @@ +%global scl nodejs010 +%scl_package %scl +%global install_scl 1 + +Summary: %scl Software Collection +Name: %scl_name +Version: 1 +Release: 7%{?dist} + +Source1: macros.nodejs +Source2: nodejs.attr +Source3: nodejs.prov +Source4: nodejs.req +Source5: nodejs-symlink-deps +Source6: nodejs-fixdep +Source7: nodejs_native.attr + +License: GPLv2+ + +%if 0%{?install_scl} +Requires: %{scl_prefix}nodejs +%endif + +BuildRequires: scl-utils-build +BuildRequires: python-devel + +%description +This is the main package for %scl Software Collection. + +%package runtime +Summary: Package that handles %scl Software Collection. +Requires: scl-utils + +%description runtime +Package shipping essential scripts to work with %scl Software Collection. + +%package build +Summary: Package shipping basic build configuration +Requires: scl-utils-build + +%description build +Package shipping essential configuration macros to build %scl Software Collection. + +%prep +%setup -c -T + +%install +rm -rf %{buildroot} +mkdir -p %{buildroot}%{_scl_scripts}/root +cat >> %{buildroot}%{_scl_scripts}/enable << EOF +export PATH=%{_bindir}:\$PATH +export LD_LIBRARY_PATH=%{_libdir}:\$LD_LIBRARY_PATH +export PYTHONPATH=%{_scl_root}%{python_sitelib}:\$PYTHONPATH +EOF + +# install rpm magic +install -Dpm0644 %{SOURCE1} %{buildroot}%{_root_sysconfdir}/rpm/macros.%{name} +install -Dpm0644 %{SOURCE2} %{buildroot}%{_rpmconfigdir}/fileattrs/%{name}.attr +install -pm0755 %{SOURCE3} %{buildroot}%{_rpmconfigdir}/%{name}.prov +install -pm0755 %{SOURCE4} %{buildroot}%{_rpmconfigdir}/%{name}.req +install -pm0755 %{SOURCE5} %{buildroot}%{_rpmconfigdir}/%{name}-symlink-deps +install -pm0755 %{SOURCE6} %{buildroot}%{_rpmconfigdir}/%{name}-fixdep +install -Dpm0644 %{SOURCE7} %{buildroot}%{_rpmconfigdir}/fileattrs/%{name}_native.attr + + +# ensure Requires are added to every native module that match the Provides from +# the nodejs build in the buildroot +cat << EOF > %{buildroot}%{_rpmconfigdir}/%{name}_native.req +#!/bin/sh +echo 'nodejs010-nodejs(abi) = %nodejs_abi' +echo 'nodejs010-nodejs(v8-abi) = %v8_abi' +EOF +chmod 0755 %{buildroot}%{_rpmconfigdir}/%{name}_native.req + +cat << EOF > %{buildroot}%{_rpmconfigdir}/%{name}-require.sh +#!/bin/sh +%{_rpmconfigdir}/%{name}.req $* +%{_rpmconfigdir}/find-requires $* +EOF +chmod 0755 %{buildroot}%{_rpmconfigdir}/%{name}-require.sh + +cat << EOF > %{buildroot}%{_rpmconfigdir}/%{name}-provide.sh +#!/bin/sh +%{_rpmconfigdir}/%{name}.prov $* +%{_rpmconfigdir}/find-provides $* +EOF +chmod 0755 %{buildroot}%{_rpmconfigdir}/%{name}-provide.sh + +%files + +%files runtime +%scl_files + +%files build +%{_root_sysconfdir}/rpm/macros.%{scl}-config +%{_root_sysconfdir}/rpm/macros.%{name} +%{_rpmconfigdir}/fileattrs/%{name}*.attr +%{_rpmconfigdir}/%{name}* + + +%changelog +* Mon Apr 15 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-7 +- Update macros and requires/provides generator to latest + +* Wed Apr 10 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-6 +- Fix rpm requires/provides generator paths +- Add requires to main meta package + +* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-5 +- Make package architecture specific for libdir usage + +* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-4 +- Add rpm macros and tooling + +* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-3 +- Add proper scl-utils-build requires + +* Fri Apr 05 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-2 +- Add PYTHONPATH to configuration + +* Tue Mar 26 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-1 +- Initial version of the Node.js Software Collection diff --git a/test/spec/nodejs010-undeclared.spec b/test/spec/nodejs010-undeclared.spec new file mode 100644 index 0000000..e3e9de4 --- /dev/null +++ b/test/spec/nodejs010-undeclared.spec @@ -0,0 +1,123 @@ +%scl_package %scl +%global install_scl 1 + +Summary: %scl Software Collection +Name: %scl_name +Version: 1 +Release: 7%{?dist} + +Source1: macros.nodejs +Source2: nodejs.attr +Source3: nodejs.prov +Source4: nodejs.req +Source5: nodejs-symlink-deps +Source6: nodejs-fixdep +Source7: nodejs_native.attr + +License: GPLv2+ + +%if 0%{?install_scl} +Requires: %{scl_prefix}nodejs +%endif + +BuildRequires: scl-utils-build +BuildRequires: python-devel + +%description +This is the main package for %scl Software Collection. + +%package runtime +Summary: Package that handles %scl Software Collection. +Requires: scl-utils + +%description runtime +Package shipping essential scripts to work with %scl Software Collection. + +%package build +Summary: Package shipping basic build configuration +Requires: scl-utils-build + +%description build +Package shipping essential configuration macros to build %scl Software Collection. + +%prep +%setup -c -T + +%install +rm -rf %{buildroot} +mkdir -p %{buildroot}%{_scl_scripts}/root +cat >> %{buildroot}%{_scl_scripts}/enable << EOF +export PATH=%{_bindir}:\$PATH +export LD_LIBRARY_PATH=%{_libdir}:\$LD_LIBRARY_PATH +export PYTHONPATH=%{_scl_root}%{python_sitelib}:\$PYTHONPATH +EOF + +# install rpm magic +install -Dpm0644 %{SOURCE1} %{buildroot}%{_root_sysconfdir}/rpm/macros.%{name} +install -Dpm0644 %{SOURCE2} %{buildroot}%{_rpmconfigdir}/fileattrs/%{name}.attr +install -pm0755 %{SOURCE3} %{buildroot}%{_rpmconfigdir}/%{name}.prov +install -pm0755 %{SOURCE4} %{buildroot}%{_rpmconfigdir}/%{name}.req +install -pm0755 %{SOURCE5} %{buildroot}%{_rpmconfigdir}/%{name}-symlink-deps +install -pm0755 %{SOURCE6} %{buildroot}%{_rpmconfigdir}/%{name}-fixdep +install -Dpm0644 %{SOURCE7} %{buildroot}%{_rpmconfigdir}/fileattrs/%{name}_native.attr + + +# ensure Requires are added to every native module that match the Provides from +# the nodejs build in the buildroot +cat << EOF > %{buildroot}%{_rpmconfigdir}/%{name}_native.req +#!/bin/sh +echo 'nodejs010-nodejs(abi) = %nodejs_abi' +echo 'nodejs010-nodejs(v8-abi) = %v8_abi' +EOF +chmod 0755 %{buildroot}%{_rpmconfigdir}/%{name}_native.req + +cat << EOF > %{buildroot}%{_rpmconfigdir}/%{name}-require.sh +#!/bin/sh +%{_rpmconfigdir}/%{name}.req $* +%{_rpmconfigdir}/find-requires $* +EOF +chmod 0755 %{buildroot}%{_rpmconfigdir}/%{name}-require.sh + +cat << EOF > %{buildroot}%{_rpmconfigdir}/%{name}-provide.sh +#!/bin/sh +%{_rpmconfigdir}/%{name}.prov $* +%{_rpmconfigdir}/find-provides $* +EOF +chmod 0755 %{buildroot}%{_rpmconfigdir}/%{name}-provide.sh + +%scl_install + +%files + +%files runtime +%scl_files + +%files build +%{_root_sysconfdir}/rpm/macros.%{scl}-config +%{_root_sysconfdir}/rpm/macros.%{name} +%{_rpmconfigdir}/fileattrs/%{name}*.attr +%{_rpmconfigdir}/%{name}* + + +%changelog +* Mon Apr 15 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-7 +- Update macros and requires/provides generator to latest + +* Wed Apr 10 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-6 +- Fix rpm requires/provides generator paths +- Add requires to main meta package + +* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-5 +- Make package architecture specific for libdir usage + +* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-4 +- Add rpm macros and tooling + +* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-3 +- Add proper scl-utils-build requires + +* Fri Apr 05 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-2 +- Add PYTHONPATH to configuration + +* Tue Mar 26 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-1 +- Initial version of the Node.js Software Collection diff --git a/test/spec/nodejs010.spec b/test/spec/nodejs010.spec new file mode 100644 index 0000000..1d1a492 --- /dev/null +++ b/test/spec/nodejs010.spec @@ -0,0 +1,124 @@ +%global scl nodejs010 +%scl_package %scl +%global install_scl 1 + +Summary: %scl Software Collection +Name: %scl_name +Version: 1 +Release: 7%{?dist} + +Source1: macros.nodejs +Source2: nodejs.attr +Source3: nodejs.prov +Source4: nodejs.req +Source5: nodejs-symlink-deps +Source6: nodejs-fixdep +Source7: nodejs_native.attr + +License: GPLv2+ + +%if 0%{?install_scl} +Requires: %{scl_prefix}nodejs +%endif + +BuildRequires: scl-utils-build +BuildRequires: python-devel + +%description +This is the main package for %scl Software Collection. + +%package runtime +Summary: Package that handles %scl Software Collection. +Requires: scl-utils + +%description runtime +Package shipping essential scripts to work with %scl Software Collection. + +%package build +Summary: Package shipping basic build configuration +Requires: scl-utils-build + +%description build +Package shipping essential configuration macros to build %scl Software Collection. + +%prep +%setup -c -T + +%install +rm -rf %{buildroot} +mkdir -p %{buildroot}%{_scl_scripts}/root +cat >> %{buildroot}%{_scl_scripts}/enable << EOF +export PATH=%{_bindir}:\$PATH +export LD_LIBRARY_PATH=%{_libdir}:\$LD_LIBRARY_PATH +export PYTHONPATH=%{_scl_root}%{python_sitelib}:\$PYTHONPATH +EOF + +# install rpm magic +install -Dpm0644 %{SOURCE1} %{buildroot}%{_root_sysconfdir}/rpm/macros.%{name} +install -Dpm0644 %{SOURCE2} %{buildroot}%{_rpmconfigdir}/fileattrs/%{name}.attr +install -pm0755 %{SOURCE3} %{buildroot}%{_rpmconfigdir}/%{name}.prov +install -pm0755 %{SOURCE4} %{buildroot}%{_rpmconfigdir}/%{name}.req +install -pm0755 %{SOURCE5} %{buildroot}%{_rpmconfigdir}/%{name}-symlink-deps +install -pm0755 %{SOURCE6} %{buildroot}%{_rpmconfigdir}/%{name}-fixdep +install -Dpm0644 %{SOURCE7} %{buildroot}%{_rpmconfigdir}/fileattrs/%{name}_native.attr + + +# ensure Requires are added to every native module that match the Provides from +# the nodejs build in the buildroot +cat << EOF > %{buildroot}%{_rpmconfigdir}/%{name}_native.req +#!/bin/sh +echo 'nodejs010-nodejs(abi) = %nodejs_abi' +echo 'nodejs010-nodejs(v8-abi) = %v8_abi' +EOF +chmod 0755 %{buildroot}%{_rpmconfigdir}/%{name}_native.req + +cat << EOF > %{buildroot}%{_rpmconfigdir}/%{name}-require.sh +#!/bin/sh +%{_rpmconfigdir}/%{name}.req $* +%{_rpmconfigdir}/find-requires $* +EOF +chmod 0755 %{buildroot}%{_rpmconfigdir}/%{name}-require.sh + +cat << EOF > %{buildroot}%{_rpmconfigdir}/%{name}-provide.sh +#!/bin/sh +%{_rpmconfigdir}/%{name}.prov $* +%{_rpmconfigdir}/find-provides $* +EOF +chmod 0755 %{buildroot}%{_rpmconfigdir}/%{name}-provide.sh + +%scl_install + +%files + +%files runtime +%scl_files + +%files build +%{_root_sysconfdir}/rpm/macros.%{scl}-config +%{_root_sysconfdir}/rpm/macros.%{name} +%{_rpmconfigdir}/fileattrs/%{name}*.attr +%{_rpmconfigdir}/%{name}* + + +%changelog +* Mon Apr 15 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-7 +- Update macros and requires/provides generator to latest + +* Wed Apr 10 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-6 +- Fix rpm requires/provides generator paths +- Add requires to main meta package + +* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-5 +- Make package architecture specific for libdir usage + +* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-4 +- Add rpm macros and tooling + +* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-3 +- Add proper scl-utils-build requires + +* Fri Apr 05 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-2 +- Add PYTHONPATH to configuration + +* Tue Mar 26 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-1 +- Initial version of the Node.js Software Collection diff --git a/test/test.PamCheck.py b/test/test.PamCheck.py index 08d1cff..25df479 100644 --- a/test/test.PamCheck.py +++ b/test/test.PamCheck.py @@ -5,18 +5,21 @@ import Testing import PamCheck # FIXME harcode + class TestPamCheck(unittest.TestCase): + def setUp(self): - self.pkg = Testing.getTestedPackage('PamCheck') + self.pkg = Testing.getTestedPackage('binary/PamCheck') Testing.startTest() + def tearDown(self): self.pkg.cleanup() + def testcheck(self): PamCheck.check.check(self.pkg) - self.assertEqual( Testing.getOutput(), ['PamCheck.i586: E: use-old-pam-stack /etc/pam.d/PamCheck (line 1)']) + self.assertEqual(Testing.getOutput(), + ['PamCheck.i586: E: use-old-pam-stack ' + '/etc/pam.d/PamCheck (line 1)']) -# enjoy \o/ if __name__ == '__main__': unittest.main() - -#print Testing.getOutput() diff --git a/test/test.Pkg.py b/test/test.Pkg.py index 6d061d4..43416e1 100644 --- a/test/test.Pkg.py +++ b/test/test.Pkg.py @@ -5,7 +5,9 @@ import unittest import Testing import Pkg + class TestPkg(unittest.TestCase): + def setUp(self): Testing.startTest() @@ -16,14 +18,14 @@ class TestPkg(unittest.TestCase): ("b", rpm.RPMSENSE_LESS, (None, "1.0", None)), ("c", rpm.RPMSENSE_EQUAL, ("5", "2.0", "3")), ("d", 0, (None, None, None))]), - ): + ): self.assertEqual(Pkg.parse_deps(arg), exp) def test_rangeCompare(self): for (req, prov) in ( (("foo", rpm.RPMSENSE_LESS, (None, "1.0", None)), ("foo", rpm.RPMSENSE_EQUAL, ("1", "0.5", None))), - ): + ): self.assertFalse(Pkg.rangeCompare(req, prov)) if __name__ == '__main__': diff --git a/test/test.SpecCheck.py b/test/test.SpecCheck.py index fadf970..f0e586d 100644 --- a/test/test.SpecCheck.py +++ b/test/test.SpecCheck.py @@ -2,13 +2,17 @@ import re import unittest + import Testing import SpecCheck + class TestSpecCheck(unittest.TestCase): + def setUp(self): - self.pkg = Testing.getTestedSpecPackage('SpecCheck') + self.pkg = Testing.getTestedSpecPackage('spec/SpecCheck') Testing.startTest() + def testcheck(self): SpecCheck.check.check_spec(self.pkg, self.pkg.name) out = "\n".join(Testing.getOutput()) @@ -25,6 +29,7 @@ class TestSpecCheck(unittest.TestCase): in out) self.assertTrue("unversioned-explicit-obsoletes versioned-obsoletes" not in out) + self.assertTrue("setup-not-quiet" in out) if __name__ == '__main__': unittest.main() diff --git a/test/test.SpecCheck2.py b/test/test.SpecCheck2.py new file mode 100644 index 0000000..4b9123f --- /dev/null +++ b/test/test.SpecCheck2.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- + +import unittest + +import Testing +import SpecCheck + + +class TestSpecCheck(unittest.TestCase): + + def setUp(self): + self.pkg = Testing.getTestedSpecPackage('spec/SpecCheck2') + Testing.startTest() + + def testcheck(self): + SpecCheck.check.check_spec(self.pkg, self.pkg.name) + out = "\n".join(Testing.getOutput()) + self.assertFalse("patch-not-applied" in out) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test.SpecCheck3.py b/test/test.SpecCheck3.py new file mode 100644 index 0000000..98a98b3 --- /dev/null +++ b/test/test.SpecCheck3.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- + +import unittest + +import Testing +import SpecCheck + + +class TestSpecCheck(unittest.TestCase): + + def setUp(self): + self.pkg = Testing.getTestedSpecPackage('spec/SpecCheck3') + Testing.startTest() + + def testcheck(self): + SpecCheck.check.check_spec(self.pkg, self.pkg.name) + out = "\n".join(Testing.getOutput()) + self.assertFalse("patch-not-applied" in out) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_scl.py b/test/test_scl.py new file mode 100644 index 0000000..dafc7ec --- /dev/null +++ b/test/test_scl.py @@ -0,0 +1,206 @@ +import os +import sys + +# add rpmlint-scl, rpmlint and rpmlint/tools to PATH +# also add rpmlint-scl/tools, so this keeps working once merged with rpmlint +for directory in ['../rpmlint/tools', '../rpmlint', '../tools', '..']: + sys.path.insert(0, os.path.join(os.path.dirname(__file__), directory)) + +# rpmlint's Testing needs TESTPATH +os.environ['TESTPATH'] = os.path.dirname(__file__) + + +import Testing +import SCLCheck + + +class Tools(object): + '''Class providing basic tools for other classes''' + def _spec_test_output(self, spec): + '''Wrapper that checks spec file and returns output''' + pkg = Testing.getTestedSpecPackage(spec) + Testing.startTest() + # call check_spec() directly, as check() doesn't work with + # getTestedSpecPackage() + SCLCheck.check.check_spec(pkg, pkg.name) + return Testing.getOutput() + + def _rpm_test_output(self, rpm): + '''Wrapper that checks RPM package and returns output''' + pkg = Testing.getTestedPackage(rpm) + Testing.startTest() + SCLCheck.check.check(pkg) + return Testing.getOutput() + + +class TestSCLBacis(Tools): + '''Basic tests of Software Collections checks''' + def test_nonscl_spec_silent(self): + '''SCL check on non-SCL spec has to be silent''' + assert not self._spec_test_output('spec/SpecCheck') + + def test_nonscl_binary_silent(self): + '''SCL check on non-SCL binary RPM has to be silent even with + suspicious filename''' + assert not self._rpm_test_output('binary/python3-power') + + def test_bunch_of_scl_source_rpms(self): + '''A bunch of testing source RPM packages using SCL + Assuming they are all OK and except silent output + While adding more checks, this might change''' + for package in ['nodejs010-1', 'nodejs010-nodejs-0.10.3', + 'nodejs010-nodejs-forever']: + assert not self._rpm_test_output(os.path.join('source', package)) + + def test_bunch_of_scl_binary_rpms(self): + '''A bunch of testing binary RPM packages using SCL + Assuming they are all OK and except silent output + While adding more checks, this might change''' + for package in ['nodejs010-runtime', 'nodejs010-nodejs-0.10.3', + 'nodejs010-nodejs-oauth']: + assert not self._rpm_test_output(os.path.join('binary', package)) + + def test_correct_nodejs(self): + '''Tests probably correct nodejs.spec and nodejs010.spec''' + assert not self._spec_test_output('spec/nodejs-good') + assert not self._spec_test_output('spec/nodejs010') + + def test_undeclared(self): + '''Tests SCL specs without %scl definition or %scl_package calls''' + for spec in ['nodejs010', 'nodejs']: + out = self._spec_test_output('spec/'+spec+'-undeclared') + assert len(out) == 1 + assert 'undeclared-scl' in out[0] + + +class TestSCLMain(Tools): + '''Tests of Software Collections main package checks''' + def test_nobuild(self): + '''Tests SCL metapackage without build subpackage''' + out = self._spec_test_output('spec/nodejs010-nobuild') + assert len(out) == 1 + assert 'no-build-in-scl-metapackage' in out[0] + + def test_noruntime(self): + '''Tests SCL metapackage without runtime subpackage''' + out = self._spec_test_output('spec/nodejs010-noruntime') + assert len(out) == 2 + out = '\n'.join(out) + assert 'no-runtime-in-scl-metapackage' in out + assert 'scl-main-metapackage-contains-files' in out + + def test_missing_requires(self): + '''Tests SCL metapackage without scl-utils-build (B)Rs''' + out = self._spec_test_output('spec/nodejs010-missing-requires') + assert len(out) == 2 + out = '\n'.join(out) + assert 'scl-metapackage-without-scl-utils-build-br' in out + assert 'scl-build-without-requiring-scl-utils-build' in out + + def test_alien_subpackage(self): + '''Tests SCL metapackage with extra subpackage''' + for diff in ['', '-n']: + out = self._spec_test_output( + 'spec/nodejs010-alien-subpackage' + diff) + assert len(out) == 1 + assert 'weird-subpackage-in-scl-metapackage' in out[0] + assert 'hehe' in out[0] + + def test_nosclinstall(self): + '''Tests SCL metapackage that doesn't call %scl_install''' + out = self._spec_test_output('spec/nodejs010-nosclinstall') + assert len(out) == 1 + assert 'scl-metapackage-without-%scl_install' in out[0] + + def test_noarch(self): + '''Tests noarch SCL metapackages (not) containing %{_libdir}''' + assert not self._spec_test_output('spec/nodejs010-noarch-good') + out = self._spec_test_output('spec/nodejs010-noarch-libdir') + assert len(out) == 1 + assert 'noarch-scl-metapackage-with-libdir' in out[0] + + def test_badfiles(self): + '''Tests SCL metapackage %files section checks''' + out = self._spec_test_output('spec/nodejs010-badfiles') + assert len(out) == 3 + out = '\n'.join(out) + assert 'scl-main-metapackage-contains-files' in out + assert 'scl-runtime-package-without-%scl_files' in out + assert 'scl-build-package-without-rpm-macros' in out + + +class TestSCLSource(Tools): + '''Tests of Software Collections enabled package spec checks''' + def test_no_pkg_name(self): + '''Tests SCL spec without pkg_name definition''' + out = self._spec_test_output('spec/nodejs-no-pkg_name') + assert len(out) == 1 + assert 'missing-pkg_name-definition' in out[0] + + def test_name_without_prefix(self): + '''Tests SCL spec without prefixed name''' + out = self._spec_test_output('spec/nodejs-name-without-prefix') + assert len(out) == 1 + assert 'name-without-scl-prefix' in out[0] + + def test_name_with_prefix_without_condition(self): + '''Tests SCL spec with prefixed name without condition in + scl_prefix macro''' + out = self._spec_test_output( + 'spec/nodejs-name-with-noncondition-prefix') + assert len(out) == 1 + assert 'scl-prefix-without-condition' in out[0] + + def test_conflicts_without_prefix(self): + '''Tests SCL spec with nonprefixed conflicts''' + out = self._spec_test_output('spec/nodejs-conflicts-without-prefix') + assert len(out) == 1 + assert 'obsoletes-or-conflicts-without-scl-prefix' in out[0] + + def test_provides_without_prefix(self): + '''Tests SCL spec with nonprefixed conflicts''' + out = self._spec_test_output('spec/nodejs-provides-without-prefix') + assert len(out) == 1 + assert 'provides-without-scl-prefix' in out[0] + + def test_main_package_without_scl_require(self): + '''Tests SCL spec where the main package doesn't require anything + from collection''' + out = self._spec_test_output('spec/nodejs-norequire') + assert len(out) == 1 + assert 'doesnt-require-scl-runtime-or-other-scl-package' in out[0] + + def test_n_supbackage_without_prefix(self): + '''Tests SCL spec where a subpackage uses -n and doesn't start with + SCL prefix''' + out = self._spec_test_output('spec/nodejs-n-noprefix') + assert len(out) == 1 + assert 'subpackage-with-n-without-scl-prefix' in out[0] + + def test_setup_without_n(self): + '''Tests SCL spec where setup doesn't use -n option''' + out = self._spec_test_output('spec/nodejs-setup-no-n') + assert len(out) == 1 + assert 'scl-setup-without-n' in out[0] + + +class TestSCLBinary(Tools): + '''Tests of Software Collections binary RPMs''' + def test_scl_name_screwed_up(self): + '''SCL check on SCL package that differs it's name from scl + tree folder''' + out = self._rpm_test_output('binary/nodejs110-nodejs-oauth') + assert len(out) == 1 + assert 'scl-name-screwed-up' in out[0] + + def test_scl_forbidden_folders(self): + '''SCL check on SCL package that has files in forbidden folders''' + out = self._rpm_test_output('binary/outside-nodejs010-nodejs-oauth') + assert len(out) == 1 + assert 'file-outside-of-scl-tree' in out[0] + + def test_scl_macros_outside_of_build(self): + '''SCL check on SCL package that has files in forbidden folders''' + out = self._rpm_test_output('binary/macros-nodejs010-nodejs-oauth') + assert len(out) == 1 + assert 'scl-rpm-macros-outside-of-build' in out[0] |