add setuptools

Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
This commit is contained in:
Adam Stokes 2015-08-21 14:15:04 -04:00
parent f57d157722
commit 5ead10de47
3 changed files with 82 additions and 1 deletions

2
.gitignore vendored
View File

@ -60,3 +60,5 @@ target/
installer/*.img installer/*.img
logs/* logs/*
venv venv
debian
.pybuild

View File

@ -1,7 +1,9 @@
# #
# Makefile for subiquity # Makefile for subiquity
# #
PYTHONSRC=subiquity NAME=subiquity
VERSION=0.0.1
PYTHONSRC=$(NAME)
PYTHONPATH=$(shell pwd):$(HOME)/download/probert: PYTHONPATH=$(shell pwd):$(HOME)/download/probert:
VENVPATH=$(shell pwd)/venv VENVPATH=$(shell pwd)/venv
VENVACTIVATE=$(VENVPATH)/bin/activate VENVACTIVATE=$(VENVPATH)/bin/activate
@ -13,10 +15,17 @@ BOOTLOADER=grub2
OFFLINE=-o OFFLINE=-o
INSTALLIMG=ubuntu-server-${STREAM}-${RELEASE}-${ARCH}-installer.img INSTALLIMG=ubuntu-server-${STREAM}-${RELEASE}-${ARCH}-installer.img
INSTALLER_RESOURCES += $(shell find installer/resources -type f) INSTALLER_RESOURCES += $(shell find installer/resources -type f)
GITDEBDIR=/tmp/subiquity-deb
DEBDIR=./debian
.PHONY: run clean .PHONY: run clean
all: dryrun all: dryrun
$(NAME)_$(VERSION).orig.tar.gz: clean
cd .. && tar czf $(NAME)_$(VERSION).orig.tar.gz $(shell basename `pwd`) --exclude-vcs --exclude=debian --exclude='.tox*'
tarball: $(NAME)_$(VERSION).orig.tar.gz
install_deps: install_deps:
sudo apt-get install python3-urwid python3-pyudev python3-netifaces python3-nose python3-flake8 python3-parted python3-yaml git bzr ubuntu-cloudimage-keyring python3-jinja2 python3-coverage sudo apt-get install python3-urwid python3-pyudev python3-netifaces python3-nose python3-flake8 python3-parted python3-yaml git bzr ubuntu-cloudimage-keyring python3-jinja2 python3-coverage
@ -47,7 +56,29 @@ installer: installer/$(INSTALLIMG)
run: installer run: installer
(cd installer && INSTALLER=$(INSTALLIMG) ./runinstaller) (cd installer && INSTALLER=$(INSTALLIMG) ./runinstaller)
git-checkout-deb:
@if [ ! -d "$(GITDEBDIR)" ]; then \
git clone -q https://github.com/CanonicalLtd/subiquity-deb.git $(GITDEBDIR); \
fi
@if [ ! -h "$(DEBDIR)" ]; then \
ln -sf $(GITDEBDIR)/debian $(DEBDIR); \
fi
DPKGBUILDARGS = -us -uc -i'.git.*|.tox|.bzr.*|.editorconfig|.travis-yaml'
deb-src: git-checkout-deb clean tarball
@dpkg-buildpackage -S -sa $(DPKGBUILDARGS)
deb-release: git-checkout-deb
@dpkg-buildpackage -S -sd $(DPKGBUILDARGS)
deb: git-checkout-deb
@dpkg-buildpackage -b $(DPKGBUILDARGS)
clean: clean:
@-debian/rules clean
@rm -rf debian/subiquity
@rm -rf ../$(NAME)_*.deb ../$(NAME)_*.tar.gz ../$(NAME)_$.dsc ../$(NAME)_*.changes \
../$(NAME)_*.build ../$(NAME)_*.upload
wrap-and-sort
rm -f installer/target.img rm -f installer/target.img
rm -f installer/installer.img rm -f installer/installer.img
rm -f installer/geninstaller.log rm -f installer/geninstaller.log

48
setup.py Normal file
View File

@ -0,0 +1,48 @@
#!/usr/bin/env python3
# -*- mode: python; -*-
#
# Copyright 2015 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This package is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
subiquity
=========
Ubuntu Server Installer
"""
from setuptools import setup, find_packages
import os
import sys
import subiquity
if sys.argv[-1] == 'clean':
print("Cleaning up ...")
os.system('rm -rf subiquity.egg-info build dist')
sys.exit()
setup(name='subiquity',
version=subiquity.__version__,
description="Ubuntu Server Installer",
long_description=__doc__,
author='Canonical Engineering',
author_email='ubuntu-dev@lists.ubuntu.com',
url='https://github.com/CanonicalLtd/subiquity',
license="AGPLv3+",
scripts=['bin/subiquity',
'bin/curtin_wrap.sh'],
packages=find_packages(exclude=["tests"]),
data_files=[])