File: rules

package info (click to toggle)
openrct2-objects 1.6.1%2Bdfsg-1
  • links: PTS, VCS
  • area: contrib
  • in suites: trixie
  • size: 23,756 kB
  • sloc: python: 307; sh: 71; makefile: 25
file content (35 lines) | stat: -rwxr-xr-x 1,116 bytes parent folder | download | duplicates (5)
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
#!/usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk

BUILD_DATE := $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "+%Y-%m-%d %H:%M:%S %z")

%:
	dh $@

# Upstream relies on a powershell script to create the zip archives.
# Implement equivalent logic here in d/rules

override_dh_auto_clean:
	dh_auto_clean
	rm -rf artifacts

override_dh_auto_build:
	mkdir -m 755 -p artifacts/objects
	find objects/ -type f | xargs chmod 644
	find objects/ -type d | xargs chmod 755
	find objects/ | xargs touch --no-dereference --date='$(BUILD_DATE)'
	for DIR in "official" "rct1" "rct2" "rct2ww" "rct2tt"; do \
	  cp -ar objects/$$DIR artifacts/objects/; \
	done
	WORK_DIR=$$(pwd); \
	for OBJ in $$(find artifacts/objects/ -name object.json); do \
	  DIR_TO_ZIP=$$(dirname $$OBJ); \
	  DIR_NAME=$$(basename $$DIR_TO_ZIP); \
	  ORDERED_FILES=$$(cd $$DIR_TO_ZIP/ && find . ! -path . -type f | sort | tr '\n' ' '); \
	  cd $$DIR_TO_ZIP/ && TZ=UTC zip -9 -roX ../$$DIR_NAME.parkobj $$ORDERED_FILES && cd $$WORK_DIR; \
	  rm -rf $$DIR_TO_ZIP; \
	done

override_dh_auto_install:
	dh_install artifacts/objects/* usr/share/openrct2/object/