summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rwxr-xr-xmkipks29
1 files changed, 3 insertions, 26 deletions
diff --git a/mkipks b/mkipks
index 982a007..63d1e22 100755
--- a/mkipks
+++ b/mkipks
@@ -50,17 +50,17 @@ do
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
@@ -72,22 +72,16 @@ do
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
78done 78done
79 79
80if [ -n "$CLASSIC" ]
81then
82 DATADIR=$TDIR/data
83 CTRLDIR=$TDIR/control
84fi
85
86if [ -z "$FILES" ] 80if [ -z "$FILES" ]
87then 81then
88 FILES=`find $OPIEDIR -name "*.control" -print` 82 FILES=`find $OPIEDIR -name "*.control" -print`
89fi 83fi
90 84
91RDIR=$PWD 85RDIR=$PWD
92ORIGDIR=`pwd` 86ORIGDIR=`pwd`
93cd $OPIEDIR 87cd $OPIEDIR
@@ -213,44 +207,27 @@ do
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