%{!?scl_name_base:%global scl_name_base thermostat} %{!?scl_name_version:%global scl_name_version 1} %{!?scl:%global scl %{scl_name_base}%{scl_name_version}} %scl_package %scl # do not produce empty debuginfo package %global debug_package %{nil} Name: %scl_name Version: 1.2 # Release should be higher than el6 builds. Use convention # 60.X where X is an increasing int. 60 for rhel-6. We use # 70.X for rhel-7. For some reason we cannot rely on the # dist tag. Release: 70.6%{?dist} Summary: Package that installs %scl License: GPLv2+ Source0: README Source1: LICENSE # Require minimal scl-utils which has fix for RHBZ#1033674 BuildRequires: scl-utils-build >= 20130529-4 # Required for java macro expansion and a version # which has the fix for RHBZ#1098523 and RHBZ#1122947 BuildRequires: javapackages-tools >= 3.4.1-6 BuildRequires: javapackages-tools BuildRequires: help2man # This needs to require all packages shipped with the thermostat1 # collection. The leaf package is thermostat1-thermostat-webapp # which should pull in thermostat1-thermostat plus all deps, such # as mongo-java-driver and mongodb from the mongodb collection. # See RHBZ#1033653 for an explanation as to why thermostat-webapp # and not thermostat without webapp. Requires: %{scl_prefix}thermostat-webapp Requires: %{name}-runtime %description This is the main package for the %scl Software Collection. %package runtime Summary: Package that handles %scl Software Collection. Requires: scl-utils >= 20130529-2 Requires: mongodb24 >= 1-2 # The following packages are carried in the RHEL-6 based collection, # but come from base RHEL-7 there. Obsolete them appropriately # including sub-packages and mvn()-style provides. Obsoletes: %{scl_prefix}apache-commons-beanutils Obsoletes: %{scl_prefix}mvn(commons-beanutils:commons-beanutils) Obsoletes: %{scl_prefix}apache-commons-beanutils-javadoc Obsoletes: %{scl_prefix}apache-commons-cli Obsoletes: %{scl_prefix}mvn(commons-cli:commons-cli) Obsoletes: %{scl_prefix}apache-commons-cli-javadoc Obsoletes: %{scl_prefix}apache-commons-codec Obsoletes: %{scl_prefix}mvn(commons-codec:commons-codec) Obsoletes: %{scl_prefix}apache-commons-codec-javadoc Obsoletes: %{scl_prefix}apache-commons-collections Obsoletes: %{scl_prefix}mvn(commons-collections:commons-collections) Obsoletes: %{scl_prefix}apache-commons-collections-javadoc Obsoletes: %{scl_prefix}apache-commons-collections-testframework Obsoletes: %{scl_prefix}apache-commons-collections-testframework-javadoc Obsoletes: %{scl_prefix}apache-commons-io Obsoletes: %{scl_prefix}mvn(commons-io:commons-io) Obsoletes: %{scl_prefix}apache-commons-io-javadoc Obsoletes: %{scl_prefix}apache-commons-logging Obsoletes: %{scl_prefix}mvn(commons-logging:commons-logging) Obsoletes: %{scl_prefix}apache-commons-logging-javadoc Obsoletes: %{scl_prefix}felix-framework Obsoletes: %{scl_prefix}mvn(org.apache.felix:org.apache.felix.framework) Obsoletes: %{scl_prefix}felix-framework-javadoc Obsoletes: %{scl_prefix}hawtjni Obsoletes: %{scl_prefix}mvn(org.fusesource.hawtjni:hawtjni-runtime) Obsoletes: %{scl_prefix}hawtjni-javadoc Obsoletes: %{scl_prefix}maven-hawtjni-plugin Obsoletes: %{scl_prefix}httpcomponents-client Obsoletes: %{scl_prefix}mvn(org.apache.httpcomponents:httpclient) Obsoletes: %{scl_prefix}mvn(org.apache.httpcomponents:httpmime) Obsoletes: %{scl_prefix}httpcomponents-client-javadoc Obsoletes: %{scl_prefix}httpcomponents-core Obsoletes: %{scl_prefix}mvn(org.apache.httpcomponents:httpcore) Obsoletes: %{scl_prefix}httpcomponents-core-javadoc Obsoletes: %{scl_prefix}jansi Obsoletes: %{scl_prefix}mvn(org.fusesource.jansi:jansi) Obsoletes: %{scl_prefix}jansi-javadoc Obsoletes: %{scl_prefix}jansi-native Obsoletes: %{scl_prefix}mvn(org.fusesource.jansi:jansi-native) Obsoletes: %{scl_prefix}jansi-native-javadoc Obsoletes: %{scl_prefix}objectweb-asm Obsoletes: %{scl_prefix}objectweb-asm-javadoc Obsoletes: %{scl_prefix}mvn(asm:asm) Obsoletes: %{scl_prefix}mvn(asm:asm-commons) # In RHSCL 1.1 there was a -common sub package Obsoletes: %{name}-common < %{version}-%{release} %description runtime Package shipping essential scripts to work with the %scl Software Collection. %package build Requires: scl-utils >= 20130529-2 Requires: %{name}-runtime = %{version}-%{release} # This version of javapackages-tools has the fix for # RHBZ#1098523 and RHBZ#1122947 Requires: javapackages-tools >= 3.4.1-6 Summary: Build support tools for the %scl Software Collection. %description build Package shipping essential configuration marcros/files in order to be able to build %scl Software Collection. %package scldevel Summary: Package shipping development files for %scl. Group: Applications/File # This version of javapackages-tools has the fix for # RHBZ#1098523 and RHBZ#1122947 Requires: javapackages-tools >= 3.4.1-6 %description scldevel Development files for %scl (useful e.g. for hierarchical collection building with transitive dependencies). %prep %setup -c -T #===================# # SCL enable script # #===================# cat <enable # The thermostat1 collection depends on the mongodb24 collection # for the mongo-java-driver. We need to source the enable script # in order for xmvn builds to work. . scl_source enable mongodb24 # Generic variables export PATH="%{_bindir}:\${PATH:-/bin:/usr/bin}" export MANPATH="%{_mandir}:\${MANPATH}" # Needed by Java Packages Tools to locate java.conf export JAVACONFDIRS="%{_sysconfdir}/java:\${JAVACONFDIRS:-/etc/java}" # Required by XMvn to locate its configuration file(s) export XDG_CONFIG_DIRS="%{_sysconfdir}/xdg:\${XDG_CONFIG_DIRS:-/etc/xdg}" # Not really needed by anything for now, but kept for consistency with # XDG_CONFIG_DIRS. export XDG_DATA_DIRS="%{_datadir}:\${XDG_DATA_DIRS:-/usr/local/share:/usr/share}" EOF #===========# # java.conf # #===========# cat <java.conf # Java configuration file for %{scl} software collection. JAVA_LIBDIR=%{_javadir} JNI_LIBDIR=%{_jnidir} JVM_ROOT=%{_jvmdir} EOF #=============# # XMvn config # #=============# cat <configuration.xml /opt/rh/%{scl}/root opt/rh/%{scl}/root/usr/share/maven-fragments %{scl}-resolve compound opt/rh/%{scl}/root %{scl} mongodb24-resolve base-resolve resolve-system compound / %{scl}-resolve mongodb24-resolve base-resolve install compound opt/rh/%{scl}/root %{scl} base-install install-raw-pom compound opt/rh/%{scl}/root %{scl} base-raw-pom install-effective-pom compound opt/rh/%{scl}/root %{scl} base-effective-pom EOF #=====================# # README and man page # #=====================# # This section generates README file from a template and creates man page # from that file, expanding RPM macros in the template file. cat >README <<'EOF' %{expand:%(cat %{SOURCE0})} EOF # copy the license file so %%files section sees it cp %{SOURCE1} . # scldevel macros cat << EOF > macros.%{scl_name_base}-scldevel %%scl_%{scl_name_base} %{scl} %%scl_prefix_%{scl_name_base} %{scl_prefix} EOF %build # generate a helper script that will be used by help2man cat >h2m_helper <<'EOF' #!/bin/bash [ "$1" == "--version" ] && echo "%{scl_name} %{version} Software Collection" || cat README EOF chmod a+x h2m_helper # generate the man page help2man -N --section 7 ./h2m_helper -o %{scl_name}.7 %install # Parentheses are needed here as workaround for rhbz#1017085 (%scl_install) install -d -m 755 %{buildroot}%{_scl_scripts} install -p -m 755 enable %{buildroot}%{_scl_scripts}/ install -d -m 755 %{buildroot}%{_sysconfdir}/java install -p -m 644 java.conf %{buildroot}%{_sysconfdir}/java/ install -d -m 755 %{buildroot}%{_sysconfdir}/xdg/xmvn install -p -m 644 configuration.xml %{buildroot}%{_sysconfdir}/xdg/xmvn/ # Create java/maven/icons directories so that they'll get properly owned. # These are listed in the scl_files macro. See also: RHBZ#1057169 mkdir -p %{buildroot}%{_javadir} mkdir -p %{buildroot}%{_prefix}/lib/java mkdir -p %{buildroot}%{_javadocdir} mkdir -p %{buildroot}%{_mavenpomdir} mkdir -p %{buildroot}%{_datadir}/maven-effective-poms mkdir -p %{buildroot}%{_mavendepmapfragdir} mkdir -p %{buildroot}%{_datadir}/icons/hicolor/scalable/apps # install generated man page mkdir -p %{buildroot}%{_mandir}/man7/ install -m 644 %{scl_name}.7 %{buildroot}%{_mandir}/man7/%{scl_name}.7 # scldevel macro install -p -m 644 macros.%{scl_name_base}-scldevel %{buildroot}%{_root_sysconfdir}/rpm/ # Empty package (no file content). The sole purpose of this package # is collecting its dependencies so that the whole SCL can be # installed by installing %{name}. %files # The -f filesystem is RHEL-7 only. For some reason scl-utils does not # generate this file on RHEL-6. See RHBZ#1057169 and related bugs. %files runtime -f filesystem %doc README %{_mandir}/man7/%{scl_name}.* %doc LICENSE %{scl_files} %dir %{_sysconfdir}/java %{_sysconfdir}/java/java.conf %{_sysconfdir}/xdg/xmvn/configuration.xml %dir %{_javadir} %dir %{_javadocdir} %dir %{_mavenpomdir} %dir %{_datadir}/maven-effective-poms %dir %{_mavendepmapfragdir} %files build %{_root_sysconfdir}/rpm/macros.%{scl}-config %files scldevel %{_root_sysconfdir}/rpm/macros.%{scl_name_base}-scldevel %changelog * Tue Sep 16 2014 Severin Gehwolf - 1.2-70.6 - Add sub-packages to list of obsoletes which are only carried in the RHEL-6-based collection. - Add scl-ized mvn() provides to list of obsoletes as well. - Resolves: RHBZ#1088188 * Fri Jul 25 2014 Severin Gehwolf - 1.2-70.5 - Fix javapackages-tools Rs/BRs. - Related: RHBZ#1110882 * Wed Jun 25 2014 Severin Gehwolf - 1.2-70.4 - Drop javapackages-tools requires from -scldevel. * Tue Jun 24 2014 Severin Gehwolf - 1.2-70.3 - Obsolete el6-only carried transitive deps. - Obsolete merged -common sub-package. * Tue Jun 24 2014 Severin Gehwolf - 1.2-70.2 - Require minimal javapackages-tools version with xmvn bugfix. * Mon Jun 23 2014 Severin Gehwolf - 1.2-70.1 - Merge common sub-package into runtime. * Mon Mar 31 2014 Honza Horak - 1.1-5 - Fix path typo in README Related: #1061461 * Mon Mar 10 2014 Severin Gehwolf - 1.1-4 - Own filesystem directories and java dir in the thermostat1 collection. - Resolves: RHBZ#1057169 * Thu Feb 13 2014 Omair Majid - 1.1-3 - Update README - Resolves: RHBZ#1061461 * Wed Feb 12 2014 Severin Gehwolf - 1.1-2 - Introduce scldevel subpackage. - Resolves: RHBZ#1063360 * Wed Feb 12 2014 Omair Majid - 1.1-1 - Add LICENSE, README and man page - Bump version to 1.1 - Resolves: RHBZ#1061461 * Mon Jan 27 2014 Severin Gehwolf - 1-11 - Own common java/maven/icon directories for this scl. - Resolves: RHBZ#1057169 * Thu Jan 16 2014 Severin Gehwolf - 1-10 - Depend on minimal scl-utils version which has fix for RHBZ#1033674. - Resolves: RHBZ#1051005 * Wed Jan 15 2014 Severin Gehwolf - 1-9 - Depend on minimal scl-utils version which contains the scl_source file. - Include release in requires for thermostat1-common. - Resolves: RHBZ#1051576 * Fri Dec 13 2013 Severin Gehwolf - 1-8 - Make the thermostat1 metapackage depend on webapp. - Resolves: RHBZ#891540. * Wed Nov 27 2013 Severin Gehwolf - 1-7 - Properly source dependent mongodb24 SCL. * Mon Nov 11 2013 Severin Gehwolf 1-6 - Enable the mongodb24 collection in the thermostat1 enable scriptlet. * Thu Nov 07 2013 Severin Gehwolf 1-5 - Fix xmvn repo dependency on mongodb24 collection. * Fri Oct 25 2013 Severin Gehwolf 1-4 - Move essential files into common subpackage. * Fri Oct 25 2013 Severin Gehwolf 1-3 - First version including Java SCL configs. * Tue Sep 24 2013 Severin Gehwolf 1-2 - Bump release for rebuild. * Mon Jul 29 2013 Omair Majid 1-1 - Initial package