summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/oh-buildopk22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/oh-buildopk b/src/oh-buildopk
index d64dbfe..d743824 100644
--- a/src/oh-buildopk
+++ b/src/oh-buildopk
@@ -31,6 +31,26 @@ fi
# Iterate over packages.
while [ ${#} -gt 0 ]; do
- printf 'This program is a stub.\n'
+ # Write debian-binary.
+ echo '2.0' > debian-binary
+ # Pack data.tar.gz.
+ cd ${1}
+ pwd
+ tar -czf ../data.tar.gz .
+ cd ..
+ # Pack control.tar.gz.
+ mkdir control
+ cp ../${1}.pkg/control control
+ [ -f ../${1}.pkg/preinst ] && cp ../${1}.pkg/preinst control
+ [ -f ../${1}.pkg/postinst ] && cp ../${1}.pkg/postinst control
+ [ -f ../${1}.pkg/prerm ] && cp ../${1}.pkg/prerm control
+ [ -f ../${1}.pkg/postrm ] && cp ../${1}.pkg/postrm control
+ cd control
+ tar -czf ../control.tar.gz .
+ cd ..
+ # Pack opk file.
+ tar -czf ../../${1}_pkgver-pkgrev_arch.opk \
+ debian-binary data.tar.gz control.tar.gz
+ rm -Rf debian-binary control data.tar.gz control.tar.gz
shift
done