2014-03-08 02:34:09 +00:00
|
|
|
UBUNTU_BOXES= precise quantal raring saucy trusty
|
2014-03-10 01:54:29 +00:00
|
|
|
DEBIAN_BOXES= squeeze wheezy sid jessie
|
2014-03-08 02:34:09 +00:00
|
|
|
TODAY=$(shell date -u +"%Y-%m-%d")
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
2014-03-10 00:35:53 +00:00
|
|
|
all: ubuntu debian
|
2014-03-08 02:34:09 +00:00
|
|
|
|
2014-03-10 00:35:53 +00:00
|
|
|
ubuntu: $(UBUNTU_BOXES)
|
|
|
|
debian: $(DEBIAN_BOXES)
|
|
|
|
|
|
|
|
# REFACTOR: Figure out how can we reduce duplicated code
|
2014-03-09 23:30:57 +00:00
|
|
|
$(UBUNTU_BOXES): CONTAINER = "vagrant-lxc-base-${@}-amd64"
|
|
|
|
$(UBUNTU_BOXES): PACKAGE = "output/${TODAY}/vagrant-lxc-${@}-amd64.box"
|
2014-03-08 02:34:09 +00:00
|
|
|
$(UBUNTU_BOXES):
|
2014-03-09 23:30:57 +00:00
|
|
|
@mkdir -p $$(dirname $(PACKAGE))
|
2014-03-10 00:35:53 +00:00
|
|
|
@sudo -E ./mk-debian.sh ubuntu $(@) amd64 $(CONTAINER) $(PACKAGE)
|
|
|
|
@sudo chmod +rw $(PACKAGE)
|
|
|
|
@sudo chown ${USER}: $(PACKAGE)
|
|
|
|
$(DEBIAN_BOXES): CONTAINER = "vagrant-lxc-base-${@}-amd64"
|
|
|
|
$(DEBIAN_BOXES): PACKAGE = "output/${TODAY}/vagrant-lxc-${@}-amd64.box"
|
|
|
|
$(DEBIAN_BOXES):
|
|
|
|
@mkdir -p $$(dirname $(PACKAGE))
|
|
|
|
@sudo -E ./mk-debian.sh debian $(@) amd64 $(CONTAINER) $(PACKAGE)
|
2014-03-09 07:18:10 +00:00
|
|
|
@sudo chmod +rw $(PACKAGE)
|
2014-03-09 23:24:09 +00:00
|
|
|
@sudo chown ${USER}: $(PACKAGE)
|
2014-03-08 02:34:09 +00:00
|
|
|
|
2014-03-10 00:35:53 +00:00
|
|
|
clean: ALL_BOXES = ${DEBIAN_BOXES} ${UBUNTU_BOXES}
|
2014-03-08 02:34:09 +00:00
|
|
|
clean:
|
2014-03-10 00:35:53 +00:00
|
|
|
@for r in $(ALL_BOXES); do \
|
2014-03-09 22:36:48 +00:00
|
|
|
sudo -E ./clean.sh $${r}\
|
2014-03-09 23:30:57 +00:00
|
|
|
vagrant-lxc-base-$${r}-amd64 \
|
2014-03-10 02:27:58 +00:00
|
|
|
output/${TODAY}/vagrant-lxc-$${r}-amd64.box; \
|
2014-03-09 22:36:48 +00:00
|
|
|
done
|