[Crosstoolchain-logs] [crosstoolchain] 01/04: Initial structure for cross-gcc source package

Wookey wookey at moszumanska.debian.org
Thu Feb 6 17:24:54 UTC 2014


This is an automated email from the git hooks/post-receive script.

wookey pushed a commit to branch master
in repository crosstoolchain.

commit 1209b1044510a9f02420a80d19bae24fe9e73d8c
Author: Wookey <wookey at wookware.org>
Date:   Thu Feb 6 03:19:13 2014 +0000

    Initial structure for cross-gcc source package
---
 cross-gcc-0.1/debian/README.source     |  16 ++++
 cross-gcc-0.1/debian/changelog         |   5 ++
 cross-gcc-0.1/debian/control           | 108 ++++++++++++++++++++++
 cross-gcc-0.1/debian/control.binary.in |  33 +++++++
 cross-gcc-0.1/debian/control.head.in   |  12 +++
 cross-gcc-0.1/debian/copyright         |  29 ++++++
 cross-gcc-0.1/debian/rules             | 158 +++++++++++++++++++++++++++++++++
 cross-gcc-0.1/debian/source/format     |   1 +
 8 files changed, 362 insertions(+)

diff --git a/cross-gcc-0.1/debian/README.source b/cross-gcc-0.1/debian/README.source
new file mode 100644
index 0000000..33433f7
--- /dev/null
+++ b/cross-gcc-0.1/debian/README.source
@@ -0,0 +1,16 @@
+This package does not contain the sources used to build the resulting packages. 
+It build-depends on the gcc source and uses that (via the
+gcc-<ver>-source package)
+
+All the supported gcc cross-targets are built by this package.
+
+Changing the set of TARGET architectures built, or the set of HOST
+architectures they are built for, set the TARGET_LIST and HOST_LIST
+variables respectively, then run:
+debian/rules control
+
+You can either set them on the command line, or change them in the
+rules file.
+
+e.g (if just overriding on the command line):
+TARGET_LIST="armel armhf" HOST_LIST="amd64" debian/rules control
diff --git a/cross-gcc-0.1/debian/changelog b/cross-gcc-0.1/debian/changelog
new file mode 100644
index 0000000..51733d8
--- /dev/null
+++ b/cross-gcc-0.1/debian/changelog
@@ -0,0 +1,5 @@
+cross-gcc (0.1) unstable; urgency=low
+
+  * Initial release
+
+ -- Wookey <wookey at debian.org>  Sat, 06 Feb 2014 01:04:00 +0100
diff --git a/cross-gcc-0.1/debian/control b/cross-gcc-0.1/debian/control
new file mode 100644
index 0000000..1fbb4f6
--- /dev/null
+++ b/cross-gcc-0.1/debian/control
@@ -0,0 +1,108 @@
+Source: cross-gcc
+Section: devel
+Priority: extra
+Maintainer: Wookey <wookey at wookware.org>
+Standards-Version: 3.9.5
+Build-Depends: dpkg-dev, dpkg,
+  binutils-source, autoconf (>=2.64), dejagnu,
+  bison, flex, gettext, texinfo, quilt, lsb-release,
+  sed, tar, xz-utils, python3:any, zlib1g-dev
+Vcs-Browser: https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi?p=crosstoolchain/crosstoolchain.git;a=tree
+Vcs-Git: https://alioth.debian.org/anonscm/git/crosstoolchain/crosstoolchain.git
+
+Package: binutils-arm-linux-gnueabihf
+Architecture: amd64 i386
+Section: devel
+Depends: ${misc:Depends}
+Built-Using: binutils-BINUTILS.VER
+Description: Cross-binutils (assembler, linker etc) targetting armhf
+ This package is the GNU binutils (assembler, linker, strip etc) built
+ for cross-building armhf binaries/packages
+ .
+ It is built by the cross-binutils package from the normal binutils
+ sources.
+
+Package: binutils-arm-linux-gnueabi
+Architecture: amd64 i386
+Section: devel
+Depends: ${misc:Depends}
+Built-Using: binutils-BINUTILS.VER
+Description: Cross-binutils (assembler, linker etc) targetting armel
+ This package is the GNU binutils (assembler, linker, strip etc) built
+ for cross-building armel binaries/packages
+ .
+ It is built by the cross-binutils package from the normal binutils
+ sources.
+
+Package: binutils-aarch64-linux-gnu
+Architecture: amd64 i386
+Section: devel
+Depends: ${misc:Depends}
+Built-Using: binutils-BINUTILS.VER
+Description: Cross-binutils (assembler, linker etc) targetting arm64
+ This package is the GNU binutils (assembler, linker, strip etc) built
+ for cross-building arm64 binaries/packages
+ .
+ It is built by the cross-binutils package from the normal binutils
+ sources.
+
+Package: binutils-mips-linux-gnu
+Architecture: amd64 i386
+Section: devel
+Depends: ${misc:Depends}
+Built-Using: binutils-BINUTILS.VER
+Description: Cross-binutils (assembler, linker etc) targetting mips
+ This package is the GNU binutils (assembler, linker, strip etc) built
+ for cross-building mips binaries/packages
+ .
+ It is built by the cross-binutils package from the normal binutils
+ sources.
+
+Package: binutils-mipsel-linux-gnu
+Architecture: amd64 i386
+Section: devel
+Depends: ${misc:Depends}
+Built-Using: binutils-BINUTILS.VER
+Description: Cross-binutils (assembler, linker etc) targetting mipsel
+ This package is the GNU binutils (assembler, linker, strip etc) built
+ for cross-building mipsel binaries/packages
+ .
+ It is built by the cross-binutils package from the normal binutils
+ sources.
+
+Package: binutils-powerpc-linux-gnu
+Architecture: amd64 i386
+Section: devel
+Depends: ${misc:Depends}
+Built-Using: binutils-BINUTILS.VER
+Description: Cross-binutils (assembler, linker etc) targetting powerpc
+ This package is the GNU binutils (assembler, linker, strip etc) built
+ for cross-building powerpc binaries/packages
+ .
+ It is built by the cross-binutils package from the normal binutils
+ sources.
+
+Package: binutils-i486-linux-gnu
+Architecture: amd64
+Section: devel
+Depends: ${misc:Depends}
+Built-Using: binutils-BINUTILS.VER
+Description: Cross-binutils (assembler, linker etc) targetting i386
+ This package is the GNU binutils (assembler, linker, strip etc) built
+ for cross-building i386 binaries/packages
+ .
+ It is built by the cross-binutils package from the normal binutils
+ sources.
+
+Package: binutils-x86_64-linux-gnu
+Architecture: i386
+Section: devel
+Depends: ${misc:Depends}
+Built-Using: binutils-BINUTILS.VER
+Description: Cross-binutils (assembler, linker etc) targetting amd64
+ This package is the GNU binutils (assembler, linker, strip etc) built
+ for cross-building amd64 binaries/packages
+ .
+ It is built by the cross-binutils package from the normal binutils
+ sources.
+
diff --git a/cross-gcc-0.1/debian/control.binary.in b/cross-gcc-0.1/debian/control.binary.in
new file mode 100644
index 0000000..12b58f7
--- /dev/null
+++ b/cross-gcc-0.1/debian/control.binary.in
@@ -0,0 +1,33 @@
+Package: cpp-GCC_BASE_VER-DEB_TARGET_GNU_TYPE
+Architecture: ARCH_LIST_FOR_BINARY
+Section: devel
+Depends: ${misc:Depends}
+Built-Using: gcc-GCC_BASE_VER-GCC.VER
+Description: Cross-gcc (cpp) targetting DEB_TARGET_ARCH
+ This package is the GNU C pre-processor cpp built for cross-building 
+ DEB_TARGET_ARCH binaries/packages
+ .
+ It is built by the cross-gcc package from the normal gcc sources.
+
+Package: gcc-GCC_BASE_VER-DEB_TARGET_GNU_TYPE
+Architecture: ARCH_LIST_FOR_BINARY
+Section: devel
+Depends: ${misc:Depends}
+Built-Using: gcc-GCC_BASE_VER-GCC.VER
+Description: Cross-gcc (GCC) targetting DEB_TARGET_ARCH
+ This package is the GNU C compiler built for cross-building 
+ DEB_TARGET_ARCH binaries/packages
+ .
+ It is built by the cross-gcc package from the normal gcc sources.
+
+Package: g++-GCC_BASE_VER-DEB_TARGET_GNU_TYPE
+Architecture: ARCH_LIST_FOR_BINARY
+Section: devel
+Depends: ${misc:Depends}
+Built-Using: gcc-GCC_BASE_VER-GCC.VER
+Description: Cross-gcc (G++) targetting DEB_TARGET_ARCH
+ This package is the GNU C++ compiler built for cross-building 
+ DEB_TARGET_ARCH binaries/packages
+ .
+ It is built by the cross-gcc package from the normal gcc sources.
+
diff --git a/cross-gcc-0.1/debian/control.head.in b/cross-gcc-0.1/debian/control.head.in
new file mode 100644
index 0000000..a8bab5d
--- /dev/null
+++ b/cross-gcc-0.1/debian/control.head.in
@@ -0,0 +1,12 @@
+Source: cross-gcc
+Section: devel
+Priority: extra
+Maintainer: Wookey <wookey at wookware.org>
+Standards-Version: 3.9.5
+Build-Depends: dpkg-dev, dpkg,
+  binutils-source, autoconf (>=2.64), dejagnu,
+  bison, flex, gettext, texinfo, quilt, lsb-release,
+  sed, tar, xz-utils, python3:any, zlib1g-dev
+Vcs-Browser: https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi?p=crosstoolchain/crosstoolchain.git;a=tree
+Vcs-Git: https://alioth.debian.org/anonscm/git/crosstoolchain/crosstoolchain.git
+
diff --git a/cross-gcc-0.1/debian/copyright b/cross-gcc-0.1/debian/copyright
new file mode 100644
index 0000000..f0d47c7
--- /dev/null
+++ b/cross-gcc-0.1/debian/copyright
@@ -0,0 +1,29 @@
+This package was made by Wookey <wookey at wookware.org>.  The structure
+was derived from the <arch>-cross-toolchain-base package by Marcin
+Juskiewicz.
+
+These scripts are free software; you can redistribute it and/or modify it
+under the terms of the GPLv2 or later
+
+Files: *
+Licence: GPL-2+
+Copyright:   Copyright 2014 Wookey <wookey at debian.org>
+             Copyright 2010 Marcin Juskiewicz <marcin.juskiewicz at linaro.org>
+
+License:
+	     
+  This package is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 3 of the License, or
+  (at your option) any later version.
+    
+  This program 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 General Public License for more details.
+    
+  You should have received a copy of the GNU General Public License
+  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+On Debian systems, the complete text of the GNU General
+Public License can be found in /usr/share/common-licenses/GPL-3'.
diff --git a/cross-gcc-0.1/debian/rules b/cross-gcc-0.1/debian/rules
new file mode 100755
index 0000000..c561f3e
--- /dev/null
+++ b/cross-gcc-0.1/debian/rules
@@ -0,0 +1,158 @@
+#!/usr/bin/make -f
+
+# prefix for builds - without leading slash
+PF ?= usr
+
+THIS_PKG         := $(shell dpkg-parsechangelog| sed -n 's/-*//; s/^Source: \(.*\)/\1/p')
+THIS_PKG_VER     := $(shell dpkg-parsechangelog| sed -n 's/^Version: \(.*\)/\1/p')
+THIS_PKG_MAINT   := $(shell dpkg-parsechangelog| sed -n 's/^Maintainer: \(.*\)/\1/p')
+
+DEB_HOST_ARCH    := $(shell dpkg-architecture -qDEB_HOST_ARCH)
+stamp            := stamp-dir/
+
+DISTRO ?= $(shell lsb_release -is)
+
+ifeq ($(DISTRO),Debian)
+#TARGET_LIST ?= armhf armel arm64 mips mipsel powerpc i386 amd64
+TARGET_LIST ?= armhf
+HOST_LIST ?= amd64 i386
+GCC_BASE_VER ?=4.8
+else # Ubuntu
+TARGET_LIST ?= armhf armel arm64
+HOST_LIST ?= amd64 i386
+BASE_VER_GCC ?=4.8
+endif
+
+VER_GCC     := $(shell dpkg-parsechangelog -l/usr/src/gcc-$(BASE_VER_GCC)/debian/changelog | egrep '^Version:' | cut -f 2 -d ' '|cut -f 1 -d '-'|cut -d '.' -f1-3)
+PKG_VER_GCC := $(shell dpkg-parsechangelog -l/usr/src/gcc-$(BASE_VER_GCC)/debian/changelog | egrep '^Version:' | cut -f 2 -d ' '|cut -f 1 -d '-')
+DEB_VER_GCC := $(shell dpkg-parsechangelog -l/usr/src/gcc-$(BASE_VER_GCC)/debian/changelog | egrep '^Version:' | cut -f 2 -d ' ')
+
+GCC_DIR  := /usr/src/gcc
+
+# Don't try to build the HOST=TARGET (ie. non-cross) combination on/for this arch
+TARGETS := $(filter-out ${DEB_HOST_ARCH}, ${TARGET_LIST})
+
+# taken from gcc packaging
+define unpack_tarball
+	tar -x -f $1
+endef
+
+info:
+	@echo "Gcc version:         ${VER_GCC}	${DEB_VER_GCC}	${PKG_VER_GCC}"
+	@echo
+	@echo "Target architecture list: ${TARGETS}"     
+	@echo "Host architecture:        ${DEB_HOST_ARCH}"
+
+$(stamp)init-dirs:
+	mkdir debian/tmp -p
+	touch $@
+
+init: $(stamp)init
+
+$(stamp)init:
+	@echo START $@
+	$(call unpack_tarball, ${GCC_DIR}/gcc-$(BASE_VER_GCC)-${VER_GCC}.tar.xz)
+	set -e; \
+	cd gcc-$(BASE_VER_GCC)-${PKG_VER_GCC} ;\
+	cp -a ${GCC_DIR}/debian/ . ;\
+	if [ -n "$$(grep -v '^\#' ${CURDIR}/debian/patches/gcc/series)" ]; then \
+	  QUILT_PATCHES=${CURDIR}/debian/patches/gcc quilt push -a; \
+	fi; \
+
+	touch $@
+
+$(stamp)build-%: $(stamp)init
+	@echo START $@
+	set -e; \
+	cd gcc-$(BASE_VER_GCC)-${PKG_VER_GCC}; \
+	DEB_TARGET_ARCH=$* dpkg-buildpackage -T control-stamp; \
+	WITH_SYSROOT=/ DEB_TARGET_ARCH=$* with_deps_on_target_arch_pkgs=yes dpkg-buildpackage -B -uc -us; \
+	cd ..; \
+	touch $@
+
+
+clean:
+	rm -rf gcc-*
+	rm -rf debian/tmp debian/files
+	find debian -name '*~' | xargs -r rm -f
+	rm -f *.deb *.changes
+	rm -rf repackfiles tmp
+	rm -rf $(stamp)
+	mkdir $(stamp)
+
+
+#
+# Repack resulting packages to make changes:
+# - Set Source and Version to this package 
+define repack_deb
+	echo "repacking $$deb ..."; \
+	rm -rf tmp/*; \
+	dpkg-deb -x $$deb tmp; \
+	dpkg-deb -e $$deb tmp/DEBIAN; \
+	pkgname=`echo $$deb | cut -d'_' -f1`; \
+        sed -i -e's/^Source:.*/Source: ${THIS_PKG} (${THIS_PKG_VER})/' tmp/DEBIAN/control; \
+        sed -i -e's/^Maintainer:.*/Maintainer: ${THIS_PKG_MAINT}\nXB-Original-Source-&/' tmp/DEBIAN/control; \
+	sed -i -e'3 a\
+	Built-Using: gcc-$(BASE_VER_GCC) (=${DEB_VER_GCC})' tmp/DEBIAN/control; \
+	if [ -e debian/overrides/$$pkgname ]; then \
+	  mkdir -p tmp/usr/share/lintian/overrides; \
+	  cp debian/overrides/$$pkgname tmp/usr/share/lintian/overrides/; \
+	fi; \
+ 	(cd tmp && md5sum `find usr -type f` >>DEBIAN/md5sums);\
+	dpkg-deb -b tmp/ ../$$deb; \
+	echo "        done";
+endef
+
+repack-debs:
+	@echo START $@
+	install -d repackfiles; \
+	for deb in $(wildcard *.deb); \
+	do \
+	  $(call repack_deb, $${deb}) \
+	done; \
+
+BUILD_TARGETS := $(patsubst %,$(stamp)build-%,${TARGETS})
+
+build-arch: build
+build-indep: 
+build: $(BUILD_TARGETS)
+	rm -f *.changes
+
+binary: binary-arch binary-indep 
+binary-arch:  build-arch mangle-debian-files
+binary-indep:
+
+
+$(stamp)debian-files-base:
+	@echo START $@
+	rm -f debian/files
+	touch $@
+
+define generate_debian_files
+	@echo Debs: $1
+	@for deb in $1; \
+	do \
+		echo -n "`basename $$deb` " >>debian/files; \
+		dpkg-deb -I $$deb | grep Section  | cut -d ' ' -f 3 | tr "\n" ' ' >>debian/files; \
+		dpkg-deb -I $$deb | grep Priority | cut -d ' ' -f 3 | tr -d "\n" >>debian/files; \
+		echo "" >>debian/files; \
+	done
+endef
+
+mangle-debian-files: $(stamp)debian-files-base repack-debs
+	@echo START $@
+	$(call generate_debian_files,  $(wildcard *.deb))
+
+
+# Generate the control file from head plus stanza for each binary
+# Don't build binaries when HOST=TARGET
+
+control:
+	cat debian/control.head.in > debian/control;
+	for DEB_TARGET_ARCH in $(TARGET_LIST); do \
+	    DEB_TARGET_GNU_TYPE=`dpkg-architecture -a$${DEB_TARGET_ARCH} -qDEB_HOST_GNU_TYPE -f 2>/dev/null`; \
+	    ARCH_LIST_FOR_BINARY=`echo ${HOST_LIST} | sed "s/ *$${DEB_TARGET_ARCH} *//"`; \
+	    sed -e "s/DEB_TARGET_ARCH/$${DEB_TARGET_ARCH}/g" debian/control.binary.in | \
+	    sed -e "s/ARCH_LIST_FOR_BINARY/$${ARCH_LIST_FOR_BINARY}/g" | \
+	    sed -e "s/DEB_TARGET_GNU_TYPE/$${DEB_TARGET_GNU_TYPE}/g" >> debian/control; \
+	done
diff --git a/cross-gcc-0.1/debian/source/format b/cross-gcc-0.1/debian/source/format
new file mode 100644
index 0000000..89ae9db
--- /dev/null
+++ b/cross-gcc-0.1/debian/source/format
@@ -0,0 +1 @@
+3.0 (native)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/crosstoolchain/crosstoolchain.git



More information about the Crosstoolchain-logs mailing list