diff options
author | Roland Reichwein <rr@reichwein.it> | 2018-02-28 09:35:07 +0100 |
---|---|---|
committer | Roland Reichwein <rr@reichwein.it> | 2018-02-28 09:35:07 +0100 |
commit | bc9181917182e27324ff0437cf0d10abd91fa581 (patch) | |
tree | 4c3141f0ab45235fc7bc2492f5090a96b3f11dfe | |
parent | 1fb8bf91a6a796c307e31338cc9b850c41d6dd6d (diff) |
Compatibility for different build OSes
-rw-r--r-- | Makefile | 16 | ||||
-rw-r--r-- | debian/changelog | 7 | ||||
-rw-r--r-- | debian/control | 3 | ||||
-rw-r--r-- | html/index.html | 4 | ||||
-rw-r--r-- | html/webbox.js | 2 | ||||
-rw-r--r-- | src/Makefile | 10 |
6 files changed, 30 insertions, 12 deletions
@@ -7,10 +7,11 @@ install: all mkdir -p $(DESTDIR)/var/www/webbox cp -r html/* $(DESTDIR)/var/www/webbox/ - # Minify - uglifyjs html/webbox.js -m -c > $(DESTDIR)/var/www/webbox/webbox.js - htmlmin html/index.html $(DESTDIR)/var/www/webbox/index.html - cleancss -o $(DESTDIR)/var/www/webbox/webbox.css html/webbox.css + # Minify, conditionally + command -v uglifyjs && uglifyjs html/webbox.js -m -c > $(DESTDIR)/var/www/webbox/webbox.js || true + command -v htmlmin && \ + htmlmin html/index.html $(DESTDIR)/var/www/webbox/index.html || true + command -v cleancss && cleancss -o $(DESTDIR)/var/www/webbox/webbox.css html/webbox.css || true mkdir -p $(DESTDIR)/usr/lib/webbox cp src/query $(DESTDIR)/usr/lib/webbox/ @@ -22,8 +23,15 @@ deploy: all sudo service apache2 start deb: + # build binary deb package dpkg-buildpackage -us -uc -rfakeroot +deb-src: + dpkg-source -b . + +debs: deb-src + # TODO: build for different OSes + clean: make -C src clean dh_clean diff --git a/debian/changelog b/debian/changelog index ee955fd..4e13203 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +webbox (1.6) unstable; urgency=medium + + * New version + * Speedup by minification + + -- Roland Reichwein <rr@antcom.de> Tue, 27 Feb 2018 13:57:31 +0100 + webbox (1.5) unstable; urgency=medium * New version diff --git a/debian/control b/debian/control index 5dbb8a0..d6a00f5 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,8 @@ Source: webbox Section: web Priority: extra Maintainer: Roland Reichwein <mail@reichwein.it> -Build-Depends: debhelper (>= 9), qtbase5-dev, libfcgi-dev, node-uglify, htmlmin, cleancss +# grep is dummy +Build-Depends: debhelper (>= 9), qtbase5-dev, libfcgi-dev, node-uglify | grep, htmlmin | grep, cleancss | grep Standards-Version: 4.1.3 Homepage: http://www.reichwein.it/webbox/ diff --git a/html/index.html b/html/index.html index d33d678..e9ea819 100644 --- a/html/index.html +++ b/html/index.html @@ -12,14 +12,14 @@ <table> <tr> <td class="title">Webbox</td> - <td class="menusymbol" onclick="showMenu();"><img src="menu.png"/></td> + <td class="menusymbol" onclick="showMenu();"><img src="menu.png" alt=""/></td> </tr> </table> <input id="uploadfile" type="file" onchange="onUploadFile();" multiple hidden/> <table class="menu"> <tr> <td class="firsttd"></td> - <td class="entry" onclick="refresh();"><img src="refresh-inverted.png"/></td> + <td class="entry" onclick="refresh();"><img src="refresh-inverted.png" alt=""/></td> </tr> </table> </div> diff --git a/html/webbox.js b/html/webbox.js index 09a3979..55df1f5 100644 --- a/html/webbox.js +++ b/html/webbox.js @@ -57,7 +57,7 @@ function loadContents(dir) { } - xhr.open("GET", "bin/query" + currentDir + "?command=list", true); + xhr.open("GET", "bin/query" + dir + "?command=list", true); xhr.setRequestHeader("Authorization", "Basic " + btoa(username + ":" + password)); xhr.send(); } diff --git a/src/Makefile b/src/Makefile index 0a8ab19..482e986 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,16 +1,18 @@ ARCH=$(shell dpkg-architecture -qDEB_HOST_MULTIARCH) TARGET=query -CPPFLAGS=-Wall -O2 -fPIC -std=gnu++17 -I/usr/include/$(ARCH)/qt5 -I/usr/include/$(ARCH)/qt5/QtCore -LDFLAGS=-Wall -O2 -fPIC -std=gnu++17 -lstdc++ -lfcgi -lQt5Core +# gnu++17 since gcc 5 +STANDARD=$(shell g++ -std=gnu++17 -E -x c++ - < /dev/null > /dev/null 2>/dev/null && echo "-std=gnu++17" || echo "-std=gnu++14") +CPPFLAGS=-Wall -O2 $(STANDARD) -fPIC -I/usr/include/$(ARCH)/qt5 -I/usr/include/$(ARCH)/qt5/QtCore +LDFLAGS=-Wall -O2 $(STANDARD) -fPIC -lstdc++ -lfcgi -lQt5Core OBJS=webbox.o all: $(TARGET) $(TARGET): $(OBJS) - gcc $(LDFLAGS) -o $@ $^ + g++ $(LDFLAGS) -o $@ $^ %.o: %.cpp - gcc $(CPPFLAGS) -c -o $@ $< + g++ $(CPPFLAGS) -c -o $@ $< clean: -rm -rf $(TARGET) $(OBJS) |