~canonical-ci-engineering/ubuntu-ci-services-itself/ansible

« back to all changes in this revision

Viewing changes to .pc/ansible-vault-manpage.patch/Makefile

  • Committer: Package Import Robot
  • Author(s): Harlan Lieberman-Berg
  • Date: 2014-04-01 22:00:24 UTC
  • mfrom: (1.1.9)
  • Revision ID: package-import@ubuntu.com-20140401220024-jkxyhf2ggcv7xmqa
Tags: 1.5.4+dfsg-1
* Pull missing manpages from upstream development branch.
* New upstream version 1.5.4, security update.
* Add patch to correct directory_mode functionality. (Closes: #743027)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/make
 
2
# WARN: gmake syntax
 
3
########################################################
 
4
# Makefile for Ansible
 
5
#
 
6
# useful targets:
 
7
#   make sdist ---------------- produce a tarball
 
8
#   make rpm  ----------------- produce RPMs
 
9
#   make deb ------------------ produce a DEB
 
10
#   make docs ----------------- rebuild the manpages (results are checked in)
 
11
#   make tests ---------------- run the tests
 
12
#   make pyflakes, make pep8 -- source code checks
 
13
 
 
14
########################################################
 
15
# variable section
 
16
 
 
17
NAME = "ansible"
 
18
OS = $(shell uname -s)
 
19
 
 
20
# Manpages are currently built with asciidoc -- would like to move to markdown
 
21
# This doesn't evaluate until it's called. The -D argument is the
 
22
# directory of the target file ($@), kinda like `dirname`.
 
23
MANPAGES := docs/man/man1/ansible.1 docs/man/man1/ansible-playbook.1 docs/man/man1/ansible-pull.1 docs/man/man1/ansible-doc.1 docs/man/man1/ansible-galaxy.1
 
24
ifneq ($(shell which a2x 2>/dev/null),)
 
25
ASCII2MAN = a2x -D $(dir $@) -d manpage -f manpage $<
 
26
ASCII2HTMLMAN = a2x -D docs/html/man/ -d manpage -f xhtml
 
27
else
 
28
ASCII2MAN = @echo "ERROR: AsciiDoc 'a2x' command is not installed but is required to build $(MANPAGES)" && exit 1
 
29
endif
 
30
 
 
31
PYTHON=python
 
32
SITELIB = $(shell $(PYTHON) -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
 
33
 
 
34
# VERSION file provides one place to update the software version
 
35
VERSION := $(shell cat VERSION)
 
36
 
 
37
# Get the branch information from git
 
38
ifneq ($(shell which git),)
 
39
GIT_DATE := $(shell git log -n 1 --format="%ai")
 
40
endif
 
41
 
 
42
ifeq ($(shell echo $(OS) | egrep -c 'Darwin|FreeBSD|OpenBSD'),1)
 
43
DATE := $(shell date -j -r $(shell git log -n 1 --format="%at") +%Y%m%d%H%M)
 
44
else
 
45
DATE := $(shell date --utc --date="$(GIT_DATE)" +%Y%m%d%H%M)
 
46
endif
 
47
 
 
48
# RPM build parameters
 
49
RPMSPECDIR= packaging/rpm
 
50
RPMSPEC = $(RPMSPECDIR)/ansible.spec
 
51
RPMDIST = $(shell rpm --eval '%{?dist}')
 
52
RPMRELEASE = 1
 
53
ifeq ($(OFFICIAL),)
 
54
    RPMRELEASE = 0.git$(DATE)
 
55
endif
 
56
RPMNVR = "$(NAME)-$(VERSION)-$(RPMRELEASE)$(RPMDIST)"
 
57
 
 
58
NOSETESTS ?= nosetests
 
59
 
 
60
########################################################
 
61
 
 
62
all: clean python
 
63
 
 
64
tests:
 
65
        PYTHONPATH=./lib ANSIBLE_LIBRARY=./library  $(NOSETESTS) -d -w test/units -v
 
66
 
 
67
authors:
 
68
        sh hacking/authors.sh
 
69
 
 
70
# Regenerate %.1.asciidoc if %.1.asciidoc.in has been modified more
 
71
# recently than %.1.asciidoc.
 
72
%.1.asciidoc: %.1.asciidoc.in
 
73
        sed "s/%VERSION%/$(VERSION)/" $< > $@
 
74
 
 
75
# Regenerate %.1 if %.1.asciidoc or VERSION has been modified more
 
76
# recently than %.1. (Implicitly runs the %.1.asciidoc recipe)
 
77
%.1: %.1.asciidoc VERSION
 
78
        $(ASCII2MAN)
 
79
 
 
80
loc:
 
81
        sloccount lib library bin
 
82
 
 
83
pep8:
 
84
        @echo "#############################################"
 
85
        @echo "# Running PEP8 Compliance Tests"
 
86
        @echo "#############################################"
 
87
        -pep8 -r --ignore=E501,E221,W291,W391,E302,E251,E203,W293,E231,E303,E201,E225,E261,E241 lib/ bin/
 
88
        -pep8 -r --ignore=E501,E221,W291,W391,E302,E251,E203,W293,E231,E303,E201,E225,E261,E241 --filename "*" library/
 
89
 
 
90
pyflakes:
 
91
        pyflakes lib/ansible/*.py lib/ansible/*/*.py bin/*
 
92
 
 
93
clean:
 
94
        @echo "Cleaning up distutils stuff"
 
95
        rm -rf build
 
96
        rm -rf dist
 
97
        @echo "Cleaning up byte compiled python stuff"
 
98
        find . -type f -regex ".*\.py[co]$$" -delete
 
99
        @echo "Cleaning up editor backup files"
 
100
        find . -type f \( -name "*~" -or -name "#*" \) -delete
 
101
        find . -type f \( -name "*.swp" \) -delete
 
102
        @echo "Cleaning up manpage stuff"
 
103
        find ./docs/man -type f -name "*.xml" -delete
 
104
        find ./docs/man -type f -name "*.asciidoc" -delete
 
105
        find ./docs/man/man3 -type f -name "*.3" -delete
 
106
        @echo "Cleaning up output from test runs"
 
107
        rm -rf test/test_data
 
108
        @echo "Cleaning up RPM building stuff"
 
109
        rm -rf MANIFEST rpm-build
 
110
        @echo "Cleaning up Debian building stuff"
 
111
        rm -rf debian
 
112
        rm -rf deb-build
 
113
        rm -rf docs/json
 
114
        rm -rf docs/js
 
115
        @echo "Cleaning up authors file"
 
116
        rm -f AUTHORS.TXT
 
117
 
 
118
python:
 
119
        $(PYTHON) setup.py build
 
120
 
 
121
install:
 
122
        $(PYTHON) setup.py install
 
123
 
 
124
sdist: clean docs
 
125
        $(PYTHON) setup.py sdist -t MANIFEST.in
 
126
 
 
127
rpmcommon: $(MANPAGES) sdist
 
128
        @mkdir -p rpm-build
 
129
        @cp dist/*.gz rpm-build/
 
130
        @sed -e 's#^Version:.*#Version: $(VERSION)#' -e 's#^Release:.*#Release: $(RPMRELEASE)%{?dist}#' $(RPMSPEC) >rpm-build/$(NAME).spec
 
131
 
 
132
srpm: rpmcommon
 
133
        @rpmbuild --define "_topdir %(pwd)/rpm-build" \
 
134
        --define "_builddir %{_topdir}" \
 
135
        --define "_rpmdir %{_topdir}" \
 
136
        --define "_srcrpmdir %{_topdir}" \
 
137
        --define "_specdir $(RPMSPECDIR)" \
 
138
        --define "_sourcedir %{_topdir}" \
 
139
        -bs rpm-build/$(NAME).spec
 
140
        @rm -f rpm-build/$(NAME).spec
 
141
        @echo "#############################################"
 
142
        @echo "Ansible SRPM is built:"
 
143
        @echo "    rpm-build/$(RPMNVR).src.rpm"
 
144
        @echo "#############################################"
 
145
 
 
146
rpm: rpmcommon
 
147
        @rpmbuild --define "_topdir %(pwd)/rpm-build" \
 
148
        --define "_builddir %{_topdir}" \
 
149
        --define "_rpmdir %{_topdir}" \
 
150
        --define "_srcrpmdir %{_topdir}" \
 
151
        --define "_specdir $(RPMSPECDIR)" \
 
152
        --define "_sourcedir %{_topdir}" \
 
153
        --define "_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm" \
 
154
        --define "__python `which $(PYTHON)`" \
 
155
        -ba rpm-build/$(NAME).spec
 
156
        @rm -f rpm-build/$(NAME).spec
 
157
        @echo "#############################################"
 
158
        @echo "Ansible RPM is built:"
 
159
        @echo "    rpm-build/$(RPMNVR).noarch.rpm"
 
160
        @echo "#############################################"
 
161
 
 
162
debian: sdist
 
163
deb: debian
 
164
        cp -r packaging/debian ./
 
165
        chmod 755 debian/rules
 
166
        fakeroot debian/rules clean
 
167
        fakeroot dh_install
 
168
        fakeroot debian/rules binary
 
169
 
 
170
# for arch or gentoo, read instructions in the appropriate 'packaging' subdirectory directory
 
171
 
 
172
webdocs: $(MANPAGES)
 
173
        (cd docsite/; make docs)
 
174
 
 
175
docs: $(MANPAGES)