-
Notifications
You must be signed in to change notification settings - Fork 0
/
tar.txt
46 lines (27 loc) · 1.14 KB
/
tar.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
45
46
NAME=tar
VER="lfs_8.0_systemd"
ARCH=x86_64
PKG=tar-1.29
cd /sources
tar xf tar-1.29.tar.xz
cd tar-1.29
PKG="${PWD##*/}"
FAKEROOT=/fakeroot/$PKG
FORCE_UNSAFE_CONFIGURE=1 \
./configure --prefix=/usr \
--bindir=/bin
make
make install
make -C doc install-html docdir=/usr/share/doc/tar-1.29
make DESTDIR=$FAKEROOT install
mkdir -p $FAKEROOT /usr/share/doc
cp -vR /usr/share/doc/tar-1.29 $FAKEROOT/usr/share/doc/
### 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 Tar package contains an archiving program." WHERE name IS "tar";'
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