Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 34 additions & 2 deletions pkgbuild
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ pkg_fetch() {
pkg_unpack() {
SRC=$WORK_DIR/$name/src
PKG=$WORK_DIR/$name/pkg
SRC2=/usr/

umask 022

Expand Down Expand Up @@ -153,7 +154,11 @@ pkg_unpack() {
case $i in
*.tar|*.tar.gz|*.tar.Z|*.tgz|*.tar.bz2|*.tar.lz|*.tbz2|*.tar.xz|*.txz|*.tar.lzma|*.zip|*.rpm)
msg "Unpacking: $i"
$TAR -p -o -C $SRC -xf $i;;
$TAR -p -o -C $SRC -xf $i
if [ "$INSTALL_SOURCES" = 1 ] || [ "$INSTALL_SOURCES" = "yes" ]; then
cp -r $SRC $SRC2;
fi
;;
*)
msg "Preparing: $i"
cp $i $SRC;;
Expand All @@ -162,7 +167,7 @@ pkg_unpack() {
msgerr "Unpacking/Preparing failed: $i"
abort 1
}
done
done
}

pkg_build() {
Expand Down Expand Up @@ -245,6 +250,25 @@ strip_files() {
done
}

split_files() {
if [ "$nostrip" ]; then
for i in $nostrip; do
xstrip="$xstrip -e $i"
done
FILTER="grep -v $xstrip"
else
FILTER="cat"
fi

mkdir -p /usr/debug/$name

DEBUGFILE="/usr/debug/$name/$name.debug"

find . -type f -printf "%P\n" 2>/dev/null | $FILTER | while read -r binary ; do
${CROSS_COMPILE}strip --strip-all "$binary" -o $DEBUGFILE 2>/dev/null
done
}

compressinfomanpages() {
find . -type f -path "*/man/man*/*" | while read -r file; do
if [ "$file" = "${file%%.gz}" ]; then
Expand Down Expand Up @@ -298,6 +322,12 @@ pkg_package() {
if [ "$KEEP_DOC" = 0 ] || [ "$KEEP_DOC" = "no" ]; then
rm -fr usr/share/doc usr/share/gtk-doc usr/doc usr/gtk-doc
fi

if [ "$NO_SPLIT" = 0 ] || [ "$NO_SPLIT" = "no" ]; then
if [ "$NO_STRIP" = 0 ] || [ "$NO_STRIP" = "no" ]; then
split_files
fi
fi

if [ "$NO_STRIP" = 0 ] || [ "$NO_STRIP" = "no" ]; then
strip_files
Expand Down Expand Up @@ -622,6 +652,8 @@ PACKAGE_DIR="/var/cache/scratchpkg/packages"
WORK_DIR="/var/cache/scratchpkg/work"
COMPRESSION_MODE="xz"
NO_STRIP="no"
NO_SPLIT="yes"
INSTALL_SOURCES="no"
IGNORE_MDSUM="no"
KEEP_LIBTOOL="no"
KEEP_LOCALE="no"
Expand Down
2 changes: 2 additions & 0 deletions scratchpkg.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# CURL_OPTS=""
# COMPRESSION_MODE="xz"
# NO_STRIP="no"
# NO_SPLIT="yes"
# INSTALL_SOURCES="no"
# IGNORE_MDSUM="no"
# KEEP_LIBTOOL="no"
# KEEP_LOCALE="no"
Expand Down