-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
69 lines (56 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
all: debian zipfile
.PHONY: all
VERSION := 1.0.0
SRC_DIR := src
INSTALL_DIR := installer
BUILD_DIR := build
ZIP_DIR := suns
ZIP_FILE := suns.zip
PY_INSTALLER := suns_installer.py
PLUGIN_INIT := $(SRC_DIR)/__init__.py
PLUGIN_MOTIFS := $(SRC_DIR)/suns_aa_motifs.py
PLUGIN_PATH := usr/lib/python2.7/dist-packages/pmg_tk/startup
DEB_DIR := debian
DEB_BUILD_DIR := $(DEB_DIR)/build
DEB_NAME := pymol-suns-search
DEB_VERSION := 1
DEB_FULL := $(DEB_NAME)_$(VERSION)-$(DEB_VERSION)_all.deb
DOC_PATH := usr/share/doc/$(DEB_NAME)
debian: $(BUILD_DIR)/$(DEB_FULL)
.PHONY: debian
$(BUILD_DIR)/$(DEB_FULL): \
$(DEB_DIR)/control \
$(PLUGIN_INIT) \
$(PLUGIN_MOTIFS)
mkdir -p $(BUILD_DIR) \
$(DEB_BUILD_DIR)/DEBIAN \
$(DEB_BUILD_DIR)/$(PLUGIN_PATH) \
$(DEB_BUILD_DIR)/$(DOC_PATH)
cp $(PLUGIN_INIT) $(DEB_BUILD_DIR)/$(PLUGIN_PATH)/suns-search.py
cp $(PLUGIN_MOTIFS) $(DEB_BUILD_DIR)/$(PLUGIN_PATH)
cp $(DEB_DIR)/copyright $(DEB_BUILD_DIR)/$(DOC_PATH)/copyright
cp $(DEB_DIR)/control $(DEB_BUILD_DIR)/DEBIAN/control
gzip -9 -c $(DEB_DIR)/changelog > $(BUILD_DIR)/changelog.gz
chmod 644 $(BUILD_DIR)/changelog.gz
cp $(BUILD_DIR)/changelog.gz $(DEB_BUILD_DIR)/$(DOC_PATH)
rm $(BUILD_DIR)/changelog.gz
ln -fs $(DOC_PATH)/changelog.gz \
$(DEB_BUILD_DIR)/$(DOC_PATH)/changelog.Debian.gz
find $(DEB_BUILD_DIR) -type d | xargs chmod 755
fakeroot dpkg-deb --build $(DEB_BUILD_DIR) $(BUILD_DIR)/$(DEB_FULL)
zipfile: $(INSTALL_DIR)/$(ZIP_FILE)
.PHONY: zipfile
pyinstaller: $(INSTALL_DIR)/$(PY_INSTALLER)
.PHONY: pyinstaller
$(INSTALL_DIR)/$(ZIP_FILE): $(SRC_DIR)/__init__.py $(SRC_DIR)/pika
ln -s src suns
zip -r $(INSTALL_DIR)/$(ZIP_FILE) suns
rm suns
$(INSTALL_DIR)/$(PY_INSTALLER): $(SRC_DIR)/__init__.py $(SRC_DIR)/pika $(INSTALL_DIR)/$(ZIP_FILE) $(INSTALL_DIR)/make_py_installer.py
python $(INSTALL_DIR)/make_py_installer.py $(INSTALL_DIR)/$(ZIP_FILE) $(INSTALL_DIR)/$(PY_INSTALLER)
.PHONY: suns_aa_motifs
suns_aa_motifs:
python motifs/make_word_dicts.py motifs/ src/suns_aa_motifs.py
.PHONY: clean
clean:
rm -rf $(INSTALL_DIR)/$(ZIP_FILE)