Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

RPM build

Mike McGannc920394b0982
diff --git a/Gruntfile.js b/Gruntfile.js
index 481d4c4e4..3d5a93267 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -17,6 +17,7 @@ var buildTimestamp = moment.utc().format("MMMM DD, YYYY [-] HH:mm [UTC]");
// Append to all URI references for cache busting
var buildNonce = moment.utc().format("YYYYMMDDHHmmssSSS");
+var buildNumber = moment.utc().format("YYMMDDHHmmss");
module.exports = function(grunt) {
@@ -83,7 +84,23 @@ module.exports = function(grunt) {
src: ["**"], dest: "web/brand" }
]
},
-
+
+ rpm_sources: {
+ files: [
+ { expand: true, cwd: "deploy/sources",
+ src: ["**"], dest: "build/rpmbuild/SOURCES" },
+ { expand: true, cwd: "deploy",
+ src: ["worldview.spec"], dest: "build/rpmbuild/SPECS" },
+ { expand: true, cwd: "dist",
+ src: [
+ "site-<%=grunt.option('packageName')%>.tar.bz2",
+ "site-<%=grunt.option('packageName')%>-debug.tar.bz2",
+ "worldview-config.tar.bz2"
+ ],
+ dest: "build/rpmbuild/SOURCES" }
+ ]
+ },
+
// Copies the source files to the build directory
source: {
files: [{
@@ -171,6 +188,13 @@ module.exports = function(grunt) {
}]
},
+ rpm: {
+ files: [{
+ expand: true, flatten: true, cwd: "build/rpmbuild",
+ src: ["**/*.rpm"], dest: "dist"
+ }]
+ },
+
site: {
files: [{
expand: true, cwd: "build/worldview-debug",
@@ -219,6 +243,11 @@ module.exports = function(grunt) {
command: "find build -type d -empty -delete"
},
+ rpmbuild: {
+ command: 'rpmbuild --define "_topdir $PWD/build/rpmbuild" ' +
+ '-ba build/rpmbuild/SPECS/worldview.spec'
+ },
+
tar_config: {
command: "tar cjCf build dist/worldview-config.tar.bz2 " +
"options"
@@ -309,6 +338,11 @@ module.exports = function(grunt) {
options: {
create: ["dist"]
}
+ },
+ rpmbuild: {
+ options: {
+ create: ["build/rpmbuild"]
+ }
}
},
@@ -341,7 +375,13 @@ module.exports = function(grunt) {
build_site: [
"build/site-<%=grunt.option('packageName')%>-debug",
"build/site-<%=grunt.option('packageName')%>",
- ]
+ ],
+ dist_rpm: [
+ "dist/*.rpm"
+ ],
+ rpmbuild: [
+ "build/rpmbuild"
+ ],
},
replace: {
@@ -362,6 +402,31 @@ module.exports = function(grunt) {
}]
},
+ rpm_sources: {
+ src: [
+ "build/rpmbuild/SOURCES/*",
+ "build/rpmbuild/SPECS/*",
+ "!**/*.tar.bz2"
+ ],
+ overwrite: true,
+ replacements: [{
+ from: "@WORLDVIEW@",
+ to: "<%=grunt.option('packageName')%>"
+ }, {
+ from: "@BUILD_VERSION@",
+ to: "<%=pkg.version%>"
+ }, {
+ from: "@BUILD_RELEASE@",
+ to: "<%=pkg.release%>"
+ }, {
+ from: "@GIT_REVISION@",
+ to: "<%=grunt.config.get('source-revision')%>"
+ }, {
+ from: "@BUILD_NUMBER@",
+ to: buildNumber
+ }]
+ },
+
tokens: {
src: [
"build/site-<%=grunt.option('packageName')%>-debug/**/*.html",
@@ -450,10 +515,6 @@ module.exports = function(grunt) {
// Lets use "clean" as a target instead of the name of the task
grunt.renameTask("clean", "remove");
- // Make sure these directories exist
- grunt.file.mkdir("build/rpmbuild");
- grunt.file.mkdir("dist");
-
grunt.registerTask("load_branding", "Load branding", function() {
var brand = grunt.file.readJSON("build/options/brand.json");
brand.officialName = brand.officialName || brand.name;
@@ -517,6 +578,18 @@ module.exports = function(grunt) {
"copy:dist_site_release_versioned"
]);
+ grunt.registerTask("rpm-only", [
+ "load_branding",
+ "git-rev-parse:source",
+ "remove:rpmbuild",
+ "mkdir:rpmbuild",
+ "copy:rpm_sources",
+ "replace:rpm_sources",
+ "remove:dist_rpm",
+ "exec:rpmbuild",
+ "copy:rpm"
+ ]);
+
grunt.registerTask("check", ["lint", "test"]);
grunt.registerTask("clean", ["remove:build"]);
grunt.registerTask("distclean", ["remove:build", "remove:dist"]);
diff --git a/deploy/worldview.spec b/deploy/worldview.spec
index 5ea483bac..4340c27d4 100644
--- a/deploy/worldview.spec
+++ b/deploy/worldview.spec
@@ -6,15 +6,16 @@
Name: @WORLDVIEW@
Version: @BUILD_VERSION@
-Release: @BUILD_RELEASE@%{?build_num}@GIT_REVISION@%{?dist}
+Release: @BUILD_RELEASE@.@[email protected]@GIT_REVISION@%{?dist}
Summary: Browse full-resolution, near real-time satellite imagery.
License: Copyright NASA
URL: http://earthdata.nasa.gov
-Source2: httpd.@[email protected]
-Source3: httpd.@[email protected]
+Source0: site-@[email protected]
+Source1: site-@[email protected]
+Source2: worldview-config.tar.bz2
+Source3: httpd.conf
+Source4: httpd-debug.conf
#Source4: events_log.conf
#Source4: events_log-debug.conf
#Source5: cron.worldview
@@ -57,8 +58,11 @@ Non-minified version of Worldview for debugging
%setup -c -T
tar xf %{SOURCE0}
tar xf %{SOURCE1}
-cp %{SOURCE2} .
+tar xf %{SOURCE2}
+cp -r options/{brand,config} site-@WORLDVIEW@/web
+cp -r options/{brand,config} site-@WORLDVIEW@-debug/web
cp %{SOURCE3} .
+cp %{SOURCE4} .
#cp %{SOURCE4} .
#cp %{SOURCE5} .
#cp %{SOURCE6} .
@@ -72,36 +76,27 @@ cp %{SOURCE3} .
%install
rm -rf %{buildroot}
-chmod 755 @WORLDVIEW@/bin/*
-chmod 755 @WORLDVIEW@-debug/bin/*
+#chmod 755 @WORLDVIEW@/bin/*
+#chmod 755 @WORLDVIEW@-debug/bin/*
# Apache configuration for release
install -m 755 -d %{buildroot}/%{httpdconfdir}
-install -m 644 httpd.@[email protected] \
+install -m 644 httpd.conf \
%{buildroot}/%{httpdconfdir}/@[email protected]
+rm httpd.conf
# Apache configuration for debug
-install -m 644 httpd.@[email protected] \
+install -m 644 httpd-debug.conf \
%{buildroot}/%{httpdconfdir}/@[email protected]
-
-# Release options directory
-install -m 755 -d %{buildroot}/%{_sysconfdir}
-mv @WORLDVIEW@/options %{buildroot}/%{_sysconfdir}/@WORLDVIEW@
-ln -s %{_sysconfdir}/@WORLDVIEW@ @WORLDVIEW@/options
-
-# Debug options directory
-mv @WORLDVIEW@-debug/options %{buildroot}/%{_sysconfdir}/@WORLDVIEW@-debug
-ln -s %{_sysconfdir}/@WORLDVIEW@-debug @WORLDVIEW@-debug/options
+rm httpd-debug.conf
# Release application
install -m 755 -d %{buildroot}/%{_datadir}/@WORLDVIEW@
-cp -r @WORLDVIEW@/* %{buildroot}/%{_datadir}/@WORLDVIEW@
+cp -r site-@WORLDVIEW@/* %{buildroot}/%{_datadir}/@WORLDVIEW@
# Debug application
install -m 755 -d %{buildroot}/%{_datadir}/@WORLDVIEW@-debug
-cp -r @WORLDVIEW@-debug/* %{buildroot}/%{_datadir}/@WORLDVIEW@-debug
+cp -r site-@WORLDVIEW@-debug/* %{buildroot}/%{_datadir}/@WORLDVIEW@-debug
#install -m 755 -d %{buildroot}/%{_sysconfdir}/@WORLDVIEW@
#install -m 644 events_log.conf \
@@ -134,7 +129,6 @@ rm -rf %{buildroot}
%defattr(-,root,root,-)
%{_datadir}/@WORLDVIEW@
%config(noreplace) %{httpdconfdir}/@[email protected]
-%{_sysconfdir}/@WORLDVIEW@
#%config(noreplace) %{_sysconfdir}/@WORLDVIEW@/events_log.conf
#%config(noreplace) %{_sysconfdir}/cron.d/@WORLDVIEW@
#%config(noreplace) %{_sysconfdir}/logrotate.d/@WORLDVIEW@
@@ -147,7 +141,6 @@ rm -rf %{buildroot}
%files debug
%{_datadir}/@WORLDVIEW@-debug
%config(noreplace) %{httpdconfdir}/@[email protected]
-%{_sysconfdir}/@WORLDVIEW@-debug
#%config(noreplace) %{_sysconfdir}/@WORLDVIEW@-debug/events_log-debug.conf
#%config(noreplace) %{_sysconfdir}/cron.d/@WORLDVIEW@-debug
#%config(noreplace) %{_sysconfdir}/logrotate.d/@WORLDVIEW@-debug