author | kergoth <kergoth> | 2002-09-22 22:19:53 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2002-09-22 22:19:53 (UTC) |
commit | 3049d9418b882283814ca71baa98420b2a6745db (patch) (unidiff) | |
tree | 33d42d9e076b995cdb7a45603fe59f88dfc2025a | |
parent | 3f194c85b5b9243ff30f1067361ef9fa5bb85a1e (diff) | |
download | opie-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
-rwxr-xr-x | mkipks | 16 |
1 files changed, 7 insertions, 9 deletions
@@ -1,40 +1,37 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | 2 | ||
3 | QTE_VERSION=2.3.4 | 3 | QTE_VERSION=2.3.4 |
4 | DEB_VERSION=2.0 | 4 | DEB_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 |
7 | mkdir -p etc/rc2.d | 7 | mkdir -p $OPIEDIR/etc/rc2.d |
8 | rm -f etc/rc2.d/S98opie | 8 | ln -sf ../init.d/opie $OPIEDIR/etc/rc2.d/S98opie |
9 | ln -s ../init.d/opie etc/rc2.d/S98opie | ||
10 | 9 | ||
11 | mkdir -p etc/rcS.d | 10 | mkdir -p $OPIEDIR/etc/rcS.d |
12 | rm -f etc/rcS.d/S01bootsplash | 11 | ln -sf ../init.d/bootsplash $OPIEDIR/etc/rcS.d/S01bootsplash |
13 | ln -s ../init.d/bootsplash etc/rcS.d/S01bootsplash | ||
14 | 12 | ||
15 | rm -f ipaq/etc/rc2.d/S96opieatd | 13 | ln -sf ../init.d/opieatd $OPIEDIR/ipaq/etc/rc2.d/S96opieatd |
16 | ln -s ../init.d/opieatd ipaq/etc/rc2.d/S96opieatd | ||
17 | 14 | ||
18 | 15 | ||
19 | 16 | ||
20 | VERSION_MAJ=$(sed -n -e 's/.*QPE_VERSION "\([0-9]*\)\..*\..*".*/\1/p' <$OPIEDIR/include/qpe/version.h) | 17 | VERSION_MAJ=$(sed -n -e 's/.*QPE_VERSION "\([0-9]*\)\..*\..*".*/\1/p' <$OPIEDIR/include/qpe/version.h) |
21 | VERSION_MIN=$(sed -n -e 's/.*QPE_VERSION ".*\.\([0-9]*\)\..*".*/\1/p' <$OPIEDIR/include/qpe/version.h) | 18 | VERSION_MIN=$(sed -n -e 's/.*QPE_VERSION ".*\.\([0-9]*\)\..*".*/\1/p' <$OPIEDIR/include/qpe/version.h) |
22 | VERSION_PAT=$(sed -n -e 's/.*QPE_VERSION ".*\..*\.\([0-9]*\).*/\1/p' <$OPIEDIR/include/qpe/version.h) | 19 | VERSION_PAT=$(sed -n -e 's/.*QPE_VERSION ".*\..*\.\([0-9]*\).*/\1/p' <$OPIEDIR/include/qpe/version.h) |
23 | SUB_VERSION=$(sed -n -e 's,.*SUB_VERSION \"\(.*\)\".*,\1,p' <$OPIEDIR/include/qpe/version.h) | 20 | SUB_VERSION=$(sed -n -e 's,.*SUB_VERSION \"\(.*\)\".*,\1,p' <$OPIEDIR/include/qpe/version.h) |
24 | if grep -q 'QPE_VERSION .*snapshot' $OPIEDIR/include/qpe/version.h | 21 | if grep -q 'QPE_VERSION .*snapshot' $OPIEDIR/include/qpe/version.h |
25 | then | 22 | then |
26 | VERSION_CVS="$(date +%Y%m%d)" | 23 | VERSION_CVS="$(date +%Y%m%d)" |
27 | SUB_VERSION=$VERSION_CVS | 24 | SUB_VERSION=$VERSION_CVS |
28 | else | 25 | else |
29 | VERSION_CVS="" | 26 | VERSION_CVS="" |
30 | fi | 27 | fi |
31 | 28 | ||
32 | QPE_VERSION=$VERSION_MAJ.$VERSION_MIN.$VERSION_PAT | 29 | QPE_VERSION=$VERSION_MAJ.$VERSION_MIN.$VERSION_PAT |
33 | 30 | ||
34 | ARCH=arm | 31 | ARCH=arm |
35 | STRIP=arm-linux-strip | 32 | STRIP=arm-linux-strip |
36 | STRIP_FILES="*ARM*not stripped" | 33 | STRIP_FILES="*ARM*not stripped" |
37 | 34 | ||
38 | TDIR=/tmp/ipk$$ | 35 | TDIR=/tmp/ipk$$ |
39 | DATADIR=$TDIR | 36 | DATADIR=$TDIR |
40 | CTRLDIR=$TDIR/CONTROL | 37 | CTRLDIR=$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 |
81 | done | 78 | done |
82 | 79 | ||
83 | if [ -n "$CLASSIC" ] | 80 | if [ -n "$CLASSIC" ] |
84 | then | 81 | then |
85 | DATADIR=$TDIR/data | 82 | DATADIR=$TDIR/data |
86 | CTRLDIR=$TDIR/control | 83 | CTRLDIR=$TDIR/control |
87 | fi | 84 | fi |
88 | 85 | ||
89 | if [ -z "$FILES" ] | 86 | if [ -z "$FILES" ] |
90 | then | 87 | then |
91 | FILES=`find $OPIEDIR -name "*.control" -print` | 88 | FILES=`find $OPIEDIR -name "*.control" -print` |
92 | fi | 89 | fi |
93 | 90 | ||
94 | RDIR=$PWD | 91 | RDIR=$PWD |
92 | ORIGDIR=`pwd` | ||
95 | cd $OPIEDIR | 93 | cd $OPIEDIR |
96 | 94 | ||
97 | for i in $FILES | 95 | for i in $FILES |
98 | do | 96 | do |
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 |