%global scl_name_prefix rh- %global scl_name_base jmc %global scl %{scl_name_prefix}%{scl_name_base} # Do not produce empty debuginfo package %global debug_package %{nil} # Define SCL macros %scl_package %scl %global custom_release 70 %global revnum 1 Name: %{scl_name} Version: 8.0.1 # Release should be higher than el6 builds. Use convention # 70.X where X is an increasing int. For some reason we cannot # rely on the dist tag. Release: %{custom_release}.%{revnum}%{?dist} Summary: Package that installs %{scl} License: GPLv2+ Group: Applications/File Source0: README Source1: LICENSE BuildRequires: scl-utils-build BuildRequires: help2man Requires: %{name}-runtime >= %{version}-%{release} Requires: %{name}-jmc %description This is the main package for the %{scl} Software Collection. %package runtime Summary: Package that handles %{scl} Software Collection. Requires: scl-utils Requires: rh-maven36-runtime %description runtime Package shipping essential scripts to work with the %{scl} Software Collection. %package build Summary: Build support tools for the %{scl} Software Collection. Requires: scl-utils-build Requires: %{name}-scldevel = %{version}-%{release} %description build Package shipping essential configuration macros/files in order to be able to build %{scl} Software Collection. %package scldevel Summary: Package shipping development files for %{scl}. Requires: %{name}-runtime = %{version}-%{release} Requires: rh-eclipse-scldevel Requires: rh-maven36-scldevel %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 # We have a run-time dependency on maven collection, enable it first if not already if ! scl_enabled rh-maven36 ; then if [ -z "\$RPM_BUILD_ROOT" ] ; then . scl_source enable rh-maven36 fi fi # 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 #============================# # Eclipse configuration file # # ===========================# cat <eclipse.conf # Eclipse platform root directory eclipse.root=%{_prefix}/lib/eclipse # Location of architecture-independant dropins eclipse.dropins.noarch=%{_datadir}/eclipse/dropins # Location of architecture-independant droplets eclipse.droplets.noarch=%{_datadir}/eclipse/droplets # Location of architecture-dependant dropins eclipse.dropins.archful=%{_prefix}/lib/eclipse/dropins # Location of architecture-dependant droplets eclipse.droplets.archful=%{_prefix}/lib/eclipse/droplets # Comma-separated list of directories searched for external bundles eclipse.bundles=%{_prefix}/share/java,%{_prefix}/lib/java # Software collection ID (empty if not SCL) scl.namespace=%{?scl} # Software collection root directory (empty if not SCL) scl.root=%{?_scl_root} EOF #=============# # XMvn config # #=============# cat <configuration.xml /opt/rh/%{scl}/root/usr/share/maven-metadata /opt/rh/%{scl}/root opt/rh/%{scl}/root/usr/share/maven-metadata resolve-%{scl} compound opt/rh/%{scl}/root %{scl} base-resolve resolve compound resolve-local resolve-%{scl} resolve-rh-maven36 resolve-rh-eclipse install compound opt/rh/%{scl}/root %{scl} base-install EOF #=====================# # Javapackages config # #=====================# cat <javapackages-config.json { "maven.req": { "always_generate": [ "%{scl}-runtime" ], "java_requires": { "package_name": "java", "always_generate": true, "skip": false }, "java_devel_requires": { "package_name": "java-devel", "always_generate": false, "skip": false } }, "javadoc.req": { "always_generate": [ "%{scl}-runtime" ] } } 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} . # ============================# # SCL devel macros # # ============================# cat <macros.%{scl}-scldevel %%scl_%{scl_name_base} %{scl} %%scl_prefix_%{scl_name_base} %{scl_prefix} %%_scl_prefix_%{scl_name_base} %_scl_prefix %%_scl_scripts_%{scl_name_base} %_scl_scripts %%_scl_root_%{scl_name_base} %_scl_root EOF # ============================# # Additional SCL build macros # # ============================# cat <macros.%{scl}-config # Customisations for desktop applications %%app_name_prefix Red Hat JDK Mission Control %{version} %%app_exec_prefix scl enable %{scl_name} 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 (%{scl_install}) # install scl scripts install -d -m 755 %{buildroot}%{_scl_scripts} install -p -m 755 enable %{buildroot}%{_scl_scripts}/ # install man page install -d -m 755 %{buildroot}%{_mandir}/man7 install -p -m 644 %{scl_name}.7 %{buildroot}%{_mandir}/man7/ # install rpm macros install -d -m 755 %{buildroot}%{_root_sysconfdir}/rpm install -p -m 644 macros.%{scl}-scldevel %{buildroot}%{_root_sysconfdir}/rpm/ # install java, and xmvn config install -d -m 755 %{buildroot}%{_sysconfdir}/java install -p -m 644 java.conf %{buildroot}%{_sysconfdir}/java/ install -p -m 644 javapackages-config.json %{buildroot}%{_sysconfdir}/java/ install -d -m 755 %{buildroot}%{_sysconfdir}/xdg/xmvn install -p -m 644 configuration.xml %{buildroot}%{_sysconfdir}/xdg/xmvn/ # Eclipse Platform features and bundles install -m 755 -d %{buildroot}%{_prefix}/lib/eclipse/features install -m 755 -d %{buildroot}%{_prefix}/lib/eclipse/plugins # Archful dropins install -m 755 -d %{buildroot}%{_prefix}/lib/eclipse/dropins # Archful droplets install -m 755 -d %{buildroot}%{_prefix}/lib/eclipse/droplets # Noarch dropins install -m 755 -d %{buildroot}%{_datadir}/eclipse/dropins # Noarch droplets install -m 755 -d %{buildroot}%{_datadir}/eclipse/droplets # Eclipse config install -m 644 -p eclipse.conf %{buildroot}%{_sysconfdir}/java/ # JMC install -m 755 -d %{buildroot}%{_prefix}/lib/jmc # other directories that should be owned by the runtime install -d -m 755 %{buildroot}%{_datadir}/licenses # otherwise unowned java directories (native java bits are always in /usr/lib even on 64bit arches) install -d -m 755 %{buildroot}%{_prefix}/share/java install -d -m 755 %{buildroot}%{_prefix}/share/javadoc # otherwise unowned maven directories install -d -m 755 %{buildroot}%{_datadir}/maven-metadata install -d -m 755 %{buildroot}%{_datadir}/maven-poms cat macros.%{scl}-config >> %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl}-config # 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 jmc. %files %files runtime -f filelist %{scl_files} %doc README %license LICENSE %{_sysconfdir}/java %dir %{_datadir}/licenses %dir %{_prefix}/share/java %dir %{_prefix}/share/javadoc %dir %{_datadir}/maven-metadata %dir %{_datadir}/maven-poms %{_prefix}/lib/eclipse %{_prefix}/share/eclipse %{_prefix}/lib/jmc %files build %license LICENSE %{_root_sysconfdir}/rpm/macros.%{scl}-config %files scldevel %license LICENSE %{_root_sysconfdir}/rpm/macros.%{scl}-scldevel %changelog * Tue Aug 17 2021 Alex Macdonald - 8.0.1-1 - Update to version 8.0.1 * Thu Jan 28 2021 Alex Macdonald - 8.0.0-1 - Update to version 8.0.0 - Update to use rh-maven36 * Tue Feb 25 2020 Jie Kang - 7.1.0-1 - Update version to match jmc upstream version * Mon Mar 04 2019 Jie Kang - 7.0.0-7 - Add back javadoc file ownership * Wed Feb 27 2019 Jie Kang - 7.0.0-6 - Add dependency on rh-maven35-runtime * Tue Feb 26 2019 Jie Kang - 7.0.0-5 - Remove dependency on rh-eclipse-runtime - Move scldevel requires to scldevel package * Fri Feb 22 2019 Jie Kang - 7.0.0-4 - Remove unused files. Add proper Requires on rh-jmc-jmc * Tue Feb 19 2019 Jie Kang - 7.0.0-3 - Bump version for new build * Tue Feb 19 2019 Jie Kang - 7.0.0-2 - Remove BR on rh-eclipse-scldevel * Thu Nov 15 2018 Jie Kang - 7.0.0-1 - Initial package