Commit 8d97c8d9 authored by Vladimir Bashkirtsev's avatar Vladimir Bashkirtsev

Initial commit

parents
all: nsswitch.conf ld.so.conf
tar xf glibc-2.27.tar.xz
patch -Np1 -d glibc-2.27 < glibc-2.27-fhs-1.patch
$(eval LINKER=$(shell readelf -l /tools/bin/bash | sed -n 's@.*interpret.*/tools\(.*\)\]$$@\1@p'))
cd glibc-2.27 && sed -i 's|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=$(LINKER) -o|' scripts/test-installation.pl
cd glibc-2.27 && sed -i 's|/lib64/ld-linux-x86-64.so.2|/lib/ld-linux-x86-64.so.2|' sysdeps/unix/sysv/linux/x86_64/ldconfig.h
cd glibc-2.27 && sed -i 's/\\$$$$(pwd)/`pwd`/' timezone/Makefile
mkdir glibc-build
cd glibc-build && ../glibc-2.27/configure --build=$(CLFS_TARGET) --host=$(CLFS_TARGET) --prefix=/usr --disable-werror --enable-kernel=4.14.36 --enable-stack-protector=strong libc_cv_slibdir=/lib
$(MAKE) -C glibc-build
# FIXME: glibc tests fail, we should exclude tests which are known to fail and beyond our control
-if [[ ! "$(BUILD_OPTIONS)" =~ no-tests ]] ; then \
$(MAKE) -C glibc-build -k check ; \
fi
touch /etc/ld.so.conf
sed '/test-installation/s@$$(PERL)@echo not running@' -i glibc-2.27/Makefile
$(MAKE) -C glibc-build install
cp -v glibc-2.27/nscd/nscd.conf /etc/nscd.conf
mkdir -pv /var/cache/nscd
install -v -Dm644 glibc-2.27/nscd/nscd.tmpfiles /usr/lib/tmpfiles.d/nscd.conf
install -v -Dm644 glibc-2.27/nscd/nscd.service /lib/systemd/system/nscd.service
$(MAKE) -C glibc-build localedata/install-locales
@echo "$$NSSWITCH" > /etc/nsswitch.conf
mkdir tzdata
tar xf tzdata2018e.tar.gz -C tzdata
$(eval ZONEINFO=/usr/share/zoneinfo)
mkdir -pv $(ZONEINFO)/posix
mkdir -pv $(ZONEINFO)/right
$(eval TZ=etcetera southamerica northamerica europe africa antarctica asia australasia backward pacificnew systemv)
cd tzdata && \
for tz in $(TZ) ; do \
zic -L /dev/null -d $(ZONEINFO) -y "sh yearistype.sh" $$tz && \
zic -L /dev/null -d $(ZONEINFO)/posix -y "sh yearistype.sh" $$tz && \
zic -L leapseconds -d $(ZONEINFO)/right -y "sh yearistype.sh" $$tz ; \
done
cd tzdata && cp -v zone.tab iso3166.tab $(ZONEINFO)
cd tzdata && zic -d $(ZONEINFO) -p America/New_York
ln -sv /usr/share/zoneinfo/GMT /etc/localtime
@echo "$$LDSOCONF" > /etc/ld.so.conf
rm -rf glibc-2.27
rm -rf glibc-build
rm -rf tzdata
gcc -dumpspecs | perl -p -e 's@/tools/lib/ld@/lib/ld@g;' -e 's@\*startfile_prefix_spec:\n@$$_/usr/lib/ @g;' > $$(dirname $$(gcc --print-libgcc-file-name))/specs
nsswitch.conf:
define NSSWITCH
# Begin /etc/nsswitch.conf
passwd: files
group: files
shadow: files
hosts: files dns
networks: files
protocols: files
services: files
ethers: files
rpc: files
# End /etc/nsswitch.conf
endef
export NSSWITCH
ld.so.conf:
define LDSOCONF
# Begin /etc/ld.so.conf
/usr/local/lib
/opt/lib
# End /etc/ld.so.conf
endef
export LDSOCONF
<project name="glibc">
<target name="cross-glibc">
<property name="makedir" value="${builddir}/glibc-build"/>
<mkdir dir="${makedir}"/>
<exec executable="tar" failonerror="true">
<arg line="xf packages/glibc/glibc-2.27.tar.xz -C ${builddir}"/>
</exec>
<exec executable="${builddir}/glibc-2.27/configure" dir="${makedir}" failonerror="true">
<env key="PATH" path="${PATH}"/>
<env key="LD_LIBRARY_PATH" path=""/>
<env key="BUILD_CC" value="gcc"/>
<env key="CC" value="${CLFS_TARGET}-gcc"/>
<env key="AR" value="${CLFS_TARGET}-ar"/>
<env key="RANLIB" value="${CLFS_TARGET}-ranlib"/>
<arg line="--prefix=/tools --host=${CLFS_TARGET} --build=${CLFS_HOST} --enable-kernel=4.14.36 --with-binutils=${sysrootdir}/cross-tools/bin --with-headers=${sysrootdir}/tools/include"/>
</exec>
<exec executable="make" dir="${makedir}" failonerror="true">
<env key="PATH" path="${PATH}"/>
<env key="LD_LIBRARY_PATH" path=""/>
</exec>
<exec executable="make" dir="${makedir}" failonerror="true">
<env key="PATH" path="${PATH}"/>
<env key="LD_LIBRARY_PATH" path=""/>
<env key="DESTDIR" value="${sysrootdir}"/>
<arg line="install"/>
</exec>
<delete dir="${builddir}/glibc-2.27"/>
<delete dir="${makedir}"/>
</target>
</project>
Submitted By: Armin K. <krejzi at email dot com>
Date: 2013-02-11
Initial Package Version: 2.17
Upstream Status: Not Applicable
Origin: Self
Description: This patch removes references to /var/db directory which is not part
of FHS and replaces them with more suitable directories in /var
hierarchy - /var/cache/nscd for nscd and /var/lib/nss_db for nss_db.
--- a/Makeconfig 2012-12-25 04:02:13.000000000 +0100
+++ b/Makeconfig 2013-02-11 01:32:32.500667439 +0100
@@ -250,7 +250,7 @@
# Directory for the database files and Makefile for nss_db.
ifndef vardbdir
-vardbdir = $(localstatedir)/db
+vardbdir = $(localstatedir)/lib/nss_db
endif
inst_vardbdir = $(install_root)$(vardbdir)
--- a/nscd/nscd.h 2012-12-25 04:02:13.000000000 +0100
+++ b/nscd/nscd.h 2013-02-11 01:32:32.500667439 +0100
@@ -112,11 +112,11 @@
/* Paths of the file for the persistent storage. */
-#define _PATH_NSCD_PASSWD_DB "/var/db/nscd/passwd"
-#define _PATH_NSCD_GROUP_DB "/var/db/nscd/group"
-#define _PATH_NSCD_HOSTS_DB "/var/db/nscd/hosts"
-#define _PATH_NSCD_SERVICES_DB "/var/db/nscd/services"
-#define _PATH_NSCD_NETGROUP_DB "/var/db/nscd/netgroup"
+#define _PATH_NSCD_PASSWD_DB "/var/cache/nscd/passwd"
+#define _PATH_NSCD_GROUP_DB "/var/cache/nscd/group"
+#define _PATH_NSCD_HOSTS_DB "/var/cache/nscd/hosts"
+#define _PATH_NSCD_SERVICES_DB "/var/cache/nscd/services"
+#define _PATH_NSCD_NETGROUP_DB "/var/cache/nscd/netgroup"
/* Path used when not using persistent storage. */
#define _PATH_NSCD_XYZ_DB_TMP "/var/run/nscd/dbXXXXXX"
--- a/nss/db-Makefile 2012-12-25 04:02:13.000000000 +0100
+++ b/nss/db-Makefile 2013-02-11 01:32:32.500667439 +0100
@@ -22,7 +22,7 @@
/etc/rpc /etc/services /etc/shadow /etc/gshadow \
/etc/netgroup)
-VAR_DB = /var/db
+VAR_DB = /var/lib/nss_db
AWK = awk
MAKEDB = makedb --quiet
--- a/sysdeps/generic/paths.h 2012-12-25 04:02:13.000000000 +0100
+++ b/sysdeps/generic/paths.h 2013-02-11 01:32:32.500667439 +0100
@@ -68,7 +68,7 @@
/* Provide trailing slash, since mostly used for building pathnames. */
#define _PATH_DEV "/dev/"
#define _PATH_TMP "/tmp/"
-#define _PATH_VARDB "/var/db/"
+#define _PATH_VARDB "/var/lib/nss_db/"
#define _PATH_VARRUN "/var/run/"
#define _PATH_VARTMP "/var/tmp/"
--- a/sysdeps/unix/sysv/linux/paths.h 2012-12-25 04:02:13.000000000 +0100
+++ b/sysdeps/unix/sysv/linux/paths.h 2013-02-11 01:32:32.504000831 +0100
@@ -68,7 +68,7 @@
/* Provide trailing slash, since mostly used for building pathnames. */
#define _PATH_DEV "/dev/"
#define _PATH_TMP "/tmp/"
-#define _PATH_VARDB "/var/db/"
+#define _PATH_VARDB "/var/lib/nss_db/"
#define _PATH_VARRUN "/var/run/"
#define _PATH_VARTMP "/var/tmp/"
bin
/sbin/.*
/usr/bin/.*
/usr/sbin/.*
/usr/lib/tmpfiles.d/.*
/lib/systemd/system/.*
/var/lib/nss_db/.*
headers
/usr/include/.*
lib
/usr/libexec/getconf/.*
/usr/lib/gconv/.*
/usr/lib/lib.*\.(so|a)
/usr/lib/.*\.o
/usr/lib/audit/.*
/lib/.*\.so
locale
/usr/share/locale/.*
/usr/lib/locale/.*
zoneinfo
/usr/share/zoneinfo/.*
info
/usr/share/info/.*
international
/usr/share/i18n/.*
cache
/var/cache/ldconfig/.*
etc
/etc/.*
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment