summaryrefslogtreecommitdiffstats
path: root/src/oh-buildopk
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2012-01-21 00:14:02 (EST)
committer P. J. McDermott <pjm@nac.net>2012-01-21 00:14:02 (EST)
commit5248d43ba586271151d47f152fc196cddc9bb87b (patch)
tree455f16876a5d3499135367419fe258db9afb5c7c /src/oh-buildopk
parent7a7ea92b9643f99c8c240a61b4a55ea7f40a0a78 (diff)
Write a proof-of-concept oh-buildopk.
Diffstat (limited to 'src/oh-buildopk')
-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