~landscape/landscape-client/master

« back to all changes in this revision

Viewing changes to Makefile

  • Committer: GitHub
  • Author(s): Eric Snow
  • Date: 2017-04-26 20:43:03 UTC
  • mfrom: (1027.2.6)
  • Revision ID: git-v1:6875fab8cbdbe8e0b64f4e4037ca5062c3fecc5f
Merge pull request #1 from ericsnowcurrently/git-makefile

Update the make file to be git-centric.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
PYTHON3 ?= python3
5
5
TRIAL ?= $(shell which trial)
6
6
TRIAL_ARGS ?=
7
 
UBUNTU_RELEASE := $(shell lsb_release -cs)
8
 
# version in the code is authoritative
9
 
# Use := here, not =, it's really important, otherwise UPSTREAM_VERSION
10
 
# will be updated behind your back with the current result of that
11
 
# command everytime it is mentioned/used.
12
 
UPSTREAM_VERSION := $(shell python -c "from landscape import UPSTREAM_VERSION; print UPSTREAM_VERSION")
13
 
CHANGELOG_VERSION := $(shell dpkg-parsechangelog | grep ^Version | cut -f 2 -d " " | cut -f 1 -d '-')
14
 
BZR_REVNO := $(shell bzr revno)
15
 
ifeq (+bzr,$(findstring +bzr,$(UPSTREAM_VERSION)))
16
 
TARBALL_VERSION := $(UPSTREAM_VERSION)
17
 
else
18
 
TARBALL_VERSION := $(UPSTREAM_VERSION)+bzr$(BZR_REVNO)
19
 
endif
20
7
 
21
8
.PHONY: help
22
9
help:  ## Print help about available targets
23
 
        @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
 
10
        @grep -h -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
24
11
 
25
12
.PHONY: depends
26
13
depends: depends2 depends3  ## Install py2 and py3 dependencies.
107
94
        LC_ALL=C ${TXT2MAN} -P Landscape -s 1 -t landscape-config < man/landscape-config.txt > man/landscape-config.1
108
95
        LC_ALL=C ${TXT2MAN} -P Landscape -s 1 -t landscape-sysinfo < man/landscape-sysinfo.txt > man/landscape-sysinfo.1
109
96
 
110
 
origtarball: sdist
111
 
        cp -f sdist/landscape-client-$(TARBALL_VERSION).tar.gz \
112
 
                ../landscape-client_$(TARBALL_VERSION).orig.tar.gz
113
 
 
114
 
prepchangelog:
115
 
# add a temporary entry for a local build if needed
116
 
ifeq (,$(findstring +bzr,$(CHANGELOG_VERSION)))
117
 
        dch -v $(TARBALL_VERSION)-0ubuntu0 "New local test build" --distribution $(UBUNTU_RELEASE)
118
 
else
119
 
# just update the timestamp
120
 
        dch --distribution $(UBUNTU_RELEASE) --release $(UBUNTU_RELEASE)
121
 
endif
122
 
 
123
 
updateversion:
124
 
        sed -i -e "s/^UPSTREAM_VERSION.*/UPSTREAM_VERSION = \"$(TARBALL_VERSION)\"/g" \
125
 
                landscape/__init__.py
126
 
 
127
 
package: clean prepchangelog updateversion
128
 
        debuild -b $(DEBUILD_OPTS)
129
 
 
130
 
sourcepackage: clean origtarball prepchangelog updateversion
131
 
        # need to remove sdist here because it doesn't exist in the
132
 
        # orig tarball
133
 
        rm -rf sdist
134
 
        debuild -S $(DEBUILD_OPTS)
135
 
 
136
97
MESSAGE_DIR = `pwd`/runclient-messages
137
98
LOG_FILE = `pwd`/runclient.log
138
99
 
 
100
.PHONY: freshdata
139
101
freshdata:
140
102
        -sudo rm -rf $(MESSAGE_DIR)
141
103
        -sudo mkdir $(MESSAGE_DIR)
142
104
 
 
105
.PHONY: run
143
106
run:
144
107
        -sudo ./landscape-client \
145
108
                -a onward -t "John's PC" \
149
112
                --log-level=debug \
150
113
                --ping-url=http://localhost:8081/ping \
151
114
 
 
115
.PHONY: freshrun
152
116
freshrun: freshdata run
153
117
 
 
118
.PHONY: tags
154
119
tags:
155
120
        -ctags --languages=python -R .
156
121
 
 
122
.PHONY: etags
157
123
etags:
158
124
        -etags --languages=python -R .
159
125
 
160
 
releasetarball:
161
 
        make sdist TARBALL_VERSION=$(UPSTREAM_VERSION)
162
 
 
163
 
sdist: clean
164
 
        mkdir -p sdist
165
 
        # --uncommitted because we want any changes the developer might have made
166
 
        # locally to be included in the package without having to commit
167
 
        bzr export --uncommitted sdist/landscape-client-$(TARBALL_VERSION)
168
 
        rm -rf sdist/landscape-client-$(TARBALL_VERSION)/debian
169
 
        sed -i -e "s/^UPSTREAM_VERSION.*/UPSTREAM_VERSION = \"$(TARBALL_VERSION)\"/g" \
170
 
                sdist/landscape-client-$(TARBALL_VERSION)/landscape/__init__.py
171
 
        cd sdist && tar cfz landscape-client-$(TARBALL_VERSION).tar.gz landscape-client-$(TARBALL_VERSION)
172
 
        cd sdist && md5sum landscape-client-$(TARBALL_VERSION).tar.gz > landscape-client-$(TARBALL_VERSION).tar.gz.md5
173
 
        rm -rf sdist/landscape-client-$(TARBALL_VERSION)
174
 
 
175
 
.PHONY: tags etags freshdata run freshrun package sourcepackage updateversion origtarball prepchangelog lint releasetarball
 
126
include Makefile.packaging
 
127
 
176
128
.DEFAULT_GOAL := help