]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blobdiff - pkgs/glibc/glibc.nm
Change file layout of the makefiles.
[people/ms/ipfire-3.x.git] / pkgs / glibc / glibc.nm
index 70eb14f08a7bf03e4c599687f8b3cfb629ecea7e..73372aa50e60dd14194e2d6076f574086d6893e1 100644 (file)
 ###############################################################################
-#                                                                             #
-# 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/>.       #
-#                                                                             #
+# IPFire.org    - An Open Source Firewall Solution                            #
+# Copyright (C) - IPFire Development Team <info@ipfire.org>                   #
 ###############################################################################
 
-###############################################################################
-# Definitions
-###############################################################################
-
-include $(PKGROOT)/Include
-
-PKG_NAME       = glibc
-PKG_VER        = 2.14
-PKG_REL        = 1
-
 # TODO tzdata
 
-PKG_MAINTAINER = Michael Tremer <michael.tremer@ipfire.org>
-PKG_GROUPS     = System/Base
-PKG_URL        = http://sources.redhat.com/glibc/
-PKG_LICENSE    = GPLv2+ LGPLv2+
-PKG_SUMMARY    = The GNU libc libraries.
-
-PKG_BUILD_DEPS+= audit-devel autoconf automake gettext libcap-devel \
-       libselinux-devel texinfo
-
-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 \
+name       = glibc
+version    = 2.14
+release    = 1
+
+maintainer = Michael Tremer <michael.tremer@ipfire.org>
+groups     = System/Base
+url        = http://sources.redhat.com/glibc/
+license    = GPLv2+ LGPLv2+
+summary    = The GNU libc libraries.
+
+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
-
-# Build glibc with custom cflags
-GLIBC_FLAGS = -O3 -g -fasynchronous-unwind-tables -DNDEBUG -DPIC
-
-ifeq "$(DISTRO_ARCH)" "i686"
-       GLIBC_FLAGS += -march=i686 -mtune=generic
-endif
-
-ifeq "$(DISTRO_ARCH)" "x86_64"
-       GLIBC_FLAGS += -mtune=generic
-endif
-
-export CFLAGS    = $(GLIBC_FLAGS)
-export CXXFLAGS  = $(GLIBC_FLAGS)
-
-GLIBC_TARGET_PLATFORM = $(subst -gnu,,$(DISTRO_MACHINE))
-OPTIMIZED_KERNEL = 2.6.32
-
-PKG_OBJECTS   += $(THISAPP).tar.xz
-
-# $(THISAPP)-pt_pax-1.patch - Support for PT_PaX markings.
-
-# $(THISAPP)-strlcpy_strlcat-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.
-
-# $(THISAPP)-asprintf_reset2null-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. 
-
-# $(THISAPP)-issetugid-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: 
-
-# $(THISAPP)-localedef_trampoline-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.
-
-# $(THISAPP)-sanitize_env.patch
-#      This patch resticts the environment, particularly with setuid programs. 
-
-# $(THISAPP)-mktemp_urandom.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(): 
-
-# $(THISAPP)-res_randomid.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.
-
-# $(THISAPP)-resolv_response_length.patch
-#      This patch does a check on the buffer size of res_* functions.
-
-QUALITY_AGENT_RPATH_ALLOW_ORIGIN=yes
-
-define STAGE_PREPARE
-       @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
-
-       # 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)/$(PKG_NAME)-stack_chk_fail.c \
-               > $(DIR_APP)/debug/stack_chk_fail.c
-
-       #cd $(DIR_APP) && \
-       #       sed -e "s|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=$(shell readelf -l /bin/sh | sed -n 's@.*interpret.*$(TOOLS_DIR)\(.*\)]$$@\1@p') -o|" \
-       #       -i scripts/test-installation.pl
-
-       # Use gnu hash style
-       cd $(DIR_APP) && sed -i Makeconfig \
-               -e "s/-Wl,--hash-style=both/-Wl,--hash-style=gnu -Wl,-O1/"
-
-       # stdlib/tst-putenvmod is not linked against libc.
-       cd $(DIR_APP) && sed -i stdlib/Makefile \
-               -e "s/^CFLAGS-tst-putenvmod.c.*/& -fno-stack-protector/g"
-
-       # stdio-common/bug22 hits timeout.
-       cd $(DIR_APP) && sed -i stdio-common/bug22.c \
-               -e "s/#define TIMEOUT.*/#define TIMEOUT 300/"
-
-       # These tests don't work or need more investigation:
-       cd $(DIR_APP) && sed -i dlfcn/Makefile -e "s/default //g"
-
-       cd $(DIR_APP) && sed -i nptl/Makefile \
-               -e "s/tst-mutex5 //g" \
-               -e "s/tst-mutex5a //g" \
-               -e "s/tst-cond11 //g" \
-               -e "s/tst-rwlock6 //g" \
-               -e "s/tst-rwlock7 //g" \
-               -e "s/tst-sem5 //g" \
-               -e "s/tst-cancelx4 //g" \
-               -e "s/tst-cancelx5 //g" \
-               -e "s/tst-cancelx10 //g" \
-               -e "s/tst-cancelx18 //g" \
-               -e "s/tst-signal1 //g"
-
-       # These are known to fail on x86:
-       cd $(DIR_APP) && sed -i rt/Makefile \
-               -e "s/tst-cpuclock1 //g" \
-               -e "s/tst-cpuclock2 //g"
-
-       cd $(DIR_APP) && sed -i elf/Makefile \
-               -e "s/tst-tls1 //g" \
-               -e "s/tst-tls1-static //g" \
-               -e "s/tst-tls2 //g" \
-               -e "s/tst-tls2-static //g" \
-               -e "s/tst-tls3 //g" \
-               -e "s/resolvfail //g" \
-               -e "s/constload1 //g" \
-               -e "s/order //g" \
-               -e "s/lateglobal //g" \
-               -e "s/dblload //g" \
-               -e "s/dblunload //g" \
-               -e "s/reldep6 //g" \
-               -e "s/circleload1 //g" \
-               -e "s/tst-global1 //g" \
-               -e "s/tst-audit2 //g" \
-               -e "s/check-localplt //g" \
-               -e "s/check-localplt.out$$//g"
-
-       cd $(DIR_APP) && sed -i signal/Makefile \
-               -e "s/tst-sigset2//g"
-
-       #cd $(DIR_APP) && sed -i configure \
-       #       -e "s/-Werror -fstack-protector/-fstack-protector/"
-endef
-
-define STAGE_BUILD
-       cd $(DIR_SRC)/glibc-build && \
-               CFLAGS="$(CFLAGS) -fno-asynchronous-unwind-tables" \
-               ../$(THISAPP)/configure \
-                       --build=$(GLIBC_TARGET_PLATFORM) \
-                       --host=$(GLIBC_TARGET_PLATFORM) \
+end
+
+source_dl  = http://ftp.gnu.org/gnu/glibc/
+sources    = %{thisapp}.tar.xz
+
+build
+       requires
+               audit-devel
+               autoconf
+               automake
+               gettext
+               libcap-devel
+               libselinux-devel
+               texinfo
+       end
+
+       # Build glibc with custom cflags
+       GLIBC_FLAGS = -O3 -g -fasynchronous-unwind-tables -DNDEBUG -DPIC
+
+       if "%{DISTRO_ARCH}" == "i686"
+               GLIBC_FLAGS += -march=i686 -mtune=generic
+       elif "%{DISTRO_ARCH}" == "x86_64"
+               GLIBC_FLAGS += -mtune=generic
+       end
+
+       export CFLAGS   = %{GLIBC_FLAGS}
+       export CXXFLAGS = %{GLIBC_FLAGS}
+
+       # Optimize glibc for kernel
+       OPTIMIZED_KERNEL = 2.6.32
+
+       export QUALITY_AGENT_RPATH_ALLOW_ORIGIN=yes
+
+       prepare_cmds
+               # 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.
+               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.
+               sed -i 's|@BASH@|/bin/bash|' elf/ldd.bash.in
+
+               # We don't install pt_chown(1) on the final system, so why install it to
+               # $(TOOLS_DIR):
+               sed -e "/^install.*pt_chown/d" -i login/Makefile
+
+               # Build nscd with -fstack-protector-all, instead of -fstack-protector:
+               sed -e "s/fstack-protector/&-all/" -i nscd/Makefile
+
+               cat %{DIR_SOURCE}/glibc-stack_chk_fail.c > debug/stack_chk_fail.c
+
+               # Use gnu hash style
+               sed -i Makeconfig \
+                       -e "s/-Wl,--hash-style=both/-Wl,--hash-style=gnu -Wl,-O1/"
+
+               # stdlib/tst-putenvmod is not linked against libc.
+               sed -i stdlib/Makefile \
+                       -e "s/^CFLAGS-tst-putenvmod.c.*/& -fno-stack-protector/g"
+
+               # stdio-common/bug22 hits timeout.
+               sed -i stdio-common/bug22.c \
+                       -e "s/#define TIMEOUT.*/#define TIMEOUT 300/"
+
+               # These tests don't work or need more investigation:
+               sed -i dlfcn/Makefile -e "s/default //g"
+
+               sed -i nptl/Makefile \
+                       -e "s/tst-mutex5 //g" \
+                       -e "s/tst-mutex5a //g" \
+                       -e "s/tst-cond11 //g" \
+                       -e "s/tst-rwlock6 //g" \
+                       -e "s/tst-rwlock7 //g" \
+                       -e "s/tst-sem5 //g" \
+                       -e "s/tst-cancelx4 //g" \
+                       -e "s/tst-cancelx5 //g" \
+                       -e "s/tst-cancelx10 //g" \
+                       -e "s/tst-cancelx18 //g" \
+                       -e "s/tst-signal1 //g"
+
+               # These are known to fail on x86:
+               sed -i rt/Makefile \
+                       -e "s/tst-cpuclock1 //g" \
+                       -e "s/tst-cpuclock2 //g"
+
+               sed -i elf/Makefile \
+                       -e "s/tst-tls1 //g" \
+                       -e "s/tst-tls1-static //g" \
+                       -e "s/tst-tls2 //g" \
+                       -e "s/tst-tls2-static //g" \
+                       -e "s/tst-tls3 //g" \
+                       -e "s/resolvfail //g" \
+                       -e "s/constload1 //g" \
+                       -e "s/order //g" \
+                       -e "s/lateglobal //g" \
+                       -e "s/dblload //g" \
+                       -e "s/dblunload //g" \
+                       -e "s/reldep6 //g" \
+                       -e "s/circleload1 //g" \
+                       -e "s/tst-global1 //g" \
+                       -e "s/tst-audit2 //g" \
+                       -e "s/check-localplt //g" \
+                       -e "s/check-localplt.out$$//g"
+
+               sed -i signal/Makefile \
+                       -e "s/tst-sigset2//g"
+       end
+
+       build
+               mkdir %{DIR_SRC}/glibc-build
+               cd %{DIR_SRC}/glibc-build
+
+               CFLAGS="${CFLAGS} -fno-asynchronous-unwind-tables" \
+               ../%{thisapp}/configure \
+                       --build=%{DISTRO_BUILDTARGET} \
+                       --host=%{DISTRO_BUILDTARGET} \
                        --prefix=/usr \
                        --libexecdir=/usr/lib/glibc \
                        --disable-profile \
                        --enable-add-ons \
