%global gem_name openshift-origin-common # 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. %if 0%{?el6}%{?fc16} %global rubyabi 1.8 %global gem_dir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null) %global gem_cache %{gem_dir}/cache/%{gem_name}-%{version}.gem %global gem_docdir %{gem_dir}/doc/%{gem_name}-%{version} %global gem_instdir %{gem_dir}/gems/%{gem_name}-%{version} %global gem_libdir %{gem_instdir}/lib %global gem_spec %{gem_dir}/specifications/%{gem_name}-%{version}.gemspec %endif %global selinux_variants mls strict targeted Summary: Common library code for OpenShift subsystem Name: rubygem-%{gem_name} Version: 0.13.3 Release: 7%{?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: stickshift.fc Source2: stickshift.if Source3: stickshift.te # https://github.com/openshift/crankcase/pull/357 Patch0: openshift-origin-common_gemspec_fixes.patch Requires: ruby(abi) >= 1.8 Requires: rubygems Requires: rubygem(activemodel) Requires: rubygem(json) Requires: selinux-policy BuildRequires: ruby-devel %if 0%{?rhel} == 6 BuildRequires: rubygems %else BuildRequires: rubygems-devel %endif BuildRequires: selinux-policy BuildRequires: selinux-policy-devel BuildRequires: hardlink BuildArch: noarch Provides: rubygem(%{gem_name}) = %version %description This packages contains common library code for the OpenShift subsystem. %prep gem unpack %{SOURCE0} %setup -q -D -T -n %{gem_name}-%{version} %patch0 -p1 mkdir SELinux cp %{SOURCE1} %{SOURCE2} %{SOURCE3} SELinux %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}/ mkdir -p %{buildroot}/usr/share/selinux/packages/%{name} cd SELinux make -f %{_datadir}/selinux/devel/Makefile install -p -m 644 -D stickshift.pp %{buildroot}%{_datadir}/selinux/packages/%{name}/stickshift.pp make -f %{_datadir}/selinux/devel/Makefile clean cd - /usr/sbin/hardlink -cv %{buildroot}%{_datadir}/selinux %files %dir %{gem_instdir} %doc %{gem_instdir}/LICENSE %doc %{gem_instdir}/COPYRIGHT %doc %{gem_docdir} %doc %{gem_instdir}/Gemfile %doc %{gem_instdir}/Rakefile %doc %{gem_instdir}/README.md %doc %{gem_instdir}/%{gem_name}.gemspec %{gem_spec} %{_datadir}/selinux/packages/%{name}/ %exclude %{gem_cache} %exclude %{gem_libdir} %exclude %{gem_instdir}/%{name}.spec %post if [ "$1" -le "1" ] ; then # First install semodule -i %{_datadir}/selinux/packages/%{name}/stickshift.pp 2>/dev/null || : fixfiles -R rubygem-stickshift-common restore fi %preun if [ "$1" -lt "1" ] ; then # Final removal semodule -r stickshift 2>/dev/null || : fi %postun if [ "$1" -ge "1" ] ; then # Upgrade semodule -i %{_datadir}/selinux/packages/%{name}/stickshift.pp 2>/dev/null || : # TODO # What other packages should be added here? Probably anything that could be # affected by stickshift.fc, right? fixfiles -R rubygem-stickshift-common restore fi %changelog * Thu Aug 16 2012 Brenton Leanhardt - 0.13.3-7 - Using rubygem-devel macros and the exclude macro - Removed SELinux dir from package * Wed Aug 15 2012 Brenton Leanhardt - 0.13.3-6 - Keeping the LICENSE and COPYRIGHT file in their original locations * Fri Aug 10 2012 Brenton Leanhardt 0.13.3-5 - Added patch to remove unneeded rubygem-mongo from gemspec and fix project homepage - Removed uneeded policycoreutils-python require * Mon Aug 06 2012 Brenton Leanhardt 0.13.3-4 - Removed unneeded rubygem-mongo dependency - Removed unneeded make BuildRequire - Removed unneeded BuildRoot tag - Removed unneeded defattr usage - Removed unneeded clean section - Removed unneeded cached gem - Changed RPM_BUILD_ROOT to buildroot for consistency * Thu Aug 02 2012 Troy Dawson 0.13.3-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.13.1-3 - Switched Source0 to gem * Wed Jul 18 2012 Brenton Leanhardt 0.13.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 09 2012 Brenton Leanhardt 0.13.1-1 - Initial package creation for Fedora - Removed rcov