forked from Oneiroi/appliance-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (40 loc) · 2.03 KB
/
Makefile
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
VERSION = 004
INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL}
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_SCRIPT = ${INSTALL_PROGRAM}
INSTALL_PYTHON = ${INSTALL} -m 644
define COMPILE_PYTHON
python -c "import compileall as c; c.compile_dir('$(1)', force=1)"
python -O -c "import compileall as c; c.compile_dir('$(1)', force=1)"
endef
PYTHONDIR := $(shell python -c "import distutils.sysconfig as d; print d.get_python_lib()")
all:
man:
pod2man --section=8 --release="appliance-tools $(VERSION)" --center "Appliance Tools" docs/appliance-creator.pod > docs/appliance-creator.8
pod2man --section=8 --release="appliance-tools $(VERSION)" --center "Appliance Tools" docs/ec2-converter.pod > docs/ec2-converter.8
install: man
$(INSTALL_PROGRAM) -D tools/appliance-creator $(DESTDIR)/usr/bin/appliance-creator
$(INSTALL_PROGRAM) -D tools/image-minimizer $(DESTDIR)/usr/bin/image-minimizer
$(INSTALL_PROGRAM) -D tools/ec2-converter $(DESTDIR)/usr/bin/ec2-converter
$(INSTALL_DATA) -D README $(DESTDIR)/usr/share/doc/appliance-tools-$(VERSION)/README
$(INSTALL_DATA) -D COPYING $(DESTDIR)/usr/share/doc/appliance-tools-$(VERSION)/COPYING
mkdir -p $(DESTDIR)/usr/share/appliance-tools/
mkdir -p $(DESTDIR)/$(PYTHONDIR)/appcreate
mkdir -p $(DESTDIR)/$(PYTHONDIR)/ec2convert
$(INSTALL_PYTHON) -D appcreate/*.py $(DESTDIR)/$(PYTHONDIR)/appcreate/
$(INSTALL_PYTHON) -D ec2convert/*.py $(DESTDIR)/$(PYTHONDIR)/ec2convert/
$(call COMPILE_PYTHON,$(DESTDIR)/$(PYTHONDIR)/appcreate)
$(call COMPILE_PYTHON,$(DESTDIR)/$(PYTHONDIR)/ec2convert)
mkdir -p $(DESTDIR)/usr/share/man/man8
$(INSTALL_DATA) -D docs/*.8 $(DESTDIR)/usr/share/man/man8
uninstall:
rm -f $(DESTDIR)/usr/bin/appliance-creator
rm -f $(DESTDIR)/usr/bin/image-minimizer
rm -f $(DESTDIR)/usr/bin/ec2-converter
rm -rf $(DESTDIR)/usr/lib/appliance-creator
rm -rf $(DESTDIR)/usr/share/doc/appliance-tools-$(VERSION)
dist : all
git-archive --format=tar --prefix=appliance-tools-$(VERSION)/ HEAD | bzip2 -9v > appliance-tools-$(VERSION).tar.bz2
clean:
rm -f *~ creator/*~ installer/*~ docs/*.8