|
|
@@ -108,6 +108,32 @@ build()
|
|
|
|
|
|
tar zcf $ROOT/data.tar.gz -C root --owner=0 --group=0 .
|
|
|
tar zcf $OUTPUTDIR/smartdns.$VER.$FILEARCH.ipk --owner=0 --group=0 ./control.tar.gz ./data.tar.gz ./debian-binary
|
|
|
+
|
|
|
+ which apk >/dev/null 2>&1
|
|
|
+ if [ $? -eq 0 ]; then
|
|
|
+ APK_VER="`echo $VER | sed 's/[-]/-r/'`"
|
|
|
+ ARCH="`echo $ARCH | sed 's/all/noarch/g'`"
|
|
|
+ apk mkpkg \
|
|
|
+ --info "name:smartdns" \
|
|
|
+ --info "version:$APK_VER" \
|
|
|
+ --info "description:A smartdns Server" \
|
|
|
+ --info "arch:$ARCH" \
|
|
|
+ --info "license:GPL" \
|
|
|
+ --info "origin: https://github.com/pymumu/smartdns.git" \
|
|
|
+ --info "depends:libc libpthread" \
|
|
|
+ --script "post-install:$ROOT/control/postinst" \
|
|
|
+ --script "pre-deinstall:$ROOT/control/prerm" \
|
|
|
+ --files "$ROOT/root/" \
|
|
|
+ --output "$OUTPUTDIR/smartdns.$VER.$FILEARCH.apk"
|
|
|
+ if [ $? -ne 0 ]; then
|
|
|
+ echo "build apk package failed."
|
|
|
+ rm -fr $ROOT/
|
|
|
+ return 1
|
|
|
+ fi
|
|
|
+ else
|
|
|
+ echo "== warning: apk tool not found, skip build apk package. =="
|
|
|
+ fi
|
|
|
+
|
|
|
rm -fr $ROOT/
|
|
|
}
|
|
|
|