Makefile for LFS 20020509, chapter 5 and 6 separated

Christophe Devine devine at debiam.org
Fri May 10 04:15:36 PDT 2002


  Hi all,

I've been able to apply the keep_chap5_and_chap6_sep.txt hint
on the latest CVS version of the book and everything worked
fine, using the following Makefile ( which can also be found at
http://193.54.225.81/devine/lfs/Makefile ) :

#
#    Makefile for Chapters 5 and 6 of Linux From Scratch, Version 20020509,
#       with the 'Keeping chapter 5 and chapter 6 separate' hint merged.
#
#          Before running 'make', check that this Makefile is located
#            inside the 'lfs-packages-cvs-20020501-1159' directory.
#

LFS=/mnt/lfs
TIMEZONE=GMT
KEYMAP=i386/qwerty/us.map.gz

all:

	[ `id -u` = "0"   ] && [ `id -g` = "0"    ]
	[ `umask` = "022" ] || [ `umask` = "0022" ]
	
	md5sum -c 00MD5SUMS
	
	make chapter5
	make chapter6

chapter5:

	mkdir -p $(LFS)/static/usr/src
	cp  -v * $(LFS)/static/usr/src
	
	cd $(LFS)/static/usr/src && \
	make	LFS=$(LFS)/static  static-bash        static-binutils   \
		static-bzip2       static-diffutils   static-fileutils  \
		static-findutils   static-gawk        static-gcc        \
		static-grep        static-gzip        static-make       \
		static-patch       static-sed         static-sh-utils   \
		static-tar         static-texinfo     static-textutils

chapter6:

	make directories
	
	echo "root:x:0:0:root:/root:/bin/bash" > $(LFS)/etc/passwd
	
	echo "root:x:0:"	 > $(LFS)/etc/group
	echo "bin:x:1:"		>> $(LFS)/etc/group
	echo "sys:x:2:"		>> $(LFS)/etc/group
	echo "kmem:x:3:"	>> $(LFS)/etc/group
	echo "tty:x:4:"		>> $(LFS)/etc/group
	echo "tape:x:5:"	>> $(LFS)/etc/group
	echo "daemon:x:6:"	>> $(LFS)/etc/group
	echo "floppy:x:7:"	>> $(LFS)/etc/group
	echo "disk:x:8:"	>> $(LFS)/etc/group
	echo "lp:x:9:"		>> $(LFS)/etc/group
	echo "dialout:x:10:"	>> $(LFS)/etc/group
	echo "audio:x:11:"	>> $(LFS)/etc/group
	
	mount proc $(LFS)/proc -t proc
	
	echo "cd /static/usr/src &&"	 > $(LFS)/root/.bash_profile
	echo "make inside-chroot &&"	>> $(LFS)/root/.bash_profile
	echo "logout"			>> $(LFS)/root/.bash_profile
	
	cd $(LFS) && \
	chroot $(LFS) /static/usr/bin/env -i HOME=/root TERM=`echo $$TERM` \
	    PATH=/sbin:/bin:/usr/sbin:/usr/bin:/static/bin:/static/usr/bin \
	    SHELL=/static/bin/bash PS1='\u:\w\$$ ' /static/bin/bash --login

static-bash:

	[ -e /usr/lib/libcurses.a ]
	
	bzip2 -dc bash-2.05a.tar.bz2 | tar -xv && \
	cd bash-2.05a && \
	\
	./configure --enable-static-link \
	    --prefix=$(LFS)/usr --bindir=$(LFS)/bin --with-curses && \
	make && \
	make install && \
	ln -sf bash $(LFS)/bin/sh
	
	rm -rf bash-2.05a

static-binutils:

	bzip2 -dc binutils-2.12.tar.bz2 | tar -xv && \
	cd binutils-2.12 && \
	\
	mkdir ../binutils-build && \
	cd ../binutils-build && \
	../binutils-2.12/configure --prefix=$(LFS)/usr --disable-nls && \
	make tooldir=$(LFS)/usr LDFLAGS=-all-static && \
	make tooldir=$(LFS)/usr install
	
	rm -rf binutils-2.12 binutils-build

static-bzip2:

	bzip2 -dc bzip2-1.0.2.tar.bz2 | tar -xv && \
	cd bzip2-1.0.2 && \
	\
	make CC="gcc -static" && \
	make PREFIX=$(LFS)/usr install && \
	mv $(LFS)/usr/bin/{bzcat,bunzip2,bzip2,bzip2recover,bzless,bzmore} $(LFS)/bin
	
	rm -rf bzip2-1.0.2

static-diffutils:

	bzip2 -dc diffutils-2.8.1.tar.bz2 | tar -xv && \
	cd diffutils-2.8.1 && \
	\
	CPPFLAGS=-Dre_max_failures=re_max_failures2 \
	./configure --prefix=$(LFS)/usr --disable-nls && \
	make LDFLAGS=-static && \
	make install
	
	rm -rf diffutils-2.8.1

static-fileutils:

	bzip2 -dc fileutils-4.1.tar.bz2 | tar -xv && \
	cd fileutils-4.1 && \
	\
	./configure --disable-nls \
	    --prefix=$(LFS)/usr --bindir=$(LFS)/bin && \
	make LDFLAGS=-static && \
	make install && \
	ln -sf ../../bin/install $(LFS)/usr/bin
	
	rm -rf fileutils-4.1

static-findutils:

	bzip2 -dc findutils-4.1.tar.bz2 | tar -xv && \
	cd findutils-4.1 && \
	\
	bzip2 -dc ../findutils-4.1.patch.bz2 | patch -Np1 && \
	CPPFLAGS=-Dre_max_failures=re_max_failures2 \
	./configure --prefix=$(LFS)/usr --disable-nls && \
	make libexecdir=/usr/bin LDFLAGS=-static && \
	make libexecdir=/usr/bin install
	
	rm -rf findutils-4.1

static-gawk:

	bzip2 -dc gawk-3.1.0.tar.bz2 | tar -xv && \
	cd gawk-3.1.0 && \
	\
	cp awklib/Makefile.in awklib/Makefile.in.backup && \
	sed -e '/^datadir/s/awk/gawk/' \
	-e '/^libexecdir/s%/awk%%' awklib/Makefile.in.backup \
	    > awklib/Makefile.in && \
	CPPFLAGS=-Dre_max_failures=re_max_failures2 \
	./configure --prefix=$(LFS)/usr --disable-nls \
	    --libexecdir=$(LFS)/usr/bin && \
	make LDFLAGS=-static && \
	make install
	
	rm -rf gawk-3.1.0

static-gcc:

	bzip2 -dc gcc-2.95.3.tar.bz2 | tar -xv && \
	cd gcc-2.95.3 && \
	\
	bzip2 -dc ../gcc-2.95.3-2.patch.bz2 | patch -Np1 && \
	mkdir ../gcc-build && \
	cd ../gcc-build && \
	../gcc-2.95.3/configure --prefix=/static/usr --enable-languages=c,c++ \
	   --disable-nls --disable-shared --enable-threads=posix && \
	make BOOT_LDFLAGS=-static bootstrap && \
	make prefix=$(LFS)/usr install && \
	ln -sf gcc $(LFS)/usr/bin/cc && \
	rmdir $(LFS)/usr/*-gnu/include && \
	rmdir $(LFS)/usr/*-gnu
	
	rm -rf gcc-2.95.3 gcc-build

static-grep:

	bzip2 -dc grep-2.5.tar.bz2 | tar -xv && \
	cd grep-2.5 && \
	\
	CPPFLAGS=-Dre_max_failures=re_max_failures2 \
	./configure --prefix=$(LFS)/usr --bindir=$(LFS)/bin \
	    --disable-nls --disable-perl-regexp && \
	make LDFLAGS=-static && \
	make install
	
	rm -rf grep-2.5

static-gzip:

	bzip2 -dc gzip-1.2.4a.tar.bz2 | tar -xv && \
	cd gzip-1.2.4a && \
	\
	./configure --prefix=$(LFS)/usr && \
	make LDFLAGS=-static && \
	make install && \
	cp $(LFS)/usr/bin/{gunzip,gzip} $(LFS)/bin && \
	rm $(LFS)/usr/bin/{gunzip,gzip}
	
	rm -rf gzip-1.2.4a

static-make:

	bzip2 -dc make-3.79.1.tar.bz2 | tar -xv && \
	cd make-3.79.1 && \
	\
	./configure --prefix=$(LFS)/usr --disable-nls && \
	make LDFLAGS=-static && \
	make install
	
	rm -rf make-3.79.1

static-patch:

	bzip2 -dc patch-2.5.4.tar.bz2 | tar -xv && \
	cd patch-2.5.4 && \
	\
	CPPFLAGS=-D_GNU_SOURCE \
	./configure --prefix=$(LFS)/usr && \
	make LDFLAGS=-static && \
	make install
	
	rm -rf patch-2.5.4

static-sed:

	bzip2 -dc sed-3.02.tar.bz2 | tar -xv && \
	cd sed-3.02 && \
	\
	CPPFLAGS=-Dre_max_failures=re_max_failures2 \
	./configure --prefix=$(LFS)/usr --bindir=$(LFS)/bin && \
	make LDFLAGS=-static && \
	make install
	
	rm -rf sed-3.02

static-sh-utils:

	bzip2 -dc sh-utils-2.0.tar.bz2 | tar -xv && \
	cd sh-utils-2.0 && \
	\
	./configure --prefix=$(LFS)/usr \
	    --disable-nls && \
	make LDFLAGS=-static && \
	make install && \
	mv $(LFS)/usr/bin/{basename,date,echo,false,hostname} $(LFS)/bin && \
	mv $(LFS)/usr/bin/{pwd,sleep,stty,test,true,uname} $(LFS)/bin
	
	rm -rf sh-utils-2.0

static-tar:

	bzip2 -dc tar-1.13.tar.bz2 | tar -xv && \
	cd tar-1.13 && \
	\
	bzip2 -dc ../tar-1.13.patch.bz2 | patch -Np1 && \
	./configure --prefix=$(LFS)/usr \
	    --disable-nls --libexecdir=$(LFS)/usr/bin \
	    --bindir=$(LFS)/bin && \
	make LDFLAGS=-static && \
	make install
	
	rm -rf tar-1.13

static-texinfo:

	bzip2 -dc texinfo-4.2.tar.bz2 | tar -xv && \
	cd texinfo-4.2 && \
	\
	./configure --prefix=$(LFS)/usr \
	    --disable-nls && \
	make LDFLAGS=-static && \
	make install
	
	rm -rf texinfo-4.2

static-textutils:

	bzip2 -dc textutils-2.0.tar.bz2 | tar -xv && \
	cd textutils-2.0 && \
	\
	./configure --prefix=$(LFS)/usr \
	    --disable-nls && \
	make LDFLAGS=-static && \
	make install && \
	mv $(LFS)/usr/bin/{cat,head} $(LFS)/bin
	
	rm -rf textutils-2.0

directories:

	cd $(LFS) && \
	mkdir -p bin boot dev/pts etc/opt home lib mnt proc root sbin tmp var opt && \
	for dirname in $(LFS)/usr $(LFS)/usr/local; \
	    do \
	    mkdir $$dirname; \
	    cd $$dirname; \
	    mkdir bin etc include lib sbin share src; \
	    ln -s share/man; \
	    ln -s share/doc; \
	    ln -s share/info; \
	    cd $$dirname/share; \
	    mkdir dict doc info locale man nls misc terminfo zoneinfo; \
	    cd $$dirname/share/man; \
	    mkdir man{1,2,3,4,5,6,7,8}; \
	done && \
	cd $(LFS)/var && \
	mkdir -p lock log mail run spool tmp opt cache lib/misc local && \
	cd $(LFS)/opt && \
	mkdir bin doc include info lib man && \
	cd $(LFS)/usr && \
	ln -s ../var/tmp
	
	cd $(LFS) && \
	chmod 0750 root && \
	chmod 1777 tmp var/tmp

inside-chroot:

	ln -s /proc/mounts /etc/mtab
	
	ln -s /static/bin/sh   /bin
	ln -s /static/bin/bash /bin
	ln -s /static/bin/pwd  /bin
	ln -s /static/usr/bin/cpp /lib
	
	echo "# Begin /root/.bash_profile"		 > /root/.bash_profile
	echo ""						>> /root/.bash_profile
	echo "PS1='\u:\w\$$ '"				>> /root/.bash_profile
	echo "PATH=/bin:/usr/bin:/sbin:/usr/sbin"	>> /root/.bash_profile
	echo ""						>> /root/.bash_profile
	echo "export PS1 PATH"				>> /root/.bash_profile
	echo ""						>> /root/.bash_profile
	echo "# End /root/.bash_profile"		>> /root/.bash_profile
	
	touch /tmp/timestamp
	
	for file in /static/usr/src/*; do ln -s $$file /usr/src; done
	
	cd /usr/src && \
	make  makedev kernel-headers  glibc gcc  man-pages findutils \
	      gawk ncurses  vim bison less groff textutils  sed flex \
	      binutils  fileutils  sh-utils  gettext  net-tools perl \
	      m4 texinfo  autoconf automake bash  file libtool bin86 \
	      bzip2 ed  kbd  diffutils e2fsprogs grep gzip  man lilo \
	      make modutils netkit-base patch procinfo procps psmisc \
	      reiserfsprogs shadow  sysklogd sysvinit tar util-linux \
	      lfs-bootscripts config-software

logPackage:

	find /{bin,boot,dev,lib,sbin,usr} -cnewer /tmp/timestamp \
	    ! -path "/usr/src*" -exec echo "$(P): {}" \; >> /var/log/packages
	
	touch /tmp/timestamp

makedev:

	bzcat MAKEDEV-1.5.bz2 > /dev/MAKEDEV && \
	cd /dev && \
	chmod 754 MAKEDEV && \
	./MAKEDEV -v generic-nopty
	
	make P=MAKEDEV-1.5 logPackage

kernel-headers:

	tar -xvjf linux-2.4.18.tar.bz2 && \
	cd linux && \
	\
	make mrproper && \
	make include/linux/version.h && \
	make symlinks && \
	mkdir /usr/include/asm && \
	cp include/asm/* /usr/include/asm && \
	cp -R include/linux /usr/include && \
	touch /usr/include/linux/autoconf.h
	
	chown -R 0.0 /usr/include/{linux,asm}
	
	make P=linux-2.4.18 logPackage

glibc:

	tar -xvjf glibc-2.2.5.tar.bz2 && \
	cd glibc-2.2.5 && \
	\
	tar -xvjf ../glibc-linuxthreads-2.2.5.tar.bz2 && \
	touch /etc/ld.so.conf && \
	cp malloc/Makefile malloc/Makefile.backup && \
	sed 's%\$$(PERL)%/usr/bin/perl%' \
	    malloc/Makefile.backup > malloc/Makefile && \
	cp login/Makefile login/Makefile.backup && \
	sed 's/root/0/' login/Makefile.backup > login/Makefile && \
	mkdir ../glibc-build && \
	cd ../glibc-build && \
	../glibc-2.2.5/configure --prefix=/usr \
	    --enable-add-ons --libexecdir=/usr/bin && \
	echo "cross-compiling = no" > configparms && \
	make && \
	make install && \
	make localedata/install-locales
	
	rm -rf glibc-build
	rm -rf glibc-2.2.5
	make P=glibc-2.2.5 logPackage

man-pages:

	tar -xvjf man-pages-1.48.tar.bz2 && \
	cd man-pages-1.48 && \
	\
	make install
	
	rm -rf man-pages-1.48
	make P=man-pages-1.48 logPackage

findutils:

	tar -xvjf findutils-4.1.tar.bz2 && \
	cd findutils-4.1 && \
	\
	bzcat ../findutils-4.1.patch.bz2 | patch -Np1 && \
	./configure --prefix=/usr && \
	make localstatedir=/var/lib/misc libexecdir=/usr/bin && \
	make localstatedir=/var/lib/misc libexecdir=/usr/bin install
	
	rm -rf findutils-4.1
	make P=findutils-4.1 logPackage

gawk:

	tar -xvjf gawk-3.1.0.tar.bz2 && \
	cd gawk-3.1.0 && \
	\
	cp awklib/Makefile.in awklib/Makefile.in.backup && \
	sed -e '/^datadir/s/awk/gawk/' \
	-e '/^libexecdir/s%/awk%%' awklib/Makefile.in.backup \
	    > awklib/Makefile.in && \
	./configure --prefix=/usr --libexecdir=/usr/bin && \
	make && \
	make install
	
	rm -rf gawk-3.1.0
	make P=gawk-3.1.0 logPackage

ncurses:

	tar -xvjf ncurses-5.2.tar.bz2 && \
	cd ncurses-5.2 && \
	\
	./configure --prefix=/usr --libdir=/lib \
	    --with-shared --disable-termcap && \
	make && \
	make install && \
	mv /lib/*.a /usr/lib && \
	chmod 755 /lib/*.5.2 && \
	ln -sf libncurses.a /usr/lib/libcurses.a && \
	ln -sf ../../lib/libncurses.so /usr/lib && \
	ln -sf ../../lib/libcurses.so /usr/lib && \
	ln -sf ../../lib/libform.so /usr/lib && \
	ln -sf ../../lib/libpanel.so /usr/lib && \
	ln -sf ../../lib/libmenu.so /usr/lib
	
	rm -rf ncurses-5.2
	make P=ncurses-5.2 logPackage

vim:

	tar -xvjf vim-6.1.tar.bz2 && \
	cd vim61 && \
	\
	./configure --prefix=/usr --localstatedir=/var/lib/vim && \
	make CPPFLAGS=-DSYS_VIMRC_FILE=\\\"/etc/vimrc\\\" && \
	make install && \
	ln -sf vim /usr/bin/vi
	
	rm -rf vim61
	make P=vim-6.1 logPackage

gcc:

	tar -xvjf gcc-2.95.3.tar.bz2 && \
	cd gcc-2.95.3 && \
	\
	bzcat ../gcc-2.95.3-2.patch.bz2 | patch -Np1 && \
	mkdir ../gcc-build && \
	cd ../gcc-build && \
	../gcc-2.95.3/configure --prefix=/usr --enable-shared \
	    --enable-languages=c,c++ --enable-threads=posix && \
	make bootstrap && \
	make install && \
	ln -sf ../usr/bin/cpp /lib && \
	ln -sf ../bin/cpp /usr/lib && \
	ln -sf gcc /usr/bin/cc && \
	rmdir /usr/*-gnu/include && \
	rmdir /usr/*-gnu
	
	rm -rf gcc-build
	rm -rf gcc-2.95.3
	make P=gcc-2.95.3 logPackage

bison:

	tar -xvjf bison-1.35.tar.bz2 && \
	cd bison-1.35 && \
	\
	./configure --prefix=/usr && \
	make && \
	make install
	
	echo '#!/bin/sh'			 > /usr/bin/yacc
	echo 'exec /usr/bin/bison -y "$$@"'	>> /usr/bin/yacc
	chmod 755 /usr/bin/yacc
	
	rm -rf bison-1.35
	make P=bison-1.35 logPackage

less:

	tar -xvjf less-374.tar.bz2 && \
	cd less-374 && \
	\
	./configure --prefix=/usr --bindir=/bin && \
	make && \
	make install
	
	rm -rf less-374
	make P=less-374 logPackage

groff:

	tar -xvjf groff-1.17.2.tar.bz2 && \
	cd groff-1.17.2 && \
	\
	./configure --prefix=/usr && \
	make && \
	make install && \
	ln -s soelim /usr/bin/zsoelim && \
	ln -s eqn /usr/bin/geqn && \
	ln -s tbl /usr/bin/gtbl
	
	rm -rf groff-1.17.2
	make P=groff-1.17.2 logPackage

man:

	tar -xvjf man-1.5j.tar.bz2 && \
	cd man-1.5j && \
	\
	PATH="$$PATH:/usr/bin:/bin" ./configure -default && \
	make && \
	make install && \
	mv /usr/share/misc/man.conf /etc
	
	rm -rf man-1.5j
	make P=man-1.5j logPackage

perl:

	tar -xvjf perl-5.6.1.tar.bz2 && \
	cd perl-5.6.1 && \
	\
	./configure.gnu --prefix=/usr && \
	make && \
	make install
	
	rm -rf perl-5.6.1
	make P=perl-5.6.1 logPackage

m4:

	tar -xvjf m4-1.4.tar.bz2 && \
	cd m4-1.4 && \
	\
	./configure --prefix=/usr && \
	make && \
	make install
	
	rm -rf m4-1.4
	make P=m4-1.4 logPackage

texinfo:

	tar -xvjf texinfo-4.2.tar.bz2 && \
	cd texinfo-4.2 && \
	\
	./configure --prefix=/usr && \
	make && \
	make install && \
	make TEXMF=/usr/share/texmf install-tex
	
	rm -rf texinfo-4.2
	make P=texinfo-4.2 logPackage

autoconf:

	tar -xvjf autoconf-2.53.tar.bz2 && \
	cd autoconf-2.53 && \
	\
	./configure --prefix=/usr && \
	make && \
	make install
	
	rm -rf autoconf-2.53
	make P=autoconf-2.53 logPackage

automake:

	tar -xvjf automake-1.6.tar.bz2 && \
	cd automake-1.6 && \
	\
	./configure --prefix=/usr && \
	make install
	
	rm -rf automake-1.6
	make P=automake-1.6 logPackage

bash:

	tar -xvjf bash-2.05a.tar.bz2 && \
	cd bash-2.05a && \
	\
	./configure --prefix=/usr --with-curses \
	    --bindir=/bin && \
	make && \
	make install && \
	ln -sf bash /bin/sh
	
	rm -rf bash-2.05a
	make P=bash-2.05a logPackage

flex:

	tar -xvjf flex-2.5.4a.tar.bz2 && \
	cd flex-2.5.4 && \
	\
	./configure --prefix=/usr && \
	make && \
	make install
	
	echo '#!/bin/sh'			 > /usr/bin/lex
	echo 'exec /usr/bin/flex -l "$$@"'	>> /usr/bin/lex
	chmod 755 /usr/bin/lex
	
	rm -rf flex-2.5.4
	make P=flex-2.5.4 logPackage

file:

	tar -xvjf file-3.37.tar.bz2 && \
	cd file-3.37 && \
	\
	touch aclocal.m4 configure Makefile.in stamp-h.in && \
	./configure --prefix=/usr --datadir=/usr/share/misc && \
	make && \
	make install
	
	rm -rf file-3.37
	make P=file-3.37 logPackage

libtool:

	tar -xvjf libtool-1.4.2.tar.bz2 && \
	cd libtool-1.4.2 && \
	\
	./configure --prefix=/usr && \
	make && \
	make install
	
	rm -rf libtool-1.4.2
	make P=libtool-1.4.2 logPackage

bin86:

	tar -xvjf bin86-0.16.2.tar.bz2 && \
	cd bin86-0.16.2 && \
	\
	make && \
	make PREFIX=/usr install
	
	rm -rf bin86-0.16.2
	make P=bin86-0.16.2 logPackage

binutils:

	tar -xvjf binutils-2.12.tar.bz2 && \
	cd binutils-2.12 && \
	\
	mkdir ../binutils-build && \
	cd ../binutils-build && \
	../binutils-2.12/configure --prefix=/usr --enable-shared && \
	make tooldir=/usr && \
	make tooldir=/usr install && \
	make tooldir=/usr install-info
	
	rm -rf binutils-build
	rm -rf binutils-2.12
	make P=binutils-2.12 logPackage

bzip2:

	tar -xvjf bzip2-1.0.2.tar.bz2 && \
	cd bzip2-1.0.2 && \
	\
	make -f Makefile-libbz2_so && \
	make && \
	make PREFIX=/usr install && \
	cp bzip2-shared /bin/bzip2 && \
	ln -s libbz2.so.1.0 libbz2.so && \
	cp -a libbz2.so* /lib && \
	ln -sf ../../lib/libbz2.so /usr/lib && \
	rm /usr/bin/{bunzip2,bzcat,bzip2} && \
	mv /usr/bin/{bzip2recover,bzless,bzmore} /bin && \
	ln -sf bzip2 /bin/bunzip2 && \
	ln -sf bzip2 /bin/bzcat
	
	rm -rf bzip2-1.0.2
	make P=bzip2-1.0.2 logPackage

ed:

	tar -xvjf ed-0.2.tar.bz2 && \
	cd ed-0.2 && \
	\
	cp buf.c buf.c.backup && \
	sed 's/int u/int u, sfd/' buf.c.backup | \
	    sed '/.*\*mktemp.*/d' | \
	    sed 's/.*if (mktemp.*/  sfd = mkstemp(sfn);\
	    if ((sfd == -1) || (sfp = fopen (sfn, "w+")) == NULL)/' > buf.c && \
	./configure --prefix=/usr && \
	make && \
	make install && \
	mv /usr/bin/ed /usr/bin/red /bin
	
	rm -rf ed-0.2
	make P=ed-0.2 logPackage

gettext:

	tar -xvjf gettext-0.11.1.tar.bz2 && \
	cd gettext-0.11.1 && \
	\
	./configure --prefix=/usr && \
	make && \
	make install
	
	rm -rf gettext-0.11.1
	make P=gettext-0.11.1 logPackage

kbd:

	tar -xvjf kbd-1.06.tar.bz2 && \
	cd kbd-1.06 && \
	\
	bzcat ../kbd-1.06-2.patch.bz2 | patch -Np1 && \
	./configure && \
	make && \
	make install
	
	rm -rf kbd-1.06
	make P=kbd-1.06 logPackage

diffutils:

	tar -xvjf diffutils-2.8.1.tar.bz2 && \
	cd diffutils-2.8.1 && \
	\
	./configure --prefix=/usr && \
	make && \
	make install
	
	rm -rf diffutils-2.8.1
	make P=diffutils-2.8.1 logPackage

e2fsprogs:

	tar -xvjf e2fsprogs-1.27.tar.bz2 && \
	cd e2fsprogs-1.27 && \
	\
	mkdir ../e2fsprogs-build && \
	cd ../e2fsprogs-build && \
	../e2fsprogs-1.27/configure --prefix=/usr --with-root-prefix="" \
	    --enable-elf-shlibs && \
	make && \
	make install && \
	make install-libs && \
	install-info /usr/share/info/libext2fs.info /usr/share/info/dir
	
	rm -rf e2fsprogs-build
	rm -rf e2fsprogs-1.27
	make P=e2fsprogs-1.27 logPackage

fileutils:

	tar -xvjf fileutils-4.1.tar.bz2 && \
	cd fileutils-4.1 && \
	\
	./configure --prefix=/usr --bindir=/bin && \
	make && \
	make install && \
	ln -sf ../../bin/install /usr/bin
	
	rm -rf fileutils-4.1
	make P=fileutils-4.1 logPackage

grep:

	tar -xvjf grep-2.5.tar.bz2 && \
	cd grep-2.5 && \
	\
	./configure --prefix=/usr --bindir=/bin && \
	make && \
	make install
	
	rm -rf grep-2.5
	make P=grep-2.5 logPackage

gzip:

	tar -xvjf gzip-1.2.4a.tar.bz2 && \
	cd gzip-1.2.4a && \
	\
	./configure --prefix=/usr && \
	cp gzexe.in gzexe.in.backup && \
	sed 's%"BINDIR"%/bin%' gzexe.in.backup > gzexe.in && \
	make && \
	make install && \
	mv /usr/bin/gzip /bin && \
	rm /usr/bin/{gunzip,zcat} && \
	ln -sf gzip /bin/gunzip && \
	ln -sf gzip /bin/zcat && \
	ln -sf gunzip /bin/uncompress
	
	rm -rf gzip-1.2.4a
	make P=gzip-1.2.4a logPackage

lilo:

	tar -xvjf lilo-22.2.tar.bz2 && \
	cd lilo-22.2 && \
	\
	make && \
	make install
	
	rm -rf lilo-22.2
	make P=lilo-22.2 logPackage

make:

	tar -xvjf make-3.79.1.tar.bz2 && \
	cd make-3.79.1 && \
	\
	./configure --prefix=/usr && \
	make && \
	make install && \
	chgrp root /usr/bin/make && \
	chmod 755 /usr/bin/make
	
	rm -rf make-3.79.1
	make P=make-3.79.1 logPackage

modutils:

	tar -xvjf modutils-2.4.15.tar.bz2 && \
	cd modutils-2.4.15 && \
	\
	./configure && \
	make && \
	make install
	
	rm -rf modutils-2.4.15
	make P=modutils-2.4.15 logPackage

netkit-base:

	tar -xvjf netkit-base-0.17.tar.bz2 && \
	cd netkit-base-0.17 && \
	\
	./configure && \
	make && \
	make install && \
	cp etc.sample/{services,protocols} /etc
	
	rm -rf netkit-base-0.17
	make P=netkit-base-0.17 logPackage

patch:

	tar -xvjf patch-2.5.4.tar.bz2 && \
	cd patch-2.5.4 && \
	\
	CPPFLAGS=-D_GNU_SOURCE \
	./configure --prefix=/usr && \
	make && \
	make install
	
	rm -rf patch-2.5.4
	make P=patch-2.5.4 logPackage

procinfo:

	tar -xvjf procinfo-18.tar.bz2 && \
	cd procinfo-18 && \
	\
	make LDLIBS=-lncurses && \
	make install
	
	rm -rf procinfo-18
	make P=procinfo-18 logPackage

procps:

	tar -xvjf procps-2.0.7.tar.bz2 && \
	cd procps-2.0.7 && \
	\
	make && \
	make XSCPT="" install && \
	mv /usr/bin/kill /bin
	
	rm -rf procps-2.0.7
	make P=procps-2.0.7 logPackage

psmisc:

	tar -xvjf psmisc-20.2.tar.bz2 && \
	cd psmisc-20.2 && \
	\
	./configure --prefix=/usr \
	    --exec-prefix=/ && \
	make && \
	make install
	
	rm -rf psmisc-20.2
	make P=psmisc-20.2 logPackage

reiserfsprogs:

	tar -xvjf reiserfsprogs-3.x.1b.tar.bz2 && \
	cd reiserfsprogs-3.x.1b && \
	\
	./configure --mandir=/usr/share/man && \
	make && \
	make install
	
	rm -rf reiserfsprogs-3.x.1b
	make P=reiserfsprogs-3.x.1b logPackage

sed:

	tar -xvjf sed-3.02.tar.bz2 && \
	cd sed-3.02 && \
	\
	./configure --prefix=/usr --bindir=/bin && \
	make && \
	make install
	
	rm -rf sed-3.02
	make P=sed-3.02 logPackage

sh-utils:

	tar -xvjf sh-utils-2.0.tar.bz2 && \
	cd sh-utils-2.0 && \
	\
	./configure --prefix=/usr && \
	make && \
	make install && \
	mv /usr/bin/{basename,date,echo,false,hostname} /bin && \
	mv /usr/bin/{pwd,sleep,stty,su,test,true,uname} /bin && \
	mv /usr/bin/chroot /usr/sbin
	
	ln -sf test /bin/[
	
	rm -rf sh-utils-2.0
	make P=sh-utils-2.0 logPackage

net-tools:

	tar -xvjf net-tools-1.60.tar.bz2 && \
	cd net-tools-1.60 && \
	\
	yes "" | make && \
	make update
	
	rm -rf net-tools-1.60
	make P=net-tools-1.60 logPackage

shadow:

	tar -xvjf shadow-4.0.3.tar.bz2 && \
	cd shadow-4.0.3 && \
	\
	./configure --prefix=/usr --enable-shared && \
	make && \
	make install && \
	cp etc/{limits,login.access} /etc && \
	sed 's%/var/spool/mail%/var/mail%' \
	    etc/login.defs.linux > /etc/login.defs && \
	ln -sf vipw /usr/sbin/vigr && \
	rm /bin/vipw && \
	mv /bin/sg /usr/bin && \
	mv /lib/{libmisc.*a,libshadow.*a} /usr/lib && \
	ln -s ../../lib/libshadow.so /usr/lib
	
	rm -rf shadow-4.0.3
	make P=shadow-4.0.3 logPackage

sysklogd:

	tar -xvjf sysklogd-1.4.1.tar.bz2 && \
	cd sysklogd-1.4.1 && \
	\
	make && \
	make install
	
	rm -rf sysklogd-1.4.1
	make P=sysklogd-1.4.1 logPackage

sysvinit:

	tar -xvjf sysvinit-2.84.tar.bz2 && \
	cd sysvinit-2.84 && \
	\
	cp src/init.c src/init.c.backup && \
	sed 's/\(.*\)\(Sending processes\)\(.*\)/\1\2 started by init\3/' \
	    src/init.c.backup > src/init.c && \
	\
	make -C src && \
	make -C src install
	
	rm -rf sysvinit-2.84
	make P=sysvinit-2.84 logPackage

tar:

	tar -xvjf tar-1.13.tar.bz2 && \
	cd tar-1.13 && \
	\
	bzcat ../tar-1.13.patch.bz2 | patch -Np1 && \
	./configure --prefix=/usr \
	    --libexecdir=/usr/bin --bindir=/bin && \
	make && \
	make install
	
	rm -rf tar-1.13
	make P=tar-1.13 logPackage

textutils:

	tar -xvjf textutils-2.0.tar.bz2
	cd textutils-2.0 && \
	\
	./configure --prefix=/usr && \
	make && \
	make install && \
	mv /usr/bin/{cat,head} /bin
	
	rm -rf textutils-2.0
	make P=textutils-2.0 logPackage

util-linux:

	tar -xvjf util-linux-2.11q.tar.bz2
	cd util-linux-2.11q && \
	\
	cp hwclock/hwclock.c hwclock/hwclock.c.backup && \
	sed 's%etc/adjtime%var/lib/hwclock/adjtime%' \
	    hwclock/hwclock.c.backup > hwclock/hwclock.c && \
	mkdir -p /var/lib/hwclock && \
	\
	./configure && \
	make HAVE_SLN=yes && \
	make HAVE_SLN=yes install
	
	rm -rf util-linux-2.11q
	make P=util-linux-2.11q logPackage

lfs-bootscripts:

	tar -xvjf lfs-bootscripts-1.9.tar.bz2
	cd lfs-bootscripts-1.9 && \
	\
	cp -a rc.d sysconfig /etc && \
	chown -R root.root /etc/rc.d /etc/sysconfig
	
	rm -rf lfs-bootscripts-1.9

config-software:

	echo "\" Begin /root/.vimrc"	 > /root/.vimrc
	echo ""				>> /root/.vimrc
	echo "set nocompatible"		>> /root/.vimrc
	echo "set bs=2"			>> /root/.vimrc
	echo ""				>> /root/.vimrc
	echo "\" End /root/.vimrc"	>> /root/.vimrc
	
	echo "# Begin /etc/nsswitch.conf"	 > /etc/nsswitch.conf
	echo ""					>> /etc/nsswitch.conf
	echo "passwd: files"			>> /etc/nsswitch.conf
	echo "group: files"			>> /etc/nsswitch.conf
	echo "shadow: files"			>> /etc/nsswitch.conf
	echo ""					>> /etc/nsswitch.conf
	echo "publickey: files"			>> /etc/nsswitch.conf
	echo ""					>> /etc/nsswitch.conf
	echo "hosts: files dns"			>> /etc/nsswitch.conf
	echo "networks: files"			>> /etc/nsswitch.conf
	echo ""					>> /etc/nsswitch.conf
	echo "protocols: db files"		>> /etc/nsswitch.conf
	echo "services: db files"		>> /etc/nsswitch.conf
	echo "ethers: db files"			>> /etc/nsswitch.conf
	echo "rpc: db files"			>> /etc/nsswitch.conf
	echo ""					>> /etc/nsswitch.conf
	echo "netgroup: db files"		>> /etc/nsswitch.conf
	echo ""					>> /etc/nsswitch.conf
	echo "# End /etc/nsswitch.conf"		>> /etc/nsswitch.conf
	
	ln -sf ../usr/share/zoneinfo/$(TIMEZONE) /etc/localtime
	
	echo "# Begin /etc/ld.so.conf"	 > /etc/ld.so.conf
	echo ""				>> /etc/ld.so.conf
	echo "/usr/local/lib"		>> /etc/ld.so.conf
	echo "/opt/lib"			>> /etc/ld.so.conf
	echo ""				>> /etc/ld.so.conf
	echo "# End /etc/ld.so.conf"	>> /etc/ld.so.conf
	
	echo "# Begin /etc/syslog.conf"			 > /etc/syslog.conf
	echo ""						>> /etc/syslog.conf
	echo "auth,authpriv.* -/var/log/auth.log"	>> /etc/syslog.conf
	echo "*.*;auth,authpriv.none -/var/log/sys.log"	>> /etc/syslog.conf
	echo "daemon.* -/var/log/daemon.log"		>> /etc/syslog.conf
	echo "kern.* -/var/log/kern.log"		>> /etc/syslog.conf
	echo "mail.* -/var/log/mail.log"		>> /etc/syslog.conf
	echo "user.* -/var/log/user.log"		>> /etc/syslog.conf
	echo "*.emerg *"				>> /etc/syslog.conf
	echo ""						>> /etc/syslog.conf
	echo "# End /etc/syslog.conf"			>> /etc/syslog.conf
	
	/usr/sbin/pwconv
	
	echo "# Begin /etc/inittab"			 > /etc/inittab
	echo ""						>> /etc/inittab
	echo "id:3:initdefault:"			>> /etc/inittab
	echo ""						>> /etc/inittab
	echo "si::sysinit:/etc/rc.d/init.d/rc sysinit"	>> /etc/inittab
	echo ""						>> /etc/inittab
	echo "l0:0:wait:/etc/rc.d/init.d/rc 0"		>> /etc/inittab
	echo "l1:S1:wait:/etc/rc.d/init.d/rc 1"		>> /etc/inittab
	echo "l2:2:wait:/etc/rc.d/init.d/rc 2"		>> /etc/inittab
	echo "l3:3:wait:/etc/rc.d/init.d/rc 3"		>> /etc/inittab
	echo "l4:4:wait:/etc/rc.d/init.d/rc 4"		>> /etc/inittab
	echo "l5:5:wait:/etc/rc.d/init.d/rc 5"		>> /etc/inittab
	echo "l6:6:wait:/etc/rc.d/init.d/rc 6"		>> /etc/inittab
	echo ""						>> /etc/inittab
	echo "ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now" >> /etc/inittab
	echo ""						>> /etc/inittab
	echo "su:S016:respawn:/sbin/sulogin"		>> /etc/inittab
	echo ""						>> /etc/inittab
	echo "1:2345:respawn:/sbin/agetty tty1 9600"	>> /etc/inittab
	echo "2:2345:respawn:/sbin/agetty tty2 9600"	>> /etc/inittab
	echo "3:2345:respawn:/sbin/agetty tty3 9600"	>> /etc/inittab
	echo "4:2345:respawn:/sbin/agetty tty4 9600"	>> /etc/inittab
	echo "5:2345:respawn:/sbin/agetty tty5 9600"	>> /etc/inittab
	echo "6:2345:respawn:/sbin/agetty tty6 9600"	>> /etc/inittab
	echo ""						>> /etc/inittab
	echo "# End /etc/inittab"			>> /etc/inittab
	
	ln -s $(KEYMAP) /usr/share/kbd/keymaps/defkeymap.map.gz
	
	touch /var/run/utmp /var/log/{btmp,lastlog,wtmp} && \
	chmod 644 /var/run/utmp /var/log/{btmp,lastlog,wtmp}
	
	passwd root

-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-dev' in the subject header of the message



More information about the lfs-dev mailing list