| 1 | #!/usr/bin/make -f |
| 2 | |
| 3 | include /usr/share/dpkg/pkg-info.mk # DEB_VERSION |
| 4 | |
| 5 | PKG = github.com/mailru/easyjson |
| 6 | BIN = $(CURDIR)/build/bin |
| 7 | SRC = $(CURDIR)/build/src/$(PKG) |
| 8 | export GO111MODULE = off |
| 9 | export GOPATH = $(CURDIR)/build |
| 10 | export GOCACHE = $(CURDIR)/build/cache |
| 11 | |
| 12 | %: |
| 13 | dh $@ --buildsystem=golang --builddirectory=build |
| 14 | |
| 15 | override_dh_auto_test: |
| 16 | |
| 17 | execute_after_dh_auto_build: |
| 18 | echo $$GO111MODULE $$GOPATH |
| 19 | $(BIN)/easyjson -stubs \ |
| 20 | $(SRC)/tests/snake.go \ |
| 21 | $(SRC)/tests/data.go \ |
| 22 | $(SRC)/tests/omitempty.go \ |
| 23 | $(SRC)/tests/nothing.go \ |
| 24 | $(SRC)/tests/named_type.go \ |
| 25 | $(SRC)/tests/custom_map_key_type.go \ |
| 26 | $(SRC)/tests/embedded_type.go \ |
| 27 | $(SRC)/tests/reference_to_pointer.go |
| 28 | $(BIN)/easyjson -all $(SRC)/tests/data.go |
| 29 | $(BIN)/easyjson -all $(SRC)/tests/nothing.go |
| 30 | $(BIN)/easyjson -all $(SRC)/tests/errors.go |
| 31 | $(BIN)/easyjson -snake_case $(SRC)/tests/snake.go |
| 32 | $(BIN)/easyjson -omit_empty $(SRC)/tests/omitempty.go |
| 33 | $(BIN)/easyjson -build_tags=use_easyjson $(SRC)/benchmark/data.go |
| 34 | $(BIN)/easyjson $(SRC)/tests/nested_easy.go |
| 35 | $(BIN)/easyjson $(SRC)/tests/named_type.go |
| 36 | $(BIN)/easyjson $(SRC)/tests/custom_map_key_type.go |
| 37 | $(BIN)/easyjson $(SRC)/tests/embedded_type.go |
| 38 | $(BIN)/easyjson $(SRC)/tests/reference_to_pointer.go |
| 39 | $(BIN)/easyjson $(SRC)/tests/key_marshaler_map.go |
| 40 | $(BIN)/easyjson -disallow_unknown_fields \ |
| 41 | $(SRC)/tests/disallow_unknown.go |
| 42 | |
| 43 | B = $(CURDIR)/debian/tmp/usr/bin |
| 44 | M = $(CURDIR)/debian/tmp/usr/share/man/man1 |
| 45 | |
| 46 | ifeq (,$(filter nodoc,$(DEB_BUILD_PROFILES))) |
| 47 | execute_before_dh_installman-arch: |
| 48 | mkdir -pv $(M) |
| 49 | help2man --version-string="$(DEB_VERSION)" \ |
| 50 | --no-info --no-discard-stderr \ |
| 51 | --name="Fast JSON serializer for Go" \ |
| 52 | --output $(M)/easyjson.1 \ |
| 53 | $(B)/easyjson |
| 54 | endif |