-
Notifications
You must be signed in to change notification settings - Fork 0
/
patch.txt
38 lines (22 loc) · 1.04 KB
/
patch.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
NAME=patch
VER="lfs_8.0_systemd"
ARCH=x86_64
PKG=patch-2.7.5
cd /sources
tar xf patch-2.7.5.tar.xz
cd patch-2.7.5
PKG="${PWD##*/}"
FAKEROOT=/fakeroot/$PKG
./configure --prefix=/usr
make
make install
make DESTDIR=$FAKEROOT install
### 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 Patch package contains a program for modifying or creating files by applying a “patch” file typically created by the diff program." WHERE name IS "patch";'
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