Update topdir Makefile targets

A number of changes to the toplevel make file and dir structure.

- deb-src and deb-release fail because debian was a symlink.  This is not allowed
  so instead we git clone and then move the debian dir to the toplevel.
- Fix the clean target to only run rules/debian if the debian dir exists.
- Drop probert as a submodule and instead clone it as needed, controlling the
  version through a Makefile variable.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
This commit is contained in:
Ryan Harper 2015-09-01 10:04:24 -05:00
parent 73a91728bc
commit 8d678ad353
3 changed files with 26 additions and 19 deletions

3
.gitmodules vendored
View File

@ -1,3 +0,0 @@
[submodule "probert"]
path = probert
url = git@github.com:CanonicalLtd/probert.git

View File

@ -15,7 +15,10 @@ BOOTLOADER=grub2
OFFLINE=-o
INSTALLIMG=ubuntu-server-${STREAM}-${RELEASE}-${ARCH}-installer.img
INSTALLER_RESOURCES += $(shell find installer/resources -type f)
GITDEBDIR=/tmp/subiquity-deb
PROBERTDIR=./probert
PROBERT_REPO=https://github.com/CanonicalLtd/probert.git
PROBERT_REVNO=cf19028b1061a2b8fe2662a45669243d26324f65
GITDEBDIR=./debian.git
DEBDIR=./debian
ifneq (,$(MACHINE))
@ -26,7 +29,7 @@ endif
all: dryrun
$(NAME)_$(VERSION).orig.tar.gz: clean
$(NAME)_$(VERSION).orig.tar.gz: probert clean
cd .. && tar czf $(NAME)_$(VERSION).orig.tar.gz $(shell basename `pwd`) --exclude-vcs --exclude=debian --exclude='.tox*'
tarball: $(NAME)_$(VERSION).orig.tar.gz
@ -34,7 +37,7 @@ tarball: $(NAME)_$(VERSION).orig.tar.gz
install_deps:
sudo apt-get install python3-urwid python3-pyudev python3-netifaces python3-nose python3-flake8 python3-yaml git bzr ubuntu-cloudimage-keyring python3-jinja2 python3-coverage
dryrun:
dryrun: probert
$(MAKE) ui-view DRYRUN="--dry-run"
ui-view:
@ -52,7 +55,7 @@ unit:
echo "Running unit tests..."
python3 -m "nose" -v --nologcapture --with-coverage ${TOPDIR}/tests/
installer/$(INSTALLIMG): installer/geninstaller installer/runinstaller $(INSTALLER_RESOURCES)
installer/$(INSTALLIMG): installer/geninstaller installer/runinstaller $(INSTALLER_RESOURCES) probert
(cd installer && ./geninstaller -v $(OFFLINE) -r $(RELEASE) -a $(ARCH) -s $(STREAM) -b $(BOOTLOADER))
echo $(INSTALLER_RESOURCES)
@ -61,29 +64,37 @@ installer: installer/$(INSTALLIMG)
run: installer
(cd installer && INSTALLER=$(INSTALLIMG) ./runinstaller)
probert:
@if [ ! -d "$(PROBERTDIR)" ]; then \
git clone -q $(PROBERT_REPO) $(PROBERTDIR); \
(cd probert && git checkout -f $(PROBERT_REVNO)); \
fi
git-checkout-deb:
@if [ ! -d "$(GITDEBDIR)" ]; then \
@if [ ! -d "$(DEBDIR)" ]; then \
git clone -q https://github.com/CanonicalLtd/subiquity-deb.git $(GITDEBDIR); \
fi
@if [ ! -h "$(DEBDIR)" ]; then \
ln -sf $(GITDEBDIR)/debian $(DEBDIR); \
fi
mv $(GITDEBDIR)/debian $(DEBDIR); \
rm -fr $(GITDEBDIR); \
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
deb-release: git-checkout-deb tarball
@dpkg-buildpackage -S -sd $(DPKGBUILDARGS)
deb: git-checkout-deb
@dpkg-buildpackage -b $(DPKGBUILDARGS)
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
@if [ -d "$(DEBDIR)" ]; then \
./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; \
fi
rm -f installer/target.img
rm -f installer/installer.img
rm -f installer/geninstaller.log

@ -1 +0,0 @@
Subproject commit f98791fe735866c2e1d244dc12849d880b323bfd