summaryrefslogtreecommitdiff
path: root/scripts/GeneratePackageMake
authorwimpie <wimpie>2005-01-09 03:02:21 (UTC)
committer wimpie <wimpie>2005-01-09 03:02:21 (UTC)
commit67d1d0b292553af550219d770cbd5c00987d8b8b (patch) (unidiff)
tree517759c7fbda44a40ff733e3b5d5667d90558caa /scripts/GeneratePackageMake
parent987bc9a2c5b39ddd4dc2a665cea65688bfd2179e (diff)
downloadopie-67d1d0b292553af550219d770cbd5c00987d8b8b.zip
opie-67d1d0b292553af550219d770cbd5c00987d8b8b.tar.gz
opie-67d1d0b292553af550219d770cbd5c00987d8b8b.tar.bz2
CONTROL files : reset version to 'standard' format
(partly rolls back my drastic all-applicatoins-same-version change) now format is x.y(.z)$EXTRAVERSION where x.y (and aptionally .z) are x : major version y : minor version z : application patch and extra version is seconds-since-epoch this value can be used to automatically upgrade versions with minor changes (without manual update of the control file)
Diffstat (limited to 'scripts/GeneratePackageMake') (more/less context) (ignore whitespace changes)
-rwxr-xr-xscripts/GeneratePackageMake8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/GeneratePackageMake b/scripts/GeneratePackageMake
index 099d3e8..9d692a9 100755
--- a/scripts/GeneratePackageMake
+++ b/scripts/GeneratePackageMake
@@ -1,228 +1,228 @@
1# generate file containg control name / package name / files 1# generate file containg control name / package name / files
2find . -name *.control | grep -v -- "-mt.control" | while read i 2find . -name *.control | grep -v -- "-mt.control" | while read i
3do 3do
4 i=${i/.\//} 4 i=${i/.\//}
5 CDIR=${i%/*} 5 CDIR=${i%/*}
6 BNAME=${i##*/} 6 BNAME=${i##*/}
7 BNAME=${BNAME/.control/} 7 BNAME=${BNAME/.control/}
8 echo "cdir: ${CDIR}" 8 echo "cdir: ${CDIR}"
9 echo "bname: ${BNAME}" 9 echo "bname: ${BNAME}"
10 grep -e "Package:" -e "Files:" ./${i} 10 grep -e "Package:" -e "Files:" ./${i}
11done > /tmp/ALL 11done > /tmp/ALL
12 12
13# 13#
14# makefile header 14# makefile header
15# 15#
16 16
17cat << MAKEFILEHEADER 17cat << MAKEFILEHEADER
18 18
19# 19#
20# generate -mt.control file from regular control 20# generate -mt.control file from regular control
21# arg 1 : path to control file to convert 21# arg 1 : path to control file to convert
22# 22#
23 23
24define GenerateMTControl 24define GenerateMTControl
25@echo "Generating -mt control file for \$(basename \$<)" 25@echo "Generating -mt control file for \$(basename \$<)"
26@\$(OPIEDIR)/scripts/tothreaded \$< \$(OPIEDIR)/AllThreadedPackages 26@\$(OPIEDIR)/scripts/tothreaded \$< \$(OPIEDIR)/AllThreadedPackages
27endef 27endef
28 28
29# 29#
30# package one control file 30# package one control file
31# arg 1 : directory from OPIEROOT where control file resides 31# arg 1 : directory from OPIEROOT where control file resides
32# arg 2 : control file basename without -mt (no .control) 32# arg 2 : control file basename without -mt (no .control)
33# arg 3 : control file basename with -mt if needed 33# arg 3 : control file basename with -mt if needed
34# arg 4 : package name (value specified by Package: ...) 34# arg 4 : package name (value specified by Package: ...)
35# 35#
36 36
37define DoPackage 37define DoPackage
38@echo \"Building ipk of \$(4)\" 38echo \"Building ipk of \$(4)\"
39@( \$(ForSubst) ) > \$(TOPDIR)/scripts/subst 39( \$(ForSubst) ) > \$(TOPDIR)/scripts/subst
40@( \$(ForFileSubst) ) > \$(TOPDIR)/scripts/Filesubst 40( \$(ForFileSubst) ) > \$(TOPDIR)/scripts/Filesubst
41@( cd \$(OPIEDIR); \\ 41( cd \$(OPIEDIR); \\
42 \$(OPIEDIR)/scripts/mkipkg \\ 42 \$(OPIEDIR)/scripts/mkipkg \\
43 --subst=\$(OPIEDIR)/scripts/subst \\ 43 --subst=\$(OPIEDIR)/scripts/subst \\
44 --filesubst=\$(OPIEDIR)/scripts/filesubst \\ 44 --filesubst=\$(OPIEDIR)/scripts/filesubst \\
45 --control=\$(OPIEDIR)/\$(1)/\$(3).control \\ 45 --control=\$(OPIEDIR)/\$(1)/\$(3).control \\
46 --prerm=\$(OPIEDIR)/\$(1)/\$(2).prerm \\ 46 --prerm=\$(OPIEDIR)/\$(1)/\$(2).prerm \\
47 --preinst=\$(OPIEDIR)/\$(1)/\$(2).preinst \\ 47 --preinst=\$(OPIEDIR)/\$(1)/\$(2).preinst \\
48 --postrm=\$(OPIEDIR)/\$(1)/\$(2).postrm \\ 48 --postrm=\$(OPIEDIR)/\$(1)/\$(2).postrm \\
49 --postinst=\$(OPIEDIR)/\$(1)/\$(2).postinst \\ 49 --postinst=\$(OPIEDIR)/\$(1)/\$(2).postinst \\
50 --strip=\$(STRIP) \$(OPIEDIR); \\ 50 --strip=\$(STRIP) \$(OPIEDIR); \\
51 rm -f \$(OPIEDIR)/Packages/\$(4)_*.ipk; \\ 51 rm -f \$(OPIEDIR)/Packages/\$(4)_*.ipk; \\
52 mv *.ipk \$(OPIEDIR)/Packages; \\ 52 mv *.ipk \$(OPIEDIR)/Packages; \\
53 touch \$(OPIEDIR)/Packages/\$(4) \\ 53 touch \$(OPIEDIR)/Packages/\$(4) \\
54) || true 54) || true
55endef 55endef
56 56
57# 57#
58# prepared for generating the substfile for every build 58# prepared for generating the substfile for every build
59# 59#
60 60
61define ForSubst 61define ForSubst
62echo 's,\\\$\$QPE_VERSION,\$(QPE_VERSION),g'; \\ 62echo 's,\\\$\$QPE_VERSION,\$(QPE_VERSION),g'; \\
63echo 's,\\\$\$OPIE_VERSION,\$(OPIE_VERSION),g'; \\ 63echo 's,\\\$\$OPIE_VERSION,\$(OPIE_VERSION),g'; \\
64echo 's,\\\$\$QTE_VERSION,\$(QTE_VERSION),g'; \\ 64echo 's,\\\$\$QTE_VERSION,\$(QTE_VERSION),g'; \\
65echo 's,\\\$\$QTE_REVISION,\$(QTE_REVISION),g'; \\ 65echo 's,\\\$\$QTE_REVISION,\$(QTE_REVISION),g'; \\
66echo 's,\\\$\$SUB_VERSION,\$(SUB_VERSION),g'; \\ 66echo 's,\\\$\$SUB_VERSION,\$(SUB_VERSION),g'; \\
67echo 's,\\\$\$EXTRAVERSION,\$(EXTRAVERSION),g'; \\ 67echo 's,\\\$\$EXTRAVERSION,\$(EXTRAVERSION),g'; \\
68echo 's,\\\$\$QTE_BASEVERSION,\$(QTE_BASEVERSION),g' 68echo 's,\\\$\$QTE_BASEVERSION,\$(QTE_BASEVERSION),g'
69endef 69endef
70 70
71define ForFileSubst 71define ForFileSubst
72echo 's,\\\$\$OPIEDIR/root/,/,g'; \\ 72echo 's,\\\$\$OPIEDIR/root/,/,g'; \\
73echo 's,\$(OPIEDIR)/root/,/,g'; \\ 73echo 's,\$(OPIEDIR)/root/,/,g'; \\
74echo 's,\\\$\$OPIEDIR,\$(prefix),g'; \\ 74echo 's,\\\$\$OPIEDIR,\$(prefix),g'; \\
75echo 's,\$(OPIEDIR),\$(prefix),g'; \\ 75echo 's,\$(OPIEDIR),\$(prefix),g'; \\
76echo 's,\\\$\$QTDIR,\$(prefix),g'; \\ 76echo 's,\\\$\$QTDIR,\$(prefix),g'; \\
77echo 's,\$(QTDIR),\$(prefix),g'; \\ 77echo 's,\$(QTDIR),\$(prefix),g'; \\
78echo 's,^\(\./\)*root/,/,g'; \\ 78echo 's,^\(\./\)*root/,/,g'; \\
79echo 's,^\(\./\)*etc/,\$(prefix)/etc/,g'; \\ 79echo 's,^\(\./\)*etc/,\$(prefix)/etc/,g'; \\
80echo 's,^\(\./\)*lib/,\$(prefix)/lib/,g'; \\ 80echo 's,^\(\./\)*lib/,\$(prefix)/lib/,g'; \\
81echo 's,^\(\./\)*bin/,\$(prefix)/bin/,g'; \\ 81echo 's,^\(\./\)*bin/,\$(prefix)/bin/,g'; \\
82echo 's,^\(\./\)*pics/,\$(prefix)/pics/,g'; \\ 82echo 's,^\(\./\)*pics/,\$(prefix)/pics/,g'; \\
83echo 's,^\(\./\)*sounds/,\$(prefix)/sounds/,g'; \\ 83echo 's,^\(\./\)*sounds/,\$(prefix)/sounds/,g'; \\
84echo 's,^\(\./\)*i18n/,\$(prefix)/i18n/,g'; \\ 84echo 's,^\(\./\)*i18n/,\$(prefix)/i18n/,g'; \\
85echo 's,^\(\./\)*plugins/,\$(prefix)/plugins/,g'; \\ 85echo 's,^\(\./\)*plugins/,\$(prefix)/plugins/,g'; \\
86echo 's,^\(\./\)*apps/,\$(prefix)/apps/,g'; \\ 86echo 's,^\(\./\)*apps/,\$(prefix)/apps/,g'; \\
87echo 's,^\(\./\)*share/,\$(prefix)/share/,g'; \\ 87echo 's,^\(\./\)*share/,\$(prefix)/share/,g'; \\
88echo 's,^\(\./\)*i18n/,\$(prefix)/i18n/,g'; \\ 88echo 's,^\(\./\)*i18n/,\$(prefix)/i18n/,g'; \\
89echo 's,^\(\./\)*help/,\$(prefix)/help/,g' 89echo 's,^\(\./\)*help/,\$(prefix)/help/,g'
90endef 90endef
91 91
92# 92#
93# Will contain a list of all non-mt control files 93# Will contain a list of all non-mt control files
94ALLCONTROLFILES= 94ALLCONTROLFILES=
95 95
96# 96#
97# Will contain a list of all packaging targets 97# Will contain a list of all packaging targets
98ALLPACKAGES= 98ALLPACKAGES=
99 99
100# s contains now single space 100# s contains now single space
101s=\$(x) \$(x) 101s=\$(x) \$(x)
102 102
103# 103#
104# for convenience : generate AllTh 104# for convenience : generate AllTh
105ATP=\$(OPIEDIR)/AllThreadedPackages 105ATP=\$(OPIEDIR)/AllThreadedPackages
106 106
107MAKEFILEHEADER 107MAKEFILEHEADER
108 108
109while read k 109while read k
110do 110do
111 CDIR="${k#* }" 111 CDIR="${k#* }"
112 read k 112 read k
113 BNAME="${k#* }" 113 BNAME="${k#* }"
114 read k 114 read k
115 case $k in 115 case $k in
116 *"ackage:"*) 116 *"ackage:"*)
117 Pkg="${k#* }" 117 Pkg="${k#* }"
118 Pkg="${Pkg// }" 118 Pkg="${Pkg// }"
119 ;; 119 ;;
120 *"iles:"*) 120 *"iles:"*)
121 Files="${k/Files:/}" 121 Files="${k/Files:/}"
122 ;; 122 ;;
123 esac 123 esac
124 read k 124 read k
125 case $k in 125 case $k in
126 *"ackage:"*) 126 *"ackage:"*)
127 Pkg="${k#* }" 127 Pkg="${k#* }"
128 Pkg="${Pkg// }" 128 Pkg="${Pkg// }"
129 ;; 129 ;;
130 *"iles:"*) 130 *"iles:"*)
131 Files="${k/Files:/}" 131 Files="${k/Files:/}"
132 ;; 132 ;;
133 esac 133 esac
134 134
135 cat << HERE 135 cat << HERE
136# 136#
137# package $Pkg in ${BNAME} 137# package $Pkg in ${BNAME}
138# 138#
139 139
140package-${Pkg} : \$(OPIEDIR)/Packages/$Pkg 140package-${Pkg} : \$(OPIEDIR)/Packages/$Pkg
141package-${Pkg}-mt : \$(ATP) \$(OPIEDIR)/Packages/$Pkg-mt 141package-${Pkg}-mt : \$(ATP) \$(OPIEDIR)/Packages/$Pkg-mt
142 142
143# collect control files and package targets 143# collect control files and package targets
144 144
145ALLCONTROLFILES += ${CDIR}/${BNAME}.control 145ALLCONTROLFILES += ${CDIR}/${BNAME}.control
146ALLPACKAGES += $Pkg 146ALLPACKAGES += $Pkg
147 147
148# to generate -mt control file 148# to generate -mt control file
149\$(OPIEDIR)/${CDIR}/${BNAME}-mt.control : \$(OPIEDIR)/${CDIR}/${BNAME}.control 149\$(OPIEDIR)/${CDIR}/${BNAME}-mt.control : \$(OPIEDIR)/${CDIR}/${BNAME}.control
150 \$(GenerateMTControl) 150 \$(GenerateMTControl)
151 151
152HERE 152HERE
153 153
154 if [ ! -z "${Files}" ] 154 if [ ! -z "${Files}" ]
155 then 155 then
156 156
157 cat << HERE 157 cat << HERE
158# optimize speed 158# optimize speed
159.phony : \$(wildcard \$(addprefix \$(OPIEDIR)/,${Files})) 159.phony : \$(wildcard \$(addprefix \$(OPIEDIR)/,${Files}))
160 160
161# capture missing files (because not built) 161# capture missing files (because not built)
162\$(OPIEDIR)/Packages/$Pkg \$(OPIEDIR)/Packages/$Pkg-mt \$(SUBSTFILES): \$(wildcard \$(addprefix \$(OPIEDIR)/,${Files})) 162\$(OPIEDIR)/Packages/$Pkg \$(OPIEDIR)/Packages/$Pkg-mt \$(SUBSTFILES): \$(wildcard \$(addprefix \$(OPIEDIR)/,${Files}))
163HERE 163HERE
164 164
165# echo "\$(wildcard \$(addprefix \$(OPIEDIR)/,${Files})) : " 165# echo "\$(wildcard \$(addprefix \$(OPIEDIR)/,${Files})) : "
166 166
167 fi 167 fi
168 168
169 cat << HERE 169 cat << HERE
170\$(OPIEDIR)/Packages/$Pkg : \$(OPIEDIR)/${CDIR}/${BNAME}.control 170\$(OPIEDIR)/Packages/$Pkg : \$(OPIEDIR)/${CDIR}/${BNAME}.control
171 @\$(call DoPackage,${CDIR},${BNAME},${BNAME},${Pkg}) 171 @\$(call DoPackage,${CDIR},${BNAME},${BNAME},${Pkg})
172\$(OPIEDIR)/Packages/$Pkg-mt : \$(OPIEDIR)/${CDIR}/${BNAME}-mt.control 172\$(OPIEDIR)/Packages/$Pkg-mt : \$(OPIEDIR)/${CDIR}/${BNAME}-mt.control
173 @\$(call DoPackage,${CDIR},${BNAME},${BNAME}-mt,${Pkg}-mt) 173 @\$(call DoPackage,${CDIR},${BNAME},${BNAME}-mt,${Pkg}-mt)
174 174
175HERE 175HERE
176 176
177done < /tmp/ALL 177done < /tmp/ALL
178 178
179cat << HERE 179cat << HERE
180# 180#
181# regenerate package file if control files are modified 181# regenerate package file if control files are modified
182# 182#
183 183
184Package.make : \$(addprefix \$(OPIEDIR)/,\$(ALLCONTROLFILES)) 184Package.make : \$(addprefix \$(OPIEDIR)/,\$(ALLCONTROLFILES))
185 185
186# 186#
187# make targets to build packages 187# make targets to build packages
188# needs quicklauncher link in location (because dangling 188# needs quicklauncher link in location (because dangling
189# links are not considered as true files by the wildcard command) 189# links are not considered as true files by the wildcard command)
190# 190#
191# if you want to build one package only then use 191# if you want to build one package only then use
192# make package-<basenameof control> 192# make package-<basenameof control>
193# or make package-<basenameof control>-mt 193# or make package-<basenameof control>-mt
194# 194#
195 195
196packages : /opt/QtPalmtop/bin/quicklauncher \\ 196packages : /opt/QtPalmtop/bin/quicklauncher \\
197 \$(OPIEDIR)/Packages \\ 197 \$(OPIEDIR)/Packages \\
198 \$(add prefix \$(OPIEDIR)/Packages/,\$(ALLPACKAGES)) 198 \$(add prefix \$(OPIEDIR)/Packages/,\$(ALLPACKAGES))
199packages-mt : /opt/QtPalmtop/bin/quicklauncher \\ 199packages-mt : /opt/QtPalmtop/bin/quicklauncher \\
200 \$(ATP) \\ 200 \$(ATP) \\
201 \$(OPIEDIR)/Packages \\ 201 \$(OPIEDIR)/Packages \\
202 \$(addprefix \$(OPIEDIR)/Packages/,\$(addsuffix -mt,\$(ALLPACKAGES))) 202 \$(addprefix \$(OPIEDIR)/Packages/,\$(addsuffix -mt,\$(ALLPACKAGES)))
203 203
204# 204#
205# capture missing quichlauncher link 205# capture missing quichlauncher link
206# 206#
207 207
208/opt/QtPalmtop/bin/quicklauncher : 208/opt/QtPalmtop/bin/quicklauncher :
209 @echo "create a link from /opt/QtPalmtop to \$(OPIEDIR) for this target to work" 209 @echo "create a link from /opt/QtPalmtop to \$(OPIEDIR) for this target to work"
210 exit 2 210 exit 2
211 211
212# 212#
213# Create Packages directory 213# Create Packages directory
214# 214#
215 215
216\$(OPIEDIR)/Packages : 216\$(OPIEDIR)/Packages :
217 @mkdir \$(OPIEDIR)/Packages 217 @mkdir \$(OPIEDIR)/Packages
218 218
219# 219#
220# update file containing all packages 220# update file containing all packages
221# 221#
222 222
223\$(ATP) : \$(addprefix \$(OPIEDIR)/,\$(ALLCONTROLFILES)) 223\$(ATP) : \$(addprefix \$(OPIEDIR)/,\$(ALLCONTROLFILES))
224 @echo "Generating \$(notdir \$(ATP))" 224 @echo "Generating \$(notdir \$(ATP))"
225 @echo -e "\$(subst \$(s),,\$(foreach i,\$(ALLPACKAGES),\$(i)\n))" > \$@ 225 @echo -e "\$(subst \$(s),,\$(foreach i,\$(ALLPACKAGES),\$(i)\n))" > \$@
226HERE 226HERE
227 227
228rm /tmp/ALL 228rm /tmp/ALL