summaryrefslogtreecommitdiff
path: root/debian/rules
blob: 9f107bf7e8799b6b2286ec89e86aebed555b8b9e (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
35
36
37
38
39
40
41
42
43
#!/usr/bin/make -f

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure --parallel --	\
		-DENABLE_GLUT=ON	\
		-DENABLE_GTK=ON		\
		-DENABLE_QT=ON		\
		-DENABLE_TOOLS=ON	\
		-DENABLE_TTF=ON		\
		-DENABLE_DATA=OFF       \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \

override_dh_auto_install:
	dh_auto_install
	set -x; for r in 128 64 48 32 24 16; do \
		mkdir -p debian/tmp/usr/share/icons/hicolor/$${r}x$${r}/apps && \
		convert celestia-logo.png -scale $${r}x$${r} debian/tmp/usr/share/icons/hicolor/$${r}x$${r}/apps/celestia.png ; \
	done

override_dh_dwz:
	: # Unknown DWARF DW_OP_255 referenced from DIE

PACKAGE      := celestia
GIT_REPO     := https://github.com/CelestiaProject/Celestia.git
DEBIAN_PATH  := $(abspath $(dir $(firstword $(MAKEFILE_LIST))))
SRC_VERSION  := $(shell dpkg-parsechangelog -l$(DEBIAN_PATH)/changelog | awk '/^Version:/ {sub(/-[^-]*/, "", $$2); print $$2}')
GIT_REVISION := $(shell echo $(SRC_VERSION) | sed -r 's,.+git\.(\w+).*,\1,')
TARBALL      := $(PACKAGE)_$(SRC_VERSION).orig.tar.xz
.PHONY: get-orig-source
get-orig-source:
	rm -rf get-orig-source $(TARBALL) && mkdir get-orig-source
	git clone $(GIT_REPO) get-orig-source/$(PACKAGE)-$(SRC_VERSION)
	git -C get-orig-source/$(PACKAGE)-$(SRC_VERSION) checkout $(GIT_REVISION)
	find get-orig-source/$(PACKAGE)-$(SRC_VERSION) -name '.*' -print0 | xargs -0 --no-run-if-empty rm -rfv
	cd get-orig-source/$(PACKAGE)-$(SRC_VERSION) && \
		rm -rf azure-pipelines.yml debian fonts && \
		sed -i '/add_subdirectory(fonts)/d' CMakeLists.txt
	tar cJf $(TARBALL) -C get-orig-source $(PACKAGE)-$(SRC_VERSION)
	rm -rf get-orig-source
	@echo "  "$(TARBALL)" created; move it to the right destination to build the package"