author | kergoth <kergoth> | 2002-09-24 20:58:00 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2002-09-24 20:58:00 (UTC) |
commit | 93be75ceab687091f76a459eb34bfd4859986116 (patch) (unidiff) | |
tree | fdb4028af020b4a5a388270c88d68c45544b8a57 | |
parent | 16b7ec203f0306b911cbb1ee90f75cef9dcc3938 (diff) | |
download | opie-93be75ceab687091f76a459eb34bfd4859986116.zip opie-93be75ceab687091f76a459eb34bfd4859986116.tar.gz opie-93be75ceab687091f76a459eb34bfd4859986116.tar.bz2 |
Make mkipks use ipkg-build [-c].
-rwxr-xr-x | mkipks | 29 |
1 files changed, 3 insertions, 26 deletions
@@ -42,60 +42,54 @@ LIST= | |||
42 | RPM= | 42 | RPM= |
43 | 43 | ||
44 | while [ $# -ne 0 ] | 44 | while [ $# -ne 0 ] |
45 | do | 45 | do |
46 | case "$1" in | 46 | case "$1" in |
47 | -v) | 47 | -v) |
48 | VERB=1 | 48 | VERB=1 |
49 | echo >&2 "Packaging for version $VERSION_MAJ.$VERSION_MIN.$VERSION_PAT$VERSION_CVS" | 49 | echo >&2 "Packaging for version $VERSION_MAJ.$VERSION_MIN.$VERSION_PAT$VERSION_CVS" |
50 | ;; -l) | 50 | ;; -l) |
51 | LIST=1 | 51 | LIST=1 |
52 | ;; -i) | 52 | ;; -i) |
53 | shift | 53 | shift |
54 | IMAGEDIR=$1 | 54 | IMAGEDIR=$1 |
55 | DATADIR=$IMAGEDIR | 55 | DATADIR=$IMAGEDIR |
56 | mkdir -p $IMAGEDIR | 56 | mkdir -p $IMAGEDIR |
57 | ;; -classic) | 57 | ;; -classic) |
58 | CLASSIC=1 | 58 | classicopts=-c |
59 | ;; -rpm) | 59 | ;; -rpm) |
60 | if [ "$OPIEDIR" != "/opt/Qtopia" ] | 60 | if [ "$OPIEDIR" != "/opt/Qtopia" ] |
61 | then | 61 | then |
62 | echo >&2 '$OPIEDIR is not the standard /usr/Qtopia directory.' | 62 | echo >&2 '$OPIEDIR is not the standard /usr/Qtopia directory.' |
63 | sleep 1 | 63 | sleep 1 |
64 | #exit 1 | 64 | #exit 1 |
65 | fi | 65 | fi |
66 | RPM=1 | 66 | RPM=1 |
67 | ;; -arch) | 67 | ;; -arch) |
68 | shift | 68 | shift |
69 | ARCH=$1 | 69 | ARCH=$1 |
70 | STRIP= | 70 | STRIP= |
71 | STRIP_FILES= | 71 | STRIP_FILES= |
72 | ;; /*) | 72 | ;; /*) |
73 | FILES="$FILES $1" | 73 | FILES="$FILES $1" |
74 | ;; *) | 74 | ;; *) |
75 | FILES="$FILES $PWD/$1" | 75 | FILES="$FILES $PWD/$1" |
76 | esac | 76 | esac |
77 | shift | 77 | shift |
78 | done | 78 | done |
79 | 79 | ||
80 | if [ -n "$CLASSIC" ] | ||
81 | then | ||
82 | DATADIR=$TDIR/data | ||
83 | CTRLDIR=$TDIR/control | ||
84 | fi | ||
85 | |||
86 | if [ -z "$FILES" ] | 80 | if [ -z "$FILES" ] |
87 | then | 81 | then |
88 | FILES=`find $OPIEDIR -name "*.control" -print` | 82 | FILES=`find $OPIEDIR -name "*.control" -print` |
89 | fi | 83 | fi |
90 | 84 | ||
91 | RDIR=$PWD | 85 | RDIR=$PWD |
92 | ORIGDIR=`pwd` | 86 | ORIGDIR=`pwd` |
93 | cd $OPIEDIR | 87 | cd $OPIEDIR |
94 | 88 | ||
95 | for i in $FILES | 89 | for i in $FILES |
96 | do | 90 | do |
97 | rm -rf $TDIR | 91 | rm -rf $TDIR |
98 | 92 | ||
99 | mkdir -p $DATADIR | 93 | mkdir -p $DATADIR |
100 | mkdir -p $CTRLDIR | 94 | mkdir -p $CTRLDIR |
101 | 95 | ||
@@ -205,60 +199,43 @@ do | |||
205 | if [ ! -z "$size" ]; then | 199 | if [ ! -z "$size" ]; then |
206 | echo "Installed-Size: $size" >>$CTRLDIR/control | 200 | echo "Installed-Size: $size" >>$CTRLDIR/control |
207 | else | 201 | else |
208 | if [ -z "$SIZEWARNED" ] | 202 | if [ -z "$SIZEWARNED" ] |
209 | then | 203 | then |
210 | echo "Warning, no mkfs.jffs2 found, unable to set Installed-Size." | 204 | echo "Warning, no mkfs.jffs2 found, unable to set Installed-Size." |
211 | SIZEWARNED=1 | 205 | SIZEWARNED=1 |
212 | fi | 206 | fi |
213 | fi | 207 | fi |
214 | echo "Architecture: $ARCH" >>$CTRLDIR/control | 208 | echo "Architecture: $ARCH" >>$CTRLDIR/control |
215 | echo "Filename: ./$package.ipk" >>$CTRLDIR/control | 209 | echo "Filename: ./$package.ipk" >>$CTRLDIR/control |
216 | echo "Version: $version" >>$CTRLDIR/control | 210 | echo "Version: $version" >>$CTRLDIR/control |
217 | [ ! -z "$depends" ] && echo "Depends: $depends" >>$CTRLDIR/control | 211 | [ ! -z "$depends" ] && echo "Depends: $depends" >>$CTRLDIR/control |
218 | [ ! -z "$provides" ] && echo "Provides: $provides" >>$CTRLDIR/control | 212 | [ ! -z "$provides" ] && echo "Provides: $provides" >>$CTRLDIR/control |
219 | [ ! -z "$conflicts" ] && echo "Conflicts: $conflicts" >>$CTRLDIR/control | 213 | [ ! -z "$conflicts" ] && echo "Conflicts: $conflicts" >>$CTRLDIR/control |
220 | egrep -v "^(Files|Version|Depends|Provides|Conflicts|Architecture):" >>$CTRLDIR/control $i | 214 | egrep -v "^(Files|Version|Depends|Provides|Conflicts|Architecture):" >>$CTRLDIR/control $i |
221 | [ -n "$CLASSIC" ] && echo "$DEB_VERSION" >$TDIR/debian-binary | 215 | [ -n "$classicopts" ] && echo "$DEB_VERSION" >$TDIR/debian-binary |
222 | base=${i%.control} | 216 | base=${i%.control} |
223 | scripts="preinst postinst prerm postrm" | 217 | scripts="preinst postinst prerm postrm" |
224 | for pf in $scripts | 218 | for pf in $scripts |
225 | do | 219 | do |
226 | if [ -x ${base}.$pf ] | 220 | if [ -x ${base}.$pf ] |
227 | then | 221 | then |
228 | cp ${base}.$pf $CTRLDIR/$pf | 222 | cp ${base}.$pf $CTRLDIR/$pf |
229 | fi | 223 | fi |
230 | done | 224 | done |
231 | if [ -z "$CLASSIC" ] | 225 | cd $ORIGDIR; $OPIEDIR/scripts/ipkg-build $classicopts -o root -g root $TDIR; cd $OPIEDIR; |
232 | then | ||
233 | cd $ORIGDIR; $OPIEDIR/scripts/ipkg-build -o root -g root $TDIR; cd $OPIEDIR; | ||
234 | else | ||
235 | if [ "`id -u`" != "0" ] | ||
236 | then | ||
237 | if [ -z "$ROOTWARNED" ] | ||
238 | then | ||
239 | echo Warning. You are not root. Please become root or use fakeroot. | ||
240 | ROOTWARNED=1 | ||
241 | fi | ||
242 | else | ||
243 | chown -R root.root $TDIR/* | ||
244 | fi | ||
245 | ( cd $DATADIR && tar -czf $TDIR/data.tar.gz * ) | ||
246 | ( cd $CTRLDIR && tar -czf $TDIR/control.tar.gz * ) | ||
247 | ( cd $TDIR && tar -czf $OPIEDIR/$package.ipk ./control.tar.gz ./data.tar.gz ./debian-binary ) | ||
248 | fi | ||
249 | RESULT=$package.ipk | 226 | RESULT=$package.ipk |
250 | if [ -n "$VERB" ] | 227 | if [ -n "$VERB" ] |
251 | then | 228 | then |
252 | echo >&2 "Built $RESULT ($size)" | 229 | echo >&2 "Built $RESULT ($size)" |
253 | fi | 230 | fi |
254 | if [ -n "$LIST" ] | 231 | if [ -n "$LIST" ] |
255 | then | 232 | then |
256 | echo $RESULT | 233 | echo $RESULT |
257 | fi | 234 | fi |
258 | fi | 235 | fi |
259 | else | 236 | else |
260 | echo >&2 "Not building $package package" | 237 | echo >&2 "Not building $package package" |
261 | fi | 238 | fi |
262 | done | 239 | done |
263 | # clean up | 240 | # clean up |
264 | rm -rf $TDIR | 241 | rm -rf $TDIR |