Alon Bar-Lev has uploaded a new change for review. Change subject: packaging: spec: rework jar/poms installation ......................................................................
packaging: spec: rework jar/poms installation there is no reason to install poms that are not part of interface of product, however I leave this for now. the timing is due to the fact that we are to expose interface of extension api and we need to sort out the artifact installation. the installation of poms was incorrect as the update_maven_depmap at each subpackage should have been run for subset of files, same for the pom fragments. new implementation uses fedora-19 maven integration correctly, while emulating the minimum required for rhel host, using %files -f syntax. also add missing jars and poms from build. Change-Id: I0a0afe8d9c8d85e56fefdb06f155f6459c4ec650 Signed-off-by: Alon Bar-Lev <alo...@redhat.com> --- M Makefile M ovirt-engine.spec.in 2 files changed, 65 insertions(+), 90 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/21/27121/1 diff --git a/Makefile b/Makefile index 6fb4748..9065ab6 100644 --- a/Makefile +++ b/Makefile @@ -342,10 +342,15 @@ install_poms: install -dm 755 "$(DESTDIR)$(MAVENPOM_DIR)" + install -m 644 backend/manager/modules/aaa/pom.xml "$(DESTDIR)$(MAVENPOM_DIR)/$(PACKAGE_NAME)-aaa.pom" install -m 644 backend/manager/modules/bll/pom.xml "$(DESTDIR)$(MAVENPOM_DIR)/$(PACKAGE_NAME)-bll.pom" + install -m 644 backend/manager/modules/branding/pom.xml "$(DESTDIR)$(MAVENPOM_DIR)/$(PACKAGE_NAME)-branding.pom" + install -m 644 backend/manager/modules/builtin-extensions/pom.xml "$(DESTDIR)$(MAVENPOM_DIR)/$(PACKAGE_NAME)-builtin.pom" install -m 644 backend/manager/modules/common/pom.xml "$(DESTDIR)$(MAVENPOM_DIR)/$(PACKAGE_NAME)-common.pom" install -m 644 backend/manager/modules/compat/pom.xml "$(DESTDIR)$(MAVENPOM_DIR)/$(PACKAGE_NAME)-compat.pom" install -m 644 backend/manager/modules/dal/pom.xml "$(DESTDIR)$(MAVENPOM_DIR)/$(PACKAGE_NAME)-dal.pom" + install -m 644 backend/manager/modules/extensions-api-root/extensions-api/pom.xml "$(DESTDIR)$(MAVENPOM_DIR)/$(PACKAGE_NAME)-ovirt-engine-extensions-api.pom" + install -m 644 backend/manager/modules/extensions-manager/pom.xml "$(DESTDIR)$(MAVENPOM_DIR)/$(PACKAGE_NAME)-extensions-manager.pom" install -m 644 backend/manager/modules/pom.xml "$(DESTDIR)$(MAVENPOM_DIR)/$(PACKAGE_NAME)-manager-modules.pom" install -m 644 backend/manager/modules/restapi/interface/common/jaxrs/pom.xml "$(DESTDIR)$(MAVENPOM_DIR)/$(PACKAGE_NAME)-interface-common-jaxrs.pom" install -m 644 backend/manager/modules/restapi/interface/definition/pom.xml "$(DESTDIR)$(MAVENPOM_DIR)/$(PACKAGE_NAME)-restapi-definition.pom" diff --git a/ovirt-engine.spec.in b/ovirt-engine.spec.in index 3777ce4..b8996ce 100644 --- a/ovirt-engine.spec.in +++ b/ovirt-engine.spec.in @@ -52,6 +52,21 @@ %global ovirt_install_systemv 1 %global ovirt_install_poms 0 %global ovirt_require_maven 0 + +# emulate fedora java for simplicity +%undefine add_maven_depmap +%define add_maven_depmap(f:) \ + _jarpart="%2" \ + _filelist=".mfiles%{-f*:-%{-f*}}" \ + _jpath= \ + for _dir in "%{_jnidir}" "%{_javajnidir}" "%{_javadir}"; do \ + if [ -f "%{buildroot}/${_dir}/${_jarpart}" ]; then \ + _jpath="${_dir}/${_jarpart}" \ + fi \ + done \ + [ -n "${_jpath}" ] && echo "${_jpath}" >> "${_filelist}" \ + %{nil} + %endif %global ovirt_product_name oVirt Engine @@ -303,16 +318,6 @@ %description restapi The RESTful API for %{ovirt_product_name_short} -%post restapi -%if %{ovirt_install_poms} -%update_maven_depmap -%endif - -%postun restapi -%if %{ovirt_install_poms} -%update_maven_depmap -%endif - %package setup-base Summary: %{ovirt_product_name_short} suite base setup components. Group: %{ovirt_product_group} @@ -436,16 +441,9 @@ chkconfig --add ovirt-engine-notifier %endif -%if %{ovirt_install_poms} -%update_maven_depmap -%endif - %postun tools %if %{ovirt_install_systemd} %systemd_postun ovirt-engine-notifier.service -%endif -%if %{ovirt_install_poms} -%update_maven_depmap %endif %preun tools @@ -587,35 +585,65 @@ %{engine_jboss_modules}/org/ovirt/engine/core/tools/main/tools.jar %{engine_jboss_modules}/org/ovirt/engine/core/utils/main/utils.jar %{engine_jboss_modules}/org/ovirt/engine/extensions/builtin/main/builtin.jar +%{engine_legacy_restapi_war}/WEB-INF/lib/interface-common-jaxrs.jar +%{engine_legacy_restapi_war}/WEB-INF/lib/restapi-definition.jar +%{engine_legacy_restapi_war}/WEB-INF/lib/restapi-jaxrs.jar +%{engine_legacy_restapi_war}/WEB-INF/lib/restapi-types.jar %{engine_restapi_war}/WEB-INF/lib/interface-common-jaxrs.jar %{engine_restapi_war}/WEB-INF/lib/restapi-definition.jar %{engine_restapi_war}/WEB-INF/lib/restapi-jaxrs.jar %{engine_restapi_war}/WEB-INF/lib/restapi-types.jar __EOF__ -# Needed for compatibility if package is different than the directory structure +# needed for compatibility if package is different than the directory structure +# as we must install poms/files at %{name} we must set it to be the real path %if "%{name}" != "%{engine_name}" -ln -s "%{engine_name}" "%{buildroot}%{engine_java}/../%{name}" +mv "%{buildroot}%{engine_java}" "%{buildroot}%{engine_java}/../%{name}" +ln -s "%{name}" "%{buildroot}%{engine_java}" %endif # # Register poms # -%if !%{ovirt_install_poms} -rm -fr "%{buildroot}%{_mavenpomdir}" -%else -for pom in %{buildroot}%{_mavenpomdir}/*.pom; do - pomdir="$(dirname "${pom}")" +while read package pom; do + pomdir="$(dirname "%{_mavenpomdir}/${pom}")" pom="$(basename "${pom}")" jpppom="JPP.${pom}" - mv "${pomdir}/${pom}" "${pomdir}/${jpppom}" + mv "%{buildroot}${pomdir}/${pom}" "%{buildroot}${pomdir}/${jpppom}" artifact_id="$(echo "${pom}" | sed -e 's/^%{name}-//' -e 's/\.pom//')" if [ -f "%{buildroot}%{engine_java}/${artifact_id}.jar" ]; then - %add_maven_depmap "${jpppom}" "%{name}/${artifact_id}.jar" + %add_maven_depmap -f "${package}" "${jpppom}" "%{name}/${artifact_id}.jar" else - %add_maven_depmap "${jpppom}" + %add_maven_depmap -f "${package}" "${jpppom}" fi -done +done << __EOF__ +backend %{name}-aaa.pom +backend %{name}-backend.pom +backend %{name}-bll.pom +backend %{name}-builtin.pom +backend %{name}-dal.pom +backend %{name}-manager-modules.pom +backend %{name}-manager.pom +backend %{name}-ovirt-engine-extensions-api.pom +backend %{name}-scheduler.pom +backend %{name}-searchbackend.pom +backend %{name}-vdsbroker.pom +base %{name}-branding.pom +base %{name}-common.pom +base %{name}-compat.pom +base %{name}-extensions-manager.pom +base %{name}-root.pom +base %{name}-utils.pom +restapi %{name}-interface-common-jaxrs.pom +restapi %{name}-restapi-definition.pom +restapi %{name}-restapi-jaxrs.pom +restapi %{name}-restapi-parent.pom +restapi %{name}-restapi-types.pom +tools %{name}-tools.pom +__EOF__ + +%if !%{ovirt_install_poms} +rm -fr "%{buildroot}%{_mavenpomdir}" %endif # @@ -743,11 +771,6 @@ fi fi -%post -%if %{ovirt_install_poms} -%update_maven_depmap -%endif - %postun if [ "$1" -eq 0 ]; then rm -rf "%{engine_cache}" @@ -757,14 +780,11 @@ sed -i '/%{name}/d' "%{_sysconfdir}/yum/pluginconf.d/versionlock.list" fi fi -%if %{ovirt_install_poms} -%update_maven_depmap -%endif %pre %ovirt_create_user_engine -%files +%files -f .mfiles-base %dir %attr(-, %{engine_user}, %{engine_group}) %{engine_cache} %dir %attr(-, %{engine_user}, %{engine_group}) %{engine_log} @@ -783,14 +803,6 @@ %{engine_data}/branding/ovirt.brand/ %{engine_etc}/branding/00-ovirt.brand %{engine_etc}/engine.conf.d/ -%{engine_java}/aaa.jar -%{engine_java}/branding.jar -%{engine_java}/builtin.jar -%{engine_java}/common.jar -%{engine_java}/compat.jar -%{engine_java}/extensions-manager.jar -%{engine_java}/ovirt-engine-extensions-api.jar -%{engine_java}/utils.jar # # ATTENTION: @@ -801,19 +813,11 @@ %{_javadir}/%{name} %endif -%if %{ovirt_install_poms} -%{_mavendepmapfragdir}/%{name} -%{_mavenpomdir}/JPP.%{name}-root.pom -%{_mavenpomdir}/JPP.%{name}-common.pom -%{_mavenpomdir}/JPP.%{name}-compat.pom -%{_mavenpomdir}/JPP.%{name}-utils.pom -%endif - %files lib %{engine_data}/bin/java-home %{python_sitelib}/ovirt_engine/ -%files backend +%files backend -f .mfiles-backend %attr(-, %{engine_user}, %{engine_group}) %{engine_log}/host-deploy %attr(-, %{engine_user}, %{engine_group}) %{engine_state}/content @@ -834,11 +838,6 @@ %{engine_ear}/services.war/ %{engine_ear}/welcome.war/ %{engine_etc}/osinfo.conf.d/ -%{engine_java}/bll.jar -%{engine_java}/dal.jar -%{engine_java}/scheduler.jar -%{engine_java}/searchbackend.jar -%{engine_java}/vdsbroker.jar %{engine_jboss_modules}/ %{engine_data}/services/ovirt-engine @@ -847,18 +846,6 @@ %endif %if %{ovirt_install_systemv} %{_initddir}/ovirt-engine -%endif - -%if %{ovirt_install_poms} -%{_mavenpomdir}/JPP.%{name}-backend.pom -%{_mavenpomdir}/JPP.%{name}-manager.pom -%{_mavenpomdir}/JPP.%{name}-manager-modules.pom -%{_mavenpomdir}/JPP.%{name}-tools.pom -%{_mavenpomdir}/JPP.%{name}-bll.pom -%{_mavenpomdir}/JPP.%{name}-dal.pom -%{_mavenpomdir}/JPP.%{name}-scheduler.pom -%{_mavenpomdir}/JPP.%{name}-searchbackend.pom -%{_mavenpomdir}/JPP.%{name}-vdsbroker.pom %endif # @@ -950,22 +937,10 @@ %{engine_data}/dbscripts/ -%files restapi +%files restapi -f .mfiles-restapi -%{engine_java}/interface-common-jaxrs.jar -%{engine_java}/restapi-definition.jar -%{engine_java}/restapi-jaxrs.jar -%{engine_java}/restapi-types.jar %{engine_restapi_war}/ %{engine_legacy_restapi_war}/ - -%if %{ovirt_install_poms} -%{_mavenpomdir}/JPP.%{name}-interface-common-jaxrs.pom -%{_mavenpomdir}/JPP.%{name}-restapi-definition.pom -%{_mavenpomdir}/JPP.%{name}-restapi-jaxrs.pom -%{_mavenpomdir}/JPP.%{name}-restapi-parent.pom -%{_mavenpomdir}/JPP.%{name}-restapi-types.pom -%endif %files userportal @@ -988,7 +963,7 @@ %{_initddir}/ovirt-websocket-proxy %endif -%files tools +%files tools -f .mfiles-tools %config %{_sysconfdir}/logrotate.d/ovirt-engine-notifier %config %{engine_etc}/notifier/log4j.xml @@ -1015,11 +990,6 @@ %{engine_data}/services/ovirt-engine-notifier %{engine_etc}/engine-config/engine-config.*properties %{engine_etc}/notifier/notifier.conf.d/ -%{engine_java}/tools.jar - -%if %{ovirt_install_poms} -%{_mavenpomdir}/JPP.%{name}-tools.pom -%endif %if %{ovirt_install_systemd} %{_unitdir}/ovirt-engine-notifier.service -- To view, visit http://gerrit.ovirt.org/27121 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0a0afe8d9c8d85e56fefdb06f155f6459c4ec650 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Alon Bar-Lev <alo...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches