###############################################################################
#
-NAME="IPFire" # Software name
-SNAME="ipfire" # Short name
-VERSION="3.0-prealpha2" # Version number
-TOOLCHAINVERSION="${VERSION}-13" # Toolchain
-SLOGAN="Gluttony" # Software slogan
-
-# Include funtions
-. tools/make-include
-
-
-################################################################################
-# This builds the entire stage "toolchain" #
-################################################################################
-toolchain_build() {
-
- ORG_PATH=$PATH
- export PATH=${TOOLS_DIR}/usr/bin:${TOOLS_DIR}/usr/sbin:${TOOLS_DIR}/bin:${TOOLS_DIR}/sbin:$PATH
- STAGE_ORDER=01
- STAGE=toolchain
-
- LOGFILE="$BASEDIR/log_${TARGET}/_build.${STAGE_ORDER}-toolchain.log"
- export LOGFILE
-
- build_spy stage ${STAGE}
-
- # We can't skip packages in toolchain stage
- SAVE_SKIP_PACKAGE_LIST=$SKIP_PACKAGE_LIST
- SKIP_PACKAGE_LIST=
-
- icecc_disable
-
- toolchain_make stage1
- toolchain_make ccache PASS=1
- toolchain_make binutils PASS=1
- toolchain_make gcc PASS=1
- toolchain_make linux-headers
- toolchain_make glibc
- toolchain_make adjust-toolchain
- toolchain_make test-toolchain PASS=1
- toolchain_make zlib
- toolchain_make gcc PASS=2
- toolchain_make binutils PASS=2
- toolchain_make test-toolchain PASS=2
- toolchain_make ncurses
- toolchain_make attr
- toolchain_make acl
- toolchain_make bash
- toolchain_make bzip2
- toolchain_make coreutils
- toolchain_make cpio
- toolchain_make diffutils
- toolchain_make e2fsprogs
- toolchain_make icecc
- icecc_enable
- icecc_use toolchain # Use the fresh gcc
- toolchain_make ccache PASS=2
- toolchain_make file
- toolchain_make findutils
- toolchain_make gawk
- toolchain_make gettext
- toolchain_make grep
- toolchain_make gzip
- toolchain_make m4
- toolchain_make make
- toolchain_make patch
- toolchain_make pax-utils
- toolchain_make perl
- toolchain_make sed
- toolchain_make tar
- toolchain_make texinfo
- toolchain_make flex
- toolchain_make bc
- toolchain_make xz
- toolchain_make autoconf
- toolchain_make automake
- toolchain_make strip
-
- export PATH=$ORG_PATH SKIP_PACKAGE_LIST=$SAVE_SKIP_PACKAGE_LIST
- unset SAVE_SKIP_PACKAGE_LIST
-}
-
-################################################################################
-# This builds the entire stage "base" #
-################################################################################
-base_build() {
-
- PATH=${TOOLS_DIR}/usr/bin:/bin:/usr/bin:/sbin:/usr/sbin:$TOOLS_DIR/bin
- STAGE_ORDER=02
- STAGE=base
-
- LOGFILE="$BASEDIR/log_${TARGET}/_build.${STAGE_ORDER}-base.log"
- export LOGFILE
-
- build_spy stage ${STAGE}
-
- # Start distributed compiling with toolchain
- iceccd_start
- icecc_use toolchain
-
- ipfire_make stage2
- ipfire_make scripts
- ipfire_make system-release
- ipfire_make linux-headers
- ipfire_make man-pages
- ipfire_make glibc
- ipfire_make adjust-toolchain
- ipfire_make test-toolchain
- ipfire_make zlib
- ipfire_make binutils
- ipfire_make gcc
-
- # Change to self-built gcc
- icecc_use base
-
- ipfire_make make
- ipfire_make libtool
- ipfire_make gettext
- ipfire_make pkg-config
- ipfire_make berkeley
- ipfire_make sed
- ipfire_make iana-etc
- ipfire_make m4
- ipfire_make bison
- ipfire_make flex
- ipfire_make ncurses
- ipfire_make shadow
- ipfire_make cracklib
- ipfire_make pam
- ipfire_make attr
- ipfire_make acl
- ipfire_make libcap2
- ipfire_make util-linux-ng
- ipfire_make e2fsprogs
- ipfire_make coreutils
- ipfire_make procps
- ipfire_make perl
- ipfire_make readline
- ipfire_make libidn
- ipfire_make bzip2
- ipfire_make pcre
- ipfire_make paxctl
- ipfire_make autoconf
- ipfire_make automake
- ipfire_make bash
- ipfire_make cpio
- ipfire_make diffutils
- ipfire_make eventlog
- ipfire_make file
- ipfire_make findutils
- ipfire_make gmp
- ipfire_make grub
- ipfire_make gawk
- ipfire_make glib2
- ipfire_make grep
- ipfire_make groff
- ipfire_make gzip
- ipfire_make iputils
- ipfire_make iproute2
- ipfire_make kbd
- ipfire_make less
- ipfire_make man-db
- ipfire_make module-init-tools
- ipfire_make mpfr
- ipfire_make patch
- ipfire_make pax-utils
- ipfire_make psmisc
- ipfire_make syslog-ng
- ipfire_make sysvinit
- ipfire_make tar
- ipfire_make texinfo
- ipfire_make vim
+NAME="IPFire" # Software name
+SNAME="ipfire" # Short name
+VERSION="3.0-prealpha2" # Version number
+SLOGAN="Gluttony" # Software slogan
+
+BASEDIR=/ipfire-3.x
+
+. ${BASEDIR}/tools/ui-functions
+
+NAOKI=${BASEDIR}/tools/naoki
+
+while [ $# -gt 0 ]; do
+ case "${1}" in
+ --debug|-d)
+ DEBUG=1
+ log DEBUG "Debugging mode enabled by command line."
+ ;;
+ *)
+ action=${1}
+ shift
+ break
+ ;;
+ esac
+ shift
+done
+
+function package() {
+ local action=${1}
+ shift
+
+ case "${action}" in
+ dependencies|deps)
+ echo -e "${BOLD}Build dependencies:${NORMAL} $(package_build_dependencies $@)"
+ echo -e "${BOLD}Dependencies:${NORMAL} $(package_dependencies $@)"
+ ;;
+ find)
+ find_package $@
+ ;;
+ list)
+ ${NAOKI} --toolchain list
+ ;;
+ profile|info)
+ ${NAOKI} profile $@
+ ;;
+ _info)
+ package_info $(find_package $@)
+ ;;
+ esac
}
-################################################################################
-# This builds the entire stage "ipfire" #
-################################################################################
-ipfire_build() {
- PATH=${TOOLS_DIR}/usr/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/${MACHINE_REAL}-linux/bin
- STAGE_ORDER=03
- STAGE=ipfire
-
- LOGFILE="$BASEDIR/log_${TARGET}/_build.${STAGE_ORDER}-ipfire.log"
- export LOGFILE
-
- build_spy stage ${STAGE}
-
- ### Building the configuration dirs and files
- #
- ipfire_make stage3
- ipfire_make xz
- ipfire_make unzip
-
- ipfire_make linux
-
- ### Building some general stuff
- # STAGE 1
- ipfire_make libdaemon
- ipfire_make expat
- ipfire_make dbus
- ipfire_make dbus-glib
- ipfire_make upstart
- ipfire_make initscripts
- ipfire_make openssl
- ipfire_make pth
- ipfire_make libassuan
- ipfire_make libgpg-error
- ipfire_make libgcrypt
- ipfire_make gnutls
- ipfire_make perl-xml-parser
- ipfire_make intltool
- ipfire_make python
- ipfire_make python-cracklib
- ipfire_make python-dbus
- ipfire_make python-setuptools
- ipfire_make python-urlgrabber
- ipfire_make python-IPy
- ipfire_make libxml2
- ipfire_make libxslt
- ipfire_make popt
- ipfire_make libusb
- ipfire_make libusb-compat # Can be removed if usbutils supports libusb-1.0
- ipfire_make bc
- ipfire_make boost
- ipfire_make lua
+function listmatch() {
+ local arg=${1}
+ shift
- ### Building some network stuff
- #
- ipfire_make libpcap
- ipfire_make linux-atm
- ipfire_make ppp
- ipfire_make pptp
- ipfire_make dhcp
- ipfire_make iptables
- ipfire_make libnfnetlink
- ipfire_make libnetfilter_queue
- ipfire_make libnetfilter_conntrack
- ipfire_make libnetfilter_log
- ipfire_make python-netfilter_conntrack
- ipfire_make l7-protocols
- ipfire_make bridge-utils
- ipfire_make vlan
- ipfire_make bind
- ipfire_make jwhois
- ipfire_make avahi
- ipfire_make libssh2
- ipfire_make libdnet
- ipfire_make rstp
- ipfire_make ebtables
- ipfire_make openlldp
- ipfire_make radvd
- ipfire_make aiccu
- ipfire_make libnl
- ipfire_make iw
-
- ### Building some general stuff
- # STAGE 2
- ipfire_make libksba
- ipfire_make slang
- ipfire_make newt
- ipfire_make cyrus-sasl
- ipfire_make openldap
- ipfire_make pam_ldap
- ipfire_make nss_ldap
- ipfire_make ldapvi
- ipfire_make sqlite
- ipfire_make python-sqlite2
- ipfire_make curl
- ipfire_make pinentry
- ipfire_make gnupg2
- ipfire_make sudo
- ipfire_make libjpeg
- ipfire_make libpng
- ipfire_make libtiff
- ipfire_make libart
- ipfire_make freetype
- ipfire_make fontconfig
- ipfire_make pixman
- ipfire_make cairo
- ipfire_make pango
- ipfire_make lzo
- ipfire_make lsof
- ipfire_make br2684ctl
- ipfire_make etherwake
- ipfire_make beep
- ipfire_make libuser
- ipfire_make passwd
- ipfire_make directfb
- ipfire_make pdns
- ipfire_make pdns-recursor
- ipfire_make libevent
- ipfire_make libnfsidmap
- ipfire_make libgssglue
- ipfire_make librpcsecgss
- ipfire_make gperf
-
- ### Building vpn stuff
- #
- ipfire_make strongswan
- ipfire_make openvpn
-
- ### Building filesystem stuff
- #
- ipfire_make btrfs-progs
- ipfire_make reiserfsprogs
- ipfire_make libaal
- ipfire_make reiser4progs
- ipfire_make xfsprogs
- ipfire_make sysfsutils
- ipfire_make squashfs-tools
- ipfire_make dosfstools
- ipfire_make lvm2
- ipfire_make mdadm
- ipfire_make dmraid
- ipfire_make cryptsetup-luks
- ipfire_make python-cryptsetup
- ipfire_make fuse
-
- ### Building hardware utils
- #
- ipfire_make pciutils
- ipfire_make usbutils
- ipfire_make hdparm
- ipfire_make smartmontools
- ipfire_make lm-sensors
- ipfire_make parted
- ipfire_make hal
- ipfire_make hal-info
- ipfire_make udev
-
- ### Building some important tools
- #
- ipfire_make ulogd2
- ipfire_make which
- ipfire_make screen
- ipfire_make rrdtool
- ipfire_make ntp
- ipfire_make openssh
- ipfire_make ez-ipupdate
- ipfire_make noip
- ipfire_make lighttpd
- ipfire_make webinterface
- ipfire_make logrotate
- #ipfire_make logwatch
- ipfire_make dvdrtools
- ipfire_make python-parted
- ipfire_make python-pyblock
- ipfire_make libbdevid
- ipfire_make memtest86+
- ipfire_make quagga
- #ipfire_make mISDN
- ipfire_make wireless-tools
-
- ipfire_make python-werkzeug
- ipfire_make python-flup
- ipfire_make python-tornado
- ipfire_make pyfire
- ipfire_make network
- ipfire_make firewall
- ipfire_make pakfire
-}
-
-################################################################################
-# This builds the entire stage "misc" #
-################################################################################
-misc_build() {
-
- PATH=${TOOLS_DIR}/usr/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/${MACHINE_REAL}-linux/bin
- STAGE_ORDER=04
- STAGE=misc
-
- LOGFILE="$BASEDIR/log_${TARGET}/_build.${STAGE_ORDER}-misc.log"
- export LOGFILE
-
- build_spy stage ${STAGE}
-
- ipfire_make stage4
-
- ### Console tools
- #
- ipfire_make mc
- ipfire_make traceroute
- ipfire_make nmap
- #ipfire_make rsync
- ipfire_make tcpdump
- ipfire_make htop
- ipfire_make nano
- ipfire_make joe
-
- ### Servers
- #
- ipfire_make squid
- ipfire_make samba
-
- ### Assembler
- #
- ipfire_make nasm
- ipfire_make syslinux
-
- ipfire_make mkinitramfs
- ipfire_make splashy
-
- ipfire_make vsftpd
-
- ## NTFS
- #ipfire_make ntfs-3g
- #
- ## Net tools
- ipfire_make net-snmp
- ipfire_make bwm-ng
-
- ### These will become addons as usual but will be integrated later
- #
- #ipfire_make snort
- #ipfire_make oinkmaster
- ipfire_make ghostscript
- ipfire_make cups
- ipfire_make sane
- ipfire_make hplip
- #ipfire_make postfix
- #ipfire_make fetchmail
- #ipfire_make clamav
- #ipfire_make alsa
- ipfire_make portmap
- ipfire_make nfs-utils
- ipfire_make freeradius
- ipfire_make hostapd
-
- ### Debugging
- #
- ipfire_make paxtest
- ipfire_make gdb
- ipfire_make strace
- ipfire_make pychecker
-
- ### Virtualization
- #
- ipfire_make xen
- ipfire_make qemu
- ipfire_make libvirt
-}
-
-################################################################################
-# This builds the entire stage "installer" #
-################################################################################
-installer_build() {
-
- PATH=${TOOLS_DIR}/usr/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/${MACHINE_REAL}-linux/bin
- STAGE_ORDER=05
- STAGE=installer
-
- LOGFILE="$BASEDIR/log_${TARGET}/_build.${STAGE_ORDER}-installer.log"
- export LOGFILE
-
- build_spy stage ${STAGE}
-
- ipfire_make stage5
- ipfire_make pomona
-}
-
-################################################################################
-# This builds the entire stage "packages" #
-################################################################################
-packages_build() {
-
- PATH=${TOOLS_DIR}/usr/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/${MACHINE_REAL}-linux/bin
- STAGE_ORDER=06
- STAGE=packages
-
- LOGFILE="$BASEDIR/log_${TARGET}/_build.${STAGE_ORDER}-packages.log"
- export LOGFILE
-
- build_spy stage ${STAGE}
-
- # Generate ChangeLog
- git_log
-
- # Generate packages list
- echo -n "Generating packages list"
- pkg_list_packages > $BASEDIR/doc/packages-list.txt
- beautify message DONE
-
- if [ ${EMB} -eq 0 ]; then
- ipfire_make images-core
- ipfire_make images-info
- ipfire_make images-initramfs
- ipfire_make images-overlays
- ipfire_make pxe
- ipfire_make cdrom
-
- if check_loop; then
- : #ipfire_make usb-key
- else
- echo -n "Can't build usb-key images on this machine"
- beautify message WARN
+ local value
+ for value in $@; do
+ if [ "${arg}" == "${value}" ]; then
+ return 0
fi
- mv $LFS/$IMAGES_DIR/{*.iso,*.tar.gz,*.img.gz} $BASEDIR >>$LOGFILE 2>&1
- else
- if check_loop; then
- # We put here the code that is done when
- # we do an embedded build
- :
- fi
- fi
-
- # Cleanup
- stdumount
- rm -rf $LFS/tmp/*
-
- cd $PWD
+ done
+ return 1
}
-# See what we're supposed to do
-. $BASEDIR/tools/make-interactive
+
+case "${action}" in
+ package|pkg)
+ package $@
+ ;;
+ toolchain)
+ TOOLCHAIN=1
+ ${NAOKI} --toolchain tree
+ ;;
+ toolchain_build)
+ for i in $($0 toolchain); do
+ ${NAOKI} --toolchain toolchain ${i}
+ done
+ ;;
+ tree)
+ ${NAOKI} tree
+ ;;
+esac
--- /dev/null
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007, 2008, 2009 Michael Tremer & Christian Schmidt #
+# #
+# This program 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/>. #
+# #
+###############################################################################
+
+THISAPP = $(PKG_NAME)-$(PKG_VER)
+
+DIR_APP = $(DIR_SRC)/$(THISAPP)
+DIR_DL = $(DIR_SRC)/cache/tarballs
+DIR_PATCHES = $(DIR_DL)/../patches
+DIR_SRC = $(ROOT)/usr/src
+DIR_TMP = /tmp
+DIR_SOURCE = $(CURDIR)
+DIR_PACKAGES = /usr/src/packages
+
+BUILD_HOST ?= $(shell cat /proc/sys/kernel/hostname)
+
+export DIR_DL DIR_PATCHES DIR_TMP
+VPATH = $(DIR_DL):$(DIR_PATCHES)
+
+PKG_OBJECTS = $(PKG_TARBALL)
+OBJECTS = $(PKG_OBJECTS) $(PKG_PATCHES)
+
+PKG_NAME_REAL = $(notdir $(CURDIR))
+PKG_PACKAGES = default devel
+PKG_PACKAGES_FILES = $(foreach package,$(PKG_PACKAGES),$(call DO_PACKAGE_FILENAME,$(package)))
+
+DO_PACKAGE_FILENAME = $(subst --,-,$(PKG_NAME_REAL)-$(subst default,,$(1))-$(PKG_VER)-$(DISTRO_SNAME)$(DISTRO_EPOCH)-$(PKG_REL).ipk)
+
+TC_PACKAGES = binutils gcc glibc
+PKG_TOOLCHAIN_DEPS ?= $(TC_PACKAGES)
+PKG_BUILD_DEPS ?= $(TC_PACKAGES)
+
+ifeq "$(TOOLCHAIN)" "1"
+ DO_EXTRACT = bash /build/ipfire-3.x/src/scripts/extractor
+ DO_PATCHES = cd $(DIR_APP) && /build/ipfire-3.x/tools/patch $(foreach patch,$(PKG_PATCHES),$(DIR_PATCHES)/$(patch))
+else
+ DO_EXTRACT = bash /usr/src/src/scripts/extractor
+ DO_PATCHES = cd $(DIR_APP) && /usr/src/tools/patch $(foreach patch,$(PKG_PATCHES),$(DIR_PATCHES)/$(patch))
+endif
+DO_LOAD = python /build/ipfire-3.x/tools/downloader http://source.ipfire.org/source-3.x/$@
+
+define PKG_FILES_devel
+ /usr/include
+ */lib/*.so
+endef
+
+CONFIGURE_ARCH = --build=$(TARGET) --host=$(TARGET)
+
+ifeq "$(TARGET_MACHINE)" "x86_64"
+ LINKER = /lib64/ld-linux-x86-64.so.2
+else
+ LINKER = /lib/ld-linux.so.2
+endif
+
+export CFLAGS CXXFLAGS BUILD_HOST
+
+export PKG_NAME PKG_VER PKG_REL PKG_MAINTAINER PKG_GROUP PKG_URL PKG_LICENSE
+export PKG_SUMMARY PKG_DESCRIPTION=$(strip $(PKG_DESCRIPTION))
+export PKG_DEPS PKG_BUILD_DEPS
+
+export CONTROL_PREIN CONTROL_PREUN CONTROL_POSTIN CONTROL_POSTUN
--- /dev/null
+
+## XXX FIX THIS
+include $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))/gmsl
+
+STAGE_PACKAGE_TARGETS = $(call reverse,$(PKG_PACKAGES))
+
+STAGE_PREPARE = $(ROOT)/.prepared
+STAGE_BUILD = $(ROOT)/.built
+STAGE_INSTALL = $(ROOT)/.installed
+STAGE_PACKAGE = $(STAGE_PACKAGE_TARGETS)
+
+define PRE_PREPARE
+ echo "#####################################################################"
+ echo "# $(PKG_NAME) - Preparation started"
+ echo "#####################################################################"
+endef
+
+define POST_PREPARE
+ echo "#####################################################################"
+ echo "# $(PKG_NAME) - Preparation finished"
+ echo "#####################################################################"
+ touch $(STAGE_PREPARE)
+endef
+
+define PRE_BUILD
+ echo "#####################################################################"
+ echo "# $(PKG_NAME) - Build started"
+ echo "#####################################################################"
+endef
+
+define POST_BUILD
+ echo "#####################################################################"
+ echo "# $(PKG_NAME) - Build finished"
+ echo "#####################################################################"
+ touch $(STAGE_BUILD)
+endef
+
+define PRE_INSTALL
+ echo "#####################################################################"
+ echo "# $(PKG_NAME) - Install started"
+ echo "#####################################################################"
+endef
+
+define POST_INSTALL
+ echo "#####################################################################"
+ echo "# $(PKG_NAME) - Install finished"
+ echo "#####################################################################"
+ touch $(STAGE_INSTALL)
+endef
+
+.PHONY: prepare build install package
+prepare: $(STAGE_PREPARE)
+build : $(STAGE_BUILD)
+install: $(STAGE_INSTALL)
+package: $(STAGE_PACKAGE)
+
+download: $(OBJECTS)
+
+info:
+ @echo "PKG_BUILD_DEPENDENCIES=\"$(PKG_BUILD_DEPS)\""
+ @echo "PKG_DEPENDENCIES=\"$(PKG_DEPS)\""
+ @echo "PKG_DESCRIPTION=\"$(value PKG_DESCRIPTION)\""
+ @echo "PKG_FILES=\"$(objects)\""
+ @echo "PKG_GROUP=\"$(PKG_GROUP)\""
+ @echo "PKG_LICENSE=\"$(PKG_LICENSE)\""
+ @echo "PKG_MAINTAINER=\"$(PKG_MAINTAINER)\""
+ @echo "PKG_NAME=\"$(PKG_NAME_REAL)\""
+ @echo "PKG_PACKAGES=\"$(PKG_PACKAGES)\""
+ @echo "PKG_PACKAGES_FILES=\"$(PKG_PACKAGES_FILES)\""
+ @echo "PKG_VER=\"$(PKG_VER)\""
+ @echo "PKG_REL=\"$(PKG_REL)\""
+ @echo "PKG_SUMMARY=\"$(PKG_SUMMARY)\""
+ @echo "PKG_URL=\"$(PKG_URL)\""
+ifeq "$(TOOLCHAIN)" "1"
+ @echo "PKG_TOOLCHAIN_DEPS=\"$(PKG_TOOLCHAIN_DEPS)\""
+endif
+
+$(OBJECTS):
+ $(DO_LOAD)
+
+$(STAGE_PACKAGE_TARGETS): $(STAGE_INSTALL)
+ @echo "$(strip $(PKG_FILES_$@))" > $(DIR_TMP)/filelist_$@
+ @/usr/src/src/pakfire/compressor $(DIR_PACKAGES)/$(call DO_PACKAGE_FILENAME,$@) \
+ --root=$(BUILDROOT) $(if $(PKG_FILES_$@), --regexes=$(DIR_TMP)/filelist_$@)
+
+$(STAGE_PREPARE): $(OBJECTS)
+ $(PRE_PREPARE)
+ifneq "$(PKG_TARBALL)" ""
+ cd $(DIR_SRC) && $(DO_EXTRACT) $(DIR_DL)/$(PKG_TARBALL)
+endif
+
+ $(DO_PATCHES)
+
+ $(POST_PREPARE)
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ $(PRE_BUILD)
+
+ cd $(DIR_APP) && \
+ ./configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=/usr
+
+ cd $(DIR_APP) && make $(PARALLELISMFLAGS)
+
+ $(POST_BUILD)
+
+$(STAGE_INSTALL): $(STAGE_BUILD)
+ @$(PRE_INSTALL)
+
+ cd $(DIR_APP) && make install
+
+ @$(POST_INSTALL)
--- /dev/null
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt #
+# #
+# This program 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/>. #
+# #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include ../../Config
+
+PKG_NAME = acl
+PKG_VER = 2.2.47
+PKG_REL = 0
+
+PKG_MAINTAINER =
+PKG_GROUP = System/Filesystems
+PKG_URL = http://oss.sgi.com/projects/xfs/
+PKG_LICENSE = GPLv2+
+PKG_SUMMARY = Access control list utilities.
+
+define PKG_DESCRIPTION
+ This package contains the getfacl and setfacl utilities needed for \
+ manipulating access control lists.
+endef
+
+PKG_DEPS += attr
+
+PKG_TARBALL = $(THISAPP).tar.gz
+PKG_PATCHES += $(THISAPP)-build-1.patch
+#PKG_PATCHES += $(THISAPP)-nfs4.patch # Doesn't work in toolchain
+PKG_PATCHES += $(THISAPP)-params.patch
+PKG_PATCHES += $(THISAPP)-path_max.patch
+PKG_PATCHES += $(THISAPP)-segfault.patch
+#PKG_PATCHES += $(THISAPP)-walk.patch
+PKG_PATCHES += $(THISAPP)-exitcode.patch
+
+include ../../Rules
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP) && \
+ ./configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=/usr \
+ --bindir=/bin \
+ --disable-static
+
+ cd $(DIR_APP) && make LIBTOOL="libtool --tag=CC" #$(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
+
+$(STAGE_INSTALL): $(STAGE_BUILD)
+ @$(PRE_INSTALL)
+
+ cd $(DIR_APP) && make install DESTDIR=$(BUILDROOT)
+
+ install -v -m0755 $(DIR_APP)/libacl/.libs/libacl.so.1.1.0 $(BUILDROOT)/lib
+ ln -vsf libacl.so.1.1.0 $(BUILDROOT)/lib/libacl.so.1
+ ln -vsf ../../lib/libacl.so.1 $(BUILDROOT)/usr/lib/libacl.so
+ -mkdir -pv $(BUILDROOT)/usr/include/{acl,sys}
+ cp -vf $(DIR_APP)/include/libacl.h $(BUILDROOT)/usr/include/acl/
+ cp -vf $(DIR_APP)/include/acl.h $(BUILDROOT)/usr/include/sys/
+
+ @$(POST_INSTALL)
--- /dev/null
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt #
+# #
+# This program 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/>. #
+# #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include ../../Config
+
+PKG_NAME = attr
+PKG_VER = 2.4.43
+PKG_REL = 0
+
+PKG_MAINTAINER =
+PKG_GROUP = System/Filesystems
+PKG_URL = http://oss.sgi.com/projects/xfs/
+PKG_LICENSE = GPLv2+ LGPLv2+
+PKG_SUMMARY = Tools for extended attribute support.
+
+define PKG_DESCRIPTION
+ A set of tools for manipulating extended attributes on filesystem \
+ objects.
+endef
+
+PKG_TARBALL = $(THISAPP).tar.gz
+
+include ../../Rules
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP) && \
+ ./configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=/usr \
+ --bindir=/bin \
+ --enable-shared
+
+ cd $(DIR_APP) && make $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
+
+$(STAGE_INSTALL): $(STAGE_BUILD)
+ @$(PRE_INSTALL)
+
+ cd $(DIR_APP) && make install DESTDIR=$(BUILDROOT)
+
+ install -v -m0755 $(DIR_APP)/libattr/.libs/libattr.so.1.1.0 $(BUILDROOT)/lib
+ ln -vsf libattr.so.1.1.0 $(BUILDROOT)/lib/libattr.so.1
+ ln -vsf ../../lib/libattr.so.1 $(BUILDROOT)/usr/lib/libattr.so
+ install -v -d $(BUILDROOT)/usr/include/attr
+ cp -vf $(DIR_APP)/include/{attributes.h,error_context.h,libattr.h,xattr.h} \
+ $(BUILDROOT)/usr/include/attr/
+
+ @$(POST_INSTALL)
--- /dev/null
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt #
+# #
+# This program 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/>. #
+# #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include ../../Config
+
+PKG_NAME = autoconf
+PKG_VER = 2.64
+PKG_REL = 0
+
+PKG_MAINTAINER =
+PKG_GROUP = Development/Tools
+PKG_URL = http://www.gnu.org/software/autoconf/
+PKG_LICENSE = GPLv2+
+PKG_SUMMARY = A GNU tool for automatically configuring source code.
+
+PKG_DEPS += perl
+
+define PKG_DESCRIPTION
+ GNU's Autoconf is a tool for configuring source code and Makefiles. \
+ Using Autoconf, programmers can create portable and configurable \
+ packages, since the person building the package is allowed to \
+ specify various configuration options.
+endef
+
+PKG_TARBALL = $(THISAPP).tar.bz2
+
+include ../../Rules
--- /dev/null
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt #
+# #
+# This program 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/>. #
+# #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include ../../Config
+
+PKG_NAME = automake
+PKG_VER = 1.11
+PKG_REL = 0
+
+PKG_MAINTAINER =
+PKG_GROUP = Development/Tools
+PKG_URL = http://www.gnu.org/software/automake/
+PKG_LICENSE = GPLv2+
+PKG_SUMMARY = A GNU tool for automatically configuring source code.
+
+PKG_DEPS += autoconf perl
+
+define PKG_DESCRIPTION
+ Automake is a tool for automatically generating Makefile.in \
+ files compliant with the GNU Coding Standards.
+endef
+
+PKG_TARBALL = $(THISAPP).tar.bz2
+
+include ../../Rules
--- /dev/null
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt #
+# #
+# This program 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/>. #
+# #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include ../../Config
+
+PKG_NAME = bash
+PKG_VER = 4.0
+PKG_REL = 0
+
+PKG_MAINTAINER =
+PKG_GROUP = System/Tools
+PKG_URL = http://www.gnu.org/software/bash/
+PKG_LICENSE = GPLv2+
+PKG_SUMMARY = Bash is short for born again shell.
+
+define PKG_DESCRIPTION
+ Bash is the shell, or command language interpreter, that will appear in \
+ the GNU operating system. Bash is an sh-compatible shell that incorporates \
+ useful features from the Korn shell (ksh) and C shell (csh). It is intended \
+ to conform to the IEEE POSIX P1003.2/ISO 9945.2 Shell and Tools standard.
+endef
+
+PKG_DEPS += readline
+
+PKG_TARBALL = $(THISAPP).tar.gz
+
+# This patch modifies Bash to use /dev/urandom (settable with
+# --with-randomdev=) for $RANDOM, instead of getpid() and gettimeofday().
+# The test is "( echo $RANDOM; ( echo $RANDOM ); ( echo $RANDOM ) )":
+PKG_PATCHES += $(THISAPP)-rng.patch
+
+# This patch fixes various reportded issures. It is the latest posted
+# patch from linuxfromscratch.org.
+PKG_PATCHES += $(THISAPP)-fixes-4.patch
+
+PKG_PATCHES += $(THISAPP)-paths-1.patch
+PKG_PATCHES += $(THISAPP)-profile-1.patch
+
+include ../../Rules
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(STAGE_PREPARE): $(OBJECTS)
+ @$(PRE_PREPARE)
+ cd $(DIR_SRC) && $(DO_EXTRACT) $(DIR_DL)/$(PKG_TARBALL)
+
+ $(DO_PATCHES)
+
+ # Bash uses the RTLD_LAZY option when loading libraries. We want to use
+ # RTLD_NOW (it is defined from <dlfcn.h>:
+ cd $(DIR_APP) && sed -e "s/filename, RTLD_LAZY/filename, RTLD_NOW/" \
+ -i builtins/enable.def
+
+ @$(POST_PREPARE)
+
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP) && sed -i "s|htmldir = @htmldir@|htmldir = /usr/share/doc/$(THISAPP)|" \
+ Makefile.in
+
+ cd $(DIR_APP) && \
+ ac_cv_func_working_mktime=yes \
+ ./configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=/usr \
+ --bindir=/bin \
+ --without-bash-malloc \
+ --with-installed-readline
+
+ cd $(DIR_APP) && make #$(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
+
+$(STAGE_INSTALL): $(STAGE_BUILD)
+ @$(PRE_INSTALL)
+
+ cd $(DIR_APP) && make install DESTDIR=$(BUILDROOT)
+
+ # Bash startup files
+ cp -avf $(DIR_SOURCE)/bash/{bashrc,profile,shells} $(BUILDROOT)/etc
+
+ # /etc/profile.d
+ -mkdir -pv $(BUILDROOT)/etc/profile.d
+ cp -vf $(DIR_SOURCE)/profile.d/* $(BUILDROOT)/etc/profile.d
+
+ @$(POST_INSTALL)
--- /dev/null
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt #
+# #
+# This program 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/>. #
+# #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include ../../Config
+
+PKG_NAME = binutils
+PKG_VER = 2.19.1
+PKG_REL = 0
+
+PKG_MAINTAINER = Michael Tremer <michael.tremer@ipfire.org>
+PKG_GROUP = Development/Tools
+PKG_URL = http://www.gnu.org/software/binutils/
+PKG_LICENSE = GPLv2+
+PKG_SUMMARY = The GNU Binutils are a collection of binary tools.
+
+define PKG_DESCRIPTION
+ The GNU Binary Utilities, or binutils, is a collection of programming \
+ tools for the manipulation of object code in various object file formats.
+endef
+
+PKG_BUILD_DEPS = glibc
+PKG_DEPS += zlib
+
+PKG_OBJECTS += $(THISAPP).tar.bz2
+
+PKG_PATCHES += $(THISAPP)-ld_makefile.patch
+PKG_PATCHES += $(THISAPP)-pt_pax-1.patch
+PKG_PATCHES += $(THISAPP)-lazy-1.patch
+PKG_PATCHES += $(THISAPP)-asprintf_fix.patch
+
+include ../../Rules
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(STAGE_PREPARE): $(OBJECTS)
+ @$(PRE_PREPARE)
+ cd $(DIR_SRC) && $(DO_EXTRACT) $(DIR_DL)/$(THISAPP).tar.bz2
+
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(THISAPP)-pt_pax-1.patch
+ cd $(DIR_APP) && patch -Np0 -i $(DIR_PATCHES)/$(THISAPP)-asprintf_fix.patch
+
+ -mkdir -pv $(DIR_SRC)/binutils-build
+
+ @$(POST_PREPARE)
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_SRC)/binutils-build && \
+ CC="gcc -specs=$$(dirname $$(gcc --print-libgcc-file-name))/myspecs -B/usr/lib/ -B/usr/bin/" \
+ ../$(THISAPP)/configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=/usr \
+ --enable-shared \
+ --disable-nls \
+ --disable-werror \
+ --disable-static
+
+ cd $(DIR_SRC)/binutils-build && make tooldir=/usr $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
+
+$(STAGE_INSTALL): $(STAGE_BUILD)
+ @$(PRE_INSTALL)
+
+ cd $(DIR_SRC)/binutils-build && make tooldir=/usr install DESTDIR=$(BUILDROOT)
+
+ cp -fv ../$(THISAPP)/include/libiberty.h $(BUILDROOT)/usr/include
+ rm -vf /usr/lib/libiberty.a $(BUILDROOT)/usr/lib/lib{bfd,opcodes}.la
+
+ @$(POST_INSTALL)
--- /dev/null
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt #
+# #
+# This program 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/>. #
+# #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include ../../Config
+
+PKG_NAME = bzip2
+PKG_VER = 1.0.5
+PKG_REL = 0
+
+PKG_MAINTAINER =
+PKG_GROUP = Applications/Compression
+PKG_URL = http://www.bzip.org/
+PKG_LICENSE = GPLv2+
+PKG_SUMMARY = Bzip2 is a data compressor.
+
+define PKG_DESCRIPTION
+ bzip2 is a freely available, patent free (see below), high-quality data \
+ compressor that is an alternative to the GNU zip compressor.
+endef
+
+PKG_TARBALL = $(THISAPP).tar.gz
+
+PKG_PATCHES += $(THISAPP)-install_docs-1.patch
+
+CFLAGS += -fPIC -D_FILE_OFFSET_BITS=64
+
+include ../../Rules
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(STAGE_PREPARE): $(OBJECTS)
+ @$(PRE_PREPARE)
+ cd $(DIR_SRC) && $(DO_EXTRACT) $(DIR_DL)/$(PKG_TARBALL)
+
+ $(DO_PATCHES)
+
+ cd $(DIR_APP) && sed -i 's@\(ln -s -f \)\$$(PREFIX)/bin/@\1@' Makefile
+ cd $(DIR_APP) && sed -e "s/$$(CC) -shared/& $(CFLAGS)/" -i Makefile-libbz2_so
+
+ @$(POST_PREPARE)
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP) && make -f Makefile-libbz2_so
+
+ cd $(DIR_APP) && make clean
+ cd $(DIR_APP) && make $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
+
+$(STAGE_INSTALL): $(STAGE_BUILD)
+ @$(PRE_INSTALL)
+
+ cd $(DIR_APP) && make PREFIX=$(BUILDROOT)/usr install
+
+ cd $(DIR_APP) && cp -v bzip2-shared $(BUILDROOT)/bin/bzip2
+ cd $(DIR_APP) && cp -av libbz2.so* $(BUILDROOT)/lib
+ ln -sfv ../../lib/libbz2.so.1.0 $(BUILDROOT)/usr/lib/libbz2.so
+ rm -fv $(BUILDROOT)/usr/bin/{bunzip2,bzcat,bzip2}
+ ln -sfv bzip2 $(BUILDROOT)/bin/bunzip2
+ ln -sfv bzip2 $(BUILDROOT)/bin/bzcat
+ rm -vf $(BUILDROOT)/usr/lib/libbz2.a
+
+ @$(POST_INSTALL)
--- /dev/null
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt #
+# #
+# This program 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/>. #
+# #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include ../../Config
+
+PKG_NAME = coreutils
+PKG_VER = 7.6
+PKG_REL = 0
+
+PKG_MAINTAINER =
+PKG_GROUP = System/Base
+PKG_URL = http://www.gnu.org/software/coreutils/
+PKG_LICENSE = GPLv3+
+PKG_SUMMARY = A set of basic GNU tools commonly used in shell scripts.
+
+define PKG_DESCRIPTION
+ These are the GNU core utilities. This package is the combination of \
+ the old GNU fileutils, sh-utils, and textutils packages.
+endef
+
+PKG_DEPS += acl attr libcap2 ncurses pam shadow util-linux-ng
+
+PKG_TARBALL = $(THISAPP).tar.gz
+
+#PKG_PATCHES += $(THISAPP)-uname_PIC-1.patch
+PKG_PATCHES += $(THISAPP)-i18n-1.patch
+
+CFLAGS += -D_GNU_SOURCE=1 -fno-strict-aliasing
+
+include ../../Rules
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP) && \
+ gl_cv_func_printf_directive_n=no \
+ ./configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=/usr \
+ --enable-largefile \
+ --enable-install-program=arch,hostname,su \
+ --enable-no-install-program=kill,uptime
+
+ cd $(DIR_APP) && make $(PARALLELISMFLAGS) \
+ CPPFLAGS="-DUSE_PAM" su_LDFLAGS="-pie -lpam -lpam_misc"
+
+ @$(POST_BUILD)
+
+$(STAGE_INSTALL): $(STAGE_BUILD)
+ @$(PRE_INSTALL)
+
+ cd $(DIR_APP) && make install DESTDIR=$(BUILDROOT)
+
+ mv -v $(BUILDROOT)/usr/bin/{cat,chgrp,chmod,chown,cp,date,dd,df,echo} $(BUILDROOT)/bin
+ mv -v $(BUILDROOT)/usr/bin/{false,hostname,ln,ls,mkdir,mknod,mv,pwd,readlink,rm} $(BUILDROOT)/bin
+ mv -v $(BUILDROOT)/usr/bin/{rmdir,stty,sync,touch,true,uname} $(BUILDROOT)/bin
+ mv -v $(BUILDROOT)/usr/bin/chroot $(BUILDROOT)/usr/sbin
+ mv -v $(BUILDROOT)/usr/bin/{head,sleep,nice} $(BUILDROOT)/bin
+
+ cd $(DIR_APP) && install -m 4755 src/su $(BUILDROOT)/bin
+
+ # Dump /etc/dircolors.
+ dircolors -p > $(BUILDROOT)/etc/dircolors
+ -mkdir -pv $(BUILDROOT)/etc/profile.d
+ cp -vf $(DIR_SOURCE)/profile.d/dircolors.sh $(BUILDROOT)/etc/profile.d
+
+ # PAM
+ cp -vf $(DIR_SOURCE)/pam.d/su{,-l} /etc/pam.d
+
+ @$(POST_INSTALL)
--- /dev/null
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt #
+# #
+# This program 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/>. #
+# #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include ../../Config
+
+PKG_NAME = diffutils
+PKG_VER = 2.8.1
+PKG_REL = 0
+
+PKG_MAINTAINER =
+PKG_GROUP = Development/Tools
+PKG_URL = http://www.gnu.org/software/diffutils/diffutils.html
+PKG_LICENSE = GPLv2+
+PKG_SUMMARY = A GNU collection of diff utilities.
+
+define PKG_DESCRIPTION
+ Diffutils includes four utilities: diff, cmp, diff3 and sdiff. Diff \
+ compares two files and shows the differences, line by line. The cmp \
+ command shows the offset and line numbers where two files differ, or \
+ cmp can show the characters that differ between the two files.
+endef
+
+PKG_TARBALL = $(THISAPP).tar.gz
+
+PKG_PATCHES += $(THISAPP)-i18n-1.patch
+PKG_PATCHES += $(THISAPP)-hardened_tmp-1.patch
+
+include ../../Rules
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP) && \
+ ./configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=/usr
+
+ cd $(DIR_APP) && make $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
--- /dev/null
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt #
+# #
+# This program 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/>. #
+# #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include ../../Config
+
+PKG_NAME = e2fsprogs
+PKG_VER = 1.41.8
+PKG_REL = 0
+
+PKG_MAINTAINER =
+PKG_GROUP = System/Filesystems
+PKG_URL = http://e2fsprogs.sourceforge.net/
+PKG_LICENSE = GPLv2
+PKG_SUMMARY = Utilities for managing the extended (ext2/ext3/ext4) filesystems.
+
+define PKG_DESCRIPTION
+ The e2fsprogs package contains a number of utilities for creating, \
+ checking, modifying, and correcting any inconsistencies in second \
+ and third extended (ext2/ext3) filesystems.
+endef
+
+PKG_TARBALL = $(THISAPP).tar.gz
+
+include ../../Rules
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(STAGE_PREPARE): $(OBJECTS)
+ @$(PRE_PREPARE)
+ cd $(DIR_SRC) && $(DO_EXTRACT) $(DIR_DL)/$(PKG_TARBALL)
+
+ $(DO_PATCHES)
+
+ -mkdir $(DIR_APP)/build
+
+ # Fix DT_TEXTREL in e2fsprogs libraries. --disable-shared and
+ # --with-pic are not options in E2fsprogs:
+ cd $(DIR_APP) && \
+ find lib/ -name Makefile.in -exec sed -i "s/\$$(ALL_CFLAGS)/& -fPIC/" {} \;
+
+ # At run time libblkid looks for the BLKID_DEBUG environment variable to
+ # enable debbugging, with getenv(3). Some suid-root programs use libblkid,
+ # such as mount(1). e2fsprogs includes a safe_getenv() function, which calls
+ # __secure_getenv() from libc. __secure_getenv will restrict some environment
+ # variables if the user is suid or sgid. So, this command replaces getenv()
+ # with safe_getenv():
+ cd $(DIR_APP) && sed \
+ -e "s/getenv(\"BLKID_DEBUG\")/safe_getenv(\"BLKID_DEBUG\")/" \
+ -i lib/blkid/cache.c
+
+ @$(POST_PREPARE)
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP)/build && \
+ LDFLAGS=-lblkid \
+ ../configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=/usr \
+ --with-root-prefix="" \
+ --enable-elf-shlibs \
+ --disable-libblkid \
+ --disable-fsck \
+ --disable-uuidd \
+ --disable-libuuid
+
+ cd $(DIR_APP)/build && make $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
+
+$(STAGE_INSTALL): $(STAGE_BUILD)
+ @$(PRE_INSTALL)
+
+ cd $(DIR_APP)/build && make install DESTDIR=$(BUILDROOT)
+ cd $(DIR_APP)/build && make install-libs DESTDIR=$(BUILDROOT)
+
+ ln -svf ../../lib/libcom_err.so.2 $(BUILDROOT)/usr/lib/libcom_err.so
+ ln -svf ../../lib/libe2p.so.2 $(BUILDROOT)/usr/lib/libe2p.so
+ ln -svf ../../lib/libext2fs.so.2 $(BUILDROOT)/usr/lib/libext2fs.so
+ ln -svf ../../lib/libss.so.2 $(BUILDROOT)/usr/lib/libss.so
+ ln -svf ../../lib/libuuid.so.1 $(BUILDROOT)/usr/lib/libuuid.so
+
+ @$(POST_INSTALL)
--- /dev/null
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt #
+# #
+# This program 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/>. #
+# #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include ../../Config
+
+PKG_NAME = file
+PKG_VER = 5.03
+PKG_REL = 0
+
+PKG_MAINTAINER =
+PKG_GROUP = System/Tools
+PKG_URL = http://www.darwinsys.com/file/
+PKG_LICENSE = BSD
+PKG_SUMMARY = A utility for determining file types.
+
+define PKG_DESCRIPTION
+ The file command is used to identify a particular file according to the \
+ type of data contained by the file. File can identify many different \
+ file types, including ELF binaries, system libraries, RPM packages, and \
+ different graphics formats.
+endef
+
+PKG_TARBALL = $(THISAPP).tar.gz
+
+include ../../Rules
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP) && \
+ ./configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=/usr \
+ --disable-static
+
+ cd $(DIR_APP) && make $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
+
+$(STAGE_INSTALL): $(STAGE_BUILD)
+ @$(PRE_INSTALL)
+
+ cd $(DIR_APP) && make install DESTDIR=$(BUILDROOT)
+
+ rm -vf $(BUILDROOT)/usr/lib/libmagic.la
+
+ @$(POST_INSTALL)
--- /dev/null
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt #
+# #
+# This program 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/>. #
+# #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include ../../Config
+
+PKG_NAME = findutils
+PKG_VER = 4.4.2
+PKG_REL = 0
+
+PKG_MAINTAINER =
+PKG_GROUP = System/Tools
+PKG_URL = http://www.gnu.org/software/findutils/
+PKG_LICENSE = GPLv3+
+PKG_SUMMARY = The GNU versions of find utilities (find and xargs).
+
+define PKG_DESCRIPTION
+ The findutils package contains programs which will help you locate \
+ files on your system. The find utility searches through a hierarchy \
+ of directories looking for files which match a certain set of criteria \
+ (such as a filename pattern). The xargs utility builds and executes \
+ command lines from standard input arguments (usually lists of file \
+ names generated by the find command).
+endef
+
+PKG_TARBALL = $(THISAPP).tar.gz
+
+include ../../Rules
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP) && \
+ ./configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=/usr \
+ --libexecdir=/usr/lib/findutils \
+ --localstatedir=/var/lib/locate
+
+ cd $(DIR_APP) && make $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
+
+$(STAGE_INSTALL): $(STAGE_BUILD)
+ @$(PRE_INSTALL)
+
+ cd $(DIR_APP) && make install DESTDIR=$(BUILDROOT)
+
+ mv -v $(BUILDROOT)/usr/bin/find $(BUILDROOT)/bin
+
+ sed -i -e 's/find:=$${BINDIR}/find:=\/bin/' $(BUILDROOT)/usr/bin/updatedb
+
+ @$(POST_INSTALL)
--- /dev/null
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt #
+# #
+# This program 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/>. #
+# #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include ../../Config
+
+PKG_NAME = flex
+PKG_VER = 2.5.35
+PKG_REL = 0
+
+PKG_MAINTAINER =
+PKG_GROUP = Development/Tools
+PKG_URL = http://flex.sourceforge.net/
+PKG_LICENSE = BSD
+PKG_SUMMARY = A tool for creating scanners (text pattern recognizers).
+
+PKG_DEPS += m4
+
+define PKG_DESCRIPTION
+ The flex program generates scanners. Scanners are programs which can \
+ recognize lexical patterns in text. Flex takes pairs of regular \
+ expressions and C code as input and generates a C source file as \
+ output. The output file is compiled and linked with a library to \
+ produce an executable. The executable searches through its input for \
+ occurrences of the regular expressions. When a match is found, it \
+ executes the corresponding C code. Flex was designed to work with \
+ both Yacc and Bison, and is used by many programs as part of their \
+ build process.
+endef
+
+PKG_TARBALL = $(THISAPP).tar.bz2
+
+include ../../Rules
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP) && \
+ ./configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=/usr \
+ --disable-static
+
+ cd $(DIR_APP) && make $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
+
+$(STAGE_INSTALL): $(STAGE_BUILD)
+ @$(PRE_INSTALL)
+
+ cd $(DIR_APP) && make install DESTDIR=$(BUILDROOT)
+ echo "#!/bin/sh" > $(BUILDROOT)/usr/bin/lex
+ echo "exec /usr/bin/flex -l \"$$@\"" >> $(BUILDROOT)/usr/bin/lex
+ chmod 755 $(BUILDROOT)/usr/bin/lex
+
+ @$(POST_INSTALL)
--- /dev/null
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt #
+# #
+# This program 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/>. #
+# #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include ../../Config
+
+PKG_NAME = gawk
+PKG_VER = 3.1.7
+PKG_REL = 0
+
+PKG_MAINTAINER =
+PKG_GROUP = System/Tools
+PKG_URL = http://www.gnu.org/software/gawk/gawk.html
+PKG_LICENSE = GPLv3+
+PKG_SUMMARY = The GNU version of the awk text processing utility.
+
+define PKG_DESCRIPTION
+ The gawk package contains the GNU version of awk, a text processing \
+ utility. Awk interprets a special-purpose programming language to do \
+ quick and easy text pattern matching and reformatting jobs.
+endef
+
+PKG_TARBALL = $(THISAPP).tar.bz2
+
+include ../../Rules
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP) && \
+ ac_cv_func_working_mktime=yes \
+ ./configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=/usr \
+ --libexecdir=/usr/lib
+
+ cd $(DIR_APP) && echo "#define HAVE_LANGINFO_CODESET 1" >> config.h
+ cd $(DIR_APP) && echo "#define HAVE_LC_MESSAGES 1" >> config.h
+
+ cd $(DIR_APP) && make $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
--- /dev/null
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007, 2008, 2009 Michael Tremer & Christian Schmidt #
+# #
+# This program 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/>. #
+# #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include ../../Config
+
+PKG_NAME = gcc
+PKG_VER = 4.4.1
+PKG_REL = 0
+
+PKG_MAINTAINER = Michael Tremer <michael.tremer@ipfire.org>
+PKG_GROUP = Development/Compilers
+PKG_URL = http://gcc.gnu.org/
+PKG_LICENSE = GPLv3+ and GPLv2+ with exceptions
+PKG_SUMMARY = Various compilers (C, C++, Objective-C, Java, ...).
+
+define PKG_DESCRIPTION
+ The gcc package contains the GNU Compiler Collection. \
+ You'll need this package in order to compile C code.
+endef
+
+PKG_BUILD_DEPS = binutils glibc
+
+CFLAGS = -D__USE_XOPEN2K8 -pipe
+CXXFLAGS =
+
+GMP = 4.3.1
+MPFR = 2.4.1
+
+ifeq "$(MACHINE)" "i586"
+ CONFIGURE_ARGS = --disable-decimal-float
+endif
+
+ifeq "$(MACHINE)" "x86_64"
+ CONFIGURE_ARGS = --without-cloog --without-ppl --disable-multilib
+else
+ CONFIG_CPU = --with-cpu=$(TARGET_MACHINE) --with-arch=$(TARGET_MACHINE)
+endif
+
+PKG_OBJECTS += $(THISAPP).tar.bz2
+PKG_OBJECTS += gmp-$(GMP).tar.bz2
+PKG_OBJECTS += mpfr-$(MPFR).tar.bz2
+
+PKG_PATCHES += $(THISAPP)-espf-1.patch \
+ $(THISAPP)-branch-startfiles-1.patch \
+ $(THISAPP)-asprintf_fix.patch
+
+include ../../Rules
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(STAGE_PREPARE): $(OBJECTS)
+ @$(PRE_PREPARE)
+ @rm -rf $(DIR_APP) $(DIR_SRC)/gcc-build && cd $(DIR_SRC) && $(DO_EXTRACT) $(DIR_DL)/$(firstword $(PKG_OBJECTS))
+ -mkdir -v $(DIR_SRC)/gcc-build
+
+ # First, unpack gmp and mpfr.
+ # We use the build-"magic" of the gcc build system that we compile libgmp and
+ # libmpfr right (with -fPIC and so on).
+ cd $(DIR_APP) && $(DO_EXTRACT) $(DIR_DL)/gmp-$(GMP).tar.bz2
+ cd $(DIR_APP) && ln -svf gmp-* gmp
+ cd $(DIR_APP) && $(DO_EXTRACT) $(DIR_DL)/mpfr-$(MPFR).tar.bz2
+ cd $(DIR_APP) && ln -svf mpfr-* mpfr
+
+ # Remove unneeded features that will save some compile time
+ rm -rf $(DIR_APP)/lib{gfortran,java,objc} \
+ $(DIR_APP)/gcc/{fortran,java,objc,objcp}
+
+ # Branding gcc
+ cd $(DIR_APP) && sed -e "s:PKGVERSION:\"(GCC for $(NAME)-${VERSION}) \":" \
+ -i gcc/version.c
+
+ # Libgomp uses -Werror regardless of --disable-werror, and this will cause a
+ # build failure when -D_FORTIFY_SOURCE=2 causes build time warnings:
+ cd $(DIR_APP) && sed -e "s/-Werror//" -i libgomp/configure
+
+ @$(POST_PREPARE)
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(THISAPP)-espf-1.patch
+
+ cd $(DIR_APP) && sed -i 's/install_to_$$(INSTALL_DEST) //' libiberty/Makefile.in
+ cd $(DIR_APP) && sed -i 's/^XCFLAGS =$$/& -fomit-frame-pointer/' gcc/Makefile.in
+ cd $(DIR_APP) && sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
+
+ # Libgomp uses -Werror regardless of --disable-werror, and this will cause a
+ # build failure when -D_FORTIFY_SOURCE=2 causes build time warnings:
+ cd $(DIR_APP) && sed -e "s/-Werror//" -i libgomp/configure
+
+ cd $(DIR_SRC)/gcc-build && \
+ ../$(THISAPP)/configure \
+ $(CONFIGURE_ARCH) \
+ --target=$(TARGET) \
+ $(CONFIG_CPU) \
+ --prefix=/usr \
+ --libexecdir=/usr/lib \
+ --enable-espf \
+ --enable-shared \
+ --enable-threads=posix \
+ --enable-__cxa_atexit \
+ --enable-clocale=gnu \
+ --enable-languages=c,c++ \
+ --disable-bootstrap \
+ --disable-werror \
+ --disable-libssp \
+ --disable-static \
+ $(CONFIGURE_ARGS)
+
+ cd $(DIR_SRC)/gcc-build && make $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
+
+$(STAGE_INSTALL): $(STAGE_BUILD)
+ @$(PRE_INSTALL)
+
+ cd $(DIR_SRC)/gcc-build && make install DESTDIR=$(BUILDROOT)
+
+ rm -vf $(BUILDROOT)/usr/lib/lib{ffi,gomp,mudflap{,th},stdc++,supc++}.la
+
+ ln -sfv ../usr/bin/cpp $(BUILDROOT)/lib
+ ln -sfv gcc $(BUILDROOT)/usr/bin/cc
+
+ @$(POST_INSTALL)
--- /dev/null
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt #
+# #
+# This program 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/>. #
+# #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include ../../Config
+
+PKG_NAME = gettext
+PKG_VER = 0.17
+PKG_REL = 0
+
+PKG_MAINTAINER =
+PKG_GROUP = System/Base
+PKG_URL = http://www.gnu.org/software/gettext/
+PKG_LICENSE = GPLv3 LGPL2+
+PKG_SUMMARY = GNU libraries and utilities for producing multi-lingual messages.
+
+define PKG_DESCRIPTION
+ The GNU gettext package provides a set of tools and documentation for \
+ producing multi-lingual messages in programs. Tools include a set of \
+ conventions about how programs should be written to support message \
+ catalogs, a directory and file naming organization for the message \
+ catalogs, a runtime library which supports the retrieval of translated \
+ messages, and stand-alone programs for handling the translatable and \
+ the already translated strings. Gettext provides an easy to use \
+ library and tools for creating, using, and modifying natural language \
+ catalogs and is a powerful and simple method for internationalizing \
+ programs.
+endef
+
+PKG_TARBALL = $(THISAPP).tar.gz
+
+PKG_PATCHES += $(THISAPP)-open-args-1.patch
+PKG_PATCHES += $(THISAPP)-rpathFix.patch
+PKG_PATCHES += $(THISAPP)-automake-1.patch
+
+include ../../Rules
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP) && \
+ ./configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=/usr \
+ --disable-static
+
+ cd $(DIR_APP) && make $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
+
+$(STAGE_INSTALL): $(STAGE_BUILD)
+ @$(PRE_INSTALL)
+
+ cd $(DIR_APP) && make install DESTDIR=$(BUILDROOT)
+
+ rm -vf $(BUILDROOT)/usr/lib/lib{asprintf,gettext{lib,po,src}}.la
+
+ @$(POST_INSTALL)
--- /dev/null
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007, 2008, 2009 Michael Tremer & Christian Schmidt #
+# #
+# This program 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/>. #
+# #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include ../../Config
+
+PKG_NAME = glibc
+PKG_VER = 2.10.1
+PKG_REL = 0
+
+PKG_MAINTAINER = Michael Tremer <michael.tremer@ipfire.org>
+PKG_GROUP = System/Base
+PKG_URL = http://sources.redhat.com/glibc/
+PKG_LICENSE = GPLv2+ LGPLv2+
+PKG_SUMMARY = The GNU libc libraries.
+
+define PKG_DESCRIPTION
+ The glibc package contains standard libraries which are used by \
+ multiple programs on the system. In order to save disk space and \
+ memory, as well as to make upgrading easier, common system code is \
+ kept in one place and shared between programs. This particular package \
+ contains the most important sets of shared libraries: the standard C \
+ library and the standard math library. Without these two libraries, a \
+ Linux system will not function.
+endef
+
+PKG_BUILD_DEPS = # Has got no dependencies
+
+CFLAGS = -O2 -fomit-frame-pointer -pipe -DPIC -fno-strict-aliasing \
+ -mno-tls-direct-seg-refs -D_FORTIFY_SOURCE=2 \
+ -fstack-protector-all
+CXXFLAGS = $(CFLAGS)
+
+OPTIMIZED_KERNEL = 2.6.18
+
+PKG_OBJECTS += $(THISAPP).tar.bz2
+
+# Support for PT_PaX markings:
+PKG_PATCHES += $(THISAPP)-pt_pax-1.patch
+
+# This patch adds the strlcpy and strlcat functions and manual pages to Glibc.
+# A paper written about these functions is available here:
+# http://www.courtesan.com/todd/papers/strlcpy.html. The Glibc project has
+# refused to add these functions, and that mail tread starts here:
+# http://sources.redhat.com/ml/libc-alpha/2000-08/msg00052.html. Linus Torvalds
+# has added a similar function to the Linux kernel, and that mail thread is
+# here: http://lwn.net/Articles/33814/. The strlcpy() and strlcat() functions
+# are replacements for strncpy() and strncat(). The controversy of these
+# functions is that strlcpy() and strlcat() copy the source data to the
+# destination buffer until the destination is full, and discards the rest of
+# the data if there is any. This means that these functions will never
+# overflow. The basis for the Glibc team's refusal to add these functions is
+# that they silently hide programing errors, and they have a higher performance
+# hit than strncpy() and strncat(). These functions should not be needed in a
+# perfect world, but were invented to deal with the real world. Many packages
+# will use these functions if they are found, such as Perl and many BLFS
+# packages. These functions do reduce buffer overflows, and so they are
+# recommended. After installing this patch no other effort is needed to use it.
+# Packages will use autotools to detect whether they are available or not:
+PKG_PATCHES += $(THISAPP)-strlcpy_strlcat-1.patch
+
+# The asprintf(3) and vasprintf(3) functions are GNU extentions, not defined
+# by C or Posix standards. In Glibc these functions leave (char **strp) undefined
+# after an error. This patch resets (char **strp) to NULL after an error, for
+# sanity.
+PKG_PATCHES += $(THISAPP)-asprintf_reset2null-1.patch
+
+# This patch adds the issetugid() function, which is a front-end to the
+# __libc_enable_secure() dynamic linker private function. This function
+# reports whether the program is running with matching real and effective
+# ID's, or not, to determine whether the program is running with set-uid or
+# set-gid privileges. Many packages will search for issetugid() and use it if
+# found, such as Ncurses. This is safer than allowing each program to
+# determine privileges itself because it is tested at a lower level which is
+# not manipulatable by the user. Apply this patch with the following command:
+PKG_PATCHES += $(THISAPP)-issetugid-1.patch
+
+# The next patch modifies the localedef program so it does not use GCC
+# Trampoline code (http://gcc.gnu.org/onlinedocs/gccint/Trampolines.html),
+# which relies on an executable stack to run. Without this patch the localedef
+# program will be killed if it is run on a kernel with PaX memory protection.
+# See http://pax.grsecurity.net/docs/pageexec.txt and
+# http://pax.grsecurity.net/docs/segmexec.txt for more information:
+PKG_PATCHES += $(THISAPP)-localedef_trampoline-1.patch
+
+# This patch resticts the environment, particularly with setuid programs:
+#PKG_PATCHES += $(THISAPP)-sanitize_env.patch
+
+# The patch modifies __gen_tempname(), used by the mk*temp()/tmpnam() family
+# of functions, to use /dev/urandom instead of hp-timing, gettimeofday(), or
+# getpid():
+PKG_PATCHES += $(THISAPP)-mktemp_urandom.patch
+
+# The res_randomid() function is a pseudo-random number generator, using
+# getpid() for entropy. See: http://www.openbsd.org/advisories/res_random.txt
+# for the vulnerability. This patch uses /dev/urandom instead:
+PKG_PATCHES += $(THISAPP)-res_randomid.patch
+
+# This patch does a check on the buffer size of res_* functions:
+PKG_PATCHES += $(THISAPP)-resolv_response_length.patch
+
+PKG_PATCHES += $(THISAPP)-undefine-__i686.patch
+PKG_PATCHES += $(THISAPP)-arc4random.patch
+PKG_PATCHES += $(THISAPP)-hardened-configure-picdefault.patch
+PKG_PATCHES += $(THISAPP)-hardened-inittls-nosysenter.patch
+PKG_PATCHES += $(THISAPP)-hardened-pie.patch
+
+include ../../Rules
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(STAGE_PREPARE): $(OBJECTS)
+ @@$(PRE_PREPARE)
+ @rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build && cd $(DIR_SRC) && $(DO_EXTRACT) $(DIR_DL)/$(firstword $(PKG_OBJECTS))
+ @mkdir $(DIR_SRC)/glibc-build
+
+ # In the vi_VN.TCVN locale, bash enters an infinite loop at startup. It is
+ # unknown whether this is a bash bug or a Glibc problem. Disable
+ # installation of this locale in order to avoid the problem.
+ cd $(DIR_APP) && sed -i '/vi_VN.TCVN/d' localedata/SUPPORTED
+
+ # The ldd shell script contains Bash-specific syntax. Change its default
+ # program interpreter to /bin/bash in case another /bin/sh is installed.
+ cd $(DIR_APP) && sed -i 's|@BASH@|/bin/bash|' elf/ldd.bash.in
+
+ $(DO_PATCHES)
+
+ # We don't install pt_chown(1) on the final system, so why install it to
+ # $(TOOLS_DIR):
+ cd $(DIR_APP) && sed -e "/^install.*pt_chown/d" -i login/Makefile
+
+ # ldconfig is statically linked, so don't build it PIC:
+ cd $(DIR_APP) && sed "s/CFLAGS-ldconfig.c =/& -fno-PIC -fno-PIE/" \
+ -i elf/Makefile
+
+ # Build nscd with -fstack-protector-all, instead of -fstack-protector:
+ cd $(DIR_APP) && sed -e "s/fstack-protector/&-all/" -i nscd/Makefile
+
+ # We don't need to set -march=i?86 in confparams because GCC was built with
+ # --with-arch=i?86.
+
+ cat $(DIR_SOURCE)/$(THISAPP)-stack_chk_fail.c \
+ > $(DIR_APP)/debug/stack_chk_fail.c
+
+ @$(POST_PREPARE)
+
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+ # --enable-stackguard-randomization could be added here, but this is primarily
+ # for attacks by local users, and we shouldn't have those in the rebooted
+ # system. Adding this will empty the /dev/random entropy pool (via
+ # /dev/urandom), unless the system is running a Random Number Gathering Daemon
+ # (rngd). This version of Glibc uses high precision timing with SSP, so the
+ # canary value changes at run-time. This is not as good as /dev/urandom, but
+ # it's better than nothing and has very good performance.
+
+ if [ ! -e /bin/pwd ]; then ln -sfn $(TOOLS_DIR)/bin/pwd /bin/pwd; fi
+
+ cd $(DIR_APP) && sed 's/-nostdlib/& -fno-stack-protector/g' -i.orig configure
+
+ cd $(DIR_APP) && sed -i 's|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=$(LINKER) -o|' \
+ scripts/test-installation.pl
+
+ cd $(DIR_SRC)/glibc-build && \
+ CFLAGS= \
+ CXXFLAGS= \
+ ../$(THISAPP)/configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=/usr \
+ --libexecdir=/usr/lib/glibc \
+ --disable-profile \
+ --enable-add-ons \
+ --enable-kernel=$(OPTIMIZED_KERNEL) \
+ --without-selinux \
+ --disable-werror \
+ --enable-bind-now \
+ --enable-stackguard-randomization \
+ --with-stack-protector=all \
+ --enable-omitfp
+
+ # Our GCC is already passing -fPIC, and that's all we want for the libraries.
+ # LDFLAGS.so is appended to so we don't build shared libraries with
+ # DT_TEXTREL (and to tell us if something goes wrong). For now we only build
+ # the libraries, not the programs:
+ echo "build-programs=no" \
+ >> $(DIR_SRC)/glibc-build/configparms
+
+ cd $(DIR_SRC)/glibc-build && make PARALLELMFLAGS=$(PARALLELISMFLAGS) \
+ CFLAGS="-O2 -DPIC -fno-stack-protector -U_FORTIFY_SOURCE" \
+ CXXFLAGS="-O2 -DPIC -fno-stack-protector -U_FORTIFY_SOURCE"
+
+ # Then build the programs with hardening, so everything possible in
+ # $(TOOLS_DIR) is hardened:
+ echo "CFLAGS = $(CFLAGS)" > $(DIR_SRC)/glibc-build/configparms
+ echo "CXXFLAGS = $(CXXFLAGS)" >> $(DIR_SRC)/glibc-build/configparms
+ cd $(DIR_SRC)/glibc-build && make PARALLELMFLAGS=$(PARALLELISMFLAGS) \
+ CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)"
+
+ @$(POST_BUILD)
+
+$(STAGE_INSTALL): $(STAGE_BUILD)
+ @$(PRE_INSTALL)
+
+ cd $(DIR_SRC)/glibc-build && make install install_root=$(BUILDROOT)
+
+ install -vd $(BUILDROOT)/usr/lib/static/
+ mv -v $(BUILDROOT)/usr/lib/{libbsd-compat,libg,libieee,libmcheck}.a $(BUILDROOT)/usr/lib/static/
+ mv -v $(BUILDROOT)/usr/lib/{libBrokenLocale,libanl,libcrypt}.a $(BUILDROOT)/usr/lib/static/
+ mv -v $(BUILDROOT)/usr/lib/{libm,libnsl,libpthread,libresolv}.a $(BUILDROOT)/usr/lib/static/
+ mv -v $(BUILDROOT)/usr/lib/{librpcsvc,librt,libutil}.a $(BUILDROOT)/usr/lib/static/
+
+ rm -vf $(BUILDROOT){/usr,}/lib/*_g.a
+
+ # Locales
+ -mkdir -pv $(BUILDROOT)/usr/lib/locale
+ # This would install all locales that are supported, but we do only
+ # install a minimal set of them
+ cd $(DIR_SRC)/glibc-build && make localedata/install-locales install_root=$(BUILDROOT)
+
+
+ # Timezone
+ cp -v --remove-destination $(BUILDROOT)/usr/share/zoneinfo/GMT $(BUILDROOT)/etc/localtime
+
+ # Configuration
+ cp -vf $(DIR_SOURCE)/{ld.so.conf,nsswitch.conf} $(BUILDROOT)/etc
+
+ if [ -h /bin/pwd ]; then rm -f /bin/pwd; fi
+
+ @$(POST_INSTALL)
--- /dev/null
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt #
+# #
+# This program 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/>. #
+# #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include ../../Config
+
+PKG_NAME = grep
+PKG_VER = 2.5.4
+PKG_REL = 0
+
+PKG_MAINTAINER =
+PKG_GROUP = Applications/Text
+PKG_URL = http://www.gnu.org/software/grep/
+PKG_LICENSE = GPLv3+
+PKG_SUMMARY = A pattern matching utilities.
+
+define PKG_DESCRIPTION
+ The GNU versions of commonly used grep utilities. Grep searches through \
+ textual input for lines which contain a match to a specified pattern and then \
+ prints the matching lines. GNU's grep utilities include grep, egrep and fgrep.
+endef
+
+PKG_TARBALL = $(THISAPP).tar.bz2
+
+include ../../Rules
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ # --without-included-regex makes Grep use libc for regex. This gets rid of
+ # some compiler warnings, and I can't imagine why it's unsafe.
+
+ cd $(DIR_APP) && \
+ ./configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=/usr \
+ --bindir=/bin \
+ --without-included-regex
+
+ cd $(DIR_APP) && make $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
--- /dev/null
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt #
+# #
+# This program 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/>. #
+# #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include ../../Config
+
+PKG_NAME = gzip
+PKG_VER = 1.3.13
+PKG_REL = 0
+
+PKG_MAINTAINER =
+PKG_GROUP = Applications/Compression
+PKG_URL = http://www.gzip.org/
+PKG_LICENSE = GPLv2
+PKG_SUMMARY = The GNU data compression program.
+
+define PKG_DESCRIPTION
+ The gzip package contains the popular GNU gzip data compression \
+ program. Gzipped files have a .gz extension.
+endef
+
+PKG_TARBALL = $(THISAPP).tar.gz
+
+# This patch modifies 'znew' so we don't use temporary files:
+PKG_PATCHES += $(THISAPP)-openbsd-owl-tmp.patch
+
+# Fix CVE 2006-4337
+# (http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2006-4337) and
+# CVE 2006-4338 (http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2006-4338),
+# against malformed gzip files:
+PKG_PATCHES += $(THISAPP)-cve-2006-4337_len.patch
+PKG_PATCHES += $(THISAPP)-cve-2006-4338.patch
+
+include ../../Rules
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ # NO_ASM is for textrels.
+ cd $(DIR_APP) && \
+ DEFS=NO_ASM \
+ CPPFLAGS="-DHAVE_LSTAT" \
+ ./configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=/usr \
+ --bindir=/bin
+
+ cd $(DIR_APP) && make $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
+
+$(STAGE_INSTALL): $(STAGE_BUILD)
+ @$(PRE_INSTALL)
+
+ cd $(DIR_APP) && make install DESTDIR=$(BUILDROOT)
+
+ mv -v $(BUILDROOT)/bin/{gzexe,uncompress,zcmp,zdiff,zegrep} $(BUILDROOT)/usr/bin
+ mv -v $(BUILDROOT)/bin/{zfgrep,zforce,zgrep,zless,zmore,znew} $(BUILDROOT)/usr/bin
+
+ @$(POST_INSTALL)
--- /dev/null
+
+include ../../core/kernel/kernel.nm
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP) && make mrproper
+ cd $(DIR_APP) && make ARCH=x86 headers_check
+
+ @$(POST_BUILD)
+
+$(STAGE_INSTALL): $(STAGE_BUILD)
+ @$(PRE_INSTALL)
+
+ cd $(DIR_APP) && make ARCH=x86 INSTALL_HDR_PATH=dest headers_install
+ -mkdir -pv $(BUILDROOT)/usr/include
+ cd $(DIR_APP) && cp -rv dest/include/* $(BUILDROOT)/usr/include
+
+ @$(POST_INSTALL)
--- /dev/null
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007, 2008, 2009 Michael Tremer & Christian Schmidt #
+# #
+# This program 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/>. #
+# #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include ../../Config
+
+PKG_NAME = linux
+PKG_VER = 2.6.31.1
+PKG_REL = 0
+
+PKG_MAINTAINER = Michael Tremer <michael.tremer@ipfire.org>
+PKG_GROUP = System/Kernels
+PKG_URL = http://www.kernel.org/
+PKG_LICENSE = GPLv2
+PKG_SUMMARY = The Linux kernel.
+
+define PKG_DESCRIPTION
+ The kernel package contains the Linux kernel (vmlinuz), the core of any \
+ Linux operating system. The kernel handles the basic functions \
+ of the operating system: memory allocation, process allocation, device \
+ input and output, etc.
+endef
+
+PKG_BUILD_DEPS+=
+PKG_DEPS +=
+
+CFLAGS =
+CXXFLAGS =
+
+LOCALVERSION = -ipfire1
+FULLVER= $(PKG_VER)$(LOCALVERSION)
+
+# Another Union FS
+AUFS_PATCH = aufs2-$(PKG_VER)-1.patch
+PKG_PATCHES += $(AUFS_PATCH)
+
+# Grsecurity
+GRSEC_PATCH = grsecurity-2.1.14-$(PKG_VER)-200910012153.patch
+PKG_PATCHES += $(GRSEC_PATCH)
+
+# OCF
+#OCF_PATCH = ocf-linux-26-20080917.patch
+PKG_PATCHES += $(OCF_PATCH)
+
+# Reiser4 Filesystem
+REISER4_PATCH = reiser4-for-$(PKG_VER).patch
+PKG_PATCHES += $(REISER4_PATCH)
+
+# Routing improvements taken from http://www.ssi.bg/~ja/#routes
+ROUTES_PATCH = routes-$(PKG_VER)-16.diff
+PKG_PATCHES += $(ROUTES_PATCH)
+
+PKG_OBJECTS += $(THISAPP).tar.bz2
+
+PKG_PATCHES += $(THISAPP)-disable-compat_vdso-1.patch
+
+include ../../Rules
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(STAGE_PREPARE): $(OBJECTS)
+ @$(PRE_PREPARE)
+ rm -rf $(DIR_APP) && cd $(DIR_SRC) && $(DO_EXTRACT) $(DIR_DL)/$(firstword $(PKG_OBJECTS))
+
+ cd $(DIR_APP) && echo "$(LOCALVERSION)" > localversion-ipfire
+
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(AUFS_PATCH)
+ #cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(OCF_PATCH)
+ #cd $(DIR_APP) && echo "source \"crypto/ocf/Kconfig\"" >> crypto/Kconfig
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(REISER4_PATCH)
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(ROUTES_PATCH)
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(GRSEC_PATCH)
+ rm -f $(DIR_APP)/localversion-grsec
+
+ #cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(THISAPP)-disable-compat_vdso-1.patch
+
+ cd $(DIR_APP) && sed -e "s/^HOSTCFLAGS.*=.*/& -fPIC/g" -i Makefile
+
+ @$(POST_PREPARE)
+
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP) && make mrproper
+
+ # Select right optimization for the linux kernel.
+ if [ "$(TARGET)" == "i486" ]; then \
+ sed -e "s/^CONFIG_M686=y/# CONFIG_686 is not set/" \
+ -e "s/^# CONFIG_M486 is not set/CONFIG_M486=y/" \
+ < $(DIR_SOURCE)/kernel/kernel.config > $(DIR_APP)/.config; \
+ elif [ "$(TARGET)" == "i586" ]; then \
+ sed -e "s/^CONFIG_M686=y/# CONFIG_686 is not set/" \
+ -e "s/^# CONFIG_M586TSC is not set/CONFIG_M586TSC=y/" \
+ < $(DIR_SOURCE)/kernel/kernel.config > $(DIR_APP)/.config; \
+ elif [ "$(TARGET)" == "via-c7" ]; then \
+ sed -e "s/^CONFIG_M686=y/# CONFIG_686 is not set/" \
+ -e "s/^# CONFIG_MVIAC7 is not set/CONFIG_MVIAC7=y/" \
+ < $(DIR_SOURCE)/kernel/kernel.config > $(DIR_APP)/.config; \
+ elif [ "$(TARGET)" == "via-c3" ]; then \
+ sed -e "s/^CONFIG_M686=y/# CONFIG_686 is not set/" \
+ -e "s/^# CONFIG_MVIAC3_2 is not set/CONFIG_MVIAC3_2=y/" \
+ < $(DIR_SOURCE)/kernel/kernel.config > $(DIR_APP)/.config; \
+ else \
+ cp -f $(DIR_SOURCE)/kernel/kernel.config $(DIR_APP)/.config; \
+ fi
+
+ cd $(DIR_APP) && yes "" | make oldconfig
+
+ cd $(DIR_APP) && cp -vf $(DIR_SOURCE)/kernel/$(SNAME)_logo.ppm \
+ drivers/video/logo/logo_linux_clut224.ppm
+
+ cd $(DIR_APP) && make CC="gcc -nopie" $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
+
+
+$(STAGE_INSTALL): $(STAGE_BUILD)
+ @$(PRE_INSTALL)
+
+ cd $(DIR_APP) && make modules_install
+
+ cd $(DIR_APP) && cp -v arch/x86/boot/bzImage /boot/$(SNAME)kernel-$(FULLVER)
+ cd $(DIR_APP) && cp -v System.map /boot/System.map-$(FULLVER)
+
+ ln -svf $(SNAME)kernel-$(FULLVER) /boot/$(SNAME)kernel
+ ln -svf System.map-$(FULLVER) /boot/System.map
+
+ # keep the source code in $(DIR_SRC)/$(PKG_NAME)-$(FULLVER)
+ cp -fal $(DIR_APP) $(DIR_SRC)/$(PKG_NAME)-$(FULLVER)
+
+ rm -vf /lib/modules/$(KVER)/{build,source}
+ ln -svf $(DIR_SRC)/$(PKG_NAME)-$(FULLVER) /lib/modules/$(KVER)/build
+ ln -svf $(DIR_SRC)/$(PKG_NAME)-$(FULLVER) /lib/modules/$(KVER)/source
+ -mkdir -pv /lib/modules/$(KVER)/extra
+
+ @$(POST_INSTALL)
--- /dev/null
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt #
+# #
+# This program 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/>. #
+# #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include ../../Config
+
+PKG_NAME = m4
+PKG_VER = 1.4.11
+PKG_REL = 0
+
+PKG_MAINTAINER =
+PKG_GROUP = Applications/Text
+PKG_URL = http://www.gnu.org/software/m4/
+PKG_LICENSE = GPLv3+
+PKG_SUMMARY = The GNU macro processor.
+
+define PKG_DESCRIPTION
+ A GNU implementation of the traditional UNIX macro processor. M4 is \
+ useful for writing text files which can be logically parsed, and is \
+ used by many programs as part of their build process. M4 has \
+ built-in functions for including files, running shell commands, \
+ doing arithmetic, etc. The autoconf program needs m4 for generating \
+ configure scripts, but not for running configure scripts.
+endef
+
+PKG_TARBALL = $(THISAPP).tar.bz2
+
+include ../../Rules
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ # We need -D_GNU_SOURCE because this version of M4 has a bug in gnulib (or
+ # possibly autoconf) that doesn't recognise that we have asprintf() in libc.
+ cd $(DIR_APP) && \
+ CPPFLAGS="-D_GNU_SOURCE" \
+ gl_cv_func_printf_directive_n=no \
+ ./configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=/usr
+
+ cd $(DIR_APP) && make $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
--- /dev/null
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt #
+# #
+# This program 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/>. #
+# #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include ../../Config
+
+PKG_NAME = make
+PKG_VER = 3.81
+PKG_REL = 0
+
+PKG_MAINTAINER =
+PKG_GROUP = Development/Tools
+PKG_URL = http://www.gnu.org/software/make/
+PKG_LICENSE = GPLv2+
+PKG_SUMMARY = A GNU tool which simplifies the build process for users.
+
+define PKG_DESCRIPTION
+ A GNU tool for controlling the generation of executables and other \
+ non-source files of a program from the program's source files. Make \
+ allows users to build and install packages without any significant \
+ knowledge about the details of the build process. The details about \
+ how the program should be built are provided for make in the program's \
+ makefile.
+endef
+
+PKG_TARBALL = $(THISAPP).tar.bz2
+
+include ../../Rules
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP) && \
+ ./configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=/usr
+
+ cd $(DIR_APP) && make $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
--- /dev/null
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt #
+# #
+# This program 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/>. #
+# #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include ../../Config
+
+PKG_NAME = ncurses
+PKG_VER = 5.7
+PKG_REL = 0
+
+PKG_MAINTAINER =
+PKG_GROUP = System/Base
+PKG_URL = http://invisible-island.net/ncurses/ncurses.html
+PKG_LICENSE = MIT
+PKG_SUMMARY = Ncurses support utilities.
+
+define PKG_DESCRIPTION
+ The curses library routines are a terminal-independent method of \
+ updating character screens with reasonable optimization. The ncurses \
+ (new curses) library is a freely distributable replacement for the \
+ discontinued 4.4 BSD classic curses library.
+endef
+
+PKG_TARBALL = $(THISAPP).tar.gz
+
+include ../../Rules
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP) && \
+ ./configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=/usr \
+ --with-shared \
+ --without-debug \
+ --enable-widec \
+ --disable-static \
+ --enable-symlinks \
+ --disable-root-environ
+
+ cd $(DIR_APP) && make $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
+
+$(STAGE_INSTALL): $(STAGE_BUILD)
+ @$(PRE_INSTALL)
+
+ cd $(DIR_APP) && make install DESTDIR=$(BUILDROOT)
+
+ mv -v $(BUILDROOT)/usr/lib/libncursesw.so.5* $(BUILDROOT)/lib
+ ln -sfv ../../lib/libncursesw.so.5 $(BUILDROOT)/usr/lib/libncursesw.so
+ for lib in curses ncurses form panel menu; do \
+ rm -vf $(BUILDROOT)/usr/lib/lib$${lib}.so ; \
+ echo "INPUT(-l$${lib}w)" >$(BUILDROOT)/usr/lib/lib$${lib}.so ; \
+ done
+
+ rm -vf $(BUILDROOT)/usr/lib/libcursesw.so
+ echo "INPUT(-lncursesw)" >$(BUILDROOT)/usr/lib/libcursesw.so
+ ln -sfv libncurses.so $(BUILDROOT)/usr/lib/libcurses.so
+
+ @$(POST_INSTALL)
--- /dev/null
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt #
+# #
+# This program 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/>. #
+# #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include ../../Config
+
+PKG_NAME = patch
+PKG_VER = 2.5.9
+PKG_REL = 0
+
+PKG_MAINTAINER =
+PKG_GROUP = Development/Tools
+PKG_URL = http://www.gnu.org/software/patch/patch.html
+PKG_LICENSE = GPLv2+
+PKG_SUMMARY = Utility for modifying/upgrading files.
+
+define PKG_DESCRIPTION
+ The patch program applies diff files to originals. The diff \
+ command is used to compare an original to a changed file.\
+ Diff lists the changes made to the file. A person who has \
+ the original file can then use the patch command with the \
+ diff file to add the changes to their original file.
+endef
+
+PKG_TARBALL = $(THISAPP).tar.gz
+
+# Get rid of mktemp(3):
+PKG_PATCHES += $(THISAPP)-mkstemp-1.patch
+
+# Some fixes:
+PKG_PATCHES += $(THISAPP)-fixes-1.patch
+
+include ../../Rules
--- /dev/null
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt #
+# #
+# This program 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/>. #
+# #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include ../../Config
+
+PKG_NAME = pax-utils
+PKG_VER = 0.1.19
+PKG_REL = 0
+
+PKG_MAINTAINER =
+PKG_GROUP = Security/Tools
+PKG_URL = http://www.gentoo.org/proj/en/hardened/pax-utils.xml
+PKG_LICENSE = GPLv2+
+PKG_SUMMARY = Utilities for checking PaX features.
+
+PKG_DEPS += libcap2
+
+define PKG_DESCRIPTION
+ This package contains several utilities for checking PaX features.
+endef
+
+PKG_TARBALL = $(THISAPP).tar.bz2
+
+include ../../Rules
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP) && make CFLAGS="$(CFLAGS)" USE_CAP=yes $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
--- /dev/null
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt #
+# #
+# This program 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/>. #
+# #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include ../../Config
+
+PKG_NAME = perl
+PKG_VER = 5.10.0
+PKG_REL = 0
+
+PKG_MAINTAINER =
+PKG_GROUP = Development/Languages
+PKG_URL = http://www.perl.org/
+PKG_LICENSE = GPL+ or Artistic and GPLv2+ or Artistic
+PKG_SUMMARY = Practical Extraction and Report Language.
+
+PKG_DEPS += zlib
+
+define PKG_DESCRIPTION
+ Perl is a high-level programming language with roots in C, sed, awk \
+ and shell scripting. Perl is good at handling processes and files, \
+ and is especially good at handling text. Perl's hallmarks are \
+ practicality and efficiency. While it is used to do a lot of \
+ different things, Perl's most common applications are system \
+ administration utilities and web programming. A large proportion of \
+ the CGI scripts on the web are written in Perl. You need the perl \
+ package installed on your system so that your system can handle Perl \
+ scripts.
+endef
+
+PKG_TARBALL = $(THISAPP).tar.gz
+
+PKG_PATCHES += $(THISAPP)-page-1.patch
+PKG_PATCHES += $(THISAPP)-security_fix-1.patch
+
+define QUALITY_AGENT_WHITELIST_RPATH
+ /usr/lib/perl5/*/auto/DB_File/DB_File.so \
+ /usr/lib/perl5/*/auto/Time/HiRes/HiRes.so \
+ /usr/lib/perl5/*/auto/Compress/Raw/Zlib/Zlib.so
+endef
+
+include ../../Rules
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(STAGE_PREPARE): $(OBJECTS)
+ @$(PRE_PREPARE)
+ cd $(DIR_SRC) && $(DO_EXTRACT) $(DIR_DL)/$(PKG_TARBALL)
+
+ $(DO_PATCHES)
+
+ cd $(DIR_APP) && sed -i 's/command /command[ -]/' makedepend.SH
+
+ @$(POST_PREPARE)
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP) && sed -i -e "s|BUILD_ZLIB\s*= True|BUILD_ZLIB = False|" \
+ -e "s|INCLUDE\s*= ./zlib-src|INCLUDE = /usr/include|" \
+ -e "s|LIB\s*= ./zlib-src|LIB = /usr/lib|" \
+ ext/Compress/Raw/Zlib/config.in
+
+ cd $(DIR_APP) && ./configure.gnu --prefix=/usr \
+ -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 \
+ -Dpager="/usr/bin/less -isR"
+
+ cd $(DIR_APP) && make #$(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
--- /dev/null
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt #
+# #
+# This program 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/>. #
+# #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include ../../Config
+
+PKG_NAME = sed
+PKG_VER = 4.1.5
+PKG_REL = 0
+
+PKG_MAINTAINER =
+PKG_GROUP = Applications/Text
+PKG_URL = http://sed.sourceforge.net/
+PKG_LICENSE = GPLv2+
+PKG_SUMMARY = A GNU stream text editor.
+
+define PKG_DESCRIPTION
+ The sed (Stream EDitor) editor is a stream or batch (non-interactive) \
+ editor. Sed takes text as input, performs an operation or set of \
+ operations on the text and outputs the modified text. The operations \
+ that sed performs (substitutions, deletions, insertions, etc.) can be \
+ specified in a script file or from the command line.
+endef
+
+PKG_TARBALL = $(THISAPP).tar.gz
+
+include ../../Rules
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP) && \
+ ./configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=/usr \
+ --bindir=/bin \
+ --enable-html \
+ --without-included-regex
+
+ cd $(DIR_APP) && make $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
--- /dev/null
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt #
+# #
+# This program 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/>. #
+# #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include ../../Config
+
+PKG_NAME = tar
+PKG_VER = 1.22
+PKG_REL = 0
+
+PKG_MAINTAINER =
+PKG_GROUP = System/Packaging
+PKG_URL = http://www.gnu.org/software/tar/
+PKG_LICENSE = GPLv3+
+PKG_SUMMARY = A GNU file archiving program.
+
+PKG_DEPS += acl attr
+
+define PKG_DESCRIPTION
+ The GNU tar program saves many files together in one archive \
+ and can restore individual files (or all of the files) from \
+ that archive. Tar can also be used to add supplemental files \
+ to an archive and to update or list files in the archive. Tar \
+ includes multivolume support,automatic archive \
+ compression/decompression, the ability to perform remote archives, \
+ and the ability to perform incremental and full backups.
+endef
+
+PKG_TARBALL = $(THISAPP).tar.bz2
+
+# Fix extracting sparse files to a filesystem like vfat, when ftruncate
+# may fail to grow the size of a file
+PKG_PATCHES += $(THISAPP)-vfatTruncate.patch
+
+# Add support for ACLs in the tarballs.
+PKG_PATCHES += $(THISAPP)-xattrs-1.patch
+PKG_PATCHES += $(THISAPP)-xattrs-conf-1.patch
+
+include ../../Rules
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP) && \
+ CC="$(TARGET)-gcc -std=gnu99 -fgnu89-inline" \
+ ./configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=/usr \
+ --bindir=/bin \
+ --libexecdir=/usr/sbin
+
+ cd $(DIR_APP) && make $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
--- /dev/null
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt #
+# #
+# This program 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/>. #
+# #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include ../../Config
+
+PKG_NAME = texinfo
+PKG_VER = 4.13a
+PKG_REL = 0
+
+PKG_MAINTAINER =
+PKG_GROUP = Applications/Publishing
+PKG_URL = http://www.gnu.org/software/texinfo/
+PKG_LICENSE = GPLv3
+PKG_SUMMARY = Tools needed to create Texinfo format documentation files.
+
+PKG_DEPS += ncurses
+
+define PKG_DESCRIPTION
+ Texinfo is a documentation system that can produce both online \
+ information and printed output from a single source file. The GNU \
+ Project uses the Texinfo file format for most of its documentation.
+endef
+
+PKG_TARBALL = $(THISAPP).tar.gz
+
+
+DIR_APP = $(DIR_SRC)/$(PKG_NAME)-4.13
+
+include ../../Rules
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP) && \
+ LDFLAGS="-lncursesw" \
+ ./configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=/usr
+
+ cd $(DIR_APP) && make $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
--- /dev/null
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt #
+# #
+# This program 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/>. #
+# #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include ../../Config
+
+PKG_NAME = xz
+PKG_VER = 4.999.8beta
+PKG_REL = 0
+
+PKG_MAINTAINER =
+PKG_GROUP = Applications/Compression
+PKG_URL = http://tukaani.org/xz/
+PKG_LICENSE = GPLv2+
+PKG_SUMMARY = LZMA Utils.
+
+define PKG_DESCRIPTION
+ LZMA provides very high compression ratio and fast decompression. The \
+ core of the LZMA utils is Igor Pavlov's LZMA SDK containing the actual \
+ LZMA encoder/decoder. LZMA utils add a few scripts which provide \
+ gzip-like command line interface and a couple of other LZMA related \
+ tools.
+endef
+
+PKG_TARBALL = $(THISAPP).tar.gz
+
+define QUALITY_AGENT_WHITELIST_RPATH
+ /usr/bin/xz \
+ /usr/bin/lzmadec \
+ /usr/bin/xzdec
+endef
+
+include ../../Rules
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP) && \
+ ./configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=/usr \
+ --disable-static
+
+ cd $(DIR_APP) && make $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
+
+$(STAGE_INSTALL): $(STAGE_BUILD)
+ @$(PRE_INSTALL)
+
+ cd $(DIR_APP) && make install DESTDIR=$(BUILDROOT)
+
+ rm -vf $(BUILDROOT)/usr/lib/liblzma.la
+
+ @$(POST_INSTALL)
--- /dev/null
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007, 2008, 2009 Michael Tremer & Christian Schmidt #
+# #
+# This program 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/>. #
+# #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include ../../Config
+
+PKG_NAME = zlib
+PKG_VER = 1.2.3
+PKG_REL = 0
+
+PKG_MAINTAINER =
+PKG_GROUP = System/Libraries
+PKG_URL = http://www.gzip.org/zlib/
+PKG_LICENSE = zlib
+PKG_SUMMARY = The zlib compression and decompression library.
+
+define PKG_DESCRIPTION
+ Zlib is a general-purpose, patent-free, lossless data compression \
+ library which is used by many different programs.
+endef
+
+PKG_BUILD_DEPS = glibc
+
+PKG_TARBALL = $(THISAPP)-autotools-1.tar.gz
+
+CFLAGS += -fPIC -DPIC
+
+include ../../Rules
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP) && \
+ ac_cv_func_working_mktime=yes \
+ ./configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=/usr \
+ --libdir=/lib \
+ --disable-static
+ cd $(DIR_APP) && make $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
+
+$(STAGE_INSTALL): $(STAGE_BUILD)
+ @$(PRE_INSTALL)
+
+ cd $(DIR_APP) && make install DESTDIR=$(BUILDROOT)
+ -mkdir -pv $(BUILDROOT)/usr/{include,lib}
+ cd $(DIR_APP) && cp -pfv zconf.h zlib.h $(BUILDROOT)/usr/include
+ rm -vf $(BUILDROOT)/lib/libz.{la,so}
+ ln -sfv ../../lib/libz.so.$(PKG_VER) $(BUILDROOT)/usr/lib/libz.so
+
+ @$(POST_INSTALL)
--- /dev/null
+
+PKG_TOOLCHAIN_DEPS += attr
+
+include ../../core/acl/acl.nm
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP) && \
+ ./configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=$(TOOLS_DIR)
+
+ cd $(DIR_APP) && make LIBTOOL="libtool --tag=CC" #$(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
+
+
+$(STAGE_INSTALL): $(STAGE_BUILD)
+ @$(PRE_INSTALL)
+
+ cd $(DIR_APP) && make install install-dev install-lib
+
+ @$(POST_INSTALL)
--- /dev/null
+
+include ../../core/attr/attr.nm
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP) && \
+ ./configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=$(TOOLS_DIR) \
+ --enable-shared
+
+ cd $(DIR_APP) && make LIBTOOL="libtool --tag=CC" #$(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
+
+
+$(STAGE_INSTALL): $(STAGE_BUILD)
+ @$(PRE_INSTALL)
+
+ cd $(DIR_APP) && make install
+
+ install -v -m0755 $(DIR_APP)/libattr/.libs/libattr.so.1.1.0 $(TOOLS_DIR)/lib
+ ln -vsf libattr.so.1.1.0 $(TOOLS_DIR)/lib/libattr.so.1
+ ln -vsf libattr.so.1.1.0 $(TOOLS_DIR)/lib/libattr.so
+ install -v -d $(TOOLS_DIR)/include/attr
+ cp -vf $(DIR_APP)/include/{attributes.h,error_context.h,libattr.h,xattr.h} \
+ $(TOOLS_DIR)/include/attr/
+
+ @$(POST_INSTALL)
--- /dev/null
+
+PKG_TOOLCHAIN_DEPS += perl
+
+include ../../core/autoconf/autoconf.nm
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP) && \
+ ./configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=$(TOOLS_DIR)
+
+ cd $(DIR_APP) && make $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
--- /dev/null
+
+PKG_TOOLCHAIN_DEPS += autoconf perl
+
+include ../../core/automake/automake.nm
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP) && \
+ ./configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=$(TOOLS_DIR)
+
+ cd $(DIR_APP) && make $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
--- /dev/null
+
+include ../../core/bash/bash.nm
+
+$(STAGE_PREPARE): $(OBJECTS)
+ @$(PRE_PREPARE)
+ cd $(DIR_SRC) && $(DO_EXTRACT) $(DIR_DL)/$(PKG_TARBALL)
+
+ #$(DO_PATCHES) Do not apply patches at toolchain because
+ # this will require an autoreconf that is only possible
+ # with the latest version of autoconf (which CentOS hasn't got)
+
+ @$(POST_PREPARE)
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP) && \
+ ac_cv_func_working_mktime=yes \
+ ./configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=$(TOOLS_DIR) \
+ --without-bash-malloc
+
+ cd $(DIR_APP) && make #$(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
+
+
+$(STAGE_INSTALL): $(STAGE_BUILD)
+ @$(PRE_INSTALL)
+
+ cd $(DIR_APP) && make install
+
+ ln -svf bash $(TOOLS_DIR)/bin/sh
+
+ @$(POST_INSTALL)
--- /dev/null
+
+PKG_TOOLCHAIN_DEPS += kernel-headers
+
+include ../../core/binutils/binutils.nm
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_SRC)/binutils-build && \
+ CC="gcc -B/usr/bin/" \
+ ../$(THISAPP)/configure \
+ $(CONFIGURE_ARCH) \
+ --target=$(TARGET) \
+ --prefix=$(TOOLS_DIR) \
+ --disable-nls \
+ --disable-werror
+
+ cd $(DIR_SRC)/binutils-build && make tooldir=$(TOOLS_DIR) $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
+
+
+$(STAGE_INSTALL): $(STAGE_BUILD)
+ @$(PRE_INSTALL)
+
+ cd $(DIR_SRC)/binutils-build && make tooldir=$(TOOLS_DIR) install
+
+ @$(POST_INSTALL)
--- /dev/null
+
+PKG_TOOLCHAIN_DEPS += binutils-static glibc
+
+include ../binutils-static/binutils-static.nm
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_SRC)/binutils-build && \
+ ../$(THISAPP)/configure \
+ $(CONFIGURE_ARCH) \
+ --target=$(TARGET) \
+ --prefix=$(TOOLS_DIR) \
+ --with-lib-path=$(TOOLS_DIR)/lib \
+ --disable-nls \
+ --enable-shared \
+ --disable-werror
+
+ cd $(DIR_SRC)/binutils-build && make tooldir=$(TOOLS_DIR) $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
+
+
+$(STAGE_INSTALL): $(STAGE_BUILD)
+ @$(PRE_INSTALL)
+
+ cd $(DIR_SRC)/binutils-build && make tooldir=$(TOOLS_DIR) install
+
+ cd $(DIR_SRC)/binutils-build && make -C ld clean
+ cd $(DIR_SRC)/binutils-build && make -C ld LIB_PATH=/lib:/usr/lib
+ cd $(DIR_SRC)/binutils-build && cp -v ld/.libs/ld-new $(TOOLS_DIR)/bin
+
+ @$(POST_INSTALL)
--- /dev/null
+
+include ../../core/bzip2/bzip2.nm
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP) && make $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
+
+
+$(STAGE_INSTALL): $(STAGE_BUILD)
+ @$(PRE_INSTALL)
+
+ cd $(DIR_APP) && make PREFIX=$(TOOLS_DIR) install
+
+ @$(POST_INSTALL)
--- /dev/null
+
+PKG_TOOLCHAIN_DEPS += acl attr ncurses
+
+include ../../core/coreutils/coreutils.nm
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP) && \
+ gl_cv_func_printf_directive_n=no \
+ ./configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=$(TOOLS_DIR) \
+ --enable-install-program=hostname
+
+ cd $(DIR_APP) && make $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
+
+
+$(STAGE_INSTALL): $(STAGE_BUILD)
+ @$(PRE_INSTALL)
+
+ cd $(DIR_APP) && make install
+
+ cd $(DIR_APP) && cp -v src/su $(TOOLS_DIR)/bin/su-tools
+
+ @$(POST_INSTALL)
--- /dev/null
+
+include ../../core/diffutils/diffutils.nm
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP) && \
+ ./configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=$(TOOLS_DIR)
+
+ cd $(DIR_APP) && make $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
--- /dev/null
+
+include ../../core/e2fsprogs/e2fsprogs.nm
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP)/build && \
+ ../configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=$(TOOLS_DIR) \
+ --enable-elf-shlibs
+
+ cd $(DIR_APP)/build && make $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
+
+
+$(STAGE_INSTALL): $(STAGE_BUILD)
+ @$(PRE_INSTALL)
+
+ cd $(DIR_APP)/build && make install-libs
+
+ @$(POST_INSTALL)
--- /dev/null
+
+include ../../core/file/file.nm
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP) && \
+ ./configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=$(TOOLS_DIR) \
+ --disable-static
+
+ cd $(DIR_APP) && make $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
+
+
+$(STAGE_INSTALL): $(STAGE_BUILD)
+ @$(PRE_INSTALL)
+
+ cd $(DIR_APP) && make install
+
+ @$(POST_INSTALL)
--- /dev/null
+
+include ../../core/findutils/findutils.nm
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP) && \
+ ./configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=$(TOOLS_DIR) \
+ --libexecdir=$(TOOLS_DIR)/lib/findutils
+
+ cd $(DIR_APP) && make $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
+
+
+$(STAGE_INSTALL): $(STAGE_BUILD)
+ @$(PRE_INSTALL)
+
+ cd $(DIR_APP) && make install
+
+ @$(POST_INSTALL)
--- /dev/null
+
+include ../../core/flex/flex.nm
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP) && \
+ ./configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=$(TOOLS_DIR) \
+ --disable-static
+
+ cd $(DIR_APP) && make $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
+
+
+$(STAGE_INSTALL): $(STAGE_BUILD)
+ @$(PRE_INSTALL)
+
+ cd $(DIR_APP) && make install
+
+ @$(POST_INSTALL)
--- /dev/null
+
+include ../../core/gawk/gawk.nm
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP) && \
+ ac_cv_func_working_mktime=yes \
+ ./configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=$(TOOLS_DIR) \
+ --libexecdir=$(TOOLS_DIR)/lib
+
+ cd $(DIR_APP) && echo "#define HAVE_LANGINFO_CODESET 1" >> config.h
+ cd $(DIR_APP) && echo "#define HAVE_LC_MESSAGES 1" >> config.h
+
+ cd $(DIR_APP) && make $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
--- /dev/null
+
+PKG_TOOLCHAIN_DEPS += binutils-static kernel-headers
+
+include ../../core/gcc/gcc.nm
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ ## Enable -fPIC by default
+ cd $(DIR_APP) && sed 's/^\(#define CC1_SPEC.*\)\("\)$$/\1 %{fno-pic|fpic|fPIC:;:-fPIC}\2/' \
+ -i gcc/config/i386/linux.h
+ cd $(DIR_APP) && sed 's/^\(#define CC1_SPEC.*\)\("\)$$/\1 %{fno-pic|fpic|fPIC:;:-fPIC}\2/' \
+ -i gcc/config/i386/x86-64.h
+
+ # libssp has no use with new versions of Glibc. Glibc completely replaces all
+ # functions in libssp, linking to libssp will cause conflicts with libc, so
+ # libssp is a waste of space... so --disable-libssp.
+
+ set
+
+ cd $(DIR_SRC)/gcc-build && \
+ CC="gcc -B/usr/bin/" \
+ ../$(THISAPP)/configure \
+ $(CONFIGURE_ARCH) \
+ --target=$(TARGET) \
+ $(CONFIG_CPU) \
+ --prefix=$(TOOLS_DIR) \
+ --with-local-prefix=$(TOOLS_DIR) \
+ --libexecdir=$(TOOLS_DIR)/lib \
+ --enable-languages=c \
+ --enable-shared \
+ --disable-nls \
+ --disable-libssp \
+ --disable-werror \
+ --disable-static \
+ $(CONFIGURE_ARGS)
+
+ cd $(DIR_SRC)/gcc-build && make $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
+
+
+$(STAGE_INSTALL): $(STAGE_BUILD)
+ @$(PRE_INSTALL)
+
+ cd $(DIR_SRC)/gcc-build && make install
+
+ ln -fvs gcc $(TOOLS_DIR)/bin/cc
+
+ $(TARGET)-gcc -dumpspecs | sed \
+ -e 's@$(LINKER)@$(TOOLS_DIR)&@g' \
+ > $$(dirname $$($(TARGET)-gcc -print-libgcc-file-name))/specs
+
+ @$(POST_INSTALL)
--- /dev/null
+
+PKG_TOOLCHAIN_DEPS += binutils glibc
+
+include ../gcc-static/gcc-static.nm
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ # Enable hardening by default:
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(THISAPP)-espf-1.patch
+
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(THISAPP)-branch-startfiles-1.patch
+
+ # This patch fixes a conflict between libiberty's asprintf() and Glibc's, when
+ # -D_FORTIFY_SOURCE=2 is used:
+ cd $(DIR_APP) && patch -Np0 -i $(DIR_PATCHES)/$(THISAPP)-asprintf_fix.patch
+
+ cd $(DIR_APP) && sed 's@\./fixinc\.sh@-c true@' -i gcc/Makefile.in
+ cd $(DIR_APP) && sed 's/^XCFLAGS =$$/& -fomit-frame-pointer/' -i gcc/Makefile.in
+ cd $(DIR_APP) && \
+ for file in $$(find gcc/config -name linux64.h -o -name linux.h); do \
+ cp -uv $$file{,.orig}; \
+ sed -e 's@/lib\(64\)\?\(32\)\?/ld@$(TOOLS_DIR)&@g' \
+ -e 's@/usr@$(TOOLS_DIR)@g' $$file.orig > $$file; \
+ echo -e "\n#undef STANDARD_INCLUDE_DIR\n#define STANDARD_INCLUDE_DIR 0" >> $$file; \
+ touch $$file.orig; \
+ done
+
+ifeq "$(MACHINE)" "x86_64"
+ # Remove multilib options and searchpath (/lib... /usr/lib...)
+ cd $(DIR_APP) && echo "" > gcc/config/i386/t-linux64
+ ## Enable -fPIC by default (why i have to do this again ???)
+ cd $(DIR_APP) && sed 's/^\(#define CC1_SPEC.*\)\("\)$$/\1 %{fno-pic|fpic|fPIC:;:-fPIC}\2/' \
+ -i gcc/config/i386/x86-64.h
+endif
+
+ # We need to do another bootstrap, so that everything in $(TOOLS_DIR) is hardened.
+ cd $(DIR_SRC)/gcc-build && \
+ ../$(THISAPP)/configure \
+ $(CONFIGURE_ARCH) \
+ --target=$(TARGET) \
+ $(CONFIG_CPU) \
+ --prefix=$(TOOLS_DIR) \
+ --with-local-prefix=$(TOOLS_DIR) \
+ --libexecdir=$(TOOLS_DIR)/lib \
+ --enable-espf \
+ --enable-clocale=gnu \
+ --enable-shared \
+ --enable-threads=posix \
+ --enable-__cxa_atexit \
+ --enable-languages=c,c++ \
+ --disable-libstdcxx-pch \
+ --disable-bootstrap \
+ --disable-werror \
+ --disable-libssp \
+ --disable-nls \
+ --disable-static \
+ $(CONFIGURE_ARGS)
+
+ cd $(DIR_SRC)/gcc-build && make $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
+
+$(STAGE_INSTALL): $(STAGE_BUILD)
+ @$(PRE_INSTALL)
+
+ cd $(DIR_SRC)/gcc-build && make install
+
+ @$(POST_INSTALL)
--- /dev/null
+
+include ../../core/gettext/gettext.nm
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP)/gettext-tools && \
+ ./configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=$(TOOLS_DIR) \
+ --disable-shared
+
+ cd $(DIR_APP)/gettext-tools && make -C gnulib-lib
+ cd $(DIR_APP)/gettext-tools && make -C src msgfmt
+
+ @$(POST_BUILD)
+
+
+$(STAGE_INSTALL): $(STAGE_BUILD)
+ @$(PRE_INSTALL)
+
+ cd $(DIR_APP)/gettext-tools && cp -v src/msgfmt $(TOOLS_DIR)/bin
+
+ @$(POST_INSTALL)
--- /dev/null
+../../core/glibc/glibc-2.10.1-stack_chk_fail.c
\ No newline at end of file
--- /dev/null
+
+PKG_TOOLCHAIN_DEPS += binutils-static gcc-static kernel-headers
+
+include ../../core/glibc/glibc.nm
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ # Glibc uses a hard coded path for /etc/ld.so.preload. To keep Glibc from
+ # preloading libraries from the host machine perform the following command:
+ cd $(DIR_APP) && sed -e "s@/etc/ld.so.preload@$(TOOLS_DIR)@" -i elf/rtld.c
+
+ cd $(DIR_SRC)/glibc-build && \
+ CFLAGS= \
+ CXXFLAGS= \
+ ../$(THISAPP)/configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=$(TOOLS_DIR) \
+ --libexecdir=$(TOOLS_DIR)/lib/$(PKG_NAME) \
+ --with-headers=$(TOOLS_DIR)/include \
+ --with-binutils=$(TOOLS_DIR)/bin \
+ --disable-profile \
+ --enable-add-ons \
+ --enable-kernel=$(OPTIMIZED_KERNEL) \
+ --without-selinux \
+ --without-gd \
+ --enable-bind-now \
+ --enable-stackguard-randomization
+
+ # Our GCC is already passing -fPIC, and that's all we want for the libraries.
+ # LDFLAGS.so is appended to so we don't build shared libraries with
+ # DT_TEXTREL (and to tell us if something goes wrong). For now we only build
+ # the libraries, not the programs:
+ echo "build-programs=no" \
+ >> $(DIR_SRC)/glibc-build/configparms
+
+ cd $(DIR_SRC)/glibc-build && make PARALLELMFLAGS=$(PARALLELISMFLAGS) \
+ CFLAGS="-O2 -DPIC -fno-stack-protector -U_FORTIFY_SOURCE" \
+ CXXFLAGS="-O2 -DPIC -fno-stack-protector -U_FORTIFY_SOURCE"
+
+ # Then build the programs with hardening, so everything possible in
+ # $(TOOLS_DIR) is hardened:
+ echo "CFLAGS = $(CFLAGS)" > $(DIR_SRC)/glibc-build/configparms
+ echo "CXXFLAGS = $(CXXFLAGS)" >> $(DIR_SRC)/glibc-build/configparms
+ cd $(DIR_SRC)/glibc-build && make PARALLELMFLAGS=$(PARALLELISMFLAGS) \
+ CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)"
+
+ @$(POST_BUILD)
+
+
+$(STAGE_INSTALL): $(STAGE_BUILD)
+ @$(PRE_INSTALL)
+
+ -mkdir -v $(TOOLS_DIR)/etc
+ touch $(TOOLS_DIR)/etc/ld.so.conf
+
+ cd $(DIR_SRC)/glibc-build && make install
+
+ @$(POST_INSTALL)
--- /dev/null
+
+include ../../core/grep/grep.nm
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP) && \
+ ./configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=$(TOOLS_DIR) \
+ --disable-perl-regexp \
+ --without-included-regex
+
+ cd $(DIR_APP) && make $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
--- /dev/null
+
+include ../../core/gzip/gzip.nm
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ # NO_ASM is for textrels.
+ cd $(DIR_APP) && \
+ DEFS=NO_ASM \
+ CPPFLAGS="-DHAVE_LSTAT" \
+ ./configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=$(TOOLS_DIR)
+
+ cd $(DIR_APP) && make $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
+
+
+$(STAGE_INSTALL): $(STAGE_BUILD)
+ @$(PRE_INSTALL)
+
+ cd $(DIR_APP) && make install
+
+ @$(POST_INSTALL)
--- /dev/null
+
+PKG_TOOLCHAIN_DEPS = # Depend on nothing
+
+include ../../core/kernel-headers/kernel-headers.nm
+
+$(STAGE_INSTALL): $(STAGE_BUILD)
+ @$(PRE_INSTALL)
+
+ cd $(DIR_APP) && make ARCH=x86 INSTALL_HDR_PATH=dest headers_install
+ cd $(DIR_APP) && cp -rv dest/include/* $(TOOLS_DIR)/include
+
+ @$(POST_INSTALL)
--- /dev/null
+
+include ../../core/m4/m4.nm
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP) && \
+ CPPFLAGS="-D_GNU_SOURCE" \
+ gl_cv_func_printf_directive_n=no \
+ ./configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=$(TOOLS_DIR)
+
+ cd $(DIR_APP) && make $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
--- /dev/null
+
+include ../../core/make/make.nm
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP) && \
+ ./configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=$(TOOLS_DIR)
+
+ cd $(DIR_APP) && make $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
--- /dev/null
+
+include ../../core/ncurses/ncurses.nm
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP) && \
+ ./configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=$(TOOLS_DIR) \
+ --with-shared \
+ --without-debug \
+ --without-ada \
+ --enable-overwrite \
+ --enable-widec \
+ --without-cxx-binding \
+ --enable-symlinks \
+ --disable-root-environ \
+ --disable-static
+
+ cd $(DIR_APP) && make $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
+
+
+$(STAGE_INSTALL): $(STAGE_BUILD)
+ @$(PRE_INSTALL)
+
+ cd $(DIR_APP) && make install
+ for lib in curses ncurses form panel menu; do \
+ rm -vf $(TOOLS_DIR)/lib/lib$${lib}.so ; \
+ echo "INPUT(-l$${lib}w)" >$(TOOLS_DIR)/lib/lib$${lib}.so ; \
+ done
+
+ @$(POST_INSTALL)
--- /dev/null
+
+include ../../core/patch/patch.nm
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP) && \
+ ./configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=$(TOOLS_DIR)
+
+ cd $(DIR_APP) && make $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
--- /dev/null
+
+include ../../core/pax-utils/pax-utils.nm
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP) && make scanelf CFLAGS="$(CFLAGS)" $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
+
+
+$(STAGE_INSTALL): $(STAGE_BUILD)
+ @$(PRE_INSTALL)
+
+ cd $(DIR_APP) && install -m 755 -v scanelf $(TOOLS_DIR)/bin/scanelf
+
+ @$(POST_INSTALL)
--- /dev/null
+
+include ../../core/perl/perl.nm
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ -mkdir -pv $(DIR_SRC)/perl-build
+
+ # -Dlibc, locincpth, loclibpth, glibpth, and usrinc, are equivilent to the LFS
+ # Perl libc patch.
+
+ # ./Configure is used instead of ./configure.gnu because it supports builds
+ # from an object directory. -Dmksymlinks is also used, to support read-only
+ # sources. -d -e are added to accept all defaults, otherwise ./Configure will
+ # be interactive.
+ cd $(DIR_SRC)/perl-build && \
+ $(DIR_APP)/Configure \
+ -Dcc=$(TARGET)-gcc \
+ -Dprefix=$(TOOLS_DIR) \
+ -Dlibc=$(shell ls $(TOOLS_DIR)/lib/libc-*.so) \
+ -Ulocincpth \
+ -Uloclibpth \
+ -Dglibpth="$(TOOLS_DIR)/lib" \
+ -Dusrinc="$(TOOLS_DIR)/include" \
+ -Dmksymlinks \
+ -d -e
+
+ cd $(DIR_SRC)/perl-build && make #$(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
+
+
+$(STAGE_INSTALL): $(STAGE_BUILD)
+ @$(PRE_INSTALL)
+
+ cd $(DIR_SRC)/perl-build && make LNS="cp" install
+
+ @$(POST_INSTALL)
--- /dev/null
+
+include ../../core/sed/sed.nm
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP) && \
+ ./configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=$(TOOLS_DIR) \
+ --without-included-regex
+
+ cd $(DIR_APP) && make $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
--- /dev/null
+
+include ../../core/tar/tar.nm
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ # Normally the 'rmt' programs goes in sbin/.
+ cd $(DIR_APP) && LDFLAGS="-z muldefs" \
+ ./configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=$(TOOLS_DIR) \
+ --libexecdir=$(TOOLS_DIR)/bin
+ cd $(DIR_APP) && make $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
--- /dev/null
+
+PKG_TOOLCHAIN_DEPS += $(TC_PACKAGES) ncurses
+
+include ../../core/texinfo/texinfo.nm
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP) && \
+ LDFLAGS="-lncursesw" \
+ ./configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=$(TOOLS_DIR)
+
+ cd $(DIR_APP) && make $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
--- /dev/null
+
+include ../../core/xz/xz.nm
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP) && \
+ ./configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=$(TOOLS_DIR) \
+ --disable-static
+
+ cd $(DIR_APP) && make $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
+
+
+$(STAGE_INSTALL): $(STAGE_BUILD)
+ @$(PRE_INSTALL)
+
+ cd $(DIR_APP) && make install
+
+ @$(POST_INSTALL)
--- /dev/null
+
+include ../../core/zlib/zlib.nm
+
+$(STAGE_BUILD): $(STAGE_PREPARE)
+ @$(PRE_BUILD)
+
+ cd $(DIR_APP) && sed -e "s/^AC_PROG_CXX$$//g" -i configure.ac
+ cd $(DIR_APP) && autoreconf --install --force
+ cd $(DIR_APP) && \
+ ac_cv_func_working_mktime=yes \
+ ./configure \
+ $(CONFIGURE_ARCH) \
+ --prefix=$(TOOLS_DIR) \
+ --disable-static
+
+ cd $(DIR_APP) && make $(PARALLELISMFLAGS)
+
+ @$(POST_BUILD)
+
+$(STAGE_INSTALL): $(STAGE_BUILD)
+ @$(PRE_INSTALL)
+
+ cd $(DIR_APP) && make install
+
+ @$(POST_INSTALL)
PACKAGE_VERSION="0"
TAR_OPTIONS="--posix --acls --no-recursion --sparse"
-function cleanup() {
- echo " Cleaning up..."
- for i in $ARCHIEVE $CONTROL $FILES $INFO $TMP_DIR; do
- rm -rf ${i}
+decho() {
+ echo "$@" >&2
+}
+
+function isDir() {
+ [ -d "${1}" ]
+}
+
+function isFile() {
+ [ -f "${1}" ]
+}
+
+function add() {
+ local file=${1}
+
+ if isDir ${file}; then
+ addDir $@
+ return $?
+
+ elif isFile ${file}; then
+ addFile $@
+ return $?
+ fi
+
+ return 1
+}
+
+function addDir() {
+ local dir=${1}
+ local file
+
+ #decho "Adding dir ${dir}..."
+
+ local has_children=0
+
+ for file in $(find ${dir} -maxdepth 1); do
+ [ "${file}" = "${dir}" ] && continue
+
+ add ${file}
+
+ has_children=1
done
+
+ if [ "${has_children}" = "0" ]; then
+ echo "${dir}" >> ${manifest}
+ fi
+}
+
+function addFile() {
+ local file=${1}
+
+ #decho "Adding file ${file}..."
+
+ echo "${file}" >> ${manifest}
+}
+
+function create_manifest() {
+ decho "Creating manifest..."
+ addDir ${root}
+
+ apply_regexes
+
+ local file
+ local files=$(<${manifest})
+ for file in ${files}; do
+ echo "${file#${root}/}"
+ done > ${manifest}
}
+function apply_regexes() {
+ if [ -z "${regexes}" ]; then
+ return
+ fi
+
+ local file
+ local filelist
+ local files=$(<${manifest})
+ local regex
+
+ for regex in $(<${regexes}); do
+ [ "${regex:0:1}" != "/" ] && regex="/${regex}"
+ filelist=$(find ${root}${regex})
+ for file in ${files}; do
+ grep "${file}" <<<"${filelist}"
+ done
+ done > ${manifest}
+}
+
+function remove_files() {
+ local file
+ for file in $(<${manifest}); do
+ rm -f ${root}${file} 2>/dev/null
+ done
+}
+
+regexes=
+root=
+target=
+
while [ $# -gt 0 ]; do
- case "$1" in
- --rootfile=*)
- rootfile=${1#--rootfile=}
- if [ ! -e "${rootfile}" ]; then
- echo "Rootfile \"${rootfile}\" does not exist." >&2
- exit 1
- fi
- ROOTFILES="$ROOTFILES ${rootfile}"
+ case "${1}" in
+ --regexes=*)
+ regexes=${1#--regexes=}
;;
- *.ipk)
- if [ -z "$PKG_TARGET" ]; then
- PKG_TARGET=$1
- fi
+ --root=*)
+ root=${1#--root=}
;;
*)
- echo "Unrecognized option: ${1}" >&2
- exit 1
- ;;
+ if [ -z "${target}" ]; then
+ target=${1}
+ else
+ echo "Unrecognized option: ${1}" >&2
+ exit 2
+ fi
+ ;;
esac
shift
done
-if [ -z "$TARGET" ]; then
- echo "TARGET is not set. Cannot continue." >&2
- exit 1
-fi
+echo "Preparing to do ${target##*/}..."
-echo "Packaging $PKG_TARGET..."
+archieve=$(mktemp)
+control=$(mktemp)
+info=$(mktemp)
+manifest=$(mktemp)
-ARCHIEVE=$(mktemp)
-CONTROL=$(mktemp)
-FILES=$(mktemp)
-INFO=$(mktemp)
-TMP_DIR=$(mktemp -d)
+tmp=$(mktemp -d)
-echo " Collecting files..."
-for rootfile in $ROOTFILES; do
- grep -v "^#" ${rootfile} >> ${FILES}
-done
+create_manifest
-sed -e "s/KVER/${KVER}/g" \
- -e "s/IFS_TARGET/${IFS_TARGET}/g" \
- -i ${FILES}
+echo "Copying files..."
+cd ${root} && tar ${TAR_OPTIONS} --create --xz --file=${archieve} --files-from=${manifest}
-(cd / && tar --create ${TAR_OPTIONS} --files-from=${FILES} | tar --extract -C ${TMP_DIR})
-if [ "$?" != "0" ]; then
- echo -e "When copying the files, an error occoured." >&2
- cleanup
+if [ $? -ne 0 ]; then
+ echo "Error." >&2
exit 1
fi
-echo " Running quality agent hooks..."
-for hook in $(dirname $0)/compressor.d/*; do
- [ -x "${hook}" ] || continue
- ${hook} $TMP_DIR
- if [ "$?" != "0" ]; then
- cleanup
- exit 1
- fi
-done
-
-cd $TMP_DIR
-
-echo " Writing data.img..."
-cd ${TMP_DIR} && tar --create --xz --file=${ARCHIEVE} .
+remove_files
-echo " Writing meta-data..."
-cat <<EOF >$INFO
-### $NAME package
+echo "Writing meta-data..."
+cat <<EOF >${info}
+### $PKG_NAME package
PACKAGE_TARGET="$TARGET"
PACKAGE_VERSION="$PACKAGE_VERSION"
-BUILD_HOST="$(cat /proc/sys/kernel/hostname)"
+BUILD_HOST="${BUILD_HOST}"
BUILD_DATE="$(date -u)"
# Version info
PKG_MAINTAINER="$PKG_MAINTAINER"
PKG_LICENSE="$PKG_LICENSE"
-PKG_SUMMARY="$PKG_SHORT"
-PKG_DESCRIPTION="$PKG_LONG"
+PKG_SUMMARY="$PKG_SUMMARY"
+PKG_DESCRIPTION="$PKG_DESCRIPTION"
# Dependency info
PKG_DEPS="$PKG_DEPS"
PKG_BUILD_DEPS="$PKG_BUILD_DEPS"
-PKG_DATA_SHA1="$(sha1sum $ARCHIEVE | awk '{ print $1 }')"
+PKG_DATA_SHA1="$(sha1sum ${archieve} | awk '{ print $1 }')"
###
EOF
-echo " Writing control file..."
-cat <<EOF >$CONTROL
+echo "Writing control file..."
+cat <<EOF >${control}
#!/bin/sh
function prein() {
###
EOF
-rm -rf $TMP_DIR/*
-
-cat $ARCHIEVE > $TMP_DIR/data.img
-cat $CONTROL > $TMP_DIR/control
-cat $INFO > $TMP_DIR/info
-
-echo " Packaging archive..."
-find . | cpio -o -H newc --quiet > $ARCHIEVE
+cat ${archieve} > ${tmp}/data.img
+cat ${control} > ${tmp}/control
+cat ${info} > ${tmp}/info
-cat $ARCHIEVE > $PKG_TARGET
+(cd ${tmp} && find . | cpio -o -H newc --quiet > ${archieve})
-cleanup
+cat ${archieve} > ${target}
--- /dev/null
+#!/bin/bash
+
+. /ipfire-3.x/tools/naoki-include
+
+# Read in global configuration
+
+
+# CLI
+
+function usage() {
+ cat <<EOF
+$0 - Usage:
+ Blaaah
+
+EOF
+}
+
+while [ $# -gt 0 ]; do
+ case "${1}" in
+ --debug|-d)
+ DEBUG=1
+ log INFO "Debugging is enabled."
+ ;;
+
+ --force|-f)
+ FORCE=1
+ log INFO "Force is enabled."
+ ;;
+
+ --help|-h)
+ usage
+ exit 0
+ ;;
+
+ --toolchain)
+ log INFO "Toolchain option is enabled."
+ TOOLCHAIN=1
+ ;;
+
+ *)
+ if [ -z "${ACTION}" ]; then
+ ACTION=${1}
+ elif [ -z "${PKG_NAME}" ] && is_package ${1}; then
+ PKG_NAME=$(find_package ${1})
+ else
+ error "Unrecognized option: ${1}."
+ exit 2
+ fi
+ esac
+ shift
+done
+
+#if [ -z "${PKG_NAME}" ]; then
+# usage
+# error "You must provide a valid package name."
+# exit 2
+#fi
+
+# Read in package metadata
+log DEBUG "Pakckage: ${PKG_NAME}..."
+log DEBUG "Action : ${ACTION}..."
+log DEBUG "CLI : $@"
+
+## Init environment
+#BUILD_DIR=${BASEDIR}/build_$(package_id)
+
+#if [ -d "${BUILD_DIR}" ]; then
+# if force; then
+# warning "An old build directory is still there. Cleaning up."
+# naoki_cleanup
+# else
+# error "An old build directory is still there."
+# error " Run with --force or remove manually."
+# exit 1
+# fi
+#fi
+
+# Run
+case "${ACTION}" in
+ init)
+ naoki_init ${PKG_NAME} $@
+ ;;
+
+ destroy|cleanup)
+ naoki_cleanup ${PKG_NAME} $@
+ ;;
+
+ build)
+ if [ "${TOOLCHAIN}" = "1" ]; then
+ naoki_toolchain ${PKG_NAME}
+ exit $?
+ else
+ naoki_build ${PKG_NAME}
+ exit $?
+ fi
+ ;;
+
+ deps)
+ dependencies_resolve ${PKG_NAME}
+ ;;
+
+ profile)
+ package_profile ${PKG_NAME}
+ ;;
+
+ raw)
+ package_info ${PKG_NAME}
+ ;;
+
+ shell)
+ naoki_shell ${PKG_NAME}
+ ;;
+
+ list)
+ package_list
+ ;;
+
+ tree)
+ package_tree $(package_list)
+ ;;
+
+ *)
+ error "You must provide an action."
+ exit 2
+ ;;
+
+esac
--- /dev/null
+#!/bin/bash
+
+DEBUG=1 ## XXX currently always on
+
+DISTRO_NAME=IPFire
+DISTRO_SNAME=ipfire
+DISTRO_EPOCH=3
+DISTRO_VERSION=${DISTRO_EPOCH}.0-prealpha2
+DISTRO_SLOGAN="Gluttony"
+
+# Machine's infotmation
+HOSTNAME=$(</proc/sys/kernel/hostname)
+MACHINE=$(uname -m)
+
+BASEDIR=/ipfire-3.x
+
+
+BUILD_DIR="${BASEDIR}/naoki_$$"
+BUILD_ROOT="/buildroot.$$"
+LOG_DIR=${BASEDIR}/logs
+TOOLS_DIR=/tools_${MACHINE}
+PACKAGES_DIR=${BASEDIR}/packages
+
+ARCH=i686
+
+PACKAGES_TO_EXTRACT="coreutils filesystem perl util-linux-ng"
+
+PACKAGES_PARALLELISM=2
+PARALLELISMFLAGS=-j5
+
+CFLAGS="-fomit-frame-pointer -pipe"
+case "${ARCH}" in
+ i?86)
+ CFLAGS="-O2 -march=${ARCH} ${CFLAGS}"
+ CXXFLAGS="${CFLAGS}"
+ TARGET="${ARCH}-pc-linux-gnu"
+ ;;
+esac
+
+# Read in .config
+
+if [ -e "${BASEDIR}/.config" ]; then
+ log DEBUG "Loading .config..."
+ source ${BASEDIR}/.config
+fi
+
+log INFO "Machine information:"
+log INFO " Hostname : ${HOSTNAME}"
+log INFO " Architecture : ${MACHINE}"
+
+log INFO "Target information:"
+log INFO " Architecture : ${ARCH}"
+log INFO " CFLAGS : ${CFLAGS}"
+log INFO " CXXFLAGS : ${CXXFLAGS}"
+log INFO " TARGET : ${TARGET}"
+log INFO " Parallelism : ${PARALLELISMFLAGS}"
--- /dev/null
+#!/bin/bash
+
+. ${BASEDIR}/tools/ui-functions
+. ${BASEDIR}/tools/package-functions
+
+function exithandler() {
+ local mount
+ local mounts
+
+ log DEBUG "Unmounting everything in ${BUILD_DIR}..."
+ while true; do
+ mounts=$(mount | grep "${BUILD_DIR}")
+ if [ -z "${mounts}" ]; then
+ log DEBUG " Everything is unmounted."
+ break
+ fi
+
+ while read mount; do
+ umount $(awk '{ print $3 }' <<<${mount})
+ done <<<"${mounts}"
+ done
+
+ if [ "${ERROR}" != "1" ]; then
+ [ -d "${BUILD_DIR}" ] && rm -rf ${BUILD_DIR}
+ fi
+
+ log DEBUG "Shut down naoki instance with pid $$."
+ log DEBUG "----------"
+}
+trap exithandler EXIT
+
+function debug() {
+ [ "${DEBUG}" = "1" ]
+}
+
+function force() {
+ [ "${FORCE}" = "1" ]
+}
+
+function naoki_lock() {
+ local lockfile="${BUILD_DIR}/.lock"
+
+ case "${1}" in
+ 1)
+ touch ${lockfile}
+ ;;
+ 0)
+ rm -f ${lockfile}
+ ;;
+ *)
+ if [ -e "${lockfile}" ]; then
+ return 0
+ else
+ return 1
+ fi
+ ;;
+ esac
+}
+
+function naoki_prepare() {
+ local p=$(find_package ${1})
+ shift
+
+ #local pkg_dependencies=$(dependencies_resolve ${p})
+ #msg " Resolving dependencies: ${pkg_dependencies-None}"
+ #local dep
+ #for dep in ${pkg_dependencies}; do
+ # if ! package_is_built ${dep}; then
+ # msg "Dependencies for ${p} are missing. Cannot prepare."
+ # exit 4
+ # fi
+ #done
+
+ msg "Preparing environment ${BUILD_DIR}..."
+
+ mkdir -p \
+ ${BUILD_DIR} \
+ ${BUILD_DIR}/{root,tmp} \
+ ${BUILD_DIR}/{dev,proc,sys} \
+ ${BUILD_DIR}/{,usr/}{bin,lib,sbin} \
+ ${BUILD_DIR}/usr/src \
+ ${BUILD_DIR}/${BUILD_ROOT} \
+ ${BUILD_DIR}/${TOOLS_DIR}
+
+ local i
+ for i in cache ccache pkgs src tools ${PACKAGES_DIR##*/}; do
+ mkdir -p ${BASEDIR}/${i} ${BUILD_DIR}/usr/src/${i} 2>/dev/null
+ mount --bind ${BASEDIR}/${i} ${BUILD_DIR}/usr/src/${i}
+ done
+ mount --bind ${TOOLS_DIR} ${BUILD_DIR}/${TOOLS_DIR}/
+
+ # Mounting kernel fs
+ for i in dev proc sys; do
+ mount --bind /${i} ${BUILD_DIR}/${i}
+ done
+
+ #naoki_make ${p} --without-chroot download
+
+ # Extract needed packages
+
+ for i in /bin/bash /bin/sh; do
+ if [ -e "${BUILD_DIR}${i}" ]; then
+ continue
+ fi
+ log DEBUG "Creating symlink: ${BUILD_DIR}${i} --> ${TOOLS_DIR}${i}"
+ ln -sf ${TOOLS_DIR}${i} ${BUILD_DIR}${i}
+ done
+
+ naoki_make ${p} prepare $@
+ return $?
+}
+
+function naoki_cleanup() {
+ local p=$(find_package ${1})
+
+ log INFO "Cleaning up environment ${BUILD_DIR}..."
+
+ if naoki_lock; then
+ error "Cannot remove locked ${BUILD_DIR}..."
+ return 1
+ fi
+
+ #rm -rf ${BUILD_DIR}
+}
+
+function naoki_cmd() {
+ local package
+ local chroot_cmd
+ local cmd
+ local with_chroot=1
+
+ while [ $# -gt 0 ]; do
+ case "${1}" in
+ --without-chroot)
+ with_chroot=0
+ ;;
+ *)
+ if [ -z "${package}" ]; then
+ package=$(find_package ${1})
+ else
+ cmd="${cmd} ${1}"
+ fi
+ ;;
+ esac
+ shift
+ done
+ cmd=${cmd:1}
+
+ is_package ${package} || return 1
+
+ log DEBUG "Running command \"${cmd}\" - chroot=${with_chroot}."
+
+ local path="/sbin:/usr/sbin:/bin:/usr/bin"
+ if [ "${TOOLCHAIN}" = "1" ] || [ ! -e "${BUILD_DIR}/usr/bin/env" ]; then
+ path="${TOOLS_DIR}/sbin:${TOOLS_DIR}/bin:${path}"
+ fi
+ log DEBUG " PATH : ${path}"
+
+ local ps1="\u:\w\$ "
+
+ if [ "${with_chroot}" = "1" ]; then
+ chroot_cmd="chroot ${BUILD_DIR}"
+ ps1="${CLR_NORM_RED}chroot${NORMAL}: \w\$ "
+
+ touch ${BUILD_DIR}/.chroot
+ fi
+
+ local ret
+ PATH=${path} \
+ ${chroot_cmd} \
+ env -i \
+ HOME="/root" \
+ TERM="${TERM}" \
+ PS1="${ps1}" \
+ PATH="${path}" \
+ \
+ DISTRO_NAME="${DISTRO_NAME}" \
+ DISTRO_SNAME="${DISTRO_SNAME}" \
+ DISTRO_VER="${DISTRO_VER}" \
+ DISTRO_EPOCH="${DISTRO_EPOCH}" \
+ DISTRO_SLOGAN="${DISTRO_SLOGAN}" \
+ \
+ ROOT=$([ "${TOOLCHAIN}" = "1" ] && \
+ echo "${BUILD_DIR}") \
+ CHROOT="${CHROOT}" \
+ TOOLS_DIR="${TOOLS_DIR}" \
+ TOOLCHAIN="${TOOLCHAIN}" \
+ BUILDROOT="${BUILD_ROOT}" \
+ \
+ CFLAGS="${CFLAGS}" \
+ CXXFLAGS="${CXXFLAGS}" \
+ TARGET="${TARGET}" \
+ TARGET_MACHINE="${MACHINE}" \
+ PARALLELISMFLAGS="${PARALLELISMFLAGS}" \
+ \
+ ${cmd}
+
+ ret=$?
+ log DEBUG " Exit code: ${ret}"
+
+ return ${ret}
+}
+
+function naoki_make() {
+ local p=$(find_package ${1})
+ shift
+
+ local cmd="make --no-print-directory -C"
+ if [ "${CHROOT}" = "0" ] || [ "${TOOLCHAIN}" = "1" ]; then
+ cmd="${cmd} ${PKG_DIR}/${p}"
+ else
+ cmd="${cmd} /usr/src/pkgs/${p}"
+ fi
+ cmd="${cmd} -f ${p##*/}.nm"
+
+ naoki_cmd ${p} "${cmd}" $@ 2>&1 | __erase_log
+ return ${PIPESTATUS[0]}
+}
+
+function __erase_log() {
+ local line
+ while read -a line; do
+ grep -q "commands for target" <<<"${line[*]}" && continue
+ echo -e "${line[*]}"
+ done
+}
+
+function naoki_build() {
+ local p=$(find_package ${1})
+ shift
+
+ local ret
+ msg "Going on to build package \"${p}\"."
+
+ naoki_prepare ${p} $@
+ ret=$?
+
+ if [ "${ret}" != "0" ]; then
+ error "Prepare command failed."
+ exit ${ret}
+ fi
+
+ naoki_make ${p} build $@
+ ret=$?
+
+ if [ "${ret}" != "0" ]; then
+ error "Build command failed."
+ exit ${ret}
+ fi
+
+ naoki_make ${p} install $@
+ ret=$?
+
+ if [ "${ret}" != "0" ]; then
+ error "Install command failed."
+ exit ${ret}
+ fi
+
+ naoki_make ${p} package $@
+ ret=$?
+
+ if [ "${ret}" != "0" ]; then
+ error "Package command failed."
+ exit ${ret}
+ fi
+}
+
+function naoki_build_tree() {
+ local packages
+ local p
+
+ package_tree $@ | \
+ while read packages; do
+ for p in ${packages}; do
+ naoki_build ${p}
+ done
+ done
+}
+
+function naoki_shell() {
+ local p=$(find_package ${1})
+ shift
+
+ naoki_prepare ${p}
+
+ # A little help message
+ echo
+ echo -e " ${CLR_NORM_RED}Chroot environment${NORMAL}"
+ echo
+ echo " This is starting a chrooted environment where you can natively"
+ echo " access the build system. When you leave the shell all files will"
+ echo " be lost."
+ echo
+ echo " Source of ${PKG_NAME} is extracted to /usr/src."
+ echo
+ echo -e " ${BOLD}Exit with Ctrl+D.${NORMAL}"
+ echo
+
+ naoki_cmd ${p} "bash --login"
+ local ret=$?
+
+ echo
+ echo "Exit code: ${ret}"
+ echo
+}
+
+function naoki_toolchain() {
+ TOOLCHAIN=1
+
+ local p=$(find_package ${1})
+ shift
+
+ naoki_build ${p} --without-chroot $@
+}
--- /dev/null
+#!/bin/bash
+
+BASEDIR="/ipfire-3.x/"
+
+LOGFILE=${BASEDIR}/naoki.log
+
+. ${BASEDIR}/tools/naoki-functions
+. ${BASEDIR}/tools/naoki-constants
+
+
+log DEBUG "Started up naoki instance with pid $$"
--- /dev/null
+
+PKG_DIR=${BASEDIR}/pkgs
+
+function listmatch() {
+ local arg=${1}
+ shift
+
+ local value
+ for value in $@; do
+ if [ "${arg}" == "${value}" ]; then
+ return 0
+ fi
+ done
+ return 1
+}
+
+function is_package() {
+ local package=$(find_package ${1})
+
+ if listmatch ${package} $(package_list); then
+ return 0
+ else
+ log ERROR "Package ${package} is not known."
+ return 1
+ fi
+}
+
+function find_package() {
+ local package=${1}
+ #log DEBUG "Searching for package \"${package}\"."
+
+ if [ -e "${PKG_DIR}/${package}" ]; then
+ echo "${package}"
+ return 0
+ fi
+
+ local i
+ for i in $(package_list); do
+ if [ "${i##*/}" = "${package}" ]; then
+ echo "${i}"
+ return 0
+ fi
+ done
+ return 1
+}
+
+function package_repos() {
+ local repo
+
+ for repo in ${PKG_DIR}/*; do
+ if [ ! -d "${repo}" ]; then
+ continue
+ fi
+
+ if [ "${TOOLCHAIN}" = "1" ]; then
+ if [ "${repo##*/}" != "toolchain" ]; then
+ continue
+ fi
+ else
+ if [ "${repo##*/}" = "toolchain" ]; then
+ continue
+ fi
+ fi
+ echo "${repo##*/}"
+ done
+}
+
+function package_list() {
+ local package
+ local repo
+
+ for repo in $(package_repos); do
+ for package in ${PKG_DIR}/${repo}/*; do
+ if [ ! -d "${package}" ]; then
+ continue
+ fi
+
+ echo "${package#${PKG_DIR}/}"
+ done
+ done
+}
+
+function package_profile() {
+ if [ "${1}" = "--wiki" ]; then
+ echo "TODO: WIKI OUTPUT"
+ else
+ # XXX to be formatted
+ local package_name=$(find_package ${1})
+ printf "# ${BOLD}%-12s${NORMAL}: ${CLR_BOLD_GRN}%s${NORMAL}\n" "Name" "${package_name}"
+ printf "# ${BOLD}%-12s${NORMAL}: %s\n" "Version" "$(package_version ${package_name})"
+ printf "# ${BOLD}%-12s${NORMAL}: %s\n" "Release" "$(package_release ${package_name})"
+ printf "# ${BOLD}%-12s${NORMAL}: %s\n" "Group" "$(package_group ${package_name})"
+ echo "#"
+ format $(package_summary ${package_name})
+ echo "#"
+ echo -e "# ${BOLD}Description${NORMAL} :"
+ format $(package_description ${package_name})
+ echo "#"
+ printf "# ${BOLD}%-12s${NORMAL}: %s\n" "Maintainer" "$(package_maintainer ${package_name})"
+ printf "# ${BOLD}%-12s${NORMAL}: %s\n" "License" "$(package_license ${package_name})"
+ echo "#"
+ fi
+}
+
+function package_info() {
+ local p=$(find_package ${1})
+
+ log DEBUG "Fetching package information from ${PKG_DIR}/${p}..."
+
+ is_package ${p} || return 1
+
+ CHROOT=0 naoki_make ${p} --without-chroot info | grep -v "^make:"
+}
+
+function package_get() {
+ local package=$(find_package ${1})
+ local item=${2}
+
+ package_info ${package} | \
+ grep "^${item}" | \
+ awk -F= '{ print $NF }' | \
+ tr -d '"'
+}
+
+function package_name() {
+ package_get ${1} PKG_NAME
+}
+
+function package_version() {
+ package_get ${1} PKG_VER
+}
+
+function package_release() {
+ package_get ${1} PKG_REL
+}
+
+function package_description() {
+ package_get ${1} PKG_DESCRIPTION
+}
+
+function package_summary() {
+ package_get ${1} PKG_SUMMARY
+}
+
+function package_runtime_dependencies() {
+ local package
+ for package in $(package_get ${1} PKG_DEPENDENCIES); do
+ find_package ${package}
+ done
+}
+
+function package_build_dependencies() {
+ local package
+ for package in $(package_get ${1} PKG_BUILD_DEPENDENCIES); do
+ find_package ${package}
+ done
+}
+
+function package_toolchain_dependencies() {
+ local package
+ for package in $(package_get ${1} PKG_TOOLCHAIN_DEPS); do
+ find_package ${package}
+ done
+}
+
+function package_dependencies() {
+ if [ "${TOOLCHAIN}" = "1" ]; then
+ package_toolchain_dependencies $@
+ else
+ package_runtime_dependencies $@
+ package_build_dependencies $@
+ fi
+}
+
+function package_packages() {
+ package_get ${1} PKG_PACKAGES
+}
+
+function package_maintainer() {
+ package_get ${1} PKG_MAINTAINER
+}
+
+function package_group() {
+ package_get ${1} PKG_GROUP
+}
+
+function package_license() {
+ package_get ${1} PKG_LICENSE
+}
+
+function package_extract_dependencies() {
+ local package=$(find_package ${1})
+ local to_extract="${PACKAGES_TO_EXTRACT}"
+
+ local dep
+ for dep in $(dependencies_resolve ${PACKAGES_TO_EXTRACT} ${package}); do
+ echo ${dep}
+ done
+}
+
+function package_is_built() {
+ local package=$(find_package ${1})
+
+ local file
+ for file in package_packages ${package}; do
+ if [ ! -e "${file}" ]; then
+ return 1
+ fi
+ done
+ return 0
+}
+
+function dependencies_resolve() {
+ local dependencies
+ local package
+ local ret
+
+ for package in $@; do
+ log DEBUG "Resolving dependencies for ${package}..."
+
+ dependencies="$(package_build_dependencies ${package})"
+ dependencies="${dependencies} $(package_dependencies ${package})"
+
+ if [ "${dependencies}" != " " ]; then
+ log DEBUG " Got: ${dependencies}"
+ fi
+
+ ret="${ret} ${dependencies} $(dependencies_resolve ${dependencies})"
+ done
+ echo ${ret}
+}
+
+function package_sort() {
+ local pkg
+ for pkg in $@; do
+ echo "${pkg}"
+ done | sort -u | tr '\n' ' '
+}
+
+function __random() {
+ local date=$(date "+%N")
+ while [ "${date:0:1}" = "0" ]; do
+ if [ "${#date}" = "0" ]; then
+ echo "0"
+ return
+ fi
+ date=${date:1}
+ done
+ echo $(( ${date} % 2 ))
+}
+
+function package_random() {
+ local package
+ local ret
+
+ for package in $@; do
+ if [ "$(__random)" = "0" ]; then
+ ret="${ret} ${package}"
+ else
+ ret="${package} ${ret}"
+ fi
+ done
+ if [ "$(__random)" = "0" ]; then
+ ret=$(package_random ${ret})
+ fi
+ echo ${ret}
+}
+
+function package_tree() {
+ local package
+ local package2
+ local packages
+ local deps
+
+ log INFO "Making package tree..."
+
+ ret[0]=$@
+ local i=0
+ while true; do
+ packages=${ret[i]}
+ deps=
+ for package in ${packages}; do
+ deps="${deps} $(package_dependencies ${package})"
+ done
+ deps=$(package_sort ${deps})
+ if [ -n "${deps}" ]; then
+ ret[$(( ${i} + 1 ))]=${deps}
+ else
+ break
+ fi
+ i=$(( ${i} + 1 ))
+ done
+
+ local drop
+ local j
+ i=0
+ while [ ${i} -lt ${#ret[@]} ]; do
+ for package in ${ret[i]}; do
+ drop=0
+ j=$(( ${#ret[@]} - 1 ))
+ while [ ${j} -gt ${i} ]; do
+ for package2 in ${ret[j]}; do
+ if [ "${package}" == "${package2}" ]; then
+ drop=1
+ break
+ fi
+ done
+ if [ "${drop}" = "1" ]; then
+ break
+ fi
+ j=$(( ${j} - 1 ))
+ done
+ if [ "${drop}" = "1" ]; then
+ packages=
+ for package2 in ${ret[i]}; do
+ if [ "${package}" != "${package2}" ]; then
+ packages="${packages} ${package2}"
+ fi
+ done
+ ret[${i}]=$(package_sort ${packages})
+ fi
+ done
+ i=$(( ${i} + 1 ))
+ done
+
+ i=$(( ${#ret[@]} - 1 ))
+ while [ ${i} -ge 0 ]; do
+ log INFO " ${i}: ${ret[i]}"
+ echo "$(package_random ${ret[i]})"
+ i=$(( ${i} - 1 ))
+ done
+}
+
+function require_toolchain() {
+ local package
+ for package in ${PACKAGES_TO_EXTRACT}; do
+ package=$(find_package ${package})
+ if ! package_is_built ${package}; then
+ return 0
+ fi
+ done
+ return 1
+}
+
+function package_id() {
+ local p=$(find_package ${1})
+ local hash=$(sha1sum <<<${p})
+
+ echo ${hash:0:6}
+}
--- /dev/null
+#!/bin/bash
+
+for patch in $@; do
+ echo "Applying file ${patch}..."
+
+ patch -Np1 -i ${patch}
+ ret=$?
+
+ if [ ${ret} -ne 0 ]; then
+ exit ${ret}
+ fi
+done
--- /dev/null
+#!/bin/bash
+
+## Screen Dimentions
+# Find current screen size
+if [ -z "${COLUMNS}" ]; then
+ COLUMNS=$(stty size 2>/dev/null)
+ COLUMNS=${COLUMNS##* }
+fi
+
+# When using remote connections, such as a serial port, stty size returns 0
+if [ "${COLUMNS}" = "0" ]; then
+ COLUMNS=80
+fi
+
+## Set Cursur Position Commands, used via echo -e
+SET_RESULT_COL="\\033[${RESULT_COL}G"
+SET_TIME_COL="\\033[${TIME_COL}G"
+SET_VER_COL="\\033[${VER_COL}G"
+SET_OPT_COL="\\033[${OPT_COL}G"
+
+# Normal colors
+CLR_NORM_BLK="\\033[0;30m" # black
+CLR_NORM_RED="\\033[0;31m" # red
+CLR_NORM_GRN="\\033[0;32m" # green
+CLR_NORM_YEL="\\033[0;33m" # yellow
+CLR_NORM_BLU="\\033[0;34m" # blue
+CLR_NORM_MAG="\\033[0;35m" # magenta
+CLR_NORM_CYN="\\033[0;36m" # cyan
+CLR_NORM_WHT="\\033[0;37m" # white
+CLR_NORM_GRY="\\033[0;39m" # grey
+
+# Emphased colors
+CLR_BOLD_BLK="\\033[1;30m" # black
+CLR_BOLD_RED="\\033[1;31m" # red
+CLR_BOLD_GRN="\\033[1;32m" # green
+CLR_BOLD_YEL="\\033[1;33m" # yellow
+CLR_BOLD_BLU="\\033[1;34m" # blue
+CLR_BOLD_MAG="\\033[1;35m" # magenta
+CLR_BOLD_CYN="\\033[1;36m" # cyan
+CLR_BOLD_WHT="\\033[1;37m" # white
+CLR_BOLD_GRY="\\033[1;39m" # grey
+
+# Background colors
+CLR_BACK_BLK="\\033[40m" # black
+CLR_BACK_RED="\\033[41m" # red
+CLR_BACK_GRN="\\033[42m" # green
+CLR_BACK_YEL="\\033[43m" # yellow
+CLR_BACK_BLU="\\033[44m" # blue
+CLR_BACK_MAG="\\033[45m" # magenta
+CLR_BACK_CYN="\\033[46m" # cyan
+CLR_BACK_WHT="\\033[47m" # white
+
+# Action colors
+BOLD=$CLR_BOLD_GRY
+DONE=$CLR_BOLD_GRN
+SKIP=$CLR_BOLD_BLU
+WARN=$CLR_BOLD_YEL
+FAIL=$CLR_BOLD_RED
+NORMAL=$CLR_NORM_GRY
+ERROR=$CLR_BOLD_RED
+
+# Color hooks
+BRACKET_L="${CLR_BOLD_BLU}[${NORMAL}"
+BRACKET_R="${CLR_BOLD_BLU}]${NORMAL}"
+
+function log() {
+ if [ -z "${LOGFILE}" ]; then
+ return 0
+ fi
+
+ local facility=${1}
+ shift
+
+ if [ "${facility}" == "DEBUG" ] && [ "${DEBUG}" != "1" ]; then
+ return 0
+ fi
+
+ printf "%s naoki[%5d] %8s %s\n" "$(date -u)" "$$" "${facility}" "$@" >> ${LOGFILE}
+}
+
+function msg() {
+ log MESSAGE "$@"
+ echo -e "$@"
+}
+
+function error() {
+ log ERROR "$@"
+ echo -e "${ERROR}ERROR${NORMAL} : $@" >&2
+}
+
+function warning() {
+ log WARNING "$@"
+ echo -e "${WARN}WARNING${NORMAL}: $@" >&2
+}
+
+function exiterror() {
+ ERROR=1
+ error $@
+}
+
+function format() {
+ local max_length=50
+ local line="# "
+ local length=0
+
+ for word in $@; do
+ length=$(expr ${length} + ${#word})
+ if [ "${length}" -ge "${max_length}" ]; then
+ printf "${line}\n"
+ line="# ${word} "
+ length=${#word}
+ else
+ line="${line}${word} "
+ fi
+ #echo "-- ($word) $LINE"
+ done
+ printf "${line}\n"
+}