summaryrefslogtreecommitdiff
path: root/packaging/debs/apt-repository/Makefile
blob: dbf8871a51a0c12d4946a7f860019dfee4760266 (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
PACKAGES_DIR ?= ../../../PACKAGES
REPO_DIR ?= debian

SIGNING_KEY ?= default

ifeq "$(UNOFFICIAL_RELEASE)" ""
HOME_ARG = HOME=$(GNUPG_PATH)
endif

all: debian_apt_repository

clean:
	rm -rf $(REPO_DIR)

CAN_HAS_REPREPRO=$(shell [ -f /usr/bin/reprepro ] && echo true)
ifeq ($(CAN_HAS_REPREPRO), true)
debian_apt_repository: clean
	mkdir -p $(REPO_DIR)/conf
	cp -a distributions $(REPO_DIR)/conf
ifeq "$(UNOFFICIAL_RELEASE)" ""
	echo SignWith: $(SIGNING_KEY) >> $(REPO_DIR)/conf/distributions
endif
	for FILE in $(PACKAGES_DIR)/*.changes ; do \
		$(HOME_ARG) reprepro --ignore=wrongdistribution \
			-Vb $(REPO_DIR) include kitten $${FILE} ; \
	done
	reprepro -Vb $(REPO_DIR) createsymlinks
else
debian_apt_repository:
	@echo Not building APT repository as reprepro could not be found
endif