-                       --enable-kernel=$(OPTIMIZED_KERNEL) \
+                       --enable-kernel=%{OPTIMIZED_KERNEL} \
                        --with-selinux \
                        --disable-werror \
                        --enable-bind-now \
@@ -244,156 +153,157 @@ define STAGE_BUILD
                        --with-gd \
                        --with-nss-crypt
 
-       cd $(DIR_SRC)/glibc-build && sed -i config.make \
-               -e "s/^build-pic-default=.*/build-pic-default=yes/"
-
-       # 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="$(CFLAGS) -fno-stack-protector -U_FORTIFY_SOURCE" \
-               CXXFLAGS="$(CXXFLAGS) -fno-stack-protector -U_FORTIFY_SOURCE"
-
-       # Then build the programs with hardening, so everything possible in
-       # $(TOOLS_DIR) is hardened:
-       echo "# Nothing in here :D" >  $(DIR_SRC)/glibc-build/configparms
-       cd $(DIR_SRC)/glibc-build && make PARALLELMFLAGS=$(PARALLELISMFLAGS) \
-               CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)"
-endef
-
-#define STAGE_TEST
-#      cd $(DIR_SRC)/glibc-build && TIMEOUTFACTOR=16 make check \
-#              CFLAGS="$(CFLAGS) -fno-stack-protector -U_FORTIFY_SOURCE" \
-#              CXXFLAGS="$(CXXFLAGS) -fno-stack-protector -U_FORTIFY_SOURCE"
-#endef
-
-define STAGE_INSTALL
-       cd $(DIR_SRC)/glibc-build && make install install_root=$(BUILDROOT)
-
-       # Locales
-       -mkdir -pv $(BUILDROOT)/usr/lib/locale
-       # This would install all locales that are supported
-       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
-       -mkdir -pv $(BUILDROOT)/etc/{default,ld.so.conf.d}
-       install -p -m644 $(DIR_APP)/nis/nss $(BUILDROOT)/etc/default/nss
-
-       # Remove unused binaries
-       rm -vf $(BUILDROOT)/sbin/sln \
-               $(BUILDROOT)/usr/bin/rpcinfo
-
-       # Don't distribute linker cache
-       rm -vf $(BUILDROOT)/etc/ld.so.cache
-
-       # Include /usr/lib/gconv/gconv-modules.cache
-       > $(BUILDROOT)/usr/lib/gconv/gconv-modules.cache
-       chmod 644 $(BUILDROOT)/usr/lib/gconv/gconv-modules.cache
-
-       strip -g $(BUILDROOT)/usr/lib/*.o
-
-       # Move some libs to correct place
-       mv -v $(BUILDROOT)/lib/lib{memusage,pcprofile}.so $(BUILDROOT)/usr/lib/
-endef
-
-### Packages
-
-# glibc-common
-PKG_PACKAGES  += $(PKG_NAME)-common
-PKG_DEPS      += $(PKG_NAME)-common
-
-define PKG_FILES-$(PKG_NAME)-common
-       /usr/bin
-       /usr/sbin
-       /usr/share
-       !/usr/share/zoneinfo
-endef
-
-# glibc-devel
-PKG_PACKAGES  += $(PKG_NAME)-devel
-
-PKG_SUMMARY-$(PKG_NAME)-devel = \
-       Object files for development using standard C libraries.
-PKG_GROUP-$(PKG_NAME)-devel = Development/Libraries
-PKG_DEPS-$(PKG_NAME)-devel += $(PKG_NAME)-headers
-
-define PKG_DESCRIPTION-$(PKG_NAME)-devel
-       The glibc-devel package contains the object files necessary
-       for developing programs which use the standard C libraries (which are
-       used by nearly all programs).  If you are developing programs which
-       will use the standard C libraries, your system needs to have these
-       standard object files available in order to create the
-       executables.
-
-       Install glibc-devel if you are going to develop programs which will
-       use the standard C libraries.
-endef
-
-PKG_FILES-$(PKG_NAME)-devel += /usr/lib/*.a /usr/lib/*.o
-
-# glibc-headers
-PKG_PACKAGES  += $(PKG_NAME)-headers
-
-PKG_DEPS-$(PKG_NAME)-headers += kernel-headers
-
-define PKG_DESCRIPTION-$(PKG_NAME)-heasders
-       The glibc-headers package contains the header files necessary
-       for developing programs which use the standard C libraries (which are
-       used by nearly all programs).  If you are developing programs which
-       will use the standard C libraries, your system needs to have these
-       standard header files available in order to create the
-       executables.
-
-       Install glibc-headers if you are going to develop programs which will
-       use the standard C libraries.
-endef
-
-define PKG_FILES-$(PKG_NAME)-headers
-       /usr/include
-       !/usr/include/linuxthreads
-       !/usr/include/gnu/stubs-[32164]*.h
-endef
-
-# nscd
-PKG_PACKAGES  += nscd
-
-PKG_SUMMARY-nscd = A Name Service Caching Daemon (nscd).
-PKG_GROUP-nscd   = System/Daemons
-
-define PKG_DESCRIPTION-nscd
-       Nscd caches name service lookups and can dramatically improve \
-       performance with NIS+, and may help with DNS as well.
-endef
-
-define PKG_FILES-nscd
-       /usr/sbin/nscd
-endef
-
-# glibc-utils
-PKG_PACKAGES  += $(PKG_NAME)-utils
-
-PKG_SUMMARY-$(PKG_NAME)-utils = Development utilities from GNU C library.
-PKG_GROUP-$(PKG_NAME)-utils   = Development/Tools
-define PKG_DESCRIPTION_$(PKG_NAME)-utils
-       The glibc-utils package contains memusage, a memory usage profiler, \
-       mtrace, a memory leak tracer and xtrace, a function call tracer \
-       which can be helpful during program debugging.
-endef
-
-define PKG_FILES-$(PKG_NAME)-utils
-       /usr/bin/memusage
-       /usr/bin/memusagestat
-       /usr/bin/mtrace
-       /usr/bin/pcprofiledump
-       /usr/bin/xtrace
-       /usr/lib/libmemusage.so
-       /usr/lib/libpcprofile.so
-endef
+               sed -i config.make \
+                       -e "s/^build-pic-default=.*/build-pic-default=yes/"
+
+               # 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" >> configparms
+
+               make PARALLELMFLAGS=%{PARALLELISMFLAGS} \
+                       CFLAGS="%{CFLAGS} -fno-stack-protector -U_FORTIFY_SOURCE" \
+                       CXXFLAGS="%{CXXFLAGS} -fno-stack-protector -U_FORTIFY_SOURCE"
+
+               # Then build the programs with hardening, so everything possible in
+               # is hardened:
+               echo "# Nothing in here :D" > configparms
+               make PARALLELMFLAGS=%{PARALLELISMFLAGS} \
+                       CFLAGS="%{CFLAGS}" CXXFLAGS="%{CXXFLAGS}"
+       end
+
+       #test
+       #       cd $(DIR_SRC)/glibc-build
+       #       make check TIMEOUTFACTOR=16 \
+       #               CFLAGS="%{CFLAGS} -fno-stack-protector -U_FORTIFY_SOURCE" \
+       #               CXXFLAGS="%{CXXFLAGS} -fno-stack-protector -U_FORTIFY_SOURCE"
+       #end
+
+       install
+               cd %{DIR_SRC}/glibc-build
+               make install install_root=%{BUILDROOT}
+
+               # Locales
+               mkdir -pv %{BUILDROOT}/usr/lib/locale
+               # This would install all locales that are supported
+               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
+               mkdir -pv %{BUILDROOT}/etc/{default,ld.so.conf.d}
+               install -p -m644 %{DIR_APP}/nis/nss %{BUILDROOT}/etc/default/nss
+
+               # Remove unused binaries
+               rm -vf %{BUILDROOT}/sbin/sln \
+                       %{BUILDROOT}/usr/bin/rpcinfo
+
+               # Don't distribute linker cache
+               rm -vf %{BUILDROOT}/etc/ld.so.cache
+
+               # Include /usr/lib/gconv/gconv-modules.cache
+               > %{BUILDROOT}/usr/lib/gconv/gconv-modules.cache
+               chmod 644 %{BUILDROOT}/usr/lib/gconv/gconv-modules.cache
+
+               strip -g %{BUILDROOT}/usr/lib/*.o
+
+               # Move some libs to correct place
+               mv -v %{BUILDROOT}/lib/lib{memusage,pcprofile}.so %{BUILDROOT}/usr/lib/
+       end
+end
+
+packages
+       package glibc
+               requires = glibc-common=%{thisver}      
+       end
+
+       package glibc-common
+               # XXX description and summary are missing
+
+               files
+                       /usr/bin
+                       /usr/sbin
+                       /usr/share
+                       !/usr/share/zoneinfo
+               end
+       end
+
+       package glibc-devel
+               summary = Object files for development using standard C libraries.
+               description
+                       The glibc-devel package contains the object files necessary
+                       for developing programs which use the standard C libraries (which are
+                       used by nearly all programs).  If you are developing programs which
+                       will use the standard C libraries, your system needs to have these
+                       standard object files available in order to create the
+                       executables.
+
+                       Install glibc-devel if you are going to develop programs which will
+                       use the standard C libraries.
+               end
+               group = Development/Libraries
+
+               requires = glibc-headers=%{thisver}
+
+               files = /usr/lib/*.a /usr/lib/*.o
+       end
+
+       package glibc-headers
+               description
+                       The glibc-headers package contains the header files necessary
+                       for developing programs which use the standard C libraries (which are
+                       used by nearly all programs).  If you are developing programs which
+                       will use the standard C libraries, your system needs to have these
+                       standard header files available in order to create the
+                       executables.
+
+                       Install glibc-headers if you are going to develop programs which will
+                       use the standard C libraries.
+               end
+
+               requires = kernel-headers
+
+               files
+                       /usr/include
+                       !/usr/include/linuxthreads
+                       !/usr/include/gnu/stubs-[32164]*.h
+               end
+       end
+
+       package nscd
+               summary = A Name Service Caching Daemon (nscd).
+               description
+                       Nscd caches name service lookups and can dramatically improve
+                       performance with NIS+, and may help with DNS as well.
+               end
+               group = System/Daemons
+
+               files
+                       /usr/sbin/nscd
+               end
+       end
+
+       package %{name}-utils
+               summary = Development utilities from GNU C library.
+               description
+                       The glibc-utils package contains memusage, a memory usage profiler,
+                       mtrace, a memory leak tracer and xtrace, a function call tracer
+                       which can be helpful during program debugging.
+               end
+               group = Development/Tools
+
+               files
+                       /usr/bin/memusage
+                       /usr/bin/memusagestat
+                       /usr/bin/mtrace
+                       /usr/bin/pcprofiledump
+                       /usr/bin/xtrace
+                       /usr/lib/libmemusage.so
+                       /usr/lib/libpcprofile.so
+               end
+       end
+end