Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

RPM seems to be working now

Mike McGann070fca9dc28f
diff --git a/bin/eventsGeoRssParser.py b/bin/eventsGeoRssParser.py
index 0340a69d8..f1cc2002f 100755
--- a/bin/eventsGeoRssParser.py
+++ b/bin/eventsGeoRssParser.py
@@ -33,6 +33,7 @@ if options.development:
else:
confDir = '/etc/worldview'
libDir = '/var/lib/worldview'
+ os.chdir('/tmp')
# ===================================================================
# Log Configuration
@@ -311,4 +312,7 @@ def main():
outfile.truncate()
outfile.close()
-main()
+try:
+ main()
+except Exception as e:
+ errorLog.error("Unhandled exception: %s" % str(e))
diff --git a/build.xml b/build.xml
index bbc4a5a58..81795f926 100644
--- a/build.xml
+++ b/build.xml
@@ -256,7 +256,15 @@
<regexpmapper from="^[^/]*/(.*)$$" to="\1" handledirsep="true"/>
</move>
-
+ <delete includeemptydirs="true">
+ <fileset dir="${build.web.dir}" >
+ <and>
+ <size value="0"/>
+ <type type="dir"/>
+ </and>
+ </fileset>
+ </delete>
+
</target>
<target name="start-test-server" depends="deps">
@@ -334,23 +342,33 @@
<target name="rpm" depends="dist,rpm-build"/>
<target name="rpm-build">
- <mkdir dir="${user.home}/rpmbuild/SOURCES"/>
+ <mkdir dir="${build.dir}/rpm/SOURCES"/>
<copy file="${dist.dir}/worldview.tar.bz2"
- todir="${user.home}/rpmbuild/SOURCES"/>
+ todir="${build.dir}/rpm/SOURCES"/>
<copy file="${dist.dir}/worldview-debug.tar.bz2"
- todir="${user.home}/rpmbuild/SOURCES"/>
+ todir="${build.dir}/rpm/SOURCES"/>
<copy file="etc/deploy/httpd.worldview.conf"
- todir="${user.home}/rpmbuild/SOURCES"/>
+ todir="${build.dir}/rpm/SOURCES"/>
<copy file="etc/deploy/httpd.worldview-debug.conf"
- todir="${user.home}/rpmbuild/SOURCES"/>
+ todir="${build.dir}/rpm/SOURCES"/>
<copy file="etc/deploy/events_log.conf"
- todir="${user.home}/rpmbuild/SOURCES"/>
+ todir="${build.dir}/rpm/SOURCES"/>
<copy file="etc/deploy/cron.worldview"
- todir="${user.home}/rpmbuild/SOURCES"/>
+ todir="${build.dir}/rpm/SOURCES"/>
+ <copy file="etc/deploy/logrotate.worldview"
+ todir="${build.dir}/rpm/SOURCES"/>
<exec executable="rpmbuild">
- <arg value="-ba"/>
- <arg value="etc/deploy/worldview.spec"/>
+ <arg value="--define"/>
+ <arg value="_topdir ${basedir}/build/rpm"/>
+ <arg value="-ba"/>
+ <arg value="etc/deploy/worldview.spec"/>
</exec>
+ <move todir="${dist.dir}">
+ <fileset dir="${build.dir}/rpm/RPMS/noarch"/>
+ </move>
+ <move todir="${dist.dir}">
+ <fileset dir="${build.dir}/rpm/SRPMS"/>
+ </move>
</target>
</project>
diff --git a/etc/deploy/logrotate.worldview b/etc/deploy/logrotate.worldview
new file mode 100644
index 000000000..66fbeae14
--- /dev/null
+++ b/etc/deploy/logrotate.worldview
@@ -0,0 +1,8 @@
+/var/log/worldview/*.log {
+ copytruncate
+ weekly
+ rotate 4
+ compress
+ missingok
+ create 0664 apache apache
+}
diff --git a/etc/deploy/mock_install.sh b/etc/deploy/mock_install.sh
new file mode 100755
index 000000000..46ac40530
--- /dev/null
+++ b/etc/deploy/mock_install.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+BASEDIR=$(dirname "$0")/../..
+
+sudo /etc/init.d/httpd stop
+mock --init
+mock --install yum
+mock --copyin $BASEDIR/dist/worldview-*.noarch.rpm /
+mock --shell 'yum install *.rpm'
+mock --shell '/etc/init.d/httpd start'
diff --git a/etc/deploy/mock_uninstall.sh b/etc/deploy/mock_uninstall.sh
new file mode 100755
index 000000000..e2f2d38ff
--- /dev/null
+++ b/etc/deploy/mock_uninstall.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+mock --shell '/etc/init.d/httpd stop'
+mock --clean
diff --git a/etc/deploy/system_purge.sh b/etc/deploy/system_purge.sh
new file mode 100755
index 000000000..8c28848e8
--- /dev/null
+++ b/etc/deploy/system_purge.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+sudo rm -rf /var/lib/worldview
+sudo rm -rf /var/log/worldview
diff --git a/etc/deploy/worldview.spec b/etc/deploy/worldview.spec
index 43ec16545..20914acae 100644
--- a/etc/deploy/worldview.spec
+++ b/etc/deploy/worldview.spec
@@ -14,6 +14,7 @@ Source2: httpd.worldview.conf
Source3: httpd.worldview-debug.conf
Source4: events_log.conf
Source5: cron.worldview
+Source6: logrotate.worldview
BuildArch: noarch
Requires: httpd
@@ -56,6 +57,7 @@ cp %{SOURCE2} .
cp %{SOURCE3} .
cp %{SOURCE4} .
cp %{SOURCE5} .
+cp %{SOURCE6} .
%build
@@ -81,15 +83,16 @@ install -m 644 events_log.conf \
%{buildroot}/%{_sysconfdir}/worldview/events_log.conf
install -m 755 -d %{buildroot}/%{_sharedstatedir}/worldview
-touch %{buildroot}/%{_sharedstatedir}/worldview/events_data.json
install -m 755 -d %{buildroot}/%{_localstatedir}/log/worldview
-touch %{buildroot}/%{_localstatedir}/log/worldview/events_access.log
-touch %{buildroot}/%{_localstatedir}/log/worldview/events_errors.log
-touch %{buildroot}/%{_localstatedir}/log/worldview/events_debug.log
install -m 755 -d %{buildroot}/%{_sysconfdir}/cron.d
install -m 600 cron.worldview %{buildroot}/%{_sysconfdir}/cron.d/worldview
+install -m 755 -d %{buildroot}/%{_sysconfdir}/logrotate.d
+install -m 600 logrotate.worldview \
+ %{buildroot}/%{_sysconfdir}/logrotate.d/worldview
+
+
%clean
rm -rf %{buildroot}
@@ -100,15 +103,12 @@ rm -rf %{buildroot}
%config(noreplace) %{httpdconfdir}/worldview.conf
%dir %{_sysconfdir}/worldview
%config(noreplace) %{_sysconfdir}/worldview/events_log.conf
-%{_sysconfdir}/cron.d/worldview
+%config(noreplace) %{_sysconfdir}/cron.d/worldview
+%config(noreplace) %{_sysconfdir}/logrotate.d/worldview
%defattr(600,apache,apache,700)
%dir %{_sharedstatedir}/worldview
-%ghost %{_sharedstatedir}/worldview/events_data.json
%dir %{_localstatedir}/log/worldview
-%ghost %{_localstatedir}/log/worldview/events_access.log
-%ghost %{_localstatedir}/log/worldview/events_errors.log
-%ghost %{_localstatedir}/log/worldview/events_debug.log
%files debug