summaryrefslogtreecommitdiff
path: root/config.mk
blob: b48b3a9bc0503cb7727f331ff15d9a97f0d72629 (plain)
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
PACKAGE_NAME = debmake-doc
LOCALE = en

SRC_INFO_PLIST_IN = $(SOURCE_DIR)/Info.plist.in
SRC_ICON_FILE = $(SOURCE_DIR)/icon.png

# TODO latest version should not have to be manually determined
VERSION = 1.17
MANUAL_URL = https://salsa.debian.org/debian/debmake-doc/-/archive/upstream/$(VERSION)/debmake-doc-upstream-$(VERSION).tar.gz
MANUAL_SRC = tmp/$(PACKAGE_NAME)-upstream-$(VERSION)
MANUAL_FILE = $(MANUAL_SRC)/basedir/html

$(MANUAL_SRC): tmp
	curl -o $@.tar.gz $(MANUAL_URL)
	tar -x -z -f $@.tar.gz -C tmp

$(MANUAL_FILE): $(MANUAL_SRC)
	cd $(MANUAL_SRC) && make html css LANGALL=$(LOCALE)

$(DOCUMENTS_DIR): $(RESOURCES_DIR) $(MANUAL_FILE)
	mkdir -p $@
	cp -r $(MANUAL_FILE)/* $@

.INTERMEDIATE: $(SRC_INFO_PLIST_FILE)
$(SRC_INFO_PLIST_FILE): $(SRC_INFO_PLIST_IN) $(CONTENTS_DIR)
	head -n -2 $(SRC_INFO_PLIST_IN) > $@
	echo "	<key>dashIndexFilePath</key>" >> $@
	echo "	<string>index.$(LOCALE).html</string>" >> $@
	echo "</dict>" >> $@
	echo "</plist>" >> $@

$(INDEX_FILE): $(wildcard $(SOURCE_DIR)/src/*.sh) $(DOCUMENTS_DIR)
	rm -f $@
	$(SOURCE_DIR)/src/index.sh $@ $(DOCUMENTS_DIR)/*.html