Build package

This commit is contained in:
Meutel 2017-04-03 21:06:29 +02:00
parent 09f1c4c1c3
commit 41cd8d2ba2
3 changed files with 43 additions and 12 deletions

4
.gitignore vendored
View File

@ -3,6 +3,6 @@
build build
*.o *.o
*.min.js *.min.js
/bouquins bouquins
externals externals
ksql.h bouquins*.tar.gz

View File

@ -7,11 +7,7 @@ build:
- make - make
artifacts: artifacts:
paths: paths:
- '*.o' - bouquins.tar.gz
- bouquins
- '*.min.js'
- '*.html'
- '*.min.js'
expire_in: 1 hour expire_in: 1 hour
tags: tags:
- kcgi - kcgi

View File

@ -60,11 +60,19 @@ sinclude GNUmakefile.local
DATABASE = metadata.db DATABASE = metadata.db
OBJS = db.o db_author.o db_book.o db_series.o json.o main.o OBJS = db.o db_author.o db_book.o db_series.o json.o main.o
EXT = externals
BOOTSTRAP_VERSION = 3.3.7
BOOTSTRAP_DIST = bootstrap-$(BOOTSTRAP_VERSION)-dist
BOOTSTRAP_URL = https://github.com/twbs/bootstrap/releases/download/v$(BOOTSTRAP_VERSION)/$(BOOTSTRAP_DIST).zip
BOOTSTRAP_TMP_ZIP = $(EXT)/bootstrap.zip
VUE_URL = https://vuejs.org/js/vue.min.js
VUEJS = $(EXT)/vue.min.js
HTMLS = index.html book.html author.html series.html search.html HTMLS = index.html book.html author.html series.html search.html
JSMINS = index.min.js book.min.js author.min.js series.min.js search.min.js JSMINS = index.min.js book.min.js author.min.js series.min.js search.min.js $(VUEJS)
EXTJS = externals/vue.min.js CSS = $(EXT)/$(BOOTSTRAP_DIST)/css/bootstrap.min.css
CSS = externals/bootstrap.min.css FONTS = $(EXT)/$(BOOTSTRAP_DIST)/fonts/*
FONTS = externals/fonts/*
CFLAGS += -g -W -Wall -O2 $(SECURE) CFLAGS += -g -W -Wall -O2 $(SECURE)
CFLAGS += -DLOGFILE=\"$(LOGFILE)\" CFLAGS += -DLOGFILE=\"$(LOGFILE)\"
@ -80,10 +88,37 @@ all: $(TARGET) $(HTMLS) $(JSMINS)
api: swagger.json api: swagger.json
$(BOOTSTRAP_TMP_ZIP):
fetch -o $(BOOTSTRAP_TMP_ZIP) $(BOOTSTRAP_URL)
$(EXT)/$(BOOTSTRAP_DIST): $(BOOTSTRAP_TMP_ZIP)
unzip -d $(EXT) $(BOOTSTRAP_TMP_ZIP)
$(VUEJS):
fetch -o $(VUEJS) $(VUE_URL)
$(EXT): $(EXT)/$(BOOTSTRAP_DIST) $(VUEJS)
packwww: $(EXT) $(HTMLS) $(JSMINS)
mkdir -p build build/css build/fonts build/js
cp $(HTMLS) build
cp $(JSMINS) $(VUEJS) build/js
cp $(CSS) build/css
cp $(FONTS) build/fonts
packcgi: $(TARGET)
mkdir -p build/cgi-bin
cp $(TARGET) build/cgi-bin
cp $(OBJS) build/cgi-bin
package: packcgi packwww
tar czf bouquins.tar.gz -C build cgi-bin $(HTMLS) css js fonts
rm -rf build/*
installwww: all installwww: all
mkdir -p $(HTDOCS) $(HTDOCS)/css $(HTDOCS)/fonts $(HTDOCS)/js mkdir -p $(HTDOCS) $(HTDOCS)/css $(HTDOCS)/fonts $(HTDOCS)/js
install -m 0444 $(HTMLS) $(HTDOCS) install -m 0444 $(HTMLS) $(HTDOCS)
install -m 0444 $(JSMINS) $(EXTJS) $(HTDOCS)/js install -m 0444 $(JSMINS) $(HTDOCS)/js
install -m 0444 $(CSS) $(HTDOCS)/css install -m 0444 $(CSS) $(HTDOCS)/css
install -m 0444 $(FONTS) $(HTDOCS)/fonts install -m 0444 $(FONTS) $(HTDOCS)/fonts