[Blends-commit] [SCM] blends-gsoc branch, master, updated. cc3bd7379da49e7cf47411d5c6e1df6b8573cff3

Emmanouil Kiagias e.kiagias at gmail.com
Tue Jul 30 10:20:59 UTC 2013


The following commit has been merged in the master branch:
commit cc3bd7379da49e7cf47411d5c6e1df6b8573cff3
Author: Emmanouil Kiagias <e.kiagias at gmail.com>
Date:   Tue Jul 30 12:20:49 2013 +0200

    added Makefile/rules files, attention the latter files contain custom local paths for my local testing

diff --git a/devtools/Makefile b/devtools/Makefile
new file mode 100755
index 0000000..dbc6386
--- /dev/null
+++ b/devtools/Makefile
@@ -0,0 +1,66 @@
+#!/usr/bin/make -f
+
+# This Makefile is used to build a debian/control file
+# for a Debian Pure Blend.
+#
+# Copyright (C) Andreas Tille <tille at debian.org>
+# License: GPL
+
+# TARGET_DIST is one of stable, sarge, etch, unstable, or any other available
+# sources.list file available
+TARGET_DIST := $(shell head -1 debian/changelog |awk '{print $$3}'|tr -d ';')
+BLEND := $(shell /usr/share/blends-dev/blend-get-names blendname)
+
+##FIXME custom path for local testing
+GENCONTROL := /home/alamagestest/Projects/blends-gsoc/devtools/blend-gen-control
+
+# Verify whether config/control exists, if yes, add it to the depends of debian/control
+CONFIGCONTROL := $(shell if [ -d config -a -e config/control ] ; then echo config/control; fi)
+
+all: $(BLEND)-tasks.desc debian/control
+
+debian/control: debian/control.stub debian/changelog tasks/* $(CONFIGCONTROL)
+	(export LC_ALL=C;\
+	 echo "# This file is autogenerated via "make -f debian/rules dist".  Do not edit!"; \
+	 cat debian/control.stub; \
+	 test -f config/control && ( cat config/control; echo ) ; \
+	$(GENCONTROL) -S -D -c; cat control.temp ) > $@.new && mv $@.new $@ && rm control.temp
+
+tasksel: $(BLEND)-tasks.desc
+$(BLEND)-tasks.desc: tasks/* debian/changelog
+	LC_ALL=C $(GENCONTROL) -S -t && mv taskdesc.template $(BLEND)-tasks.desc.template
+
+##FIXME comment out for the moment
+#packages.txt: tasks/*
+#	$(GENCONTROL) -s $(TARGET_DIST) -a > packages.txt.$$$$ && mv packages.txt.$$$$ packages.txt
+
+#avoidpackages.txt: tasks/* sources.list.$(TARGET_DIST)
+#	$(GENCONTROL) -s $(TARGET_DIST) -e > avoidpackages.txt.$$$$ && mv avoidpackages.txt.$$$$ avoidpackages.txt
+
+by_vote:
+	rm -f by_vote
+	wget http://developer.skolelinux.no/popcon/by_vote
+
+##FIXME comment out for the moment
+#packages-sorted.txt: packages.txt by_vote
+#	for pkg in `cat packages.txt` ; do \
+#		grep " $$pkg " by_vote ; \
+#	done | LANG=C sort -r -n -k 4 -k 3 > packages-sorted.txt
+#usage: packages-sorted.txt
+
+clean: 
+	rm -rf tmp
+	rm -f tasks/*~
+	rm -rf tasksel
+	rm -f packages.txt by_vote packages-sorted.txt
+	rm -f debian/*-config.postinst debian/*-config.preinst debian/*-config.postrm debian/*-config.prerm
+
+distclean: clean
+
+proper: distclean
+	rm -f debian/control
+	rm -f $(BLEND)-tasks.desc
+
+dist:
+	rm -f $(BLEND)-tasks.desc debian/control
+	make -f debian/rules get-orig-source
diff --git a/devtools/blend-gen-control b/devtools/blend-gen-control
index e2c8ca5..d5ce771 100755
--- a/devtools/blend-gen-control
+++ b/devtools/blend-gen-control
@@ -562,7 +562,7 @@ def gen_control(**kwargs):
     architecture = "any"
 
     #TODO this is used for testing for the moment, will be changed
-    control_path = "control"
+    control_path = "control.temp"
     logger.debug("Opening file {0} to write".format(control_path))
     with open(control_path,'w') as fout:
 
diff --git a/devtools/rules b/devtools/rules
new file mode 100755
index 0000000..0a05569
--- /dev/null
+++ b/devtools/rules
@@ -0,0 +1,97 @@
+#!/usr/bin/make -f
+
+# This is a debian/rules file which builds meta packages
+# for a Debian Pure Blend.
+#
+# Copyright (C) Andreas Tille <tille at debian.org>
+# License: GPL
+
+BLENDNAME   := $(shell /usr/share/blends-dev/blend-get-names blendname)
+PREFIX      := $(shell /usr/share/blends-dev/blend-get-names metapackageprefix)
+
+##FIXME custom path for local testing
+BLENDMKFILE :=/home/alamagestest/Projects/blends-gsoc/devtools/Makefile
+BLEND_INSTALL_HELPER := /usr/share/blends-dev/blend-install-helper
+
+TARGET_DIST := $(shell head -1 debian/changelog |awk '{print $$3}'|tr -d ';')
+BLEND       := $(shell /usr/share/blends-dev/blend-get-names blendname)
+
+##FIXME custom path for local testing
+GENCONTROL  := /home/alamagestest/Projects/blends-gsoc/devtools/blend-gen-control
+
+VERSION     := $(shell dpkg-parsechangelog -ldebian/changelog | grep Version: | cut -f2 -d' ' | cut -f1 -d- )
+DISTDIR     := $(BLENDNAME)-$(VERSION)
+
+DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
+
+all:
+	echo $(PREFIX), $(BLENDNAME)
+
+INSTALLREADME := $(shell if test -e README ; then echo "-A README"; fi)
+
+debian/control: 
+	$(MAKE) -f $(BLENDMKFILE) debian/control
+
+$(BLEND)-tasks.desc:
+	$(MAKE) -f $(BLENDMKFILE) $(BLEND)-tasks.desc && \
+	sed "s/.*\(\[\!$(DEB_HOST_ARCH)\]\|\[\!$(DEB_HOST_ARCH) .*\| .*\!$(DEB_HOST_ARCH) .*\| .*\!$(DEB_HOST_ARCH)\]\) |//;s/|.*//" $(BLEND)-tasks.desc.template | \
+	grep -vE "\[\!$(DEB_HOST_ARCH)\]|\[\!$(DEB_HOST_ARCH) | \!$(DEB_HOST_ARCH) | \!$(DEB_HOST_ARCH)\]" | \
+	sed 's/\[.*\]//' > $(BLEND)-tasks.desc.$(DEB_HOST_ARCH)
+
+%:
+	dh $@
+
+override_dh_install:
+	$(BLEND_INSTALL_HELPER)
+	dh_install $(BLENDNAME)-tasks.desc usr/share/tasksel/descs
+
+override_dh_installdocs:
+	dh_installdocs $(INSTALLREADME)
+
+override_dh_auto_clean:
+	# call make clean instead of distclean
+	make clean
+
+override_dh_auto_build:
+	# do nothing, we just called the make install target in advance
+	# and want to build the packages without network access
+
+override_dh_clean:
+	# hmmm, that would kill debian/control - so don't do this!
+	# $(MAKE) -f $(BLENDMKFILE) clean
+
+	# Clear apt-get cache
+	rm -rf tmp
+	# Remove backup files from source tarball
+	rm -f tasks/*~
+	# Remove auto generated post{inst,rm} scripts
+	rm -f debian/$(PREFIX)-*.postinst debian/$(PREFIX)-*.prerm debian/$(PREFIX)-*.postrm debian/$(PREFIX)-*.preinst
+	# remove auto generated files for config package
+	rm -f debian/$(PREFIX)-config.templates debian/$(PREFIX)-config.config \
+	      debian/$(PREFIX)-config.install   debian/$(PREFIX)-config.links  \
+	      debian/90$(PREFIX)-config
+	# remove auto generated debconf template translations
+	rm -rf debian/po
+	# remove possibly remaining debhelper files
+	rm -f debian/$(PREFIX)-*.debhelper.log
+	dh_clean
+
+get-orig-source: $(BLEND)-tasks.desc debian/control
+	if [ ! -f debian/changelog ] ; then \
+	    echo "File debian/changelog is missing. Something is wrong!" ; \
+	    exit -1 ; \
+	fi
+	if [ "$(VERSION)" = "" ] ; then \
+	    echo "Unable to obtain version number from debian/changelog. Something is wrong!" ; \
+	    exit -1 ; \
+	fi ;
+	rm -rf $(DISTDIR)
+	mkdir $(DISTDIR)
+	chmod 777 $(DISTDIR)
+	# copy with exception of VCS stuff
+	tar -cf - --exclude $(DISTDIR) \
+	          --exclude CVS --exclude .svn --exclude svn-commit.tmp --exclude .git . | \
+	    (cd $(DISTDIR); tar xfBp -)
+	rm -f `find $(DISTDIR) -name "*~"`
+	GZIP=-9 tar -czf ../$(BLENDNAME)_$(VERSION).tar.gz $(DISTDIR)
+	rm -rf $(DISTDIR)
diff --git a/devtools/sec-blend-gen-control b/devtools/sec-blend-gen-control
index 773f257..b3d6123 100755
--- a/devtools/sec-blend-gen-control
+++ b/devtools/sec-blend-gen-control
@@ -539,7 +539,7 @@ def gen_control(**kwargs):
     architecture = "any"
 
     #TODO this is used for testing for the moment, will be changed
-    control_path = "control-sec"
+    control_path = "control-sec.temp"
     logger.debug("Opening file {0} to write".format(control_path))
     with open(control_path,'w') as fout:
 

-- 
Git repository for blends-gsoc code



More information about the Blends-commit mailing list