From 77bf6fb0e642c004c28698f651bd4dc2939157f3 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Wed, 23 Oct 2002 12:54:42 +0000 Subject: [PATCH] Add several new components working towards a fully sandboxed buildsystem -Erik --- make/bash.mk | 45 +++++++++++++++++++++++++++++++++++++++ make/coreutils.mk | 54 +++++++++++++++++++++++++++++++++++++++++++++++ make/findutils.mk | 47 +++++++++++++++++++++++++++++++++++++++++ make/gawk.mk | 44 ++++++++++++++++++++++++++++++++++++++ make/make.mk | 44 ++++++++++++++++++++++++++++++++++++++ make/sed.mk | 45 +++++++++++++++++++++++++++++++++++++++ 6 files changed, 279 insertions(+) create mode 100644 make/bash.mk create mode 100644 make/coreutils.mk create mode 100644 make/findutils.mk create mode 100644 make/gawk.mk create mode 100644 make/make.mk create mode 100644 make/sed.mk diff --git a/make/bash.mk b/make/bash.mk new file mode 100644 index 0000000000..869be9df05 --- /dev/null +++ b/make/bash.mk @@ -0,0 +1,45 @@ +############################################################# +# +# bash +# +############################################################# +BASH_SOURCE:=bash-2.05b.tar.gz +BASH_SITE:=ftp://ftp.gnu.org/gnu/bash +BASH_CAT:=zcat +BASH_DIR:=$(BUILD_DIR)/bash-2.05b +BASH_BINARY:=bash +BASH_TARGET_BINARY:=bin/bash + +$(DL_DIR)/$(BASH_SOURCE): + wget -P $(DL_DIR) $(BASH_SITE)/$(BASH_SOURCE) + +bash-source: $(DL_DIR)/$(BASH_SOURCE) + +$(BASH_DIR)/.unpacked: $(DL_DIR)/$(BASH_SOURCE) + $(BASH_CAT) $(DL_DIR)/$(BASH_SOURCE) | tar -C $(BUILD_DIR) -xvf - + touch $(BASH_DIR)/.unpacked + +$(BASH_DIR)/.configured: $(BASH_DIR)/.unpacked + (cd $(BASH_DIR); autoconf; rm -f config.cache; CC=$(TARGET_CC1) \ + CFLAGS=-D_POSIX_SOURCE ./configure --prefix=/usr --disable-nls \ + --mandir=/junk --infodir=/junk \ + ); + touch $(BASH_DIR)/.configured + +$(BASH_DIR)/$(BASH_BINARY): $(BASH_DIR)/.configured + $(MAKE) CC=$(TARGET_CC1) -C $(BASH_DIR) + +$(TARGET_DIR)/$(BASH_TARGET_BINARY): $(BASH_DIR)/$(BASH_BINARY) + $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC1) -C $(BASH_DIR) install + mv $(TARGET_DIR)/usr/bin/bash* $(TARGET_DIR)/bin/ + rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/junk + +bash: ncurses uclibc $(TARGET_DIR)/$(BASH_TARGET_BINARY) + +bash-clean: + $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC1) -C $(BASH_DIR) uninstall + -make -C $(BASH_DIR) clean + +bash-dirclean: + rm -rf $(BASH_DIR) + diff --git a/make/coreutils.mk b/make/coreutils.mk new file mode 100644 index 0000000000..5e1bf351b2 --- /dev/null +++ b/make/coreutils.mk @@ -0,0 +1,54 @@ +############################################################# +# +# coreutils +# +############################################################# +COREUTILS_SOURCE:=coreutils-4.5.3.tar.bz2 +COREUTILS_SITE:=ftp://alpha.gnu.org/gnu/coreutils/ +COREUTILS_CAT:=bzcat +COREUTILS_DIR:=$(BUILD_DIR)/coreutils-4.5.3 +COREUTILS_BINARY:=src/cat +COREUTILS_TARGET_BINARY:=bin/cat +BIN_PROGS:=cat chgrp chmod chown cp date dd df dir echo false ln ls mkdir \ + mknod mv pwd rm rmdir vdir sleep stty sync touch true uname + +$(DL_DIR)/$(COREUTILS_SOURCE): + wget -P $(DL_DIR) $(COREUTILS_SITE)/$(COREUTILS_SOURCE) + +coreutils-source: $(DL_DIR)/$(COREUTILS_SOURCE) + +$(COREUTILS_DIR)/.unpacked: $(DL_DIR)/$(COREUTILS_SOURCE) + $(COREUTILS_CAT) $(DL_DIR)/$(COREUTILS_SOURCE) | tar -C $(BUILD_DIR) -xvf - + touch $(COREUTILS_DIR)/.unpacked + +$(COREUTILS_DIR)/.configured: $(COREUTILS_DIR)/.unpacked + (cd $(COREUTILS_DIR); autoconf; rm -f config.cache; CC=$(TARGET_CC1) \ + CFLAGS=-D_POSIX_SOURCE ./configure --prefix=/usr --disable-nls \ + --mandir=/junk --infodir=/junk \ + ); + touch $(COREUTILS_DIR)/.configured + +$(COREUTILS_DIR)/$(COREUTILS_BINARY): $(COREUTILS_DIR)/.configured + $(MAKE) CC=$(TARGET_CC1) -C $(COREUTILS_DIR) + +$(TARGET_DIR)/$(COREUTILS_TARGET_BINARY): $(COREUTILS_DIR)/$(COREUTILS_BINARY) + $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC1) -C $(COREUTILS_DIR) install + # some things go in root rather than usr + for f in $(BIN_PROGS); do \ + mv $(TARGET_DIR)/usr/bin/$$f $(TARGET_DIR)/bin/$$f; \ + done + # link for archaic shells + ln -fs test $(TARGET_DIR)/usr/bin/[ + # gnu thinks chroot is in bin, debian thinks it's in sbin + mv $(TARGET_DIR)/usr/bin/chroot $(TARGET_DIR)/usr/sbin/chroot + rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/junk + +coreutils: uclibc $(TARGET_DIR)/$(COREUTILS_TARGET_BINARY) + +coreutils-clean: + $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC1) -C $(COREUTILS_DIR) uninstall + -make -C $(COREUTILS_DIR) clean + +coreutils-dirclean: + rm -rf $(COREUTILS_DIR) + diff --git a/make/findutils.mk b/make/findutils.mk new file mode 100644 index 0000000000..1fa326cba9 --- /dev/null +++ b/make/findutils.mk @@ -0,0 +1,47 @@ +############################################################# +# +# findutils +# +############################################################# +FINDUTILS_SOURCE:=findutils_4.1.7.orig.tar.gz +FINDUTILS_SITE:=http://ftp.debian.org/debian/pool/main/f/findutils +FINDUTILS_CAT:=zcat +FINDUTILS_DIR:=$(BUILD_DIR)/findutils-4.1.7.orig +FINDUTILS_BINARY:=find/find +FINDUTILS_TARGET_BINARY:=usr/bin/find + +$(DL_DIR)/$(FINDUTILS_SOURCE): + wget -P $(DL_DIR) $(FINDUTILS_SITE)/$(FINDUTILS_SOURCE) + +findutils-source: $(DL_DIR)/$(FINDUTILS_SOURCE) + +$(FINDUTILS_DIR)/.unpacked: $(DL_DIR)/$(FINDUTILS_SOURCE) + $(FINDUTILS_CAT) $(DL_DIR)/$(FINDUTILS_SOURCE) | tar -C $(BUILD_DIR) -xvf - + (cd $(FINDUTILS_DIR); perl -i -p -e "s,# define mbstate_t int,# define mbstate_t int\n\ + # define wchar_t char,;" $(FINDUTILS_DIR)/lib/quotearg.c) + touch $(FINDUTILS_DIR)/.unpacked + +$(FINDUTILS_DIR)/.configured: $(FINDUTILS_DIR)/.unpacked + (cd $(FINDUTILS_DIR); autoconf; rm -f config.cache; CC=$(TARGET_CC1) \ + CFLAGS=-D_POSIX_SOURCE ./configure --prefix=/usr --disable-nls \ + --mandir=/junk --infodir=/junk --localstatedir=/var/lib/locate \ + --libexecdir='$${prefix}/lib/locate' \ + ); + touch $(FINDUTILS_DIR)/.configured + +$(FINDUTILS_DIR)/$(FINDUTILS_BINARY): $(FINDUTILS_DIR)/.configured + $(MAKE) CC=$(TARGET_CC1) -C $(FINDUTILS_DIR) + +$(TARGET_DIR)/$(FINDUTILS_TARGET_BINARY): $(FINDUTILS_DIR)/$(FINDUTILS_BINARY) + $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC1) -C $(FINDUTILS_DIR) install + rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/junk + +findutils: uclibc $(TARGET_DIR)/$(FINDUTILS_TARGET_BINARY) + +findutils-clean: + $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC1) -C $(FINDUTILS_DIR) uninstall + -make -C $(FINDUTILS_DIR) clean + +findutils-dirclean: + rm -rf $(FINDUTILS_DIR) + diff --git a/make/gawk.mk b/make/gawk.mk new file mode 100644 index 0000000000..e72e663586 --- /dev/null +++ b/make/gawk.mk @@ -0,0 +1,44 @@ +############################################################# +# +# gawk +# +############################################################# +GAWK_SOURCE:=gawk-3.1.1.tar.gz +GAWK_SITE:=ftp://ftp.gnu.org/gnu/gawk +GAWK_CAT:=zcat +GAWK_DIR:=$(BUILD_DIR)/gawk-3.1.1 +GAWK_BINARY:=gawk +GAWK_TARGET_BINARY:=usr/bin/gawk + +$(DL_DIR)/$(GAWK_SOURCE): + wget -P $(DL_DIR) $(GAWK_SITE)/$(GAWK_SOURCE) + +gawk-source: $(DL_DIR)/$(GAWK_SOURCE) + +$(GAWK_DIR)/.unpacked: $(DL_DIR)/$(GAWK_SOURCE) + $(GAWK_CAT) $(DL_DIR)/$(GAWK_SOURCE) | tar -C $(BUILD_DIR) -xvf - + touch $(GAWK_DIR)/.unpacked + +$(GAWK_DIR)/.configured: $(GAWK_DIR)/.unpacked + (cd $(GAWK_DIR); autoconf; rm -f config.cache; CC=$(TARGET_CC1) \ + CFLAGS=-D_POSIX_SOURCE ./configure --prefix=/usr --disable-nls \ + --mandir=/junk --infodir=/junk \ + ); + touch $(GAWK_DIR)/.configured + +$(GAWK_DIR)/$(GAWK_BINARY): $(GAWK_DIR)/.configured + $(MAKE) CC=$(TARGET_CC1) -C $(GAWK_DIR) + +$(TARGET_DIR)/$(GAWK_TARGET_BINARY): $(GAWK_DIR)/$(GAWK_BINARY) + $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC1) -C $(GAWK_DIR) install + rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/junk + +gawk: uclibc $(TARGET_DIR)/$(GAWK_TARGET_BINARY) + +gawk-clean: + $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC1) -C $(GAWK_DIR) uninstall + -make -C $(GAWK_DIR) clean + +gawk-dirclean: + rm -rf $(GAWK_DIR) + diff --git a/make/make.mk b/make/make.mk new file mode 100644 index 0000000000..2300218d32 --- /dev/null +++ b/make/make.mk @@ -0,0 +1,44 @@ +############################################################# +# +# make +# +############################################################# +GNUMAKE_SOURCE:=make-3.80.tar.bz2 +GNUMAKE_SITE:=ftp://ftp.gnu.org/gnu/make +GNUMAKE_CAT:=bzcat +GNUMAKE_DIR:=$(BUILD_DIR)/make-3.80 +GNUMAKE_BINARY:=make +GNUMAKE_TARGET_BINARY:=usr/bin/make + +$(DL_DIR)/$(GNUMAKE_SOURCE): + wget -P $(DL_DIR) $(GNUMAKE_SITE)/$(GNUMAKE_SOURCE) + +make-source: $(DL_DIR)/$(GNUMAKE_SOURCE) + +$(GNUMAKE_DIR)/.unpacked: $(DL_DIR)/$(GNUMAKE_SOURCE) + $(GNUMAKE_CAT) $(DL_DIR)/$(GNUMAKE_SOURCE) | tar -C $(BUILD_DIR) -xvf - + touch $(GNUMAKE_DIR)/.unpacked + +$(GNUMAKE_DIR)/.configured: $(GNUMAKE_DIR)/.unpacked + (cd $(GNUMAKE_DIR); autoconf; rm -f config.cache; CC=$(TARGET_CC1) \ + CFLAGS=-D_POSIX_SOURCE ./configure --prefix=/usr --disable-nls \ + --mandir=/junk --infodir=/junk \ + ); + touch $(GNUMAKE_DIR)/.configured + +$(GNUMAKE_DIR)/$(GNUMAKE_BINARY): $(GNUMAKE_DIR)/.configured + $(MAKE) CC=$(TARGET_CC1) -C $(GNUMAKE_DIR) + +$(TARGET_DIR)/$(GNUMAKE_TARGET_BINARY): $(GNUMAKE_DIR)/$(GNUMAKE_BINARY) + $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC1) -C $(GNUMAKE_DIR) install + rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/junk + +make: uclibc $(TARGET_DIR)/$(GNUMAKE_TARGET_BINARY) + +make-clean: + $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC1) -C $(GNUMAKE_DIR) uninstall + -make -C $(GNUMAKE_DIR) clean + +make-dirclean: + rm -rf $(GNUMAKE_DIR) + diff --git a/make/sed.mk b/make/sed.mk new file mode 100644 index 0000000000..cbd7780da2 --- /dev/null +++ b/make/sed.mk @@ -0,0 +1,45 @@ +############################################################# +# +# sed +# +############################################################# +SED_SOURCE:=sed-3.02.tar.gz +SED_SITE:=ftp://ftp.gnu.org/gnu/sed +SED_CAT:=zcat +SED_DIR:=$(BUILD_DIR)/sed-3.02 +SED_BINARY:=sed/sed +SED_TARGET_BINARY:=bin/sed + +$(DL_DIR)/$(SED_SOURCE): + wget -P $(DL_DIR) $(SED_SITE)/$(SED_SOURCE) + +sed-source: $(DL_DIR)/$(SED_SOURCE) + +$(SED_DIR)/.unpacked: $(DL_DIR)/$(SED_SOURCE) + $(SED_CAT) $(DL_DIR)/$(SED_SOURCE) | tar -C $(BUILD_DIR) -xvf - + touch $(SED_DIR)/.unpacked + +$(SED_DIR)/.configured: $(SED_DIR)/.unpacked + (cd $(SED_DIR); autoconf; rm -f config.cache; CC=$(TARGET_CC1) \ + CFLAGS=-D_POSIX_SOURCE ./configure --prefix=/usr --disable-nls \ + --mandir=/junk --infodir=/junk \ + ); + touch $(SED_DIR)/.configured + +$(SED_DIR)/$(SED_BINARY): $(SED_DIR)/.configured + $(MAKE) CC=$(TARGET_CC1) -C $(SED_DIR) + +$(TARGET_DIR)/$(SED_TARGET_BINARY): $(SED_DIR)/$(SED_BINARY) + $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC1) -C $(SED_DIR) install + mv $(TARGET_DIR)/usr/bin/sed $(TARGET_DIR)/bin/ + rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/junk + +sed: uclibc $(TARGET_DIR)/$(SED_TARGET_BINARY) + +sed-clean: + $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC1) -C $(SED_DIR) uninstall + -sed -C $(SED_DIR) clean + +sed-dirclean: + rm -rf $(SED_DIR) + -- 2.30.2