User Tools

Site Tools


linux:lfs

This is an old revision of the document!


Package Management

Everything is placed under /usr/src/packagename/packageversion

samples

VER="$( pwd | cut -d '/' -f 5 )"
PKG="$( pwd | cut -d '/' -f 4-5 )"
SRC="$( pwd | cut -d '/' -f 4 )-${VER}"
JOBS=-j8
NEEDS=""
 
### DEPCHECK ###
for i in ${NEEDS}; do
        if [ ! -d /usr/pkg/${i} ]; then
                echo "need: ${i}"
                exit 6
        fi
done
 
### UNPACK ###
tar xf ${SRC}.tar.*
cd ${SRC}
if [ "$?" != "0" ]; then
        echo "Error in unpack"
        exit 1
fi
 
### CONFIGURE ###
./configure --prefix=/usr
if [ "$?" != "0" ]; then
        echo "Error in configure"
        exit 2
fi
 
### MAKE ###
make ${JOBS}
if [ "$?" != "0" ]; then
        echo "Error in make"
        exit 3
fi
 
### POSTMAKE ###
make DESTDIR=/usr/pkg/${PKG} install
if [ "$?" != "0" ]; then
        echo "Error in postmake"
        exit 4
fi
 
### INSTALL ###
cd /usr/pkg/${PKG}
for i in f d l; do
        find ./ -type ${i} | sed 's/^.//g' > .${i}
done
tar cf - . | (cd / ; tar xf - )
if [ "$?" != "0" ]; then
        echo "Error in install"
        exit 5
fi
 
### CLEANUP ###
cd /usr/src/${PKG}
rm -rf ${SRC}
linux/lfs.1513608671.txt.gz · Last modified: 2017/12/18 15:51 by vamp898