File: BuildOsxPkg.sh

package info (click to toggle)
xmount 0.7.6-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 788 kB
  • sloc: ansic: 9,081; xml: 163; sh: 34; makefile: 7
file content (50 lines) | stat: -rwxr-xr-x 1,713 bytes parent folder | download | duplicates (2)
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
47
48
49
50
#!/bin/bash

if [ "$(whoami)" != "root" ]; then
  echo "ERROR: This script has to be run as root!"
  exit 1
fi

CWD=`dirname "$0"`
CWD=`cd "$CWD"; pwd`
DSTROOT="$CWD/dstroot"
FULL_PKG_NAME=`basename "$CWD"`
PKG_VERSION=`echo "$FULL_PKG_NAME" | cut -d"-" -f2`
PKG_SVERSION=`echo "$PKG_VERSION" | tr -d "."`

echo "==== PKG build settings ==="
echo "\$CWD=\"$CWD\""
echo "\$DSTROOT=\"$DSTROOT\""
echo "\$PKG_VERSION=\"$PKG_VERSION\""
echo "\$PKG_SVERSION=\"$PKG_SVERSION\""
echo
echo "Press any key to continue or Ctrl-C to cancel"
read

# Create new dstroot folder
rm -rf "$DSTROOT" &>/dev/null
mkdir -p "$DSTROOT"/usr/local/bin
mkdir -p "$DSTROOT"/usr/local/lib/xmount
mkdir -p "$DSTROOT"/usr/local/share/man/man1

# Populate dstroot with files
cp "$CWD"/build/src/xmount "$DSTROOT"/usr/local/bin/
find "$CWD"/build/libxmount_input -name "libxmount_input_*.dylib" -exec cp "{}" "$DSTROOT"/usr/local/lib/xmount/ \;
find "$CWD"/build/libxmount_morphing -name "libxmount_morphing_*.dylib" -exec cp "{}" "$DSTROOT"/usr/local/lib/xmount/ \;
cp "$CWD"/xmount.1 "$DSTROOT"/usr/local/share/man/man1/

# Patch 01dstroot-contents.xml
sed -i -e "s#PMDOC_DSTROOT#$DSTROOT#g" "$CWD"/xmount.pmdoc/01dstroot-contents.xml

# Patch 01dstroot.xml
sed -i -e "s#PMDOC_DSTROOT#$DSTROOT#g" "$CWD"/xmount.pmdoc/01dstroot.xml
sed -i -e "s/PMDOC_VERSION/$PKG_VERSION/g" "$CWD"/xmount.pmdoc/01dstroot.xml
sed -i -e "s/PMDOC_SVERSION/$PKG_SVERSION/g" "$CWD"/xmount.pmdoc/01dstroot.xml

# Patch index.xml
sed -i -e "s#PMDOC_CWD#$CWD#g" "$CWD"/xmount.pmdoc/index.xml
sed -i -e "s/PMDOC_VERSION/$PKG_VERSION/g" "$CWD"/xmount.pmdoc/index.xml
sed -i -e "s/PMDOC_SVERSION/$PKG_SVERSION/g" "$CWD"/xmount.pmdoc/index.xml

open "$CWD"/xmount.pmdoc