summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Bingner <sam@bingner.com>2020-03-23 14:40:26 -1000
committerSam Bingner <sam@bingner.com>2020-03-23 14:43:24 -1000
commitabdd9a04698a4a77058d83ed0dae59d3053618f7 (patch)
tree8843897868d34a3ed02b32932e0e289ca6d4bdfb
parent914d52a8e123f493f1a6021955b8f657b0c0a717 (diff)
Infrastructure to build a metapackage and _librsync metapackagemetapackages
-rwxr-xr-xcontrol.sh80
-rw-r--r--data/_librsync/_metadata/description4
-rw-r--r--data/_librsync/_metadata/homepage1
-rw-r--r--data/_librsync/_metadata/in.1200.000
-rw-r--r--data/_librsync/_metadata/in.1443.000
-rw-r--r--data/_librsync/_metadata/librsync-dev/depends1
-rw-r--r--data/_librsync/_metadata/librsync-dev/description4
-rw-r--r--data/_librsync/_metadata/librsync1/description4
l---------data/_librsync/_metadata/license1
l---------data/_librsync/_metadata/maintainer1
-rw-r--r--data/_librsync/_metadata/priority1
-rw-r--r--data/_librsync/_metadata/rdiff/depends1
-rw-r--r--data/_librsync/_metadata/rdiff/description4
-rw-r--r--data/_librsync/_metadata/rdiff/section1
-rw-r--r--data/_librsync/_metadata/rdiff/tags1
-rw-r--r--data/_librsync/_metadata/role1
-rw-r--r--data/_librsync/_metadata/section1
-rw-r--r--data/_librsync/_metadata/tags1
-rw-r--r--data/_librsync/_metadata/version1
-rw-r--r--data/_librsync/librsync-dev.install2
-rw-r--r--data/_librsync/librsync1.install1
-rw-r--r--data/_librsync/librsync_0.9.7-10.debian.tar.gzbin0 -> 7224 bytes
-rw-r--r--data/_librsync/librsync_0.9.7.orig.tar.gzbin0 -> 453802 bytes
-rw-r--r--data/_librsync/make.sh6
-rw-r--r--data/_librsync/rdiff.install1
-rwxr-xr-xfolders.sh24
-rwxr-xr-xhelper.sh59
-rwxr-xr-xmake.sh78
-rwxr-xr-xpackage.sh29
29 files changed, 252 insertions, 56 deletions
diff --git a/control.sh b/control.sh
index db0f65280..6728fe3ca 100755
--- a/control.sh
+++ b/control.sh
@@ -1,8 +1,13 @@
#!/bin/bash
shopt -s extglob nullglob
-export PKG_NAME=$1
+PKG_NAME=$1
shift
+if [[ ${PKG_NAME} == */* ]]; then
+ PKG_PARENT="${PKG_NAME%%/*}"
+ PKG_NAME="${PKG_NAME#*/}"
+fi
+export PKG_NAME PKG_PARENT
export PKG_BASE=$(realpath "$(dirname "$0")")
. "${PKG_BASE}/helper.sh"
@@ -29,7 +34,7 @@ fi
cat <<EOF
Priority: ${PKG_PRIO#+}
-Section: $(cat "${PKG_DATA}/_metadata/section")
+Section: $(cat "${PKG_FILE_SECTION}")
EOF
if [[ $1 == status || $1 == available ]]; then
@@ -43,7 +48,7 @@ EOF
fi
cat <<EOF
-Maintainer: $(cat "${PKG_DATA}/_metadata/maintainer")
+Maintainer: $(cat "${PKG_FILE_MAINTAINER}")
Architecture: ${PKG_ARCH}
EOF
@@ -61,8 +66,8 @@ Size: $(find "${PKG_DEST}" -type f -exec cat {} \; | gzip -c | wc -c | cut -d $'
EOF
fi
-if [[ -e ${PKG_DATA}/_metadata/predepends_ ]]; then
- echo "Pre-Depends: $(cat "${PKG_DATA}/_metadata/predepends_")"
+if [[ -e ${PKG_FILE_PREDEPENDS_} ]]; then
+ echo "Pre-Depends: $(cat "${PKG_FILE_PREDEPENDS_}")"
else
unset comma
@@ -77,7 +82,7 @@ else
echo -n " dpkg (>= 1.14.25-8)"
fi
- if [[ -e ${PKG_DATA}/_metadata/predepends ]]; then
+ if [[ -e ${PKG_FILE_PREDEPENDS} ]]; then
if [[ ${comma+@} == @ ]]; then
echo -n ","
else
@@ -85,7 +90,7 @@ else
comma=
fi
- echo -n " $(cat "${PKG_DATA}/_metadata/predepends")"
+ echo -n " $(cat "${PKG_FILE_PREDEPENDS}")"
fi
if [[ ${comma+@} == @ ]]; then
@@ -93,7 +98,7 @@ else
fi
fi
-if [[ ! -e ${PKG_DATA}/_metadata/depends_ ]]; then
+if [[ ! -e ${PKG_FILE_DEPENDS_} ]]; then
. "${PKG_BASE}/autodeps.sh"
unset comma
for dep in "${PKG_DEPS[@]}"; do
@@ -116,7 +121,18 @@ if [[ ! -e ${PKG_DATA}/_metadata/depends_ ]]; then
fi
done
- if [[ -e ${PKG_DATA}/_metadata/depends ]]; then
+ if [[ -e ${PKG_FILE_DEPENDS} ]]; then
+ if [[ ${comma+@} == @ ]]; then
+ echo -n ","
+ else
+ echo -n "Depends:"
+ comma=
+ fi
+
+ echo -n " $(cat "${PKG_FILE_DEPENDS}" | sed -e s/%MYVERSION%/${PKG_VRSN%-*}/g)"
+ fi
+
+ if [[ -e ${PKG_FILE_DEPENDS_ARCH} ]]; then
if [[ ${comma+@} == @ ]]; then
echo -n ","
else
@@ -124,7 +140,7 @@ if [[ ! -e ${PKG_DATA}/_metadata/depends_ ]]; then
comma=
fi
- echo -n " $(cat "${PKG_DATA}/_metadata/depends" | sed -e s/%MYVERSION%/${PKG_VRSN%-*}/g)"
+ echo -n " $(cat "${PKG_FILE_DEPENDS_ARCH}" | sed -e s/%MYVERSION%/${PKG_VRSN%-*}/g)"
fi
if [[ ${comma+@} == @ ]]; then
@@ -134,61 +150,67 @@ elif [[ -s ${PKG_DATA}/_metadata/depends_ ]]; then
echo "Depends: $(cat "${PKG_DATA}/_metadata/depends_")"
fi
-if [[ -e ${PKG_DATA}/_metadata/replaces ]]; then
+if [[ -e ${PKG_FILE_REPLACES} ]]; then
cat <<EOF
-Replaces: $(cat "${PKG_DATA}/_metadata/replaces")
+Replaces: $(cat "${PKG_FILE_REPLACES}")
EOF
fi
-if [[ -e ${PKG_DATA}/_metadata/conflicts ]]; then
+if [[ -e ${PKG_FILE_CONFLICTS} ]]; then
cat <<EOF
-Conflicts: $(cat "${PKG_DATA}/_metadata/conflicts")
+Conflicts: $(cat "${PKG_FILE_CONFLICTS}")
EOF
fi
-if [[ -e ${PKG_DATA}/_metadata/breaks ]]; then
+if [[ -e ${PKG_FILE_BREAKS} ]]; then
cat <<EOF
-Breaks: $(cat "${PKG_DATA}/_metadata/breaks")
+Breaks: $(cat "${PKG_FILE_BREAKS}")
EOF
fi
-if [[ -e ${PKG_DATA}/_metadata/provides ]]; then
+if [[ -e ${PKG_FILE_PROVIDES} ]]; then
cat <<EOF
-Provides: $(cat "${PKG_DATA}/_metadata/provides" | sed -e s/%MYVERSION%/${PKG_VRSN%-*}/)
+Provides: $(cat "${PKG_FILE_PROVIDES}" | sed -e s/%MYVERSION%/${PKG_VRSN%-*}/)
EOF
fi
+PKG_SHORT_DESCRIPTION="$(head -n 1 "${PKG_FILE_DESCRIPTION}")"
+if [ -z "${PKG_SHORT_DESCRIPTION}" ]; then
+ echo "Error: need a description to make a package" >&2
+ exit 1;
+fi
+
cat <<EOF
-Description: $(head -n 1 "${PKG_DATA}/_metadata/description")
+Description: ${PKG_SHORT_DESCRIPTION}
EOF
-if [[ $(wc -l "${PKG_DATA}/_metadata/description" | cut -d ' ' -f 1) -gt 1 ]]; then
+if [[ $(wc -l "${PKG_FILE_DESCRIPTION}" | cut -d ' ' -f 1) -gt 1 ]]; then
cat <<EOF
-$(tail -n +2 "${PKG_DATA}/_metadata/description" | fold -sw 72 | sed -e 's/^/ /')
+$(tail -n +2 "${PKG_FILE_DESCRIPTION}" | fold -sw 72 | sed -e 's/^/ /')
EOF
fi
-if [[ -e ${PKG_DATA}/_metadata/name ]]; then
+if [[ -e ${PKG_FILE_NAME} ]]; then
cat <<EOF
-Name: $(cat "${PKG_DATA}/_metadata/name")
+Name: $(cat "${PKG_FILE_NAME}")
EOF
fi
-if [[ -e ${PKG_DATA}/_metadata/author ]]; then
+if [[ -e ${PKG_FILE_AUTHOR} ]]; then
cat <<EOF
-Author: $(cat "${PKG_DATA}/_metadata/author")
+Author: $(cat "${PKG_FILE_AUTHOR}")
EOF
fi
-if [[ -e ${PKG_DATA}/_metadata/homepage ]]; then
+if [[ -e ${PKG_FILE_HOMEPAGE} ]]; then
cat <<EOF
-Homepage: $(cat "${PKG_DATA}/_metadata/homepage")
+Homepage: $(cat "${PKG_FILE_HOMEPAGE}")
EOF
fi
-if [[ -e ${PKG_DATA}/_metadata/depiction ]]; then
+if [[ -e ${PKG_FILE_DEPICTION} ]]; then
cat <<EOF
-Depiction: $(cat "${PKG_DATA}/_metadata/depiction")
+Depiction: $(cat "${PKG_FILE_DEPICTION}")
EOF
fi
diff --git a/data/_librsync/_metadata/description b/data/_librsync/_metadata/description
new file mode 100644
index 000000000..b43331c2d
--- /dev/null
+++ b/data/_librsync/_metadata/description
@@ -0,0 +1,4 @@
+rsync remote-delta algorithm library
+librsync implements the rsync remote-delta algorithm, which allows for efficient remote updates of a file, without requiring the old and new versions to both be present at the transmitter. The library uses a stream-based designed so that it can be easily embedded into network applications.
+.
+librsync is used by rdiff-backup and duplicity backup applications.
diff --git a/data/_librsync/_metadata/homepage b/data/_librsync/_metadata/homepage
new file mode 100644
index 000000000..6fc3668d4
--- /dev/null
+++ b/data/_librsync/_metadata/homepage
@@ -0,0 +1 @@
+http://librsync.sourceforge.net/
diff --git a/data/_librsync/_metadata/in.1200.00 b/data/_librsync/_metadata/in.1200.00
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/data/_librsync/_metadata/in.1200.00
diff --git a/data/_librsync/_metadata/in.1443.00 b/data/_librsync/_metadata/in.1443.00
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/data/_librsync/_metadata/in.1443.00
diff --git a/data/_librsync/_metadata/librsync-dev/depends b/data/_librsync/_metadata/librsync-dev/depends
new file mode 100644
index 000000000..f7ab12f79
--- /dev/null
+++ b/data/_librsync/_metadata/librsync-dev/depends
@@ -0,0 +1 @@
+librsync1 (>= %MYVERSION%)
diff --git a/data/_librsync/_metadata/librsync-dev/description b/data/_librsync/_metadata/librsync-dev/description
new file mode 100644
index 000000000..fd24c2b66
--- /dev/null
+++ b/data/_librsync/_metadata/librsync-dev/description
@@ -0,0 +1,4 @@
+rsync remote-delta algorithm library (development)
+librsync implements the rsync remote-delta algorithm, which allows for efficient remote updates of a file, without requiring the old and new versions to both be present at the transmitter. The library uses a stream-based designed so that it can be easily embedded into network applications.
+.
+This package contains the development files.
diff --git a/data/_librsync/_metadata/librsync1/description b/data/_librsync/_metadata/librsync1/description
new file mode 100644
index 000000000..b43331c2d
--- /dev/null
+++ b/data/_librsync/_metadata/librsync1/description
@@ -0,0 +1,4 @@
+rsync remote-delta algorithm library
+librsync implements the rsync remote-delta algorithm, which allows for efficient remote updates of a file, without requiring the old and new versions to both be present at the transmitter. The library uses a stream-based designed so that it can be easily embedded into network applications.
+.
+librsync is used by rdiff-backup and duplicity backup applications.
diff --git a/data/_librsync/_metadata/license b/data/_librsync/_metadata/license
new file mode 120000
index 000000000..577aa1598
--- /dev/null
+++ b/data/_librsync/_metadata/license
@@ -0,0 +1 @@
+../../../licenses/lgpl-2.1 \ No newline at end of file
diff --git a/data/_librsync/_metadata/maintainer b/data/_librsync/_metadata/maintainer
new file mode 120000
index 000000000..573d7ebef
--- /dev/null
+++ b/data/_librsync/_metadata/maintainer
@@ -0,0 +1 @@
+../../../people/sbingner \ No newline at end of file
diff --git a/data/_librsync/_metadata/priority b/data/_librsync/_metadata/priority
new file mode 100644
index 000000000..134d9bc32
--- /dev/null
+++ b/data/_librsync/_metadata/priority
@@ -0,0 +1 @@
+optional
diff --git a/data/_librsync/_metadata/rdiff/depends b/data/_librsync/_metadata/rdiff/depends
new file mode 100644
index 000000000..f7ab12f79
--- /dev/null
+++ b/data/_librsync/_metadata/rdiff/depends
@@ -0,0 +1 @@
+librsync1 (>= %MYVERSION%)
diff --git a/data/_librsync/_metadata/rdiff/description b/data/_librsync/_metadata/rdiff/description
new file mode 100644
index 000000000..b67015a44
--- /dev/null
+++ b/data/_librsync/_metadata/rdiff/description
@@ -0,0 +1,4 @@
+Binary diff tool for signature-based differences
+rdiff is a little like diff and patch all rolled into one, with support for binary files. Since it takes advantage of the rsync remote-delta algorithm, you do not need the source file in the same place as your destination file.
+.
+To use it, you generate a "signature" of the original file and copy the signature (which is very small) to the same location as the modified file. Then you generate a "delta" which describes the changes required to turn the source file into the modified file. The small delta file can then be used to "patch" the original file, to transform it into the modified file.
diff --git a/data/_librsync/_metadata/rdiff/section b/data/_librsync/_metadata/rdiff/section
new file mode 100644
index 000000000..19814b684
--- /dev/null
+++ b/data/_librsync/_metadata/rdiff/section
@@ -0,0 +1 @@
+Utilities
diff --git a/data/_librsync/_metadata/rdiff/tags b/data/_librsync/_metadata/rdiff/tags
new file mode 100644
index 000000000..ad5d50831
--- /dev/null
+++ b/data/_librsync/_metadata/rdiff/tags
@@ -0,0 +1 @@
+purpose::console
diff --git a/data/_librsync/_metadata/role b/data/_librsync/_metadata/role
new file mode 100644
index 000000000..52b4d7301
--- /dev/null
+++ b/data/_librsync/_metadata/role
@@ -0,0 +1 @@
+hacker
diff --git a/data/_librsync/_metadata/section b/data/_librsync/_metadata/section
new file mode 100644
index 000000000..e0eb96881
--- /dev/null
+++ b/data/_librsync/_metadata/section
@@ -0,0 +1 @@
+Development
diff --git a/data/_librsync/_metadata/tags b/data/_librsync/_metadata/tags
new file mode 100644
index 000000000..a8928cec8
--- /dev/null
+++ b/data/_librsync/_metadata/tags
@@ -0,0 +1 @@
+purpose::library
diff --git a/data/_librsync/_metadata/version b/data/_librsync/_metadata/version
new file mode 100644
index 000000000..6216bdf2c
--- /dev/null
+++ b/data/_librsync/_metadata/version
@@ -0,0 +1 @@
+0.9.7.10
diff --git a/data/_librsync/librsync-dev.install b/data/_librsync/librsync-dev.install
new file mode 100644
index 000000000..359dbca3c
--- /dev/null
+++ b/data/_librsync/librsync-dev.install
@@ -0,0 +1,2 @@
+/usr/include/*
+/usr/lib/+([^.]).dylib
diff --git a/data/_librsync/librsync1.install b/data/_librsync/librsync1.install
new file mode 100644
index 000000000..8d646d294
--- /dev/null
+++ b/data/_librsync/librsync1.install
@@ -0,0 +1 @@
+/usr/lib/*.*.dylib
diff --git a/data/_librsync/librsync_0.9.7-10.debian.tar.gz b/data/_librsync/librsync_0.9.7-10.debian.tar.gz
new file mode 100644
index 000000000..8afb6c11a
--- /dev/null
+++ b/data/_librsync/librsync_0.9.7-10.debian.tar.gz
Binary files differ
diff --git a/data/_librsync/librsync_0.9.7.orig.tar.gz b/data/_librsync/librsync_0.9.7.orig.tar.gz
new file mode 100644
index 000000000..c4d2402f6
--- /dev/null
+++ b/data/_librsync/librsync_0.9.7.orig.tar.gz
Binary files differ
diff --git a/data/_librsync/make.sh b/data/_librsync/make.sh
new file mode 100644
index 000000000..a1ba2aaf4
--- /dev/null
+++ b/data/_librsync/make.sh
@@ -0,0 +1,6 @@
+pkg:setup
+autoreconf -fi
+CFLAGS="-D_LARGEFILE_SOURCE -std=gnu89" pkg:configure --enable-shared --disable-static
+pkg:make
+pkg:install
+subpkg:stage
diff --git a/data/_librsync/rdiff.install b/data/_librsync/rdiff.install
new file mode 100644
index 000000000..415f082dd
--- /dev/null
+++ b/data/_librsync/rdiff.install
@@ -0,0 +1 @@
+/usr/bin
diff --git a/folders.sh b/folders.sh
index c46c5f525..3c0419673 100755
--- a/folders.sh
+++ b/folders.sh
@@ -1,23 +1,39 @@
#!/bin/bash
function PKG_DATA_() {
- echo "${PKG_BASE}/data/$1"
+ if [[ -n "${PKG_PARENT}" && "$1" != "${PKG_PARENT}" ]]; then
+ echo "${PKG_BASE}/data/${PKG_PARENT}"
+ else
+ echo "${PKG_BASE}/data/$1"
+ fi
}
export -f PKG_DATA_
function PKG_WORK_() {
- echo "${PKG_BASE}/work/${PKG_ARCH}/${PKG_CFTARG}/$1"
+ if [[ -n "${PKG_PARENT}" && "$1" != "${PKG_PARENT}" ]]; then
+ echo "${PKG_BASE}/work/${PKG_ARCH}/${PKG_CFTARG}/${PKG_PARENT}"
+ else
+ echo "${PKG_BASE}/work/${PKG_ARCH}/${PKG_CFTARG}/$1"
+ fi
}
export -f PKG_WORK_
function PKG_MORE_() {
- echo "${PKG_BASE}/more/${PKG_ARCH}/${PKG_CFTARG}/$1"
+ if [[ -n "${PKG_PARENT}" && "$1" != "${PKG_PARENT}" ]]; then
+ echo "${PKG_BASE}/more/${PKG_ARCH}/${PKG_CFTARG}/$PKG_PARENT"
+ else
+ echo "${PKG_BASE}/more/${PKG_ARCH}/${PKG_CFTARG}/$1"
+ fi
}
function PKG_DEST_() {
- echo "${PKG_BASE}/dest/${PKG_ARCH}/${PKG_CFTARG}/$1"
+ if [[ -n "${PKG_PARENT}" && "$1" != "${PKG_PARENT}" ]]; then
+ echo "${PKG_BASE}/subdest/${PKG_ARCH}/${PKG_CFTARG}/${PKG_PARENT}/$1"
+ else
+ echo "${PKG_BASE}/dest/${PKG_ARCH}/${PKG_CFTARG}/$1"
+ fi
}
export -f PKG_DEST_
diff --git a/helper.sh b/helper.sh
index 44beaffc1..f12f9a121 100755
--- a/helper.sh
+++ b/helper.sh
@@ -4,8 +4,12 @@ source "${PKG_BASE}/architect.sh"
export FAKEROOT="fakeroot -i \"${PKG_BASE}/.fakeroot\" -s \"${PKG_BASE}/.fakeroot\""
-export PKG_ROOT="$(xcrun -sdk ${PKG_SDK} --show-sdk-path)"
-export PKG_CCPF=$("${PKG_TARG}-gcc" -v 2>&1 | grep -- --prefix | sed -e 's/.*--prefix=\([^ ]*\).*/\1/')
+if [ -z "${PKG_ROOT}" ]; then
+ export PKG_ROOT="$(xcrun -sdk ${PKG_SDK} --show-sdk-path)"
+fi
+if [ -z "${PKG_CCPF}" ]; then
+ export PKG_CCPF=$("${PKG_TARG}-gcc" -v 2>&1 | grep -- --prefix | sed -e 's/.*--prefix=\([^ ]*\).*/\1/')
+fi
source "${PKG_BASE}/folders.sh"
@@ -15,31 +19,64 @@ if [[ ${PKG_NAME} != @(-|:*) ]]; then
export PKG_WORK=$(PKG_WORK_ "${PKG_NAME}")
export PKG_DEST=$(PKG_DEST_ "${PKG_NAME}")
+ if [ -n "${PKG_PARENT}" ]; then
+ export PKG_DATA=$(echo "${PKG_BASE}"/data/"${PKG_PARENT}"?(_))
+ export PKG_PARENT_DEST=$(PKG_DEST_ "${PKG_PARENT}")
+ else
+ export PKG_DATA=$(echo "${PKG_BASE}"/data/"${PKG_NAME}"?(_))
+ declare -a PKG_CHILDREN
+ for instfile in "${PKG_DATA}"/*.install; do
+ CHILD="$(basename ${instfile%.install})"
+ PKG_CHILDREN[${#PKG_CHILDREN[@]}]="${CHILD}"
+ done
+ export PKG_CHILDREN
+ fi
+ if [[ ! -e ${PKG_DATA} ]]; then
+ echo "unknown package: ${PKG_NAME}" 1>&2
+ exit 1
+ fi
export PKG_STAT=${PKG_BASE}/stat/${PKG_ARCH}/${PKG_CFTARG}/${PKG_NAME}
- export PKG_DATA=$(echo "${PKG_BASE}"/data/"${PKG_NAME}"?(_))
export PKG_RVSN=$(cat "${PKG_STAT}/dest-ver" 2>/dev/null)
- if [[ -e "${PKG_DATA}/_metadata/zlib" ]]; then
+ if [[ -e "${PKG_DATA}/_metadata/${PKG_NAME}/zlib" ]]; then
+ export PKG_ZLIB=$(cat "${PKG_DATA}/_metadata/${PKG_NAME}/zlib")
+ elif [[ -e "${PKG_DATA}/_metadata/zlib" ]]; then
export PKG_ZLIB=$(cat "${PKG_DATA}/_metadata/zlib")
else
export PKG_ZLIB=lzma
fi
- if [[ -e "${PKG_DATA}/_metadata/version" ]]; then
+ if [[ -e "${PKG_DATA}/_metadata/${PKG_NAME}/version" ]]; then
+ export PKG_VRSN=$(cat "${PKG_DATA}/_metadata/${PKG_NAME}/version")
+ elif [[ -e "${PKG_DATA}/_metadata/version" ]]; then
export PKG_VRSN=$(cat "${PKG_DATA}/_metadata/version")
fi
- if [[ -e "${PKG_DATA}/_metadata/priority" ]]; then
+ if [[ -e "${PKG_DATA}/_metadata/${PKG_NAME}/priority" ]]; then
+ export PKG_PRIO=$(cat "${PKG_DATA}/_metadata/${PKG_NAME}/priority")
+ elif [[ -e "${PKG_DATA}/_metadata/priority" ]]; then
export PKG_PRIO=$(cat "${PKG_DATA}/_metadata/priority")
fi
- if [[ ! -e ${PKG_DATA} ]]; then
- echo "unknown package: ${PKG_NAME}" 1>&2
- exit 1
- fi
-
declare -a PKG_DEPS
+ for dep in "${PKG_DATA}/_metadata/${PKG_NAME}"/*.dep; do
+ PKG_DEPS[${#PKG_DEPS[@]}]=$(basename "${dep}" .dep)
+ done
+
for dep in "${PKG_DATA}"/_metadata/*.dep; do
PKG_DEPS[${#PKG_DEPS[@]}]=$(basename "${dep}" .dep)
done
+
+ for file in "${PKG_DATA}"/_metadata/* "${PKG_DATA}"/_metadata/${PKG_NAME}/*; do
+ key="$(basename ${file})"
+ if [[ ${key} == *."${PKG_ARCH}" ]]; then
+ key="${key%.${PKG_ARCH}}_ARCH"
+ elif [[ ${key} == *.* || ${key} == *-* ]]; then
+ continue
+ fi
+ variable="PKG_FILE_$(tr '[:lower:]' '[:upper:]' <<< ${key})";
+ declare "$variable"="${file}"
+ export $variable
+ done
+ export PKG_FILE_DESCRIPTION="${PKG_DATA}/_metadata/${PKG_NAME}/description"
fi
diff --git a/make.sh b/make.sh
index 969d5b838..639b862b9 100755
--- a/make.sh
+++ b/make.sh
@@ -58,6 +58,13 @@ function pkg:patch() {
pkg:libtool_ libtool
pkg:libtool_ ltmain.sh
+ if [ -f "debian/patches/series" ]; then
+ for diff in $(cut -d'#' -f1 < debian/patches/series); do
+ echo "patching with debian ${diff}..."
+ patch ${args:=-p1} < "debian/patches/${diff}"
+ done
+ fi
+
for diff in "${PKG_DATA}"/*.diff; do
if [[ ${diff} =~ .*/_[^/]*.diff$ ]]; then
continue;
@@ -67,6 +74,16 @@ function pkg:patch() {
echo "patching with ${diff}..."
patch ${args:=-p1} <"${diff}"
done
+
+ for diff in "${PKG_DATA}"/*.diff."${PKG_ARCH}"; do
+ if [[ ${diff} =~ .*/_[^/]*.diff.${PKG_ARCH}$ ]]; then
+ continue;
+ fi
+
+ args=$(cat ${diff%.diff}.args 2>/dev/null || true)
+ echo "patching with ${diff}..."
+ patch ${args:=-p1} <"${diff}"
+ done
}
export -f pkg:patch
@@ -93,7 +110,7 @@ function pkg:autoconf() {
patch -F 3 -r/dev/null "${m4}" "${PKG_BASE}/util/libtool.m4.diff" || true
done
- autoconf
+ autoconf
}
export -f pkg:autoconf
@@ -110,10 +127,13 @@ export -f pkg:libtool_
function pkg:setup() {
pkg:extract
- if [ -z ""*/ ]; then
- echo "Empty package??"
- exit 1
- fi
+ if [ -z ""*/ ]; then
+ echo "Empty package??"
+ exit 1
+ fi
+ if [ -d "debian" ]; then
+ mv debian "$(ls | grep -v debian)"
+ fi
cd */
pkg:patch
}
@@ -154,7 +174,7 @@ function pkg:install() {
export -f pkg:install
function pkg:extract() {
- for tgz in "${PKG_DATA}"/*.{tar.{gz,xz,bz2,lz},tgz}; do
+ for tgz in "${PKG_DATA}"/*.{tar.{gz,xz,bz2,lz,lzma},tgz}; do
tar -xf "${tgz}"
done
@@ -172,6 +192,47 @@ function pkg:usrbin() {
export -f pkg:usrbin
+function subpkg:stage_() {
+ shopt -s nullglob extglob
+ export PKG_PARENT="${PKG_NAME}"
+ for install in "${PKG_DATA}"/*.install; do
+ PKG_NAME="$(basename ${install} .install)"
+ . "${PKG_BASE}"/helper.sh
+ echo Staging subproject ${PKG_NAME}
+ IFS=$'\n' read -r -d '' -a PKG_DEB_GLOBS < ${install}
+ rm -rf "${PKG_DEST}"
+ for pkg_deb_glob in "${PKG_DEB_GLOBS[@]}"; do
+ for pkg_deb_file in "${PKG_PARENT_DEST}/"${pkg_deb_glob}; do
+ SRC_FILE="${pkg_deb_file}"
+ DST_FILE="${PKG_DEST}/${SRC_FILE/#${PKG_PARENT_DEST}*(\/)/}"
+ if [ -d "${pkg_deb_file}" ]; then
+ SRC_DIR="${SRC_FILE}"
+ DST_DIR="${DST_FILE}"
+ install -dvp "${SRC_DIR}" "${DST_DIR}"
+ cp -va "${SRC_DIR}" "${DST_DIR}"
+ else
+ SRC_DIR="$(dirname ${SRC_FILE})"
+ DST_DIR="$(dirname ${DST_FILE})"
+ if [ ! -d "${DST_DIR}" ]; then
+ install -dvp "${SRC_DIR}" "${DST_DIR}"
+ fi
+ cp -va "${SRC_FILE}" "${DST_FILE}"
+ fi
+ done
+ done
+ echo Staged subproject ${PKG_DEB_NAME}
+ done
+ echo done
+}
+
+export -f subpkg:stage_
+
+function subpkg:stage() {
+ ${FAKEROOT} bash -c "subpkg:stage_"
+}
+
+export -f subpkg:stage
+
cd "${PKG_WORK}"
"${PKG_BASE}/exec.sh" "${PKG_NAME}" . "${PKG_DATA}/make.sh"
@@ -201,6 +262,10 @@ rmdir_ "${PKG_DEST}/usr/local"
rmdir_ "${PKG_DEST}/usr/lib"
rmdir_ "${PKG_DEST}/usr"
+if grep -r "${PKG_BASE}" "${PKG_DEST}"; then
+ echo "WARNING - files contain ${PWD}"
+fi
+
if [[ -e "${PKG_BASE}/arch/${PKG_ARCH}/${PKG_CFTARG}/strip" ]]; then
. "${PKG_BASE}/arch/${PKG_ARCH}/${PKG_CFTARG}/strip"
fi
@@ -215,6 +280,7 @@ find "${PKG_DEST}" -type f -name '*.elc' -print0 | while read -r -d $'\0' bin; d
done
find "${PKG_DEST}" -type f -name '*.a' -print0 | while read -r -d $'\0' bin; do
+ chmod u+w "${bin}"
"${PKG_BASE}/util/arid" "${bin}"
done
diff --git a/package.sh b/package.sh
index ba8eefa7c..69ca724f1 100755
--- a/package.sh
+++ b/package.sh
@@ -15,14 +15,26 @@ export PKG_BASE=$(realpath "$(dirname "$0")")
# when running fakeroot, we shouldn't use the previous build result
# as we don't have the fakeroot session info anymore
-if [[ -z ${FAKEROOTKEY} ]]; then
- ./make.sh "${PKG_NAME}"
-else
- ./remake.sh "${PKG_NAME}"
+if [[ -z "${PKG_PARENT}" ]]; then
+ if [[ -z ${FAKEROOTKEY} ]]; then
+ ./make.sh "${PKG_NAME}"
+ else
+ ./remake.sh "${PKG_NAME}"
+ fi
fi
source "${PKG_BASE}/helper.sh"
+if [[ -n "${PKG_CHILDREN[0]}" ]]; then
+ export PKG_PARENT="${PKG_NAME}"
+ # metapackage
+ for child in "${PKG_CHILDREN[@]}"; do
+ echo Trying ${child}
+ "$0" ${child}
+ done
+ exit 0;
+fi
+
pkg: mkdir -p /DEBIAN
./control.sh "${PKG_NAME}" control >"$(pkg_ /DEBIAN/control)"
@@ -34,6 +46,8 @@ for script in preinst extrainst_ postinst prerm postrm; do
else
./exec.sh - ldid -S "$(pkg_ /DEBIAN)/${script}"
fi
+ elif [[ -e "${PKG_DATA}/_metadata/${script}.${PKG_ARCH}" ]]; then
+ cp -a "${PKG_DATA}/_metadata/${script}.${PKG_ARCH}" "$(pkg_ /DEBIAN)/${script}"
elif [[ -e "${PKG_DATA}/_metadata/${script}" ]]; then
cp -a "${PKG_DATA}/_metadata/${script}" "$(pkg_ /DEBIAN)"
fi
@@ -47,6 +61,10 @@ export PKG_HASH=$(util/catdir.sh "${PKG_DEST}" | md5sum | cut -d ' ' -f 1)
echo "hashed dest ${PKG_NAME} to: ${PKG_HASH}"
NEED_PACK=0
+if [ ! -d "${PKG_STAT}" ]; then
+ mkdir -p "${PKG_STAT}"
+fi
+
if [[ -z ${PKG_RVSN} || ! -e "${PKG_STAT}/dest-md5" || ${PKG_HASH} != $(cat "${PKG_STAT}/dest-md5" 2>/dev/null) ]]; then
if [[ -z ${PKG_RVSN} ]]; then
PKG_RVSN=1
@@ -55,14 +73,13 @@ if [[ -z ${PKG_RVSN} || ! -e "${PKG_STAT}/dest-md5" || ${PKG_HASH} != $(cat "${P
fi
NEED_PACK=1
fi
-export PKG_PACK=${PKG_BASE}/debs/${PKG_CFTARG}/${PKG_NAME}_${PKG_VRSN}-${PKG_RVSN}_${PKG_ARCH}.deb
+export PKG_PACK=${PKG_BASE}/debs/${PKG_CFTARG}/${PKG_NAME}_${PKG_VRSN//:/_}-${PKG_RVSN}_${PKG_ARCH}.deb
if [[ ${NEED_PACK} == 0 && -f "${PKG_PACK}" ]]; then
echo "skipping re-package of ${PKG_NAME}"
else
if [[ ! -d "${PKG_BASE}/debs/${PKG_CFTARG}" ]]; then
mkdir -p "${PKG_BASE}/debs/${PKG_CFTARG}"
fi
- export PKG_PACK=${PKG_BASE}/debs/${PKG_CFTARG}/${PKG_NAME}_${PKG_VRSN}-${PKG_RVSN}_${PKG_ARCH}.deb
if [[ -e ${PKG_PACK} ]]; then
echo "package ${PKG_PACK} already exists..."
else