forked from turtlebender/repo-sync
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
28 lines (23 loc) · 1.16 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
VIRTUAL_ENV_DIR=dist
INSTALL_DIR=/var/lib/repo-sync
GEMS_PREFIX=/var/lib/gems/1.8
.PHONY: build
build:
virtualenv --no-site-packages $(VIRTUAL_ENV_DIR)
$(VIRTUAL_ENV_DIR)/bin/python setup.py install
virtualenv --relocatable $(VIRTUAL_ENV_DIR)
install: build
test -d $(INSTALL_DIR) || $(INSTALL_DIR)
cp -r $(VIRTUAL_ENV_DIR)/* $(INSTALL_DIR)
chmod +x $(INSTALL_DIR)/bin/repo*
test -e /usr/local/bin/repopull || ln -s $(INSTALL_DIR)/bin/repopull /usr/local/bin/repopull
test -e /usr/local/bin/repopush || ln -s $(INSTALL_DIR)/bin/repopush /usr/local/bin/repopush
test -e /usr/local/bin/reposync || ln -s $(INSTALL_DIR)/bin/reposync /usr/local/bin/reposync
clean:
rm -rf $(VIRTUAL_ENV_DIR)
find ./ -name "*.pyc" -delete
deb: build
PATH=${PATH}:$(GEMS_PREFIX)/bin fpm -h >/dev/null || (echo "You must install fpm: gem install fpm --no-ri --no-rdoc" ; exit 1;)
test -d debian/build/var/lib/repo-sync || mkdir -p debian/build/var/lib/repo-sync
cp -r $(VIRTUAL_ENV_DIR)/* debian/build/var/lib/repo-sync
fpm -s dir -t deb -C debian/build/ -d "inotify-tools (>= 3.13)" -n python-reposync -v 0.1 --post-install debian/post-install.sh --pre-uninstall debian/pre-uninstall.sh