-
Notifications
You must be signed in to change notification settings - Fork 0
/
gawk.txt
45 lines (26 loc) · 1.19 KB
/
gawk.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
NAME=gawk
VER="lfs_8.0_systemd"
ARCH=x86_64
PKG=gawk-4.1.4
cd /sources
tar xf gawk-4.1.4.tar.xz
cd gawk-4.1.4
PKG="${PWD##*/}"
FAKEROOT=/fakeroot/$PKG
./configure --prefix=/usr
make
make install
mkdir -v /usr/share/doc/gawk-4.1.4
cp -v doc/{awkforai.txt,*.{eps,pdf,jpg}} /usr/share/doc/gawk-4.1.4
make DESTDIR=$FAKEROOT install
mkdir -v $FAKEROOT/usr/share/doc/gawk-4.1.4
cp -v doc/{awkforai.txt,*.{eps,pdf,jpg}} $FAKEROOT/usr/share/doc/gawk-4.1.4
### create binary package and install the files
cd $FAKEROOT
mkdir -p /var/cache/packages
tar -zcvf /var/cache/packages/$PKG.$VER.$ARCH.pkg .
sqlite3 /var/cache/packages/package.db 'INSERT INTO PACKAGES(name, package, version, architecture, installed) VALUES("'$NAME'", "'$PKG'", "'$VER'", "'$ARCH'", datetime("now"));'
sqlite3 /var/cache/packages/package.db 'UPDATE PACKAGES SET about = "The Gawk package contains programs for manipulating text files." WHERE name IS "gawk";'
sqlite3 /var/cache/packages/package.db "CREATE TABLE '$NAME' ('files' TEXT);"
FILES=$(find $FAKEROOT -type f | sed 's,'"$FAKEROOT"',,')
while read -r line; do sqlite3 /var/cache/packages/package.db "INSERT INTO '$NAME' ('files') VALUES('"$line"');"; done <<< $FILES