summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--abuild.in39
1 files changed, 37 insertions, 2 deletions
diff --git a/abuild.in b/abuild.in
index be81a66..159c98d 100644
--- a/abuild.in
+++ b/abuild.in
@@ -695,6 +695,12 @@ postcheck() {
&& ! is_openrc_pkg "$name"; then
warning "Found OpenRC directory (/etc/conf.d or /etc/init.d) but name doesn't end with -openrc"
fi
+ # look for static archives
+ if ! is_static_pkg "$name"; then
+ for i in $(find "$dir"/lib "$dir"/usr/lib -name '*.a' 2>/dev/null); do
+ warning "Found static archive on ${i##*$dir/} but name doesn't end with -static"
+ done
+ fi
# look for /usr/share/doc
if [ -e "$dir"/usr/share/doc ] \
&& ! is_doc_pkg "$name"; then
@@ -1108,6 +1114,11 @@ is_dev_pkg() {
test "${subpkgname%-dev}" != "$subpkgname"
}
+# returns true if this is the -static package
+is_static_pkg() {
+ test "${1%-static}" != "$1"
+}
+
# returns true if this is the -doc package
is_doc_pkg() {
test "${1%-doc}" != "$1"
@@ -1125,7 +1136,7 @@ archcheck() {
[ "${subpkgarch:-$pkgarch}" != "noarch" ] && return 0
error "Arch specific binaries found so arch must not be set to \"noarch\""
return 1
- elif [ "${subpkgarch:-$pkgarch}" != "noarch" ] && ! is_dev_pkg; then
+ elif [ "${subpkgarch:-$pkgarch}" != "noarch" ] && ! is_dev_pkg && ! is_static_pkg "$subpkgname"; then
# we dont want -dev package go to noarch
warning "No arch specific binaries found so arch should probably be set to \"noarch\""
fi
@@ -1705,7 +1716,9 @@ default_dev() {
usr/lib/qt*/mkspecs \
usr/lib/cmake \
$(find . -name include -type d) \
- $(find $libdirs -name '*.[acho]' \
+ $([ -z "${subpackages##*$pkgname-static*}" ] && find $libdirs \
+ -name '*.a' 2>/dev/null) \
+ $(find $libdirs -name '*.[cho]' \
-o -name '*.prl' 2>/dev/null); do
if [ -e "$pkgdir/$i" ] || [ -L "$pkgdir/$i" ]; then
d="$subpkgdir/${i%/*}" # dirname $i
@@ -1728,6 +1741,28 @@ dev() {
default_dev
}
+# predefined splitfunc static
+default_static() {
+ local i=
+ depends=""
+ pkgdesc="$pkgdesc (static library)"
+
+ cd "$pkgdir" || return 0
+ local libdirs=usr/lib
+ [ -d lib/ ] && libdirs="lib/ $libdirs"
+
+ # move *.a static library
+ for i in $(find $libdir -name '*.a'); do
+ mkdir -p "$subpkgdir"/"${i%/*}"
+ mv "$i" "$subpkgdir/$i" || return 1
+ done
+ return 0
+}
+
+static() {
+ default_static
+}
+
# predefined splitfunc libs
default_libs() {
depends="$depends_libs"