summaryrefslogtreecommitdiff
authorkergoth <kergoth>2002-09-22 22:19:53 (UTC)
committer kergoth <kergoth>2002-09-22 22:19:53 (UTC)
commit3049d9418b882283814ca71baa98420b2a6745db (patch) (unidiff)
tree33d42d9e076b995cdb7a45603fe59f88dfc2025a
parent3f194c85b5b9243ff30f1067361ef9fa5bb85a1e (diff)
downloadopie-3049d9418b882283814ca71baa98420b2a6745db.zip
opie-3049d9418b882283814ca71baa98420b2a6745db.tar.gz
opie-3049d9418b882283814ca71baa98420b2a6745db.tar.bz2
Changed a couple minor paths to allow one to run mkipks from somewhere other than
Diffstat (more/less context) (ignore whitespace changes)
-rwxr-xr-xmkipks16
1 files changed, 7 insertions, 9 deletions
diff --git a/mkipks b/mkipks
index af1bb4d..982a007 100755
--- a/mkipks
+++ b/mkipks
@@ -1,40 +1,37 @@
1#!/bin/sh 1#!/bin/sh
2 2
3QTE_VERSION=2.3.4 3QTE_VERSION=2.3.4
4DEB_VERSION=2.0 4DEB_VERSION=2.0
5 5
6# Have to do this here, since CVS can't store symlinks 6# Have to do this here, since CVS can't store symlinks
7mkdir -p etc/rc2.d 7mkdir -p $OPIEDIR/etc/rc2.d
8rm -f etc/rc2.d/S98opie 8ln -sf ../init.d/opie $OPIEDIR/etc/rc2.d/S98opie
9ln -s ../init.d/opie etc/rc2.d/S98opie
10 9
11mkdir -p etc/rcS.d 10mkdir -p $OPIEDIR/etc/rcS.d
12rm -f etc/rcS.d/S01bootsplash 11ln -sf ../init.d/bootsplash $OPIEDIR/etc/rcS.d/S01bootsplash
13ln -s ../init.d/bootsplash etc/rcS.d/S01bootsplash
14 12
15rm -f ipaq/etc/rc2.d/S96opieatd 13ln -sf ../init.d/opieatd $OPIEDIR/ipaq/etc/rc2.d/S96opieatd
16ln -s ../init.d/opieatd ipaq/etc/rc2.d/S96opieatd
17 14
18 15
19 16
20VERSION_MAJ=$(sed -n -e 's/.*QPE_VERSION "\([0-9]*\)\..*\..*".*/\1/p' <$OPIEDIR/include/qpe/version.h) 17VERSION_MAJ=$(sed -n -e 's/.*QPE_VERSION "\([0-9]*\)\..*\..*".*/\1/p' <$OPIEDIR/include/qpe/version.h)
21VERSION_MIN=$(sed -n -e 's/.*QPE_VERSION ".*\.\([0-9]*\)\..*".*/\1/p' <$OPIEDIR/include/qpe/version.h) 18VERSION_MIN=$(sed -n -e 's/.*QPE_VERSION ".*\.\([0-9]*\)\..*".*/\1/p' <$OPIEDIR/include/qpe/version.h)
22VERSION_PAT=$(sed -n -e 's/.*QPE_VERSION ".*\..*\.\([0-9]*\).*/\1/p' <$OPIEDIR/include/qpe/version.h) 19VERSION_PAT=$(sed -n -e 's/.*QPE_VERSION ".*\..*\.\([0-9]*\).*/\1/p' <$OPIEDIR/include/qpe/version.h)
23SUB_VERSION=$(sed -n -e 's,.*SUB_VERSION \"\(.*\)\".*,\1,p' <$OPIEDIR/include/qpe/version.h) 20SUB_VERSION=$(sed -n -e 's,.*SUB_VERSION \"\(.*\)\".*,\1,p' <$OPIEDIR/include/qpe/version.h)
24if grep -q 'QPE_VERSION .*snapshot' $OPIEDIR/include/qpe/version.h 21if grep -q 'QPE_VERSION .*snapshot' $OPIEDIR/include/qpe/version.h
25then 22then
26 VERSION_CVS="$(date +%Y%m%d)" 23 VERSION_CVS="$(date +%Y%m%d)"
27 SUB_VERSION=$VERSION_CVS 24 SUB_VERSION=$VERSION_CVS
28else 25else
29 VERSION_CVS="" 26 VERSION_CVS=""
30fi 27fi
31 28
32QPE_VERSION=$VERSION_MAJ.$VERSION_MIN.$VERSION_PAT 29QPE_VERSION=$VERSION_MAJ.$VERSION_MIN.$VERSION_PAT
33 30
34ARCH=arm 31ARCH=arm
35STRIP=arm-linux-strip 32STRIP=arm-linux-strip
36STRIP_FILES="*ARM*not stripped" 33STRIP_FILES="*ARM*not stripped"
37 34
38TDIR=/tmp/ipk$$ 35TDIR=/tmp/ipk$$
39DATADIR=$TDIR 36DATADIR=$TDIR
40CTRLDIR=$TDIR/CONTROL 37CTRLDIR=$TDIR/CONTROL
@@ -71,48 +68,49 @@ do
71 shift 68 shift
72 ARCH=$1 69 ARCH=$1
73 STRIP= 70 STRIP=
74 STRIP_FILES= 71 STRIP_FILES=
75 ;; /*) 72 ;; /*)
76 FILES="$FILES $1" 73 FILES="$FILES $1"
77 ;; *) 74 ;; *)
78 FILES="$FILES $PWD/$1" 75 FILES="$FILES $PWD/$1"
79 esac 76 esac
80 shift 77 shift
81done 78done
82 79
83if [ -n "$CLASSIC" ] 80if [ -n "$CLASSIC" ]
84then 81then
85 DATADIR=$TDIR/data 82 DATADIR=$TDIR/data
86 CTRLDIR=$TDIR/control 83 CTRLDIR=$TDIR/control
87fi 84fi
88 85
89if [ -z "$FILES" ] 86if [ -z "$FILES" ]
90then 87then
91 FILES=`find $OPIEDIR -name "*.control" -print` 88 FILES=`find $OPIEDIR -name "*.control" -print`
92fi 89fi
93 90
94RDIR=$PWD 91RDIR=$PWD
92ORIGDIR=`pwd`
95cd $OPIEDIR 93cd $OPIEDIR
96 94
97for i in $FILES 95for i in $FILES
98do 96do
99 rm -rf $TDIR 97 rm -rf $TDIR
100 98
101 mkdir -p $DATADIR 99 mkdir -p $DATADIR
102 mkdir -p $CTRLDIR 100 mkdir -p $CTRLDIR
103 101
104 packagename=${i##*/}; packagename=${packagename%.control} 102 packagename=${i##*/}; packagename=${packagename%.control}
105 version=$(eval echo '"'$(sed -n -e "s/^Version: *//p" $i)'"') 103 version=$(eval echo '"'$(sed -n -e "s/^Version: *//p" $i)'"')
106 depends=$(eval echo '"'$(sed -n -e "s/^Depends: *//p" $i)'"') 104 depends=$(eval echo '"'$(sed -n -e "s/^Depends: *//p" $i)'"')
107 files=$(eval echo $(sed -n -e "s/^Files://p" $i)) 105 files=$(eval echo $(sed -n -e "s/^Files://p" $i))
108 arch=$(eval echo $(sed -n -e "s/^Arch://p" $i)) 106 arch=$(eval echo $(sed -n -e "s/^Arch://p" $i))
109 section=$(sed -n -e "s/^Section: *//p" $i) 107 section=$(sed -n -e "s/^Section: *//p" $i)
110 provides=$(sed -n -e "s/^Provides: *//p" $i) 108 provides=$(sed -n -e "s/^Provides: *//p" $i)
111 conflicts=$(sed -n -e "s/^Conflicts: *//p" $i) 109 conflicts=$(sed -n -e "s/^Conflicts: *//p" $i)
112 license=$(sed -n -e "s/^License: *//p" $i) 110 license=$(sed -n -e "s/^License: *//p" $i)
113 summary=$(sed -n -e "s/^Description: *//p" $i) 111 summary=$(sed -n -e "s/^Description: *//p" $i)
114 package=${packagename}_${version}_$ARCH 112 package=${packagename}_${version}_$ARCH
115 ERROR= 113 ERROR=
116 if [ -z "$files" ] 114 if [ -z "$files" ]
117 then 115 then
118 mkdir -p $DATADIR/usr/share/doc/$packagename 116 mkdir -p $DATADIR/usr/share/doc/$packagename
@@ -211,49 +209,49 @@ do
211 then 209 then
212 echo "Warning, no mkfs.jffs2 found, unable to set Installed-Size." 210 echo "Warning, no mkfs.jffs2 found, unable to set Installed-Size."
213 SIZEWARNED=1 211 SIZEWARNED=1
214 fi 212 fi
215 fi 213 fi
216 echo "Architecture: $ARCH" >>$CTRLDIR/control 214 echo "Architecture: $ARCH" >>$CTRLDIR/control
217 echo "Filename: ./$package.ipk" >>$CTRLDIR/control 215 echo "Filename: ./$package.ipk" >>$CTRLDIR/control
218 echo "Version: $version" >>$CTRLDIR/control 216 echo "Version: $version" >>$CTRLDIR/control
219 [ ! -z "$depends" ] && echo "Depends: $depends" >>$CTRLDIR/control 217 [ ! -z "$depends" ] && echo "Depends: $depends" >>$CTRLDIR/control
220 [ ! -z "$provides" ] && echo "Provides: $provides" >>$CTRLDIR/control 218 [ ! -z "$provides" ] && echo "Provides: $provides" >>$CTRLDIR/control
221 [ ! -z "$conflicts" ] && echo "Conflicts: $conflicts" >>$CTRLDIR/control 219 [ ! -z "$conflicts" ] && echo "Conflicts: $conflicts" >>$CTRLDIR/control
222 egrep -v "^(Files|Version|Depends|Provides|Conflicts|Architecture):" >>$CTRLDIR/control $i 220 egrep -v "^(Files|Version|Depends|Provides|Conflicts|Architecture):" >>$CTRLDIR/control $i
223 [ -n "$CLASSIC" ] && echo "$DEB_VERSION" >$TDIR/debian-binary 221 [ -n "$CLASSIC" ] && echo "$DEB_VERSION" >$TDIR/debian-binary
224 base=${i%.control} 222 base=${i%.control}
225 scripts="preinst postinst prerm postrm" 223 scripts="preinst postinst prerm postrm"
226 for pf in $scripts 224 for pf in $scripts
227 do 225 do
228 if [ -x ${base}.$pf ] 226 if [ -x ${base}.$pf ]
229 then 227 then
230 cp ${base}.$pf $CTRLDIR/$pf 228 cp ${base}.$pf $CTRLDIR/$pf
231 fi 229 fi
232 done 230 done
233 if [ -z "$CLASSIC" ] 231 if [ -z "$CLASSIC" ]
234 then 232 then
235 $OPIEDIR/scripts/ipkg-build -o root -g root $TDIR 233 cd $ORIGDIR; $OPIEDIR/scripts/ipkg-build -o root -g root $TDIR; cd $OPIEDIR;
236 else 234 else
237 if [ "`id -u`" != "0" ] 235 if [ "`id -u`" != "0" ]
238 then 236 then
239 if [ -z "$ROOTWARNED" ] 237 if [ -z "$ROOTWARNED" ]
240 then 238 then
241 echo Warning. You are not root. Please become root or use fakeroot. 239 echo Warning. You are not root. Please become root or use fakeroot.
242 ROOTWARNED=1 240 ROOTWARNED=1
243 fi 241 fi
244 else 242 else
245 chown -R root.root $TDIR/* 243 chown -R root.root $TDIR/*
246 fi 244 fi
247 ( cd $DATADIR && tar -czf $TDIR/data.tar.gz * ) 245 ( cd $DATADIR && tar -czf $TDIR/data.tar.gz * )
248 ( cd $CTRLDIR && tar -czf $TDIR/control.tar.gz * ) 246 ( cd $CTRLDIR && tar -czf $TDIR/control.tar.gz * )
249 ( cd $TDIR && tar -czf $OPIEDIR/$package.ipk ./control.tar.gz ./data.tar.gz ./debian-binary ) 247 ( cd $TDIR && tar -czf $OPIEDIR/$package.ipk ./control.tar.gz ./data.tar.gz ./debian-binary )
250 fi 248 fi
251 RESULT=$package.ipk 249 RESULT=$package.ipk
252 if [ -n "$VERB" ] 250 if [ -n "$VERB" ]
253 then 251 then
254 echo >&2 "Built $RESULT ($size)" 252 echo >&2 "Built $RESULT ($size)"
255 fi 253 fi
256 if [ -n "$LIST" ] 254 if [ -n "$LIST" ]
257 then 255 then
258 echo $RESULT 256 echo $RESULT
259 fi 257 fi