[Debian-iot-packaging] [openzwave-controlpanel] 03/06: Serve Bootstrap and jQuery from localhost

Dara Adib daradib-guest at moszumanska.debian.org
Fri Dec 23 03:36:45 UTC 2016


This is an automated email from the git hooks/post-receive script.

daradib-guest pushed a commit to branch debian/master
in repository openzwave-controlpanel.

commit 9232ed98f107d9ccfff2f531be7cb873b5a94b63
Author: Dara Adib <daradib at ocf.berkeley.edu>
Date:   Thu Dec 22 15:58:50 2016 -0500

    Serve Bootstrap and jQuery from localhost
---
 debian/TODO                          |  2 --
 debian/control                       |  2 +-
 debian/patches/0003-thirdparty.patch | 46 ++++++++++++++++++++++++++++++++++++
 debian/patches/series                |  1 +
 4 files changed, 48 insertions(+), 3 deletions(-)

diff --git a/debian/TODO b/debian/TODO
index e6e7750..1c6a371 100644
--- a/debian/TODO
+++ b/debian/TODO
@@ -1,5 +1,3 @@
- - Use libjs-bootstrap and libjs-jquery packages instead of CDN
-   (lintian privacy-breach-uses-embedded-file).
  - Add manpage for ozwcp binary
    (lintian binary-without-manpage).
  - Change CFLAGS and LDFLAGS in Makefile
diff --git a/debian/control b/debian/control
index b655371..60b5b75 100644
--- a/debian/control
+++ b/debian/control
@@ -11,7 +11,7 @@ Vcs-Browser: https://anonscm.debian.org/cgit/debian-iot/openzwave-controlpanel.g
 
 Package: openzwave-controlpanel
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
+Depends: libjs-bootstrap, libjs-jquery, ${shlibs:Depends}, ${misc:Depends}
 Description: OpenZWave Control Panel
  OpenZWave Control Panel (ozwcp) permits users to query, manage and
  monitor Z-Wave nodes and networks. It provides a web-based user interface.
diff --git a/debian/patches/0003-thirdparty.patch b/debian/patches/0003-thirdparty.patch
new file mode 100644
index 0000000..82bd166
--- /dev/null
+++ b/debian/patches/0003-thirdparty.patch
@@ -0,0 +1,46 @@
+From: Dara Adib <daradib at ocf.berkeley.edu>
+Date: Thu, 22 Dec 2016 15:54:19 -0500
+Subject: thirdparty
+
+Serve third-party Bootstrap and jQuery files from
+/usr/share/javascript instead of external CDN.
+Requires packages libjs-bootstrap and libjs-jquery.
+---
+ cp.html       | 6 +++---
+ webserver.cpp | 6 ++++++
+ 2 files changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/cp.html b/cp.html
+index 465ae27..0fca3a0 100644
+--- a/cp.html
++++ b/cp.html
+@@ -42,9 +42,9 @@
+         <script type="text/javascript" src="cp.js"></script>
+ 
+         <!-- Bootstrap setup -->
+-        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
+-        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
+-        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
++        <link rel="stylesheet" href="/javascript/bootstrap/css/bootstrap.min.css">
++        <script src="/javascript/jquery/jquery.min.js"></script>
++        <script src="/javascript/bootstrap/js/bootstrap.min.js"></script>
+     </head>
+     <body onload="GetDefaultDevice();" onmousemove="PosToolTip(event);">
+         <h1 id="title">OpenZWave Control Panel</h1>
+diff --git a/webserver.cpp b/webserver.cpp
+index e066f23..1b6c742 100644
+--- a/webserver.cpp
++++ b/webserver.cpp
+@@ -1133,6 +1133,12 @@ int Webserver::Handler (struct MHD_Connection *conn, const char *url,
+ 			ret = web_send_file(conn, "/usr/share/openzwave-controlpanel/cp.js", MHD_HTTP_OK, false);
+ 		else if (strcmp(url, "/favicon.png") == 0)
+ 			ret = web_send_file(conn, "/usr/share/openzwave-controlpanel/openzwavetinyicon.png", MHD_HTTP_OK, false);
++		else if (strcmp(url, "/javascript/bootstrap/css/bootstrap.min.css") == 0)
++			ret = web_send_file(conn, "/usr/share/javascript/bootstrap/css/bootstrap.min.css", MHD_HTTP_OK, false);
++		else if (strcmp(url, "/javascript/bootstrap/js/bootstrap.min.js") == 0)
++			ret = web_send_file(conn, "/usr/share/javascript/bootstrap/js/bootstrap.min.js", MHD_HTTP_OK, false);
++		else if (strcmp(url, "/javascript/jquery/jquery.min.js") == 0)
++			ret = web_send_file(conn, "/usr/share/javascript/jquery/jquery.min.js", MHD_HTTP_OK, false);
+ 		else if (strcmp(url, "/poll.xml") == 0 && (devname != NULL || usb))
+ 			ret = SendPollResponse(conn);
+ 		else if (strcmp(url, "/devices.xml") == 0 && (devname != NULL || usb))
diff --git a/debian/patches/series b/debian/patches/series
index 1c8c1ee..092b2cb 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 0001-Makefile.patch
 0002-paths.patch
+0003-thirdparty.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-iot/openzwave-controlpanel.git



More information about the Debian-iot-packaging mailing list