-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (47 loc) · 2.12 KB
/
Makefile
File metadata and controls
56 lines (47 loc) · 2.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
SHELL := /bin/bash
VERSION := $(shell cat VERSION)
DEPENDENCIES := curl, ip, php8-cgi, php8-mod-curl, lighttpd, lighttpd-mod-cgi, lighttpd-mod-setenv, lighttpd-mod-rewrite
ROOT_DIR := /opt
.PHONY: clean _web-clean _web-control _web-scripts _web-ipk web4static-ipk
clean:
rm -rf out/web
_web-clean:
rm -rf out/$(BUILD_DIR)
mkdir -p out/$(BUILD_DIR)/control
mkdir -p out/$(BUILD_DIR)/data
_web-control:
echo "Package: web4static" > out/$(BUILD_DIR)/control/control
echo "Version: $(VERSION)" >> out/$(BUILD_DIR)/control/control
echo "Depends: $(DEPENDENCIES)" >> out/$(BUILD_DIR)/control/control
echo "License: MIT" >> out/$(BUILD_DIR)/control/control
echo "Section: net" >> out/$(BUILD_DIR)/control/control
echo "URL: https://github.com/spatiumstas/web4static" >> out/$(BUILD_DIR)/control/control
echo "Architecture: all" >> out/$(BUILD_DIR)/control/control
echo "Description: Web interface" >> out/$(BUILD_DIR)/control/control
echo "" >> out/$(BUILD_DIR)/control/control
echo "/opt/etc/lighttpd/conf.d/80-w4s.conf" > out/$(BUILD_DIR)/control/conffiles
echo "/opt/etc/lighttpd/conf.d/81-w4s-local.conf" >> out/$(BUILD_DIR)/control/conffiles
_web-scripts:
cp web/ipk/postinst out/$(BUILD_DIR)/control/postinst;
chmod +x out/$(BUILD_DIR)/control/postinst
cp web/ipk/postrm out/$(BUILD_DIR)/control/postrm;
chmod +x out/$(BUILD_DIR)/control/postrm
_web-ipk:
make _web-clean
make _web-control
make _web-scripts
cd out/$(BUILD_DIR)/control; tar czvf ../control.tar.gz .; cd ../../..
mkdir -p out/$(BUILD_DIR)/data$(ROOT_DIR)
cp -r web/share out/$(BUILD_DIR)/data$(ROOT_DIR)/share
mkdir -p out/$(BUILD_DIR)/data$(ROOT_DIR)/etc/lighttpd/conf.d
cp web/etc/lighttpd/conf.d/80-w4s.conf out/$(BUILD_DIR)/data$(ROOT_DIR)/etc/lighttpd/conf.d/80-w4s.conf
cp web/etc/lighttpd/conf.d/81-w4s-local.conf out/$(BUILD_DIR)/data$(ROOT_DIR)/etc/lighttpd/conf.d/81-w4s-local.conf
cd out/$(BUILD_DIR)/data; tar czvf ../data.tar.gz .; cd ../../..
echo 2.0 > out/$(BUILD_DIR)/debian-binary
cd out/$(BUILD_DIR); \
tar czvf ../web4static_$(VERSION).ipk control.tar.gz data.tar.gz debian-binary; \
cd ../..
web4static-ipk:
@make \
BUILD_DIR=web \
_web-ipk