forked from ajenti/ajenti
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·111 lines (82 loc) · 2.84 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
PYTHON=`which python`
DESTDIR=/
BUILDIR=$(CURDIR)/debian/ajenti
RPMTOPDIR=$(CURDIR)/build
PROJECT=ajenti
VERSION=`python -c "from ajenti import __version__; print(__version__)"`
PREFIX=/usr
DATE=`date -R`
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
DOCBUILDDIR = docs/build
DOCSOURCEDIR = docs/source
ALLSPHINXOPTS = -d $(DOCBUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(DOCSOURCEDIR)
all: resources
resources:
./compile_resources.py || true
build: resources
./make_messages.py compile
run:
./ajenti-panel -v -c ./config.json
doc:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(DOCBUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
cdoc:
rm -rf $(DOCBUILDDIR)/*
make doc
pull-crowdin:
curl http://api.crowdin.net/api/project/ajenti/export?key=`cat ~/Dropbox/.crowdin.ajenti.key`
wget http://api.crowdin.net/api/project/ajenti/download/all.zip?key=`cat ~/Dropbox/.crowdin.ajenti.key` -O all.zip
unzip -o all.zip
rm all.zip
push-crowdin:
./make_messages.py extract
curl -F "files[/ajenti.po]=@ajenti/locales/ajenti.po" http://api.crowdin.net/api/project/ajenti/update-file?key=`cat ~/Dropbox/.crowdin.ajenti.key`
install: build
$(PYTHON) setup.py install --root $(DESTDIR) $(COMPILE) --prefix $(PREFIX)
rpm: build tgz
rm -rf dist/*.rpm
cat packaging/ajenti.spec.in | sed s/__VERSION__/$(VERSION)/g > ajenti.spec
mkdir -p build/SOURCES || true
cp dist/ajenti*.tar.gz build/SOURCES
rpmbuild --define '_topdir $(RPMTOPDIR)' -bb ajenti.spec
mv build/RPMS/noarch/$(PROJECT)*.rpm dist
rm ajenti.spec
deb: build tgz
rm -rf dist/*.deb
cat debian/changelog.in | sed s/__VERSION__/$(VERSION)/g | sed "s/__DATE__/$(DATE)/g" > debian/changelog
cp dist/$(PROJECT)*.tar.gz ..
rename -f 's/$(PROJECT)-(.*)\.tar\.gz/$(PROJECT)_$$1\.orig\.tar\.gz/' ../*
dpkg-buildpackage -b -rfakeroot -us -uc
mv ../$(PROJECT)*.deb dist/
rm ../$(PROJECT)*.orig.tar.gz
rm ../$(PROJECT)*.changes
rm debian/changelog
tgz: build
rm dist/*.tar.gz || true
$(PYTHON) setup.py sdist
upload-deb: deb
scp dist/*.deb [email protected]:/srv/repo/ng/debian
ssh [email protected] /srv/repo/rebuild-debian.sh
upload-rpm: rpm
scp dist/*.rpm [email protected]:/srv/repo/ng/centos/6
ssh [email protected] /srv/repo/rebuild-centos.sh
upload-rpm7: rpm
scp dist/*.rpm [email protected]:/srv/repo/ng/centos/7
ssh [email protected] /srv/repo/rebuild-centos7.sh
upload-tgz: tgz
$(PYTHON) setup.py sdist bdist_wheel upload
clean:
$(PYTHON) setup.py clean
rm -rf $(DOCBUILDDIR)/*
rm -rf ajenti-1.*
rm -rf build/ debian/$(PROJECT)* debian/*stamp* debian/files MANIFEST *.egg-info
find . -name '*.pyc' -delete
find . -name '*.c.js' -delete
find . -name '*.coffee.js' -delete
find . -name '*.c.css' -delete
find . -name '*.less.css' -delete
.PHONY: build resources clean doc cdoc