-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update building policy for debian package.
- Loading branch information
Showing
15 changed files
with
152 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,69 @@ | ||
NAME = $(shell cat bundle.json | sed -n 's/"name"//p' | tr -d '", :') | ||
VERSION = $(shell cat bundle.json | sed -n 's/"version"//p' | tr -d '", :') | ||
|
||
FILES = README.md bundle.json route.py requirements.txt | ||
DIRS = data ip | ||
PROJECT = sanji-bundle-$(NAME) | ||
|
||
all: pylint test | ||
DISTDIR = $(PROJECT)-$(VERSION) | ||
ARCHIVE = $(CURDIR)/$(DISTDIR).tar.gz | ||
|
||
SANJI_VER ?= 1.0 | ||
INSTALL_DIR = $(DESTDIR)/usr/lib/sanji-$(SANJI_VER)/$(NAME) | ||
STAGING_DIR = $(CURDIR)/staging | ||
PROJECT_STAGING_DIR = $(STAGING_DIR)/$(DISTDIR) | ||
|
||
TARGET_FILES = \ | ||
bundle.json \ | ||
requirements.txt \ | ||
route.py \ | ||
data/route.json.factory \ | ||
ip/__init__.py \ | ||
ip/addr.py \ | ||
ip/route.py | ||
DIST_FILES= \ | ||
$(TARGET_FILES) \ | ||
README.md \ | ||
Makefile \ | ||
tests/requirements.txt \ | ||
tests/test_route.py \ | ||
tests/data/route.json.factory \ | ||
tests/test_e2e/bundle.json \ | ||
tests/test_e2e/view_routes.py | ||
INSTALL_FILES=$(addprefix $(INSTALL_DIR)/,$(TARGET_FILES)) | ||
STAGING_FILES=$(addprefix $(PROJECT_STAGING_DIR)/,$(DIST_FILES)) | ||
|
||
|
||
all: | ||
|
||
clean: | ||
rm -rf $(DISTDIR)*.tar.gz $(STAGING_DIR) | ||
@rm -rf .coverage | ||
@find ./ -name *.pyc | xargs rm -rf | ||
|
||
distclean: clean | ||
|
||
pylint: | ||
flake8 -v --exclude=.git,__init__.py . | ||
test: | ||
nosetests --with-coverage --cover-erase --cover-package=route -v | ||
nosetests --with-coverage --cover-erase --cover-package=$(NAME) -v | ||
|
||
deb: | ||
mkdir -p deb | ||
cp -a debian deb/ | ||
cp -a debian.mk deb/Makefile | ||
cp -a README.md $(FILES) $(DIRS) deb/ | ||
(cd deb; \ | ||
dpkg-buildpackage -us -uc -rfakeroot;) | ||
dist: $(ARCHIVE) | ||
|
||
clean: | ||
rm -rf deb | ||
$(ARCHIVE): distclean $(STAGING_FILES) | ||
@mkdir -p $(STAGING_DIR) | ||
cd $(STAGING_DIR) && \ | ||
tar zcf $@ $(DISTDIR) | ||
|
||
$(PROJECT_STAGING_DIR)/%: % | ||
@mkdir -p $(dir $@) | ||
@cp -a $< $@ | ||
|
||
install: $(INSTALL_FILES) | ||
|
||
$(INSTALL_DIR)/%: % | ||
@mkdir -p $(dir $@) | ||
@cp -a $< $@ | ||
|
||
uninstall: | ||
-rm $(addprefix $(INSTALL_DIR)/,$(TARGET_FILES)) | ||
|
||
.PHONY: pylint test | ||
.PHONY: clean dist pylint test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
PROJ_DIR = $(abspath ..) | ||
|
||
NAME = $(shell cat $(PROJ_DIR)/bundle.json | sed -n 's/"name"//p' | tr -d '", :') | ||
VERSION = $(shell cat $(PROJ_DIR)/bundle.json | sed -n 's/"version"//p' | tr -d '", :') | ||
|
||
PROJECT = sanji-bundle-$(NAME) | ||
DEBVERSION = 1 | ||
DIST ?= unstable | ||
|
||
STAGING_DIR = $(abspath $(PROJECT)-$(VERSION)) | ||
UPSTREAM_ARCHIVE = $(PROJECT)-$(VERSION).tar.gz | ||
|
||
FILES = \ | ||
$(STAGING_DIR)/debian/changelog \ | ||
$(STAGING_DIR)/debian/compat \ | ||
$(STAGING_DIR)/debian/control \ | ||
$(STAGING_DIR)/debian/copyright \ | ||
$(STAGING_DIR)/debian/docs \ | ||
$(STAGING_DIR)/debian/postinst \ | ||
$(STAGING_DIR)/debian/README \ | ||
$(STAGING_DIR)/debian/rules \ | ||
$(STAGING_DIR)/debian/source/format | ||
|
||
.PHONY: all build | ||
|
||
all: build | ||
|
||
build: extract-upstream $(FILES) | ||
cd $(STAGING_DIR) && \ | ||
dpkg-buildpackage -us -uc -rfakeroot | ||
|
||
$(STAGING_DIR)/debian/%: $(PROJ_DIR)/build-deb/debian/% | ||
mkdir -p $(dir $@) | ||
cp $< $@ | ||
|
||
extract-upstream: | ||
tar zxf $(PROJ_DIR)/$(UPSTREAM_ARCHIVE) | ||
|
||
changelog: | ||
dch -v $(VERSION)-$(DEBVERSION) -D $(DIST) -M -u low \ | ||
--release-heuristic log | ||
|
||
clean: | ||
rm -rf $(STAGING_DIR) $(PROJECT)-* $(PROJECT)_* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
The Debian Package route | ||
---------------------------- | ||
|
||
Comments regarding the Package | ||
|
||
-- Aeluin Chen <[email protected]> Fri, 12 Jun 2015 16:48:57 +0800 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
sanji-bundle-route (0.9.4-2) unstable; urgency=low | ||
|
||
* Update building policy for debian package. | ||
|
||
-- Aeluin Chen <[email protected]> Fri, 12 Jun 2015 16:57:12 +0800 | ||
|
||
sanji-bundle-route (0.9.4-1) unstable; urgency=low | ||
|
||
* Use netifaces to speedup query time. | ||
|
||
-- Aeluin Chen <[email protected]> Fri, 05 Jun 2015 18:32:58 +0800 | ||
|
||
sanji-bundle-route (0.9.0) unstable; urgency=low | ||
|
||
* Initial Release. | ||
|
||
-- Aeluin Chen <[email protected]> Fri, 05 Jun 2015 18:27:19 +0800 |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,13 +6,13 @@ Build-Depends-Indep: python (>= 2.7) | |
Standards-Version: 3.9.3 | ||
Section: libs | ||
Homepage: http://www.moxa.com | ||
#Vcs-Git: [email protected]:lwindg/sanji-bundle-routes.git | ||
#Vcs-Browser: https://github.com/lwindg/sanji-bundle-routes | ||
#Vcs-Git: | ||
#Vcs-Browser: | ||
X-Python-Version: >= 2.5 | ||
|
||
Package: sanji-bundle-route | ||
Section: libs | ||
Architecture: all | ||
Depends: ${shlibs:Depends}, ${misc:Depends}, python2.7, python-pip | ||
Description: A sanji library for configure the default route. | ||
Description: Handle the routing table | ||
|
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.