%global gem_name openshift-origin-node # Conditionally set required macros for distros without rubygems-devel This can # be removed once https://bugzilla.redhat.com/show_bug.cgi?id=788001 is # resolved. %{!?gem_dir: %global gem_dir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)} %{!?gem_instdir: %global gem_instdir %{gem_dir}/gems/%{gem_name}-%{version}} # Used for openshift.com only default to False %global hosted 0 %global appdir %{_localstatedir}/lib/stickshift Summary: Application container runtime for OpenShift Name: rubygem-%{gem_name} Version: 0.14.6 Release: 3%{?dist} Group: Development/Tools License: ASL 2.0 URL: http://openshift.redhat.com Source0: http://mirror.openshift.com/pub/openshift-origin/source/rubygem-%{gem_name}/%{gem_name}-%{version}.gem Source1: 000001_stickshift_node.conf # https://github.com/openshift/crankcase/pull/347 Patch0: openshift-origin-node_shebang_fix.patch Requires: httpd Requires: ruby(abi) >= 1.8 Requires: rubygems Requires: rubygem(json) Requires: rubygem(parseconfig) Requires: rubygem(openshift-origin-common) Requires: rubygem(rspec) Requires: python %if %{hosted} Requires: mercurial %endif BuildRequires: ruby-devel %if 0%{?rhel} == 6 BuildRequires: rubygems %else BuildRequires: rubygems-devel %endif BuildArch: noarch Provides: rubygem(%{gem_name}) = %version %description The Node subsystem is a environment for running OpenShift Cartridges (application containers). User applications are securely sandboxed through SELinux and cgroups. %prep gem unpack %{SOURCE0} %setup -q -D -T -n %{gem_name}-%{version} #https://github.com/openshift/crankcase/pull/347 %patch0 -p1 gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec %build mkdir -p .%{gem_dir} # Create the gem as gem install only works on a gem file gem build %{gem_name}.gemspec export CONFIGURE_ARGS="--with-cflags='%{optflags}'" # gem install compiles any C extensions and installs into a directory # We set that to be a local directory so that we can move it into the # buildroot in %%install gem install -V \ --local \ --install-dir ./%{gem_dir} \ --bindir ./%{_bindir} \ --force \ --rdoc \ %{gem_name}-%{version}.gem %install mkdir -p %{buildroot}%{gem_dir} cp -a ./%{gem_dir}/* %{buildroot}%{gem_dir}/ rm %{buildroot}%{gem_dir}/cache/%{gem_name}-%{version}.gem rm -rf %{buildroot}%{gem_dir}/gems/%{gem_name}-%{version}/test # If there were programs installed: mkdir -p %{buildroot}%{_bindir} cp -a ./%{_bindir}/* %{buildroot}%{_bindir} mkdir -p %{buildroot}%{_sysconfdir}/httpd/conf.d mkdir -p %{buildroot}%{appdir}/.httpd.d ln -sf %{appdir}/.httpd.d %{buildroot}%{_sysconfdir}/httpd/conf.d/stickshift # Move the gem configs to the standard filesystem location mkdir -p %{buildroot}%{_sysconfdir}/stickshift mv %{buildroot}%{gem_instdir}/conf/* %{buildroot}%{_sysconfdir}/stickshift #move the shell binaries into proper location mv %{buildroot}%{gem_instdir}/misc/bin/* %{buildroot}%{_bindir}/ rm -rf %{buildroot}%{gem_instdir}/misc cp %{SOURCE1} %{buildroot}%{_sysconfdir}/httpd/conf.d/ # https://github.com/openshift/crankcase/pull/347 chmod 0644 %{buildroot}%{gem_dir}/gems/%{gem_name}-%{version}/lib/stickshift-node/model/unix_user.rb %files %doc LICENSE COPYRIGHT %{_bindir}/* %{gem_dir}/doc/%{gem_name}-%{version} %{gem_dir}/gems/%{gem_name}-%{version} %{gem_dir}/specifications/%{gem_name}-%{version}.gemspec %config(noreplace) %{_sysconfdir}/stickshift %config(noreplace) %attr(0750,-,-) %{_sysconfdir}/httpd/conf.d/stickshift %config(noreplace) %{_sysconfdir}/httpd/conf.d/000001_stickshift_node.conf %attr(0755,-,-) %{_var}/lib/stickshift %post if [ $1 -ge 1 ] ; then # Handle first install and upgrade # No need to add this again if we're upgrading grep ss-trap-user /etc/shells [ $? -ne 0 ] && echo "/usr/bin/ss-trap-user" >> /etc/shells restorecon -r %{_var}/lib/stickshift fi %preun if [ $1 -eq 0 ] ; then # Final removal sed -i "/ss-trap-user/d" /etc/shells restorecon -r %{_var}/lib/stickshift fi %changelog * Mon Aug 06 2012 Brenton Leanhardt 0.14.6-3 - Removed integration tests - Fixed file mode issues - Fixed usage of define - Added httpd require * Mon Aug 06 2012 Brenton Leanhardt 0.14.6-2 - Removed unneeded BuildRoot tag - Removed unneeded clean section - Removed unneeded defattr usage - Removed unneeded cached gem - Fixed the Source0 URL - Reenabled restorecon calls in %post and %preun * Thu Aug 02 2012 Troy Dawson 0.14.6-1 - Renamed package to openshift-origin-node - Updated to the latest upstream stable release - Added LICENSE and COPYRIGHT to doc * Fri Jul 20 2012 Brenton Leanhardt 0.14.2-1 - Latest upstream release * Fri Jul 20 2012 Brenton Leanhardt 0.14.2-1 - Latest upstream release - Switched Source0 to gem * Wed Jul 18 2012 Brenton Leanhardt 0.14.1-2 - Added ruby-devel and rubygem-devel build requires and replaced the ruby_sitelib and geminstdir macros with the standard macros. - Renamed %%gemname to %%gem_name so %%geminstdir will work correctly. - Fixed several file mode problems with libraries * Mon Jul 12 2012 Brenton Leanhardt 0.14.1-1 - Initial package creation for Fedora