Alon Bar-Lev has uploaded a new change for review. Change subject: packaging: create war at /var/lib instead of /usr ......................................................................
packaging: create war at /var/lib instead of /usr requires[1] [1] http://gerrit.ovirt.org/#/c/23278/ Change-Id: I725deb120e07583170d2522ee60e492184541582 Signed-off-by: Alon Bar-Lev <[email protected]> --- M .gitignore M Makefile M ovirt-engine-reports.spec.in M packaging/conf/default_master.properties M packaging/legacy-setup/ovirt-engine-reports-setup.py D packaging/sys-etc/ovirt-engine/engine.conf.d/50-ovirt-engine-reports.conf A packaging/sys-etc/ovirt-engine/engine.conf.d/50-ovirt-engine-reports.conf.in 7 files changed, 23 insertions(+), 4 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-reports refs/changes/15/23315/1 diff --git a/.gitignore b/.gitignore index 49ea166..1123229 100644 --- a/.gitignore +++ b/.gitignore @@ -16,4 +16,5 @@ ########################### build/python-check.sh.in ovirt-engine-reports.spec +packaging/sys-etc/ovirt-engine/engine.conf.d/50-ovirt-engine-reports.conf server-customizations/WEB-INF/log4j.properties diff --git a/Makefile b/Makefile index 2197f53..2894fbb 100644 --- a/Makefile +++ b/Makefile @@ -120,6 +120,7 @@ GENERATED = \ build/python-check.sh \ ovirt-engine-reports.spec \ + packaging/sys-etc/ovirt-engine/engine.conf.d/50-ovirt-engine-reports.conf \ server-customizations/WEB-INF/log4j.properties \ $(NULL) @@ -255,3 +256,4 @@ cp tmp.dev.flist "$(DESTDIR)$(PREFIX)/dev.$(PACKAGE_NAME).flist" install -d "$(DESTDIR)$(PKG_LOG_DIR)" + install -d "$(DESTDIR)$(PKG_STATE_DIR)" diff --git a/ovirt-engine-reports.spec.in b/ovirt-engine-reports.spec.in index 05c1268..9e3257d 100644 --- a/ovirt-engine-reports.spec.in +++ b/ovirt-engine-reports.spec.in @@ -15,6 +15,7 @@ OVIRT_REPORTS_NAME=%{reports_name} \\\ PREFIX=%{_prefix} \\\ SYSCONF_DIR=%{_sysconfdir} \\\ + LOCALSTATE_DIR=%{_localstatedir} \\\ BIN_DIR=%{_bindir} \\\ DATAROOT_DIR=%{_datadir} \\\ PYTHON=%{__python} \\\ @@ -22,6 +23,7 @@ JAVA_DIR=%{_javadir} \\\ PKG_JAVA_DIR=%{reports_java} \\\ PKG_LOG_DIR=%{_localstatedir}/log/%{reports_name} \\\ + PKG_STATE_DIR=%{_localstatedir}/lib/%{reports_name} \\\ %{?BUILD_FLAGS:BUILD_FLAGS="%{BUILD_FLAGS}"} \\\ %{?EXTRA_BUILD_FLAGS:EXTRA_BUILD_FLAGS="%{EXTRA_BUILD_FLAGS}"} @@ -77,6 +79,7 @@ # # /var creation # +install -dm 755 "%{buildroot}/%{_localstatedir}/lib/%{name}" install -dm 755 "%{buildroot}/%{_localstatedir}/log/%{name}" # Needed for compatibility if package is different than the directory structure @@ -88,12 +91,13 @@ %postun if [ "$1" -eq 0 ]; then rm -f /etc/ovirt-engine/jrs-deployment.version - rm -rf /usr/share/ovirt-engine/%{name}.war + rm -rf /var/lib/ovirt-engine-reports/%{name}.war rm -f /var/lib/ovirt-engine/reports.xml fi %files %dir %{_sysconfdir}/%{reports_name}/ovirt-engine-reports.conf.d +%dir %attr(-, %{engine_user}, %{engine_group}) %{_localstatedir}/lib/%{name} %dir %attr(-, %{engine_user}, %{engine_group}) %{_localstatedir}/log/%{name} %{_sysconfdir}/ovirt-engine/engine.conf.d/50-ovirt-engine-reports.conf %{reports_java} diff --git a/packaging/conf/default_master.properties b/packaging/conf/default_master.properties index 2a4b106..3be321f 100644 --- a/packaging/conf/default_master.properties +++ b/packaging/conf/default_master.properties @@ -1,7 +1,7 @@ appServerType=jboss7 # JBoss app server root dir -appServerDir=/usr/share/ovirt-engine +appServerDir=/var/lib/ovirt-engine-reports # database type dbType=postgresql diff --git a/packaging/legacy-setup/ovirt-engine-reports-setup.py b/packaging/legacy-setup/ovirt-engine-reports-setup.py index ba56957..6534816 100755 --- a/packaging/legacy-setup/ovirt-engine-reports-setup.py +++ b/packaging/legacy-setup/ovirt-engine-reports-setup.py @@ -35,11 +35,12 @@ 'REMOTE_DB_PASSWORD': None, } -DIR_DEPLOY = "/usr/share/ovirt-engine" +DIR_DEPLOY = "/var/lib/ovirt-engine-reports" JRS_APP_NAME = "ovirt-engine-reports" JRS_DB_NAME = "ovirtenginereports" JRS_PACKAGE_NAME = "jasperreports-server" DIR_WAR="%s/%s.war" % (DIR_DEPLOY, JRS_APP_NAME) +LEGACY_WAR="/usr/share/ovirt-engine/ovirt-engine-reports.war" FILE_JS_SMTP="%s/WEB-INF/js.quartz.properties" % DIR_WAR FILE_APPLICATION_CONTEXT_OVERRIDE ="%s/WEB-INF/applicationContext-ovirt-override.xml" % DIR_WAR FILE_JRS_DATASOURCES="%s/WEB-INF/js-jboss7-ds.xml" % DIR_WAR @@ -201,6 +202,9 @@ utils.clearDB(db_dict, TEMP_PGPASS, log_file) DB_EXIST = False DB_EXISTED = True + + if os.path.exists(LEGACY_WAR): + shutil.rmtree(LEGACY_WAR) if isWarInstalled(): shutil.rmtree(DIR_WAR) @@ -1002,6 +1006,10 @@ # Check if ovirt-engine is up, if so prompt the user to stop it. if utils.stopEngine(options['STOP_ENGINE']): + + if os.path.exists(LEGACY_WAR) and not os.path.exists(DIR_WAR): + shutil.copytree(LEGACY_WAR, DIR_WAR, symlinks=True) + warUpdated = isWarUpdated() if not warUpdated and isWarInstalled(): @@ -1207,6 +1215,9 @@ configureApache() + if os.path.exists(LEGACY_WAR): + shutil.rmtree(LEGACY_WAR) + # Restore previous version except: logging.error("Failed to complete the setup of the reports package!") diff --git a/packaging/sys-etc/ovirt-engine/engine.conf.d/50-ovirt-engine-reports.conf b/packaging/sys-etc/ovirt-engine/engine.conf.d/50-ovirt-engine-reports.conf deleted file mode 100644 index 4f7a9cf..0000000 --- a/packaging/sys-etc/ovirt-engine/engine.conf.d/50-ovirt-engine-reports.conf +++ /dev/null @@ -1 +0,0 @@ -ENGINE_APPS="${ENGINE_APPS} ovirt-engine-reports.war" diff --git a/packaging/sys-etc/ovirt-engine/engine.conf.d/50-ovirt-engine-reports.conf.in b/packaging/sys-etc/ovirt-engine/engine.conf.d/50-ovirt-engine-reports.conf.in new file mode 100644 index 0000000..86849e1 --- /dev/null +++ b/packaging/sys-etc/ovirt-engine/engine.conf.d/50-ovirt-engine-reports.conf.in @@ -0,0 +1,2 @@ +ENGINE_APPS="${ENGINE_APPS} \"@PKG_STATE_DIR@/ovirt-engine-reports.war\"" +ENGINE_JAVA_MODULEPATH="${ENGINE_JAVA_MODULEPATH}:@PKG_STATE_DIR@/modules" -- To view, visit http://gerrit.ovirt.org/23315 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I725deb120e07583170d2522ee60e492184541582 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-reports Gerrit-Branch: master Gerrit-Owner: Alon Bar-Lev <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
