2 # This file and its contents are supplied under the terms of the
3 # Common Development and Distribution License ("CDDL)". You may
4 # only use this file in accordance with the terms of the CDDL.
6 # A full copy of the text of the CDDL should have accompanied this
7 # source. A copy of the CDDL is also available via the Internet at
8 # http://www.illumos.org/license/CDDL.
12 # Copyright 2013 Adam Stevko. All rights reserved.
15 include ..
/..
/..
/make-rules
/shared-macros.mk
18 COMPONENT_SRC
= $(COMPONENT_NAME
)
20 COMPONENT_REVISION
=$(shell cd
$(COMPONENT_SRC
); git rev-list HEAD
--count
)
23 GIT_REPO
=https
://github.com
/OpenIndiana
/pkg5.git
29 PKG_REPO
=$(SOURCE_DIR
)/packages
/$(MACH
)/repo
31 DEVBOOK
=$(SOURCE_DIR
)/proto
/dev-guide
/book.pdf
33 CLEAN_PATHS
+= $(BUILD_DIR
)
34 CLOBBER_PATHS
+= $(SOURCE_DIR
)
37 include $(WS_TOP
)/make-rules
/prep.mk
39 $(SOURCE_DIR
)/.downloaded
: component-environment-prep
$(ARCHIVES
:%=$(USERLAND_ARCHIVES
)%)
40 @
[ -d
$(SOURCE_DIR
) ] || \
41 $(GIT
) clone
-b
$(GIT_BRANCH
) $(GIT_REPO
) $(SOURCE_DIR
)
42 @cd
$(SOURCE_DIR
); $(GIT
) checkout
$(GIT_BRANCH
); $(GIT
) pull \
43 $(GIT_REPO
); $(GIT
) log
-1 --format
=%H
> .downloaded
46 @
[ -d
$(SOURCE_DIR
) ] || \
47 $(GIT
) clone
-b
$(GIT_BRANCH
) $(GIT_REPO
) $(SOURCE_DIR
)
48 cd
$(SOURCE_DIR
); $(GIT
) pull
$(GIT_REPO
); \
49 [ $$($(GIT
) log
-1 --format
=%H
) == $$(cat .downloaded
) ] || \
50 $(GIT
) log
-1 --format
=%H
> .downloaded
52 download
:: $(SOURCE_DIR
)/.downloaded
54 $(BUILD_DIR
)/$(MACH
)/.built
: $(SOURCE_DIR
)/.downloaded
56 cd
$(SOURCE_DIR
)/src
&& \
57 PATH
=$(PATH
) $(MAKE
) && PATH
=$(PATH
) $(MAKE
) install && \
60 $(MAKE
) BUILD_VERSION
=$(BUILD_VERSION
) && \
61 $(MAKE
) publish-pkgs BUILD_VERSION
=$(BUILD_VERSION
) && \
62 $(MAKE
) repository-metadata
&& \
65 # Target to generate developer's guide
68 $(DEVBOOK
): $(SOURCE_DIR
)/.downloaded
69 cd
$(SOURCE_DIR
)/doc
/dev-guide
&& \
72 build
install: $(BUILD_DIR
)/$(MACH
)/.built
74 $(BUILD_DIR
)/$(MACH
)/publish.transforms
: $(BUILD_DIR
)/$(MACH
)/.built
75 echo
"<transform set name=pkg.fmri -> edit value pkg://[^/]+/ pkg://$(PUBLISHER)/>" > \
76 $(BUILD_DIR
)/$(MACH
)/publish.transforms
77 echo
"<transform set name=pkg.fmri -> edit value ,.+: ,$(BUILD_VERSION):>" >> \
78 $(BUILD_DIR
)/$(MACH
)/publish.transforms
79 echo
"<transform set name=pkg.fmri -> emit set name=pkg5.info.git-remote value=$(GIT_REPO)>" >> \
80 $(BUILD_DIR
)/$(MACH
)/publish.transforms
81 echo
"<transform set name=pkg.fmri -> emit set name=pkg5.info.git-branch value=$(GIT_BRANCH)>" >> \
82 $(BUILD_DIR
)/$(MACH
)/publish.transforms
83 echo
"<transform set name=pkg.fmri -> emit set name=pkg5.info.git-rev value=$(shell cd $(COMPONENT_SRC); git rev-parse HEAD)>" >> \
84 $(BUILD_DIR
)/$(MACH
)/publish.transforms
86 echo
"<transform set name=pkg.fmri -> emit set name=pkg.human-version value=$(shell cd $(COMPONENT_SRC); git rev-parse HEAD | cut -c1-8)>" >> \
87 $(BUILD_DIR
)/$(MACH
)/publish.transforms
88 echo
"<transform set name=pkg.fmri -> emit set name=userland.info.component value=$(COMPONENT)>" >> \
89 $(BUILD_DIR
)/$(MACH
)/publish.transforms
92 $(BUILD_DIR
)/$(MACH
)/.published
: $(BUILD_DIR
)/$(MACH
)/publish.transforms
93 if
[ -d
$(@D
)/pkgrecv.
dir ]; then
$(RM
) -r
$(@D
)/pkgrecv.
dir; fi
94 $(MKDIR
) $(@D
)/pkgrecv.
dir
96 pkgrecv
-s
$(PKG_REPO
) -d
$(@D
)/pkgrecv.
dir --raw \
97 $$(pkgrecv
-s
$(PKG_REPO
) --newest
)
99 for pkg in
$$(echo
$(@D
)/pkgrecv.
dir/*/*); do \
100 pkgmogrify
-O
$$pkg/manifest
$$pkg/manifest \
101 $(BUILD_DIR
)/$(MACH
)/publish.transforms
; \
102 pkgsend
-s
$(WS_REPO
) publish
--fmri-in-manifest \
103 -d
$(BUILD_DIR
)/$(MACH
)/overlay
-d
$$pkg $$pkg/manifest
; \
110 publish
: update
$(BUILD_DIR
)/$(MACH
)/.published update-metadata
113 if
test -d
$(PKG_REPO
); then \
114 pkgrepo list
-H
-F tsv
-s
$(PKG_REPO
) \
119 # Manually added dependencies
120 REQUIRED_PACKAGES
+= developer
/opensolaris
/pkg5
121 REQUIRED_PACKAGES
+= system
/zones
/internal
122 REQUIRED_PACKAGES
+= library
/python
/cherrypy-39
123 REQUIRED_PACKAGES
+= library
/python
/python-rapidjson-39
124 REQUIRED_PACKAGES
+= library
/python
/jsonschema-39
125 REQUIRED_PACKAGES
+= library
/python
/jsonrpclib-pelix-39
126 REQUIRED_PACKAGES
+= library
/python
/six-39