Blame SPECS/thermostat1.spec

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