-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
130 lines (105 loc) · 3.78 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
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#MESSAGESPOT=po/messages.pot
prefix=devinstall
statepath=/tmp/cobbler_settings/$(prefix)
all: clean build
clean:
-rm -f cobbler*.gz cobbler*.rpm MANIFEST
-rm -rf cobbler-* dist build rpm-build
-rm -f *~
-rm -f cobbler/*.pyc cobbler/yaml/*.pyc
-rm -f cobbler/webui/master.py config/modules.conf config/settings config/version
-rm -f docs/cobbler.1.gz docs/cobbler.html pod2htm*.tmp
manpage:
pod2man --center="cobbler" --release="" ./docs/cobbler.pod | gzip -c > ./docs/cobbler.1.gz
pod2html ./docs/cobbler.pod > ./docs/cobbler.html
test:
make savestate prefix=test
make rpms
make install
make eraseconfig
/sbin/service cobblerd restart
-(make nosetests)
make restorestate prefix=test
nosetests:
#nosetests tests -w cobbler --with-coverage --cover-package=cobbler --cover-erase --quiet | tee test.log
nosetests cobbler/*.py -v | tee test.log
build: manpage updatewui
python setup.py build -f
install: manpage updatewui
python setup.py install -f
debinstall: manpage updatewui
python setup.py install -f --root $(DESTDIR)
devinstall:
make savestate
make install
make restorestate
savestate:
mkdir -p $(statepath)
cp -a /var/lib/cobbler/config $(statepath)
cp /etc/cobbler/settings $(statepath)/settings
cp /etc/cobbler/modules.conf $(statepath)/modules.conf
cp /etc/httpd/conf.d/cobbler.conf $(statepath)/http.conf
cp /etc/cobbler/acls.conf $(statepath)/acls.conf
cp /etc/cobbler/users.conf $(statepath)/users.conf
cp /etc/cobbler/users.digest $(statepath)/users.digest
cp /etc/cobbler/dhcp.template $(statepath)/dhcp.template
restorestate:
cp -a $(statepath)/config /var/lib/cobbler
cp $(statepath)/settings /etc/cobbler/settings
cp $(statepath)/modules.conf /etc/cobbler/modules.conf
cp $(statepath)/users.conf /etc/cobbler/users.conf
cp $(statepath)/acls.conf /etc/cobbler/acls.conf
cp $(statepath)/users.digest /etc/cobbler/users.digest
cp $(statepath)/http.conf /etc/httpd/conf.d/cobbler.conf
cp $(statepath)/dhcp.template /etc/cobbler/dhcp.template
find /var/lib/cobbler/triggers | xargs chmod +x
chown -R apache /var/www/cobbler
chmod -R +x /var/www/cobbler/web
chmod -R +x /var/www/cobbler/svc
rm -rf $(statepath)
completion:
python mkbash.py
webtest: updatewui devinstall
make clean
make updatewui
make devinstall
make restartservices
restartservices:
/sbin/service cobblerd restart
/sbin/service httpd restart
sdist: clean updatewui
python setup.py sdist
#messages: cobbler/*.py
# xgettext -k_ -kN_ -o $(MESSAGESPOT) cobbler/*.py
# sed -i'~' -e 's/SOME DESCRIPTIVE TITLE/cobbler/g' -e 's/YEAR THE PACKAGE'"'"'S COPYRIGHT HOLDER/2007 Red Hat, Inc. /g' -e 's/FIRST AUTHOR <EMAIL@ADDRESS>, YEAR/Michael DeHaan <mdehaan@redhat.com>, 2007/g' -e 's/PACKAGE VERSION/cobbler $(VERSION)-$(RELEASE)/g' -e 's/PACKAGE/cobbler/g' $(MESSAGESPOT)
rpms: clean updatewui manpage sdist
mkdir -p rpm-build
cp dist/*.gz rpm-build/
rpmbuild --define "_topdir %(pwd)/rpm-build" \
--define "_builddir %{_topdir}" \
--define "_rpmdir %{_topdir}" \
--define "_srcrpmdir %{_topdir}" \
--define '_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm' \
--define "_specdir %{_topdir}" \
--define "_sourcedir %{_topdir}" \
-ba cobbler.spec
updatewui:
cheetah-compile ./webui_templates/master.tmpl
-(rm ./webui_templates/*.bak)
mv ./webui_templates/master.py ./cobbler/webui
eraseconfig:
-rm /var/lib/cobbler/distros*
-rm /var/lib/cobbler/profiles*
-rm /var/lib/cobbler/systems*
-rm /var/lib/cobbler/repos*
-rm /var/lib/cobbler/networks*
-rm /var/lib/cobbler/config/distros.d/*
-rm /var/lib/cobbler/config/images.d/*
-rm /var/lib/cobbler/config/profiles.d/*
-rm /var/lib/cobbler/config/systems.d/*
-rm /var/lib/cobbler/config/repos.d/*
-rm /var/lib/cobbler/config/networks.d/*
graphviz:
dot -Tpdf docs/cobbler.dot -o cobbler.pdf
tags:
find . -type f -name '*.py' | xargs etags -c TAGS