Skip to content
Makefile 1.85 KiB
Newer Older
#!/usr/bin/make

# Installsystems - Python installation framework
# Copyright © 2011-2012 Smartjog S.A
# Copyright © 2011-2012 Sébastien Luttringer
#
# This file is part of Installsystems.
#
# Installsystems is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Installsystems 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 Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Installsystems.  If not, see <http://www.gnu.org/licenses/>.
Seblu's avatar
Seblu committed

.PHONY: all tar deb clean cleanbuild buildd dsc doc
Seblu's avatar
Seblu committed

NAME=installsystems
Seblu's avatar
Seblu committed
VERSION=$(shell sed -rn 's/version = "([^"]+)"/\1/p' installsystems/__init__.py)
Seblu's avatar
Seblu committed
BUILD_DIR=__build__
DISTRO=squeeze
Seblu's avatar
Seblu committed

all:
	echo all is better than nothing

Seblu's avatar
Seblu committed
$(NAME)-$(VERSION).tar.gz:
Seblu's avatar
Seblu committed
	git archive --prefix=$(NAME)-$(VERSION)/ HEAD | gzip -9 > $(NAME)-$(VERSION).tar.gz

Seblu's avatar
Seblu committed
tar: cleantar $(NAME)-$(VERSION).tar.gz
doc:
	cd doc && make html

Seblu's avatar
Seblu committed
dsc: cleanbuild $(NAME)-$(VERSION).tar.gz
Seblu's avatar
Seblu committed
	mkdir $(BUILD_DIR)
	tar xfC $(NAME)-$(VERSION).tar.gz $(BUILD_DIR)
	cd $(BUILD_DIR) && dpkg-source -I -b $(NAME)-$(VERSION)
Seblu's avatar
Seblu committed

Seblu's avatar
Seblu committed
deb: cleanbuild $(NAME)-$(VERSION).tar.gz
Seblu's avatar
Seblu committed
	mkdir $(BUILD_DIR)
	tar xfC $(NAME)-$(VERSION).tar.gz $(BUILD_DIR)
Seblu's avatar
Seblu committed
	cd $(BUILD_DIR)/$(NAME)-$(VERSION) && dpkg-buildpackage --source-option=-I -us -uc
Seblu's avatar
Seblu committed

buildd: dsc
	chmod 644 $(BUILD_DIR)/$(NAME)_*.dsc $(BUILD_DIR)/$(NAME)_*.gz
	scp $(BUILD_DIR)/$(NAME)_*.dsc $(BUILD_DIR)/$(NAME)_*.gz incoming@buildd.fr.lan:$(DISTRO)
Seblu's avatar
Seblu committed

Seblu's avatar
Seblu committed
clean: cleantar cleanbuild
Seblu's avatar
Seblu committed

cleanbuild:
	-rm -rf  $(BUILD_DIR)

Seblu's avatar
Seblu committed
cleantar:
	-rm -f $(NAME)-*.tar.gz