File: Makefile

package info (click to toggle)
google-android-installers 1472023576
  • links: PTS, VCS
  • area: contrib
  • in suites: stretch
  • size: 1,356 kB
  • ctags: 99
  • sloc: sh: 1,972; python: 722; makefile: 165
file content (44 lines) | stat: -rw-r--r-- 1,433 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
36
37
38
39
40
41
42
43
44
PKG_SOURCE_URL:=${DL_MIRROR}/android/repository/${PKG_SOURCE}

DL_DIR=/var/cache/google-android-${PKG_NAME}-installer
INSTALL_DIR=/usr/lib/${INS_DIR}
DOC_DIR=/usr/share/doc/google-android-${PKG_NAME}

all: $(UNPACK_DIR)/source.properties

install: all
	$(eval UNPACK_DIR=$(DL_DIR)/$(shell unzip -Z -1 $(DL_DIR)/$(PKG_SOURCE) | head -1))
	install -d -m0755 $(DOC_DIR)
	@if [ -f $(UNPACK_DIR)source.properties ]; then \
		install -m0644 $(UNPACK_DIR)source.properties $(DOC_DIR)/ ; \
        fi
	@if [ -f $(UNPACK_DIR)NOTICE.txt ]; then \
		gzip -9 --stdout $(UNPACK_DIR)/NOTICE.txt > $(DOC_DIR)/copyright.gz ; \
        fi
	find ${DOC_DIR} | sort >> /var/lib/dpkg/info/google-android-${PKG_NAME}-installer.list
	chmod -R a+rX $(UNPACK_DIR)
	chmod -R go-w $(UNPACK_DIR)
	install -d -m0755 $(INSTALL_DIR)
	@if [ ! -d $(INSTALL_DIR)$(TRG_DIR) ]; then \
		mv $(UNPACK_DIR) $(INSTALL_DIR)${TRG_DIR}  ;\
		find ${INSTALL_DIR}${TRG_DIR}  | sort >> /var/lib/dpkg/info/google-android-${PKG_NAME}-installer.list ;\
	else\
		echo "\033[0;31m$(INSTALL_DIR)${TRG_DIR} already exists.\033[0m" ; \
		exit 1 ; \
	fi

$(UNPACK_DIR)/source.properties: $(DL_DIR)/$(PKG_SOURCE)
	cd $(DL_DIR) && unzip -ou $(PKG_SOURCE)

$(DL_DIR)/$(PKG_SOURCE):
	cd $(DL_DIR) && \
		su nobody -s /bin/sh -c "wget --continue $(PKG_SOURCE_URL)"
	sha1sum -c $(PKG_SOURCE).sha1

clean:
	-rm -rf -- $(UNPACK_DIR)

distclean: clean
	-rm -rf -- $(DL_DIR)

.PHONY: install clean