summary refs log tree commit diff
path: root/lib2.sh
blob: ac94cb57c5e18f88b24f7175b2c5ca96adbc6763 (plain) (blame)
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
[ -z "$pkgcat" ] && error "pkgcat unset"
[ -z "$pkgname" ] && error "pkgname unset"
[ -z "$version" ] && error "version unset"

: ${distfiles:=""}
configure_args="--prefix=/usr --sysconfdir=/etc --sbindir=/usr/bin --bindir=/usr/bin --mandir=/usr/share/man --infodir=/usr/share/info --libexecdir=/usr/lib --localstatedir=/var ${configure_args}"
: ${MAKEFLAGS:=-j$(nproc)}
: ${make_default_target:=all}
: ${make_default_args:=}
: ${CC:=gcc}
: ${CXX:=g++}
: ${CFLAGS:=-g -O2 -pipe -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=2}
: ${CXXFLAGS:=$CFLAGS}
: ${LDFLAGS:=-Wl,-z,relro -Wl,-z,now}
: ${make_install_target:=install}
: ${make_install_args:=}
: ${DESTDIR:=/dst/$pkgcat/$pkgname/$version}

export MAKEFLAGS CC CXX CFLAGS CXXFLAGS LDFLAGS DESTDIR

for s in fetch extract configure build check install; do
  verbose pre_$s
  verbose do_$s
  verbose post_$s
done