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:
parent
73a91728bc
commit
8d678ad353
|
@ -1,3 +0,0 @@
|
||||||
[submodule "probert"]
|
|
||||||
path = probert
|
|
||||||
url = git@github.com:CanonicalLtd/probert.git
|
|
41
Makefile
41
Makefile
|
@ -15,7 +15,10 @@ 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
|
PROBERTDIR=./probert
|
||||||
|
PROBERT_REPO=https://github.com/CanonicalLtd/probert.git
|
||||||
|
PROBERT_REVNO=cf19028b1061a2b8fe2662a45669243d26324f65
|
||||||
|
GITDEBDIR=./debian.git
|
||||||
DEBDIR=./debian
|
DEBDIR=./debian
|
||||||
|
|
||||||
ifneq (,$(MACHINE))
|
ifneq (,$(MACHINE))
|
||||||
|
@ -26,7 +29,7 @@ endif
|
||||||
|
|
||||||
all: dryrun
|
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*'
|
cd .. && tar czf $(NAME)_$(VERSION).orig.tar.gz $(shell basename `pwd`) --exclude-vcs --exclude=debian --exclude='.tox*'
|
||||||
|
|
||||||
tarball: $(NAME)_$(VERSION).orig.tar.gz
|
tarball: $(NAME)_$(VERSION).orig.tar.gz
|
||||||
|
@ -34,7 +37,7 @@ 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-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-yaml git bzr ubuntu-cloudimage-keyring python3-jinja2 python3-coverage
|
||||||
|
|
||||||
dryrun:
|
dryrun: probert
|
||||||
$(MAKE) ui-view DRYRUN="--dry-run"
|
$(MAKE) ui-view DRYRUN="--dry-run"
|
||||||
|
|
||||||
ui-view:
|
ui-view:
|
||||||
|
@ -52,7 +55,7 @@ unit:
|
||||||
echo "Running unit tests..."
|
echo "Running unit tests..."
|
||||||
python3 -m "nose" -v --nologcapture --with-coverage ${TOPDIR}/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))
|
(cd installer && ./geninstaller -v $(OFFLINE) -r $(RELEASE) -a $(ARCH) -s $(STREAM) -b $(BOOTLOADER))
|
||||||
echo $(INSTALLER_RESOURCES)
|
echo $(INSTALLER_RESOURCES)
|
||||||
|
|
||||||
|
@ -61,29 +64,37 @@ installer: installer/$(INSTALLIMG)
|
||||||
run: installer
|
run: installer
|
||||||
(cd installer && INSTALLER=$(INSTALLIMG) ./runinstaller)
|
(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:
|
git-checkout-deb:
|
||||||
@if [ ! -d "$(GITDEBDIR)" ]; then \
|
@if [ ! -d "$(DEBDIR)" ]; then \
|
||||||
git clone -q https://github.com/CanonicalLtd/subiquity-deb.git $(GITDEBDIR); \
|
git clone -q https://github.com/CanonicalLtd/subiquity-deb.git $(GITDEBDIR); \
|
||||||
fi
|
mv $(GITDEBDIR)/debian $(DEBDIR); \
|
||||||
@if [ ! -h "$(DEBDIR)" ]; then \
|
rm -fr $(GITDEBDIR); \
|
||||||
ln -sf $(GITDEBDIR)/debian $(DEBDIR); \
|
fi
|
||||||
fi
|
|
||||||
DPKGBUILDARGS = -us -uc -i'.git.*|.tox|.bzr.*|.editorconfig|.travis-yaml'
|
DPKGBUILDARGS = -us -uc -i'.git.*|.tox|.bzr.*|.editorconfig|.travis-yaml'
|
||||||
deb-src: git-checkout-deb clean tarball
|
deb-src: git-checkout-deb clean tarball
|
||||||
@dpkg-buildpackage -S -sa $(DPKGBUILDARGS)
|
@dpkg-buildpackage -S -sa $(DPKGBUILDARGS)
|
||||||
|
|
||||||
deb-release: git-checkout-deb
|
deb-release: git-checkout-deb tarball
|
||||||
@dpkg-buildpackage -S -sd $(DPKGBUILDARGS)
|
@dpkg-buildpackage -S -sd $(DPKGBUILDARGS)
|
||||||
|
|
||||||
deb: git-checkout-deb
|
deb: git-checkout-deb
|
||||||
@dpkg-buildpackage -b $(DPKGBUILDARGS)
|
@dpkg-buildpackage -b $(DPKGBUILDARGS)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@-debian/rules clean
|
@if [ -d "$(DEBDIR)" ]; then \
|
||||||
@rm -rf debian/subiquity
|
./debian/rules clean; \
|
||||||
@rm -rf ../$(NAME)_*.deb ../$(NAME)_*.tar.gz ../$(NAME)_$.dsc ../$(NAME)_*.changes \
|
rm -rf debian/subiquity; \
|
||||||
../$(NAME)_*.build ../$(NAME)_*.upload
|
rm -rf ../$(NAME)_*.deb ../$(NAME)_*.tar.gz ../$(NAME)_$.dsc ../$(NAME)_*.changes \
|
||||||
wrap-and-sort
|
../$(NAME)_*.build ../$(NAME)_*.upload; \
|
||||||
|
wrap-and-sort; \
|
||||||
|
fi
|
||||||
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
|
||||||
|
|
1
probert
1
probert
|
@ -1 +0,0 @@
|
||||||
Subproject commit f98791fe735866c2e1d244dc12849d880b323bfd
|
|
Loading…
Reference in New Issue