-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.am
115 lines (94 loc) · 2.75 KB
/
Makefile.am
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
EXTRA_DIST= \
AUTHORS \
COPYING \
README \
README.md \
MANIFEST.in \
setup.py.in \
autogen.sh \
$(PACKAGE).spec.in \
otestpoint \
debian \
scripts
BUILT_SOURCES = \
setup.py \
$(PACKAGE).spec \
otestpoint/mgen/mgen_pb2.py
all-local:
$(PYTHON) setup.py build
dist-hook:
find $(distdir) -name "*_pb2.py" -delete
clean-local: setup.py cleandeb
$(PYTHON) setup.py clean
-rm -rf build
-rm -rf dist
-rm -f $(BUILT_SOURCES)
-find . -name "*.pyc" -delete
-rm -rf opentestpoint_probe_mgen.egg-info
-rm -f opentestpoint-probe-mgen-*.tar.gz
-rm -f $(PACKAGE).spec
-rm -rf .rpmbuild
-rm -rf .debbuild
-rm -f debian/changelog
-rm -f .installedfiles
DISTCLEANFILES=setup.py
sdist:
$(PYTHON) setup.py sdist
edit = sed \
-e 's|@VERSION[@]|$(VERSION)|g' \
-e 's|@PYTHON[@]|$(PYTHON)|g' \
-e 's|@DEBIAN_VERSION[@]|$(DEBIAN_VERSION)|g' \
-e 's|@DATE_RFC2822[@]|$(DATE_RFC2822)|g'
setup.py: setup.py.in
if test -f $@; then chmod u+w $@; fi
$(edit) $< > $@
chmod g-w,u-w $@
install-exec-hook: $(BUILT_SOURCES)
$(PYTHON) setup.py install \
-O1 \
--single-version-externally-managed \
--record .installedfiles \
--prefix=$(prefix) \
--exec-prefix=$(exec_prefix) \
$(if $(DESTDIR),--root=$(DESTDIR))
uninstall-hook:
if test -f .installedfiles; then xargs -a .installedfiles rm -f; fi
RPMARCH=`arch`
if HAVE_RPMBUILD
rpm: $(PACKAGE).spec dist-gzip
mkdir -p .rpmbuild/BUILD \
.rpmbuild/SPECS \
.rpmbuild/SOURCES \
.rpmbuild/SRPMS \
.rpmbuild/RPMS/noarch \
.rpmbuild/tmp
cp -f $(PACKAGE)-$(VERSION).tar.gz .rpmbuild/SOURCES
rpmbuild --clean -ba $(top_srcdir)/$(PACKAGE).spec --target $(RPMARCH) \
--define "_topdir $$PWD/.rpmbuild" \
--define "_tmppath $$PWD/.rpmbuild/tmp"
@echo "============================================================"
@echo "RPMs located in .rpmbuild/RPMS and .rpmbuild/SRPMS"
endif
if HAVE_DEB
deb: dist-gzip
rm -rf .debbuild
mkdir -p .debbuild
cp -f $(PACKAGE)-$(VERSION).tar.gz .debbuild
cd .debbuild && tar xzf $(PACKAGE)-$(VERSION).tar.gz
$(edit) .debbuild/$(PACKAGE)-$(VERSION)/debian/changelog.in > \
.debbuild/$(PACKAGE)-$(VERSION)/debian/changelog
cd .debbuild/$(PACKAGE)-$(VERSION) && dpkg-buildpackage -F -us -uc
@echo "============================================================"
@echo "debs located in .debbuild"
cleandeb:
dh_clean
else
cleandeb:
endif
$(PACKAGE).spec: $(PACKAGE).spec.in
if test -f $@; then chmod u+w $@; fi
$(edit) $< > $@
chmod g-w,u-w $@
otestpoint/mgen/mgen_pb2.py: otestpoint/mgen/mgen.proto
protoc -I. -I=otestpoint/mgen -I=$(libotestpoint_PROTODIR) --python_out=. $<
sed -i -e 's/import measurementtable_pb2/from otestpoint.interface import measurementtable_pb2/' $@