package.mk 44 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537
  1. /*
  2. * source and binary package support
  3. *
  4. * @(#)package.mk (AT&T Research) 2012-02-14
  5. *
  6. * usage:
  7. *
  8. * cd $INSTALLROOT/lib/package
  9. * nmake -f name [closure] [cyg|exp|lcl|pkg|rpm|tgz] [base|delta] type
  10. *
  11. * where:
  12. *
  13. * name package description file or component
  14. *
  15. * type source build source archive, generates
  16. * $(PACKAGEDIR)/name.version.release.suffix
  17. * binary build binary archive, generates
  18. * $(PACKAGEDIR)/name.version.hosttype.release.suffix
  19. * runtime build binary archive, generates
  20. * $(PACKAGEDIR)/name-run.version.hosttype.release.suffix
  21. *
  22. * NOTE: $(PACKAGEDIR) is in the lowest view and is shared among all views
  23. *
  24. * generated archive member files are $(PACKAGEROOT) relative
  25. *
  26. * main assertions:
  27. *
  28. * NAME [ name=value ] :PACKAGE: component ...
  29. * :OMIT: component ...
  30. * :LICENSE: license-class-pattern
  31. * :CATEGORY: category-id ...
  32. * :COVERS: package ...
  33. * :REQUIRES: package ...
  34. * :INDEX: index description line
  35. * :DESCRIPTION:
  36. * [ verbose description ]
  37. * :DETAILS: style
  38. * :README:
  39. * readme lines
  40. * :EXPORT:
  41. * name=value
  42. * target :INSTALL: [ source ]
  43. *
  44. * option variables, shown with default values
  45. *
  46. * format=tgz
  47. * archive format
  48. *
  49. * version=YYYY-MM-DD
  50. * package base version (overrides current date)
  51. *
  52. * release=YYYY-MM-DD
  53. * package delta release (overrides current date)
  54. *
  55. * license=type.class
  56. * :LICENSE: type.class pattern override
  57. *
  58. * notice=1
  59. * include the conspicuous empty notice file
  60. *
  61. * copyright=0
  62. * do not prepend source file copyright notice
  63. *
  64. * strip=0
  65. * don't strip non-lcl binary package members
  66. *
  67. * variants=pattern
  68. * include variants matching pattern in binary packages
  69. *
  70. * incremental=[source:1 binary:0]
  71. * if a base archive is generated then also generate an
  72. * incremental delta archive from the previous base
  73. *
  74. * NOTE: the Makerules.mk :PACKAGE: operator defers to :package: when
  75. * a target is specified
  76. */
  77. /* these are ast centric -- we'll parameterize another day */
  78. org = ast
  79. url = http://www.research.att.com/sw/download
  80. /* generic defaults */
  81. base =
  82. category = utils
  83. checksum = md5
  84. closure =
  85. copyright = 1
  86. delta =
  87. format = tgz
  88. incremental =
  89. index =
  90. init = INIT
  91. license =
  92. licenses = $(org)
  93. mamfile = 1
  94. opt =
  95. name =
  96. notice =
  97. release =
  98. strip = 0
  99. style = tgz
  100. suffix = tgz
  101. type =
  102. variants = !(cc-g)
  103. vendor =
  104. version = $("":T=R%Y-%m-%d)
  105. SUM = sum
  106. package.notice = ------------ NOTICE -- LICENSED SOFTWARE -- SEE README FOR DETAILS ------------
  107. package.readme = $(@.package.readme.)
  108. .package.readme. :
  109. This is a package root directory $PACKAGEROOT. Source and binary
  110. packages in this directory tree are controlled by the command
  111. $()
  112. bin/package
  113. $()
  114. Binary files may be in this directory or in the install root directory
  115. $()
  116. INSTALLROOT=$PACKAGEROOT/arch/`bin/package`
  117. $()
  118. For more information run
  119. $()
  120. bin/package help
  121. $()
  122. Many of the packaged commands self-document via the --man and --html
  123. options; those that do have no separate man page.
  124. $()
  125. Each package is covered by one of the license files
  126. $()
  127. $(PACKAGELIB)/LICENSES/<license>
  128. $()
  129. where <license> is the license type for the package. At the top
  130. of each license file is a URL; the license covers all software that
  131. refers to this URL. For details run
  132. $()
  133. bin/package license [<package>]
  134. $()
  135. Any archives, distributions or packages made from source or
  136. binaries covered by license(s) must contain the corresponding
  137. license file(s)$(notice:?, this README file, and the empty file$$("\n")$$(package.notice)?.?)
  138. .package.licenses. : .FUNCTION
  139. local I F L R T all save text
  140. L := $(%)
  141. while L == "--*"
  142. I := $(L:O=1)
  143. if I == "--all"
  144. all = 1
  145. elif I == "--save"
  146. save = 1
  147. elif I == "--text"
  148. text = 1
  149. end
  150. L := $(L:O>1)
  151. end
  152. if "$(L)" == "*-*"
  153. L += $(L:/[^-]*-//) $(L:/-.*//)
  154. end
  155. L += $(licenses)
  156. for I $(L:U)
  157. if I == "gpl"
  158. I = gnu
  159. all =
  160. end
  161. if F = "$(I:D=$(PACKAGESRC):B:S=.lic:T=F)"
  162. R += $(F)
  163. if save || text
  164. T := $(.FIND. lib/package .lic $(F):P=W,query=type)
  165. R += $(T:D=$(PACKAGESRC)/LICENSES:B)
  166. end
  167. if save
  168. R += $(F:T=I:N=*.def:D=$(PACKAGESRC):B:S:T=F)
  169. elif ! all
  170. break
  171. end
  172. end
  173. end
  174. return $(R)
  175. /*
  176. * glob(3) doesn't handle / in alternation -- should it?
  177. */
  178. .package.glob. : .FUNCTION
  179. local A D I P S
  180. for I $(%)
  181. if I == "*/*"
  182. D := $(I:C,/.*,,)
  183. if ! "$(A:N=$(D))"
  184. local S.$(D)
  185. A += $(D)
  186. end
  187. S.$(D) += $(I:C,[^/]*/,,)
  188. else
  189. P := $(P)$(S)$(I)
  190. end
  191. S = |
  192. end
  193. if P == "*\|*"
  194. P := ($(P))
  195. end
  196. for I $(A)
  197. P += $(I)/$(.package.glob. $(S.$(I)))
  198. end
  199. return $(P)
  200. .MAKEINIT : .package.init
  201. .package.init : .MAKE .VIRTUAL .FORCE
  202. local V
  203. V := $(VROOT:T=F:P=L*)
  204. if ! PACKAGEROOT
  205. PACKAGEROOT := $(V:N!=*/arch/+([!/]):O=1)
  206. end
  207. if V == "$(PACKAGEROOT)"
  208. V :=
  209. end
  210. V += $(INSTALLROOT) $(PACKAGEROOT)
  211. PACKAGEVIEW := $(V:H=RU)
  212. INSTALLOFFSET := $(INSTALLROOT:C%$(PACKAGEROOT)/%%)
  213. if license
  214. license := $(license)|none.none
  215. end
  216. PACKAGELIB = lib/package
  217. PACKAGESRC = $(PACKAGEROOT)/$(PACKAGELIB)
  218. PACKAGEBIN = $(INSTALLROOT)/$(PACKAGELIB)
  219. PACKAGEDIR = $(PACKAGESRC)/$(style)
  220. INSTALLOFFSET = $(INSTALLROOT:C%$(PACKAGEROOT)/%%)
  221. package.omit = -|*/$(init)
  222. package.glob.all = $(INSTALLROOT)/src/*/*/($(MAKEFILES:/:/|/G))
  223. package.all = $(package.glob.all:P=G:W=O=$(?$(name):A=.VIRTUAL):N!=$(package.omit):T=F:$(PACKAGEVIEW:C,.*,C;^&/;;,:/ /:/G):U)
  224. package.glob.pkg = $(.package.glob. $(~$(name):P=U):C%.*%$(INSTALLROOT)/src/*/&/($(MAKEFILES:/:/|/G))%) $(~$(name):P=U:N=$(name):?$$(INSTALLROOT)/src/$$(name)/($$(MAKEFILES:/:/|/G))??)
  225. package.pkg = $(package.glob.pkg:P=G:D:N!=$(package.omit):T=F:$(PACKAGEVIEW:C,.*,C;^&/;;,:/ /:/G):U)
  226. package.closure = $(closure:?$$(package.all)?$$(package.pkg)?)
  227. package.init = $(.package.glob. $("$(init)$(name)":P=U):C%.*%$(INSTALLROOT)/src/*/&/($(MAKEFILES:/:/|/G))%:P=G:T=F:D::B)
  228. package.ini = ignore mamprobe manmake package silent
  229. package.src.pat = $(PACKAGESRC)/($(name).(ini|pkg))
  230. package.src = $(package.src.pat:P=G) $(.package.licenses. --save $(name))
  231. package.bin = $(PACKAGEBIN)/$(name).ini
  232. package.mam = --never --force --mam=static --corrupt=accept --clobber --compare --link='lib*.a*' CC=$(CC.DIALECT:N=C++:?CC?cc?) package.license.class=$(license:Q) $(=) 'dontcare test' install test
  233. op = current
  234. stamp = [0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]
  235. source = $(PACKAGEDIR)/$(name).$(version)$(release:?.$(release)??).$(suffix)
  236. binary = $(PACKAGEDIR)/$(name).$(version)$(release:?.$(release)??).$(CC.HOSTTYPE).$(suffix)
  237. runtime = $(PACKAGEDIR)/$(name)-run.$(version)$(release:?.$(release)??).$(CC.HOSTTYPE).$(suffix)
  238. old.new.source = $(PACKAGEDIR)/$(name).$(version).$(old.version).$(suffix)
  239. old.new.binary = $(PACKAGEDIR)/$(name).$(version).$(old.version).$(CC.HOSTTYPE).$(suffix)
  240. old.new.runtime = $(PACKAGEDIR)/$(name)-run.$(version).$(old.version).$(CC.HOSTTYPE).$(suffix)
  241. source.list = $("$(PACKAGEDIR)/$(name).*$(stamp).$(suffix)":P=G:H=R)
  242. binary.list = $("$(PACKAGEDIR)/$(name).*$(stamp).$(CC.HOSTTYPE).$(suffix)":P=G:H=R)
  243. runtime.list = $("$(PACKAGEDIR)/$(name)-run.*$(stamp).$(CC.HOSTTYPE).$(suffix)":P=G:H>)
  244. source.ratz = $("$(INSTALLROOT)/src/cmd/$(init)/ratz.c":T=F)
  245. binary.ratz = $("$(INSTALLROOT)/src/cmd/$(init)/ratz":T=F)
  246. $(init) : .VIRTUAL $(init)
  247. package.requires = 0
  248. ":package:" : .MAKE .OPERATOR
  249. local P I R V
  250. P := $(<:O=1)
  251. $(P) : $(>:V)
  252. if ! package.requires
  253. if ! name
  254. name := $(P)
  255. .PACKAGE. := $(P)
  256. if name == "$(init)"
  257. package.omit = -
  258. package.src += $(package.ini:C,^,$(PACKAGEROOT)/bin/,) $(PACKAGESRC)/package.mk
  259. else
  260. $(P) : $(package.init)
  261. end
  262. for I $(<:O>1)
  263. if I == "*=*"
  264. eval
  265. $(I)
  266. end
  267. else
  268. version := $(I)
  269. end
  270. end
  271. LICENSEFILEDEFAULT := $(.package.licenses. $(name):@/ /:/G)
  272. export LICENSEFILEDEFAULT
  273. end
  274. if "$(>)"
  275. for I $(>:V)
  276. $(I) : .VIRTUAL
  277. if I == "/*"
  278. package.dir += $(I:V)
  279. end
  280. end
  281. end
  282. if "$(@)"
  283. $(P).README := $(@)
  284. else
  285. $(P).README := This is the $(P) package.
  286. end
  287. end
  288. ":AUXILIARY:" : .MAKE .OPERATOR
  289. package.auxiliary.$(style) += $(>:N=/*:T=F) $(>:N!=/*:C%^%$(INSTALLROOT)/%:T=F)
  290. ":CATEGORY:" : .MAKE .OPERATOR
  291. if ! package.requires
  292. category := $(>)
  293. end
  294. .covers. : .FUNCTION
  295. local I C D F K=0 L
  296. for I $(%)
  297. if ! "$(~covers:N=$(I:B))"
  298. if F = "$(I:D:B:S=.pkg:T=F)"
  299. if D = "$(F:T=I)"
  300. covers : $(I:B)
  301. for L $(D)
  302. if L == ":COVERS:"
  303. K = 1
  304. elif L == ":*:"
  305. if K
  306. break
  307. end
  308. elif K
  309. : $(.covers. $(L))
  310. end
  311. end
  312. end
  313. else
  314. error $(--exec:?3?1?) $(I): unknown package $(I)
  315. end
  316. end
  317. end
  318. ":COVERS:" : .MAKE .OPERATOR
  319. if ! package.requires
  320. : $(.covers. $(>))
  321. end
  322. ":DESCRIPTION:" : .MAKE .OPERATOR
  323. if ! package.requires
  324. $(name).README := $(@:V)
  325. end
  326. ":DETAILS:" : .MAKE .OPERATOR
  327. if ! package.requires
  328. details.$(>:O=1) := $(@:V)
  329. end
  330. ":EXPORT:" : .MAKE .OPERATOR
  331. if ! package.requires
  332. export.$(style) := $(@:/$$("\n")/ /G)
  333. end
  334. ":INDEX:" : .MAKE .OPERATOR
  335. if ! package.requires
  336. index := $(>)
  337. end
  338. ":INSTALL:" : .MAKE .OPERATOR
  339. if ! package.requires
  340. local T S F X
  341. S := $(>)
  342. T := $(<)
  343. if "$(exe.$(style))" && "$(T)" == "bin/*([!./])"
  344. T := $(T).exe
  345. end
  346. if ! "$(S)"
  347. S := $(T)
  348. elif "$(exe.$(style))" && "$(S)" == "bin/*([!./])"
  349. S := $(S).exe
  350. end
  351. install.$(style) := $(install.$(style):V)$("\n")install : $$(ROOT)/$(T)$("\n")$$(ROOT)/$(T) : $$(ARCH)/$(S)$("\n\t")cp $< $@
  352. if strip && "$(T:N=*.exe)"
  353. install.$(style) := $(install.$(style):V)$("\n\t")strip $@ 2>/dev/null
  354. end
  355. X := $(PACKAGEROOT)/arch/$(CC.HOSTTYPE)/$(S)
  356. if strip && "$(X:T=Y)" == "*/?(x-)(dll|exe)"
  357. F := filter $(STRIP) $(STRIPFLAGS) $(X)
  358. end
  359. if "$(filter.$(style):V)"
  360. filter.$(style) := $(filter.$(style):V)$$("\n")
  361. end
  362. filter.$(style) := $(filter.$(style):V);;$(F);$(X);usr/$(T)
  363. end
  364. ":LICENSE:" : .MAKE .OPERATOR
  365. if ! package.requires && ! license
  366. license := $(>)
  367. end
  368. ":OMIT:" : .MAKE .OPERATOR
  369. if ! package.requires
  370. package.omit := $(package.omit)|$(>:C,^,*/,:/ /|/G)
  371. end
  372. ":POSTINSTALL:" : .MAKE .OPERATOR
  373. if ! package.requires
  374. postinstall.$(style) := $(@:V)
  375. end
  376. ":README:" : .MAKE .OPERATOR
  377. if ! package.requires
  378. readme.$(style) := $(@:V)
  379. end
  380. .requires. : .FUNCTION
  381. local I C D F K=0 L V T M=0
  382. for I $(%)
  383. if ! "$(~requires:N=$(I:B))"
  384. if F = "$(I:D:B:S=.pkg:T=F)"
  385. if I == "$(init)"
  386. package.omit = -
  387. else
  388. requires : $(I:B)
  389. end
  390. if V = "$(I:D:B=gen/$(I:B):S=.ver:T=F)"
  391. req : $(I:B)
  392. else
  393. error 1 $(I): package should be written before $(P)
  394. end
  395. let package.requires = package.requires + 1
  396. include "$(F)"
  397. let package.requires = package.requires - 1
  398. else
  399. error 1 $(I): package not found
  400. end
  401. end
  402. end
  403. ":REQUIRES:" : .MAKE .OPERATOR
  404. : $(.requires. $(>))
  405. ":TEST:" : .MAKE .OPERATOR
  406. if ! package.requires
  407. local T
  408. T := $(>)
  409. if "$(T)" == "bin/*([!./])"
  410. if "$(exe.$(style))"
  411. T := $(T).exe
  412. end
  413. T := $$(PWD)/$$(ARCH)/$(T)
  414. end
  415. test.$(style) := $(test.$(style):V)$("\n")test : $(T:V)$("\n\t")$(@)
  416. end
  417. base delta : .MAKE .VIRTUAL .FORCE
  418. op := $(<)
  419. closure : .MAKE .VIRTUAL .FORCE
  420. $(<) := 1
  421. cyg exp lcl pkg rpm tgz : .MAKE .VIRTUAL .FORCE
  422. style := $(<)
  423. source : .source.init .source.gen .source.$$(style)
  424. .source.init : .MAKE
  425. local A B D P V I
  426. type := source
  427. if ! "$(incremental)"
  428. incremental = 1
  429. end
  430. if "$(source.$(name))"
  431. suffix = c
  432. end
  433. : $(.init.$(style))
  434. : $(details.$(style):V:R) :
  435. A := $(source.list)
  436. B := $(A:N=*.$(stamp).$(suffix):N!=*.$(stamp).$(stamp).*:O=1:T=F)
  437. P := $(A:N=*.$(stamp).$(suffix):N!=*.$(stamp).$(stamp).*:O=2:T=F)
  438. D := $(A:N=*.$(stamp).$(stamp).$(suffix):O=1:T=F)
  439. if op == "delta"
  440. if ! B
  441. error 3 delta requires a base archive
  442. end
  443. base := -z $(B)
  444. deltaversion := $(B:B:/$(name).//)
  445. let deltasince = $(deltaversion:/.*-//) + 1
  446. deltasince := $(deltaversion:/[^-]*$/$(deltasince:F=%02d)/)
  447. if "$(release)" != "$(stamp)"
  448. release := $("":T=R%Y-%m-%d)
  449. end
  450. source := $(B:D:B:S=.$(release).$(suffix))
  451. version := $(source:B:B:/$(name).//)
  452. elif B || op == "base"
  453. if op == "base"
  454. for I $(B) $(P)
  455. V := $(I:B:/$(name)\.\([^.]*\).*/\1/)
  456. if V == "$(stamp)" && V != "$(version)"
  457. old.version := $(V)
  458. old.source := $(I)
  459. if "$(old.version)" >= "$(version)"
  460. error 3 $(name): previous base $(old.version) is newer than $(version)
  461. end
  462. break
  463. end
  464. end
  465. else
  466. source := $(B)
  467. end
  468. if B == "$(source)"
  469. if "$(B:D:B:B)" == "$(D:D:B:B)" && "$(B:B::S)" != "$(D:B::S)"
  470. error 3 $(B:B:S): base overwrite would invalidate delta $(D:B:S)
  471. end
  472. error 1 $(B:B:S): replacing current base
  473. end
  474. version := $(source:B:S:/^$(name).\(.*\).$(suffix)$/\1/)
  475. end
  476. PACKAGEGEN := $(PACKAGESRC)/gen
  477. .source.gen : $$(PACKAGEDIR) $$(PACKAGEGEN) $$(PACKAGEGEN)/SOURCE.html $$(PACKAGEGEN)/BINARY.html $$(PACKAGEGEN)/DETAILS.html
  478. BINPACKAGE := $(PATH:/:/ /G:X=package:T=F:O=1)
  479. $$(PACKAGEDIR) $$(PACKAGEGEN) : .IGNORE
  480. [[ -d $(<) ]] || mkdir $(<)
  481. $$(PACKAGEGEN)/SOURCE.html : $(BINPACKAGE)
  482. $(*) html source > $(<)
  483. $$(PACKAGEGEN)/BINARY.html : $(BINPACKAGE)
  484. $(*) html binary > $(<)
  485. $$(PACKAGEGEN)/DETAILS.html : $(BINPACKAGE)
  486. $(*) html intro > $(<)
  487. .source.exp .source.pkg .source.rpm : .MAKE
  488. error 3 $(style): source package style not supported yet
  489. exe.cyg = .exe
  490. vendor.cyg = gnu
  491. .name.cyg : .FUNCTION
  492. local N
  493. N := $(%)
  494. if N == "*-*"
  495. vendor := $(N:/-.*//)
  496. if vendor == "$(vendor.cyg)"
  497. vendor :=
  498. N := $(N:/[^-]*-//)
  499. end
  500. N := $(N:/-//G)
  501. end
  502. return $(N)
  503. .init.cyg : .FUNCTION
  504. local N O
  505. closure = 1
  506. init = .
  507. strip = 1
  508. suffix = tar.bz2
  509. format = tbz
  510. vendor := $(licenses:N!=$(vendor.cyg):O=1)
  511. package.ini := $(package.ini)
  512. package.src.pat := $(package.src.pat)
  513. package.src := $(package.src)
  514. package.bin := $(package.bin)
  515. .source.gen : .CLEAR $(*.source.gen:V:N!=*.html)
  516. name.original := $(name)
  517. name := $(.name.cyg $(name))
  518. if name != "$(name.original)"
  519. $(name) : $(~$(name.original))
  520. O := $(~covers)
  521. covers : .CLEAR
  522. for N $(O)
  523. covers : $(.name.cyg $(N))
  524. end
  525. end
  526. stamp = [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-[0-9]
  527. version.original := $(version)
  528. version := $(version:/-//G)-1
  529. if opt
  530. opt := $(opt)/$(vendor)/
  531. else
  532. opt := $(name)-$(version)/
  533. end
  534. if type == "source"
  535. version := $(version)-src
  536. source = $(PACKAGEDIR)/$(name)-$(version)$(release:?.$(release)??).$(suffix)
  537. else
  538. binary = $(PACKAGEDIR)/$(name)-$(version)$(release:?.$(release)??).$(suffix)
  539. end
  540. .source.cyg :
  541. if [[ '$(~$(name))' ]]
  542. then tmp=/tmp/pkg$(tmp)
  543. mkdir $tmp
  544. {
  545. integer m=0 o
  546. cat > $tmp/configure <<'!'
  547. echo "you didn't have to do that"
  548. !
  549. chmod +x $tmp/configure
  550. echo ";;;$tmp/configure;configure"
  551. cat > $tmp/Makefile0 <<'!'
  552. HOSTTYPE := $$(shell bin/package)
  553. ROOT = ../..
  554. ARCH = arch/$$(HOSTTYPE)
  555. all :
  556. PACKAGEROOT= CYGWIN="$$CYGWIN ntsec binmode" bin/package make $(export.$(style))
  557. install : all
  558. $(install.$(style):V)
  559. $(test.$(style):V)
  560. !
  561. echo ";;;$tmp/Makefile0;Makefile"
  562. cat > $tmp/CYGWIN-README <<'!'
  563. $(readme.$(style):@?$$(readme.$$(style))$$("\n\n")??)To build binaries from source into the ./arch/`bin/package` tree run:
  564. $()
  565. make
  566. $()
  567. $(test.$(style):@?To test the binaries after building/installing run:$$("\n\n\t")make test$$("\n\n")??)To build and/or install the binaries run:
  568. $()
  569. make install
  570. $()
  571. The bin/package command provides a command line interface for all package
  572. operations. The $(opt:/.$//) source and binary packages were generated by:
  573. $()
  574. package write cyg base source version=$(version.original) $(name.original)
  575. package write cyg base binary version=$(version.original) $(name.original)
  576. $()
  577. using the $(org)-base package. To download and install the latest
  578. $(org)-base source package in /opt/$(org) run:
  579. $()
  580. PATH=/opt/$(org)/bin:$PATH
  581. cd /opt/$(org)
  582. package authorize "NAME" password "PASSWORD" setup flat source $("\\")
  583. $(url) $("\\")
  584. $(org)-base
  585. package make
  586. $()
  587. and export /opt/$(org)/bin in PATH to use. The NAME and PASSWORD signify your
  588. agreement to the software license(s). All users get the same NAME and PASSWORD.
  589. See $(url) for details. If multiple architectures may be built under
  590. /opt/$(org) then drop "flat" and export /opt/$(org)/arch/`package`/bin in PATH
  591. to use. To update previously downloaded packages from the same url simply run:
  592. $()
  593. cd /opt/$(org)
  594. package setup
  595. package make
  596. $()
  597. To download and install the latest $(org)-base binary package in
  598. /opt/$(org) change "source" to "binary" and omit "package make".
  599. !
  600. echo ";;;$tmp/CYGWIN-README;CYGWIN-PATCHES/README"
  601. cat > $(source:/-src.$(suffix)//).setup.hint <<'!'
  602. category: $(category:/\(.\).*/\1/U)$(category:/.\(.*\)/\1/L)
  603. requires: cygwin
  604. sdesc: "$(index)"
  605. ldesc: "$($(name.original).README)"
  606. !
  607. echo ";;;$(source:/-src.$(suffix)//).setup.hint;CYGWIN-PATCHES/setup.hint"
  608. echo ";;;$(BINPACKAGE);bin/package"
  609. cat > $tmp/Makefile <<'!'
  610. :MAKE:
  611. !
  612. echo ";;;$tmp/Makefile;src/Makefile"
  613. echo ";;;$tmp/Makefile;src/cmd/Makefile"
  614. echo ";;;$tmp/Makefile;src/lib/Makefile"
  615. if [[ '$(mamfile)' == 1 ]]
  616. then cat > $tmp/Mamfile1 <<'!'
  617. info mam static
  618. note source level :MAKE: equivalent
  619. make install
  620. make all
  621. exec - ${MAMAKE} -r '*/*' ${MAMAKEARGS}
  622. done all virtual
  623. done install virtual
  624. !
  625. echo ";;;$tmp/Mamfile1;src/Mamfile"
  626. cat > $tmp/Mamfile2 <<'!'
  627. info mam static
  628. note component level :MAKE: equivalent
  629. make install
  630. make all
  631. exec - ${MAMAKE} -r '*' ${MAMAKEARGS}
  632. done all virtual
  633. done install virtual
  634. !
  635. echo ";;;$tmp/Mamfile2;src/cmd/Mamfile"
  636. echo ";;;$tmp/Mamfile2;src/lib/Mamfile"
  637. fi
  638. $(package.src:U:T=F:/.*/echo ";;;&"$("\n")/)
  639. echo ";;;$(PACKAGEGEN)/$(name.original).req"
  640. set -- $(package.closure)
  641. for i
  642. do cd $(INSTALLROOT)/$i
  643. if [[ ! '$(license)' ]] || $(MAKE) --noexec --silent 'exit $$(LICENSECLASS:N=$(license):?0?1?)' .
  644. then if [[ '$(mamfile)' == 1 ]]
  645. then (( o=m ))
  646. s=$( $(MAKE) --noexec --recurse=list recurse 2>/dev/null )
  647. if [[ $s ]]
  648. then for j in $s
  649. do if [[ -d $j ]]
  650. then cd $j
  651. if [[ ! '$(license)' ]] || $(MAKE) --noexec --silent 'exit $$(LICENSECLASS:N=$(license):?0?1?)' .
  652. then (( m++ ))
  653. $(MAKE) $(package.mam) $(export.$(style):Q) > $tmp/$m.mam
  654. echo ";;;$tmp/$m.mam;$i/$j/Mamfile"
  655. fi
  656. cd $(INSTALLROOT)/$i
  657. fi
  658. done
  659. if (( o != m ))
  660. then (( m++ ))
  661. cat > $tmp/$m.mam <<'!'
  662. info mam static
  663. note subcomponent level :MAKE: equivalent
  664. make install
  665. make all
  666. exec - ${MAMAKE} -r '*' ${MAMAKEARGS}
  667. done all virtual
  668. done install virtual
  669. !
  670. echo ";;;$tmp/$m.mam;$i/Mamfile"
  671. fi
  672. else (( m++ ))
  673. $(MAKE) $(package.mam) $(export.$(style):Q) > $tmp/$m.mam
  674. echo ";;;$tmp/$m.mam;$i/Mamfile"
  675. fi
  676. fi
  677. $(MAKE) --noexec $(-) $(=) recurse list.package.$(type) package.license.class=$(license:Q)
  678. fi
  679. done
  680. set -- $(package.dir:P=G)
  681. for i
  682. do tw -d $i -e "action:printf(';;;%s;%s\n',path,path);"
  683. done
  684. } |
  685. {
  686. : > $tmp/HEAD
  687. cat > $tmp/README <<'!'
  688. $(package.readme)
  689. !
  690. echo ";;;$tmp/README;README"
  691. sort -t';' -k5,5 -u
  692. : > $tmp/TAIL
  693. [[ '$(notice)' ]] && echo ";;;$tmp/TAIL;$(package.notice)"
  694. } |
  695. $(PAX) --filter=- \
  696. --to=ascii \
  697. --format=$(format) \
  698. --local \
  699. -wvf $(source) $(base) \
  700. $(PACKAGEVIEW:C%.*%-s",^&/,,"%) \
  701. $(vendor:?-s",^[^/],$(opt)&,"??)
  702. $(SUM) -x $(checksum) < $(source) > $(source:D:B:S=.$(checksum))
  703. rm -rf $tmp
  704. fi
  705. .source.lcl :
  706. if [[ '$(~$(name))' ]]
  707. then tmp=/tmp/pkg$(tmp)
  708. mkdir $tmp
  709. {
  710. integer m=0 o
  711. $(package.src:U:T=F:/.*/echo ";;;&"$("\n")/)
  712. set -- $(package.closure)
  713. for i
  714. do cd $(INSTALLROOT)/$i
  715. $(MAKE) --noexec $(-) $(=) .FILES.+=Mamfile recurse list.package.local
  716. done
  717. set -- $(package.dir:P=G)
  718. for i
  719. do tw -d $i -e "action:printf(';;;%s;%s\n',path,path);"
  720. done
  721. } |
  722. sort -t';' -k5,5 -u |
  723. $(PAX) --filter=- \
  724. --to=ascii \
  725. $(op:N=delta:??--format=$(format)?) \
  726. --local \
  727. -wvf $(source) $(base) \
  728. $(op:N=delta:?--format=gzip??) \
  729. $(PACKAGEVIEW:C%.*%-s",^&/,,"%)
  730. rm -rf $tmp
  731. fi
  732. .source.tgz :
  733. if [[ '$(~$(name))' ]]
  734. then tmp=/tmp/pkg$(tmp)
  735. mkdir $tmp
  736. {
  737. integer m=0 o
  738. if [[ '$(init)' == '$(name)' ]]
  739. then cat > $tmp/Makefile <<'!'
  740. :MAKE:
  741. !
  742. $(CMP) $(CMPFLAGS) $tmp/Makefile $(PACKAGEROOT)/src/Makefile && touch -r $(PACKAGEROOT)/src/Makefile $tmp/Makefile
  743. echo ";;;$tmp/Makefile;src/Makefile"
  744. cp $tmp/Makefile $tmp/Makefile1
  745. $(CMP) $(CMPFLAGS) $tmp/Makefile1 $(PACKAGEROOT)/src/cmd/Makefile && touch -r $(PACKAGEROOT)/src/cmd/Makefile $tmp/Makefile1
  746. echo ";;;$tmp/Makefile1;src/cmd/Makefile"
  747. cp $tmp/Makefile $tmp/Makefile2
  748. $(CMP) $(CMPFLAGS) $tmp/Makefile2 $(PACKAGEROOT)/src/lib/Makefile && touch -r $(PACKAGEROOT)/src/lib/Makefile $tmp/Makefile2
  749. echo ";;;$tmp/Makefile2;src/lib/Makefile"
  750. if [[ '$(mamfile)' == 1 ]]
  751. then cat > $tmp/Mamfile1 <<'!'
  752. info mam static
  753. note source level :MAKE: equivalent
  754. make install
  755. make all
  756. exec - ${MAMAKE} -r '*/*' ${MAMAKEARGS}
  757. done all virtual
  758. done install virtual
  759. !
  760. $(CMP) $(CMPFLAGS) $tmp/Mamfile1 $(PACKAGEROOT)/src/Mamfile && touch -r $(PACKAGEROOT)/src/Mamfile $tmp/Mamfile1
  761. echo ";;;$tmp/Mamfile1;src/Mamfile"
  762. cat > $tmp/Mamfile2 <<'!'
  763. info mam static
  764. note component level :MAKE: equivalent
  765. make install
  766. make all
  767. exec - ${MAMAKE} -r '*' ${MAMAKEARGS}
  768. done all virtual
  769. done install virtual
  770. !
  771. $(CMP) $(CMPFLAGS) $tmp/Mamfile2 $(PACKAGEROOT)/src/cmd/Mamfile && touch -r $(PACKAGEROOT)/src/cmd/Mamfile $tmp/Mamfile2
  772. echo ";;;$tmp/Mamfile2;src/cmd/Mamfile"
  773. cp $tmp/Mamfile2 $tmp/Mamfile3
  774. $(CMP) $(CMPFLAGS) $tmp/Mamfile3 $(PACKAGEROOT)/src/lib/Mamfile && touch -r $(PACKAGEROOT)/src/lib/Mamfile $tmp/Mamfile3
  775. echo ";;;$tmp/Mamfile3;src/lib/Mamfile"
  776. fi
  777. fi
  778. $(package.src:U:T=F:C%^$(PACKAGEROOT)/%%:C%.*%echo ";;;$(PACKAGEROOT)/&;&"$("\n")%)
  779. if [[ '$(~covers)' ]]
  780. then for i in $(~covers)
  781. do for j in lib pkg
  782. do if [[ -f $(PACKAGESRC)/$i.$j ]]
  783. then echo ";;;$(PACKAGESRC)/$i.$j;$(PACKAGELIB)/$i.$j"
  784. fi
  785. done
  786. for j in ver req
  787. do if [[ -f $(PACKAGEGEN)/$i.$j ]]
  788. then echo ";;;$(PACKAGEGEN)/$i.$j;$(PACKAGELIB)/$i.$j"
  789. fi
  790. done
  791. done
  792. for i in $(~covers:D=$(PACKAGESRC):B:S=.lic:T=F:T=I:N=*.def:D=$(PACKAGESRC):B:S:T=F:B:S)
  793. do echo ";;;$(PACKAGESRC)/$i;$(PACKAGELIB)/$i"
  794. done
  795. fi
  796. if [[ '$(PACKAGEDIR:B)' == '$(style)' ]]
  797. then echo $(name) $(version) $(release|version) 1 > $tmp/t
  798. $(CMP) $(CMPFLAGS) $tmp/t $(PACKAGEGEN)/$(name).ver || cp $tmp/t $(PACKAGEGEN)/$(name).ver
  799. echo ";;;$(PACKAGEGEN)/$(name).ver;$(PACKAGELIB)/$(name).ver"
  800. sed 's,1$,0,' $(~req:D=$(PACKAGEGEN):B:S=.ver:T=F) < /dev/null > $tmp/t
  801. $(CMP) $(CMPFLAGS) $tmp/t $(PACKAGEGEN)/$(name).req || cp $tmp/t $(PACKAGEGEN)/$(name).req
  802. echo ";;;$(PACKAGEGEN)/$(name).req;$(PACKAGELIB)/$(name).req"
  803. {
  804. echo "name='$(name)'"
  805. echo "index='$(index)'"
  806. echo "covers='$(~covers)'"
  807. echo "requires='$(~req)'"
  808. } > $tmp/t
  809. $(CMP) $(CMPFLAGS) $tmp/t $(PACKAGEGEN)/$(name).inx || cp $tmp/t $(PACKAGEGEN)/$(name).inx
  810. {
  811. {
  812. echo '$($(name).README)'
  813. if [[ '$(~covers)' ]]
  814. then echo "This package is a superset of the following package$(~covers:O=2:?s??): $(~covers); you won't need $(~covers:O=2:?these?this?) if you download $(name)."
  815. fi
  816. if [[ '$(~requires)' ]]
  817. then echo 'It requires the following package$(~requires:O=2:?s??): $(~requires).'
  818. fi
  819. } | fmt
  820. package help source
  821. package release $(name)
  822. } > $tmp/t
  823. $(CMP) $(CMPFLAGS) $tmp/t $(PACKAGEGEN)/$(name).README || cp $tmp/t $(PACKAGEGEN)/$(name).README
  824. echo ";;;$(PACKAGEGEN)/$(name).README;$(PACKAGELIB)/$(name).README"
  825. {
  826. echo '.xx title="$(name) package"'
  827. echo '.xx meta.description="$(name) package"'
  828. echo '.xx meta.keywords="software, package"'
  829. echo '.MT 4'
  830. echo '.TL'
  831. echo '$(name) package'
  832. echo '.H 1 "$(name) package"'
  833. echo '$($(name).README)'
  834. set -- $(package.closure:C,.*,$(INSTALLROOT)/&/PROMO.mm,:T=F:D::B)
  835. hot=
  836. for i
  837. do hot="$hot -e s/\\(\\<$i\\>\\)/\\\\h'0*1'\\1\\\\h'0'/"
  838. done
  839. set -- $(package.closure:B)
  840. if (( $# ))
  841. then echo 'Components in this package:'
  842. echo '.P'
  843. echo '.TS'
  844. echo 'center expand;'
  845. echo 'l l l l l l.'
  846. if [[ $hot ]]
  847. then hot="sed $hot"
  848. else hot=cat
  849. fi
  850. for i
  851. do echo $i
  852. done |
  853. pr -6 -t -s' ' |
  854. $hot
  855. echo '.TE'
  856. fi
  857. echo '.P'
  858. if [[ '$(~covers)' ]]
  859. then echo "This package is a superset of the following package$(~covers:O=2:?s??): $(~covers); you won't need $(~covers:O=2:?these?this?) if you download $(name)."
  860. fi
  861. if [[ '$(~requires)' ]]
  862. then echo 'It requires the following package$(~requires:O=2:?s??): $(~requires).'
  863. fi
  864. set -- $(.package.licenses. --all $(name))
  865. case $# in
  866. 0) ;;
  867. *) case $# in
  868. 1) echo 'The software is covered by this license:' ;;
  869. *) echo 'The software is covered by these licenses:' ;;
  870. esac
  871. echo .BL
  872. for j
  873. do i=$( $(PROTO) -l $j -p -h -o type=usage /dev/null | sed -e 's,.*\[-license?\([^]]*\).*,\1,' )
  874. echo .LI
  875. echo ".xx link=\"$i\""
  876. done
  877. echo .LE
  878. echo 'Individual components may be covered by separate licenses;'
  879. echo 'refer to the component source and/or binaries for more information.'
  880. echo .P
  881. ;;
  882. esac
  883. echo 'A recent'
  884. echo '.xx link="release change log"'
  885. echo 'is also included.'
  886. cat $(package.closure:C,.*,$(INSTALLROOT)/&/PROMO.mm,:T=F) < /dev/null
  887. echo '.H 1 "release change log"'
  888. echo '.xx index'
  889. echo '.nf'
  890. package release $(name) |
  891. sed -e 's/:::::::: \(.*\) ::::::::/.fi\$("\n").H 1 "\1 changes"\$("\n").nf/'
  892. echo '.fi'
  893. } |
  894. $(MM2HTML) $(MM2HTMLFLAGS) -o nohtml.ident > $tmp/t
  895. $(STDED) $(STDEDFLAGS) $tmp/t <<'!'
  896. /^<!--LABELS-->$/,/^<!--\/LABELS-->$/s/ changes</</
  897. /^<!--LABELS-->$/,/^<!--\/LABELS-->$/m/<A name="release change log">/
  898. w
  899. q
  900. !
  901. $(CMP) $(CMPFLAGS) $tmp/t $(PACKAGEGEN)/$(name).html || cp $tmp/t $(PACKAGEGEN)/$(name).html
  902. echo ";;;$(PACKAGEGEN)/$(name).html;$(PACKAGELIB)/$(name).html"
  903. if [[ '$(deltasince)' ]]
  904. then {
  905. echo '.xx title="$(name) package"'
  906. echo '.xx meta.description="$(name) package $(version) delta $(release)"'
  907. echo '.xx meta.keywords="software, package, delta"'
  908. echo '.MT 4'
  909. echo '.TL'
  910. echo '$(name) package $(deltaversion) delta $(release)'
  911. echo '.H 1 "$(name) package $(deltaversion) delta $(release) changes"'
  912. echo '.nf'
  913. package release $(deltasince) $(name) |
  914. sed -e 's/:::::::: \(.*\) ::::::::/.H 2 \1/'
  915. echo '.fi'
  916. } |
  917. $(MM2HTML) $(MM2HTMLFLAGS) -o nohtml.ident > $tmp/t
  918. $(CMP) $(CMPFLAGS) $tmp/t $(PACKAGEGEN)/$(name).$(release).html || cp $tmp/t $(PACKAGEGEN)/$(name).$(release).html
  919. echo ";;;$(PACKAGEGEN)/$(name).$(release).html;$(PACKAGELIB)/$(name).$(release).html"
  920. fi
  921. fi
  922. set -- $(package.closure)
  923. for i
  924. do cd $(INSTALLROOT)/$i
  925. if [[ ! '$(license)' ]] || $(MAKE) --noexec --silent 'exit $$(LICENSECLASS:N=$(license):?0?1?)' .
  926. then if [[ '$(mamfile)' == 1 ]]
  927. then (( o=m ))
  928. s=$( $(MAKE) --noexec --recurse=list recurse 2>/dev/null )
  929. if [[ $s ]]
  930. then for j in $s
  931. do if [[ -d $j ]]
  932. then cd $j
  933. if [[ ! '$(license)' ]] || $(MAKE) --noexec --silent 'exit $$(LICENSECLASS:N=$(license):?0?1?)' .
  934. then (( m++ ))
  935. $(MAKE) $(package.mam) > $tmp/$m.mam
  936. $(CMP) $(CMPFLAGS) $tmp/$m.mam $(PACKAGEROOT)/$i/$j/Mamfile && touch -r $(PACKAGEROOT)/$i/$j/Mamfile $tmp/$m.mam
  937. echo ";;;$tmp/$m.mam;$i/$j/Mamfile"
  938. fi
  939. cd $(INSTALLROOT)/$i
  940. fi
  941. done
  942. if (( o != m ))
  943. then (( m++ ))
  944. cat > $tmp/$m.mam <<'!'
  945. info mam static
  946. note subcomponent level :MAKE: equivalent
  947. make install
  948. make all
  949. exec - ${MAMAKE} -r '*' ${MAMAKEARGS}
  950. done all virtual
  951. done install virtual
  952. !
  953. $(CMP) $(CMPFLAGS) $tmp/$m.mam $(PACKAGEROOT)/$i/Mamfile && touch -r $(PACKAGEROOT)/$i/Mamfile $tmp/$m.mam
  954. echo ";;;$tmp/$m.mam;$i/Mamfile"
  955. fi
  956. else (( m++ ))
  957. $(MAKE) $(package.mam) > $tmp/$m.mam
  958. $(CMP) $(CMPFLAGS) $tmp/$m.mam $(PACKAGEROOT)/$i/Mamfile && touch -r $(PACKAGEROOT)/$i/Mamfile $tmp/$m.mam
  959. echo ";;;$tmp/$m.mam;$i/Mamfile"
  960. fi
  961. fi
  962. $(MAKE) --noexec $(-) $(=) recurse list.package.$(type) package.license.class=$(license:Q) $(copyright:N=1:??LICENSE=?)
  963. fi
  964. done
  965. set -- $(package.dir:P=G)
  966. for i
  967. do tw -d $i -e "action:printf(';;;%s;%s\n',path,path);"
  968. done
  969. } |
  970. {
  971. : > $tmp/HEAD
  972. [[ '$(notice)' ]] && echo ";;;$tmp/HEAD;$(package.notice)"
  973. cat > $tmp/README <<'!'
  974. $(package.readme)
  975. !
  976. echo ";;;$tmp/README;README"
  977. $(CMP) $(CMPFLAGS) $tmp/README $(PACKAGEROOT)/README && touch -r $(PACKAGEROOT)/README $tmp/README
  978. sort -t';' -k5,5 -u
  979. : > $tmp/TAIL
  980. [[ '$(notice)' ]] && echo ";;;$tmp/TAIL;$(package.notice)"
  981. } |
  982. $(PAX) --filter=- \
  983. --to=ascii \
  984. $(op:N=delta:??--format=$(format)?) \
  985. --local \
  986. -wvf $(source) $(base) \
  987. $(op:N=delta:?--format=gzip??) \
  988. $(PACKAGEVIEW:C%.*%-s",^&/,,"%)
  989. $(SUM) -x $(checksum) < $(source) > $(source:D:B:S=.$(checksum))
  990. echo local > $(source:D:B=$(name):S=.tim)
  991. if [[ '$(incremental)' == 1 && '$(old.source)' ]]
  992. then $(PAX) -rf $(source) -wvf $(old.new.source) -z $(old.source)
  993. $(SUM) -x $(checksum) < $(old.new.source) > $(old.new.source:D:B:S=.$(checksum))
  994. fi
  995. rm -rf $tmp
  996. else if [[ '$(old.source)' ]] && $(CMP) $(CMPFLAGS) $(source.$(name)) $(source)
  997. then : $(name) is up to date
  998. else echo $(name) $(version) $(release|version) 1 > $(PACKAGEGEN)/$(name).ver
  999. : > $(PACKAGEGEN)/$(name).req
  1000. {
  1001. echo "name='$(name)'"
  1002. echo "index='$(index)'"
  1003. echo "covers='$(~covers)'"
  1004. echo "requires='$(~req)'"
  1005. } > $(PACKAGEGEN)/$(name).inx
  1006. {
  1007. echo '.xx title="$(name) package"'
  1008. echo '.xx meta.description="$(name) package"'
  1009. echo '.xx meta.keywords="software, package"'
  1010. echo '.MT 4'
  1011. echo '.TL'
  1012. echo '$(name) package'
  1013. echo '.H 1'
  1014. echo '$($(name).README)'
  1015. } |
  1016. $(MM2HTML) $(MM2HTMLFLAGS) -o nohtml.ident > $(PACKAGEGEN)/$(name).html
  1017. if [[ '$(source.$(name))' ]]
  1018. then {
  1019. echo '$($(name).README)'
  1020. package help source
  1021. } > $(PACKAGEGEN)/$(name).README
  1022. cp $(source.$(name)) $(source)
  1023. $(SUM) -x $(checksum) < $(source) > $(source:D:B:S=.$(checksum))
  1024. fi
  1025. echo local > $(source:D:B=$(name):S=.tim)
  1026. fi
  1027. fi
  1028. binary : .binary.init .binary.gen .binary.$$(style)
  1029. .binary.init : .MAKE
  1030. local A B D I P V
  1031. type := binary
  1032. if ! "$(incremental)"
  1033. incremental = 0
  1034. end
  1035. if ! "$(~$(name))"
  1036. if name == "ratz"
  1037. suffix = exe
  1038. else
  1039. suffix = gz
  1040. end
  1041. end
  1042. : $(.init.$(style)) :
  1043. : $(details.$(style):V:R) :
  1044. A := $(binary.list)
  1045. B := $(A:N=*.$(stamp).$(CC.HOSTTYPE).$(suffix):N!=*.$(stamp).$(stamp).*:O=1:T=F)
  1046. P := $(A:N=*.$(stamp).$(CC.HOSTTYPE).$(suffix):N!=*.$(stamp).$(stamp).*:O=2:T=F)
  1047. D := $(A:N=*.$(stamp).$(stamp).$(CC.HOSTTYPE).$(suffix):O=1:T=F)
  1048. if op == "delta"
  1049. if ! B
  1050. error 3 delta requires a base archive
  1051. end
  1052. base := -z $(B)
  1053. if "$(release)" != "$(stamp)"
  1054. release := $("":T=R%Y-%m-%d)
  1055. end
  1056. binary := $(B:/$(CC.HOSTTYPE).$(suffix)$/$(release).&/)
  1057. version := $(binary:B:B:/$(name).//)
  1058. elif B || op == "base"
  1059. if op == "base"
  1060. for I $(B) $(P)
  1061. V := $(I:B:/$(name)\.\([^.]*\).*/\1/)
  1062. if V == "[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]" && V != "$(version)"
  1063. old.version := $(V)
  1064. old.binary := $(I)
  1065. if "$(old.version)" >= "$(version)"
  1066. error 3 $(name): previous base $(old.version) is newer than $(version)
  1067. end
  1068. break
  1069. end
  1070. end
  1071. else
  1072. binary := $(B)
  1073. end
  1074. if B == "$(binary)"
  1075. if "$(B:D:B)" == "$(D:D:B)" && "$(B:S)" != "$(D:S)"
  1076. error 3 $(B:B:S): base overwrite would invalidate delta $(D:B:S)
  1077. end
  1078. error 1 $(B:B:S): replacing current base
  1079. end
  1080. version := $(binary:B:/$(name).//:/\..*//)
  1081. end
  1082. PACKAGEGEN := $(PACKAGEBIN)/gen
  1083. .binary.gen : $$(PACKAGEDIR) $$(PACKAGEGEN)
  1084. .binary.exp .binary.pkg .binary.rpm : .MAKE
  1085. error 3 $(style): binary package style not supported yet
  1086. .binary.cyg :
  1087. if [[ '$(~$(name))' ]]
  1088. then tmp=/tmp/pkg$(tmp)
  1089. mkdir $tmp
  1090. {
  1091. integer m=0 o
  1092. {
  1093. echo '$($(name.original).README)' | fmt
  1094. cat <<'!'
  1095. $(readme.$(style):@?$$("\n")$$(readme.$$(style))??)
  1096. !
  1097. } > $tmp/README1
  1098. echo ";;;$tmp/README1;usr/share/doc/Cygwin/$(opt:/.$//).README"
  1099. {
  1100. echo '$($(name.original).README)' | fmt
  1101. cat <<'!'
  1102. $()
  1103. The remainder of this file is the README from the source package
  1104. that was used to generate this binary package. It describes
  1105. the source build hierarchy, not the current directory.
  1106. $()
  1107. $(package.readme)
  1108. !
  1109. } > $tmp/README2
  1110. echo ";;;$tmp/README2;usr/share/doc/$(opt)README"
  1111. package release $(name.original) > $tmp/RELEASE
  1112. echo ";;;$tmp/RELEASE;usr/share/doc/$(opt)RELEASE"
  1113. cat > $(binary:/.$(suffix)//).setup.hint <<'!'
  1114. category: $(category:/\(.\).*/\1/U)$(category:/.\(.*\)/\1/L)
  1115. requires: cygwin
  1116. sdesc: "$(index)"
  1117. ldesc: "$($(name.original).README)"
  1118. !
  1119. set -- $(.package.licenses. --text $(name.original):N!=*.lic)
  1120. for i
  1121. do echo ";;;${i};usr/share/doc/$(opt)LICENSE-${i##*/}"
  1122. done
  1123. cat <<'!'
  1124. $(filter.$(style))
  1125. !
  1126. if [[ '$(postinstall.$(style):V:O=1:?1??)' ]]
  1127. then cat >$tmp/postinstall <<'!'
  1128. $("#")!/bin/sh
  1129. $(postinstall.$(style))
  1130. !
  1131. echo ";;;$tmp/postinstall;etc/postinstall/$(name).sh"
  1132. fi
  1133. } |
  1134. {
  1135. : > $tmp/HEAD
  1136. [[ '$(notice)' ]] && echo ";;;$tmp/HEAD;$(package.notice)"
  1137. sort -t';' -k5,5 -u
  1138. : > $tmp/TAIL
  1139. [[ '$(notice)' ]] && echo ";;;$tmp/TAIL;$(package.notice)"
  1140. } |
  1141. $(PAX) --filter=- \
  1142. --to=ascii \
  1143. --format=$(format) \
  1144. --local \
  1145. -wvf $(binary)
  1146. $(SUM) -x $(checksum) < $(binary) > $(binary:D:B:S=.$(checksum))
  1147. rm -rf $tmp
  1148. fi
  1149. .binary.lcl :
  1150. if [[ '$(~$(name))' ]]
  1151. then tmp=/tmp/pkg$(tmp)
  1152. mkdir $tmp
  1153. {
  1154. $(package.src:U:T=F:/.*/echo ";;;&"$("\n")/)
  1155. $(package.bin:U:T=F:/.*/echo ";;;&"$("\n")/)
  1156. set -- $(package.closure)
  1157. for i
  1158. do cd $(INSTALLROOT)/$i
  1159. $(MAKE) --noexec $(-) --variants=$(variants:Q) $(=) recurse list.package.$(type) package.license.class=$(license:Q) cc-
  1160. done
  1161. } |
  1162. $(PAX) --filter=- \
  1163. --to=ascii \
  1164. $(op:N=delta:??--format=$(format)?) \
  1165. --local \
  1166. --checksum=md5:$(PACKAGEGEN)/$(name).sum \
  1167. --install=$(PACKAGEGEN)/$(name).ins \
  1168. -wvf $(binary) $(base) \
  1169. $(op:N=delta:?--format=gzip??) \
  1170. -s",^$tmp/,$(INSTALLOFFSET)/," \
  1171. $(PACKAGEROOT:C%.*%-s",^&/,,"%)
  1172. $(SUM) -x $(checksum) < $(binary) > $(binary:D:B:S=.$(checksum))
  1173. echo local > $(binary:D:B=$(name):S=.$(CC.HOSTTYPE).tim)
  1174. rm -rf $tmp
  1175. fi
  1176. .binary.tgz :
  1177. if [[ '$(~$(name))' ]]
  1178. then tmp=/tmp/pkg$(tmp)
  1179. mkdir $tmp
  1180. {
  1181. if [[ '$(init)' == '$(name)' ]]
  1182. then for i in lib32 lib64
  1183. do if [[ -d $(INSTALLROOT)/$i ]]
  1184. then echo ";physical;;$(INSTALLROOT)/$i"
  1185. fi
  1186. done
  1187. fi
  1188. $(package.src:U:T=F:C%^$(PACKAGEROOT)/%%:C%.*%echo ";;;$(PACKAGEROOT)/&;&"$("\n")%)
  1189. $(package.bin:U:T=F:C%^$(INSTALLROOT)/%%:C%.*%echo ";;;$(INSTALLROOT)/&;&"$("\n")%)
  1190. $(package.auxiliary.$(style):U:T=F:C%^$(INSTALLROOT)/%%:C%.*%echo ";;;$(INSTALLROOT)/&;&"$("\n")%)
  1191. if [[ '$(PACKAGEDIR:B)' == '$(style)' ]]
  1192. then echo $(name) $(version) $(release|version) 1 > $(PACKAGEGEN)/$(name).ver
  1193. echo ";;;$(PACKAGEGEN)/$(name).ver;$(PACKAGELIB)/$(name).ver"
  1194. if [[ '$(~covers)' ]]
  1195. then for i in $(~covers)
  1196. do for j in lic pkg
  1197. do if [[ -f $(PACKAGESRC)/$i.$j ]]
  1198. then echo ";;;$(PACKAGESRC)/$i.$j;$(PACKAGELIB)/$i.$j"
  1199. fi
  1200. done
  1201. for j in ver req
  1202. do if [[ -f $(PACKAGEGEN)/$i.$j ]]
  1203. then echo ";;;$(PACKAGEGEN)/$i.$j;$(PACKAGELIB)/$i.$j"
  1204. fi
  1205. done
  1206. done
  1207. for i in $(~covers:D=$(PACKAGESRC):B:S=.lic:T=F:T=I:N=*.def:D=$(PACKAGESRC):B:S:T=F:B:S)
  1208. do echo ";;;$(PACKAGESRC)/$i;$(PACKAGELIB)/$i"
  1209. done
  1210. fi
  1211. sed 's,1$,0,' $(~req:D=$(PACKAGEGEN):B:S=.ver:T=F) < /dev/null > $(PACKAGEGEN)/$(name).req
  1212. echo ";;;$(PACKAGEGEN)/$(name).req;$(PACKAGELIB)/$(name).req"
  1213. {
  1214. echo "name='$(name)'"
  1215. echo "index='$(index)'"
  1216. echo "covers='$(~covers)'"
  1217. echo "requires='$(~req)'"
  1218. } > $(PACKAGEGEN)/$(name).inx
  1219. {
  1220. {
  1221. echo '$($(name).README)'
  1222. if [[ '$(~covers)' ]]
  1223. then echo "This package is a superset of the following package$(~covers:O=2:?s??): $(~covers); you won't need $(~covers:O=2:?these?this?) if you download $(name)."
  1224. fi
  1225. if [[ '$(~requires)' ]]
  1226. then echo 'It requires the following package$(~requires:O=2:?s??): $(~requires).'
  1227. fi
  1228. } | fmt
  1229. package help binary
  1230. package release $(name)
  1231. } > $(PACKAGEGEN)/$(name).README
  1232. echo ";;;$(PACKAGEGEN)/$(name).README;$(PACKAGELIB)/$(name).README"
  1233. fi
  1234. set -- $(package.closure)
  1235. for i
  1236. do cd $(INSTALLROOT)/$i
  1237. $(MAKE) --noexec $(-) --variants=$(variants:Q) $(=) package.strip=$(strip) recurse list.package.$(type) package.license.class=$(license:Q) cc-
  1238. done
  1239. } |
  1240. {
  1241. : > $tmp/HEAD
  1242. [[ '$(notice)' ]] && echo ";;;$tmp/HEAD;$(package.notice)"
  1243. cat > $tmp/README <<'!'
  1244. $(package.readme)
  1245. !
  1246. echo ";;;$tmp/README;README"
  1247. sort -t';' -k5,5 -u
  1248. : > $tmp/TAIL
  1249. [[ '$(notice)' ]] && echo ";;;$tmp/TAIL;$(package.notice)"
  1250. } |
  1251. $(PAX) --filter=- \
  1252. --to=ascii \
  1253. $(op:N=delta:??--format=$(format)?) \
  1254. --local \
  1255. --checksum=md5:$(PACKAGEGEN)/$(name).sum \
  1256. --install=$(PACKAGEGEN)/$(name).ins \
  1257. -wvf $(binary) $(base) \
  1258. $(op:N=delta:?--format=gzip??) \
  1259. -s",^$tmp/,$(INSTALLOFFSET)/," \
  1260. $(PACKAGEROOT:C%.*%-s",^&/,,"%)
  1261. echo $(binary) >> $(binary:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst)
  1262. $(SUM) -x $(checksum) < $(binary) > $(binary:D:B:S=.$(checksum))
  1263. echo $(binary:D:B:S=.$(checksum)) >> $(binary:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst)
  1264. echo local > $(binary:D:B=$(name):S=.$(CC.HOSTTYPE).tim)
  1265. if [[ '$(incremental)' == 1 && '$(old.binary)' ]]
  1266. then $(PAX) -rf $(binary) -wvf $(old.new.binary) -z $(old.binary)
  1267. echo $(old.new.binary) >> $(binary:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst)
  1268. $(SUM) -x $(checksum) < $(old.new.binary) > $(old.new.binary:D:B:S=.$(checksum))
  1269. echo $(old.new.binary:D:B:S=.$(checksum)) >> $(binary:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst)
  1270. fi
  1271. rm -rf $tmp
  1272. else if [[ '$(binary.$(name))' ]]
  1273. then exe=$(binary.$(name))
  1274. else exe=$(INSTALLROOT)/bin/$(name)
  1275. fi
  1276. if [[ '$(old.binary)' ]] && $(CMP) $(CMPFLAGS) $exe $(binary)
  1277. then : $(name) is up to date
  1278. else echo $(name) $(version) $(release|version) 1 > $(PACKAGEGEN)/$(name).ver
  1279. : > $(PACKAGEGEN)/$(name).req
  1280. {
  1281. echo "name='$(name)'"
  1282. echo "index='$(index)'"
  1283. echo "covers='$(~covers)'"
  1284. echo "requires='$(~req)'"
  1285. } > $(PACKAGEGEN)/$(name).inx
  1286. {
  1287. echo '$($(name).README)'
  1288. package help binary
  1289. } > $(PACKAGEGEN)/$(name).README
  1290. case "$(binary)" in
  1291. *.gz) gzip < $exe > $(binary) ;;
  1292. *) cp $exe $(binary) ;;
  1293. esac
  1294. $(SUM) -x $(checksum) < $(binary) > $(binary:D:B:S=.$(checksum))
  1295. echo local > $(binary:D:B=$(name):S=.$(CC.HOSTTYPE).tim)
  1296. fi
  1297. echo $(binary) >> $(binary:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst)
  1298. echo $(binary:D:B:S=.$(checksum)) >> $(binary:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst)
  1299. fi
  1300. runtime : .runtime.init .runtime.gen .runtime.$$(style)
  1301. .runtime.init : .MAKE
  1302. local A B D I P V
  1303. type := runtime
  1304. if ! "$(incremental)"
  1305. incremental = 0
  1306. end
  1307. if ! "$(~$(name))"
  1308. if name == "ratz"
  1309. suffix = exe
  1310. else
  1311. suffix = gz
  1312. end
  1313. end
  1314. : $(.init.$(style)) :
  1315. : $(details.$(style):V:R) :
  1316. A := $(runtime.list)
  1317. B := $(A:N=*.$(stamp).$(CC.HOSTTYPE).$(suffix):N!=*.$(stamp).$(stamp).*:O=1:T=F)
  1318. P := $(A:N=*.$(stamp).$(CC.HOSTTYPE).$(suffix):N!=*.$(stamp).$(stamp).*:O=2:T=F)
  1319. D := $(A:N=*.$(stamp).$(stamp).$(CC.HOSTTYPE).$(suffix):O=1:T=F)
  1320. if op == "delta"
  1321. if ! B
  1322. error 3 delta requires a base archive
  1323. end
  1324. base := -z $(B)
  1325. if "$(release)" != "$(stamp)"
  1326. release := $("":T=R%Y-%m-%d)
  1327. end
  1328. runtime := $(B:/$(CC.HOSTTYPE).$(suffix)$/$(release).&/)
  1329. version := $(runtime:B:B:/$(name).//)
  1330. elif B || op == "base"
  1331. if op == "base"
  1332. for I $(B) $(P)
  1333. V := $(I:B:/$(name)-run\.\([^.]*\).*/\1/)
  1334. if V == "[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]" && V != "$(version)"
  1335. old.version := $(V)
  1336. old.runtime := $(I)
  1337. if "$(old.version)" >= "$(version)"
  1338. error 3 $(name): previous base $(old.version) is newer than $(version)
  1339. end
  1340. break
  1341. end
  1342. end
  1343. else
  1344. runtime := $(B)
  1345. end
  1346. if B == "$(runtime)"
  1347. if "$(B:D:B)" == "$(D:D:B)" && "$(B:S)" != "$(D:S)"
  1348. error 3 $(B:B:S): base overwrite would invalidate delta $(D:B:S)
  1349. end
  1350. error 1 $(B:B:S): replacing current base
  1351. end
  1352. version := $(runtime:B:/$(name)-run.//:/\..*//)
  1353. end
  1354. PACKAGEGEN := $(PACKAGESRC)/gen
  1355. .runtime.gen : $$(PACKAGEDIR) $$(PACKAGEGEN)
  1356. .runtime.cyg .runtime.exp .runtime.lcl .runtime.pkg .runtime.rpm : .MAKE
  1357. error 3 $(style): runtime package style not supported yet
  1358. .runtime.tgz :
  1359. if [[ '$(~$(name))' ]]
  1360. then tmp=/tmp/pkg$(tmp)
  1361. mkdir $tmp
  1362. {
  1363. if [[ '$(init)' == '$(name)' ]]
  1364. then for i in lib32 lib64
  1365. do if [[ -d $(INSTALLROOT)/$i ]]
  1366. then echo ";physical;;$(INSTALLROOT)/$i"
  1367. fi
  1368. done
  1369. fi
  1370. $(package.src:U:T=F:C%^$(PACKAGEROOT)/%%:C%.*%echo ";;;$(PACKAGEROOT)/&;&"$("\n")%)
  1371. $(package.bin:U:T=F:C%^$(INSTALLROOT)/%%:C%.*%echo ";;;$(INSTALLROOT)/&;&"$("\n")%)
  1372. $(package.auxiliary.$(style):U:T=F:C%^$(INSTALLROOT)/%%:C%.*%echo ";;;$(INSTALLROOT)/&;&"$("\n")%)
  1373. echo $(name) $(version) $(release|version) 1 > $(PACKAGEGEN)/$(name).ver
  1374. echo ";;;$(PACKAGEGEN)/$(name).ver;$(PACKAGELIB)/$(name).ver"
  1375. if [[ '$(~covers)' ]]
  1376. then for i in $(~covers)
  1377. do for j in lic pkg
  1378. do if [[ -f $(PACKAGESRC)/$i.$j ]]
  1379. then echo ";;;$(PACKAGESRC)/$i.$j;$(PACKAGELIB)/$i.$j"
  1380. fi
  1381. done
  1382. for j in ver req
  1383. do if [[ -f $(PACKAGEGEN)/$i.$j ]]
  1384. then echo ";;;$(PACKAGEGEN)/$i.$j;$(PACKAGELIB)/$i.$j"
  1385. fi
  1386. done
  1387. done
  1388. for i in $(~covers:D=$(PACKAGESRC):B:S=.lic:T=F:T=I:N=*.def:D=$(PACKAGESRC):B:S:T=F:B:S)
  1389. do echo ";;;$(PACKAGESRC)/$i;$(PACKAGELIB)/$i"
  1390. done
  1391. fi
  1392. sed 's,1$,0,' $(~req:D=$(PACKAGEGEN):B:S=.ver:T=F) < /dev/null > $(PACKAGEGEN)/$(name).req
  1393. echo ";;;$(PACKAGEGEN)/$(name).req;$(PACKAGELIB)/$(name).req"
  1394. {
  1395. echo "name='$(name)'"
  1396. echo "index='$(index)'"
  1397. echo "covers='$(~covers)'"
  1398. echo "requires='$(~req)'"
  1399. } > $(PACKAGEGEN)/$(name).inx
  1400. {
  1401. {
  1402. echo '$($(name).README)'
  1403. if [[ '$(~covers)' ]]
  1404. then echo
  1405. echo "This package is a superset of the following package$(~covers:O=2:?s??): $(~covers); you won't need $(~covers:O=2:?these?this?) if you download $(name)."
  1406. fi
  1407. if [[ '$(~requires)' ]]
  1408. then echo
  1409. echo 'It requires the following package$(~requires:O=2:?s??): $(~requires).'
  1410. fi
  1411. echo
  1412. echo "To install this $(type) package read the tarball into a directory"
  1413. echo "suitable for containing bin and lib subdirectories, and run the"
  1414. echo "$(PACKAGELIB)/gen/$(name)-run.ins script to fix up permissions."
  1415. echo
  1416. echo "To use the package export the bin directory in PATH. The commands and"
  1417. echo "libraries use \$PATH to locate dynamic libraries and related data files."
  1418. echo
  1419. } | fmt
  1420. } > $(PACKAGEGEN)/$(name)-run.README
  1421. echo ";;;$(PACKAGEGEN)/$(name)-run.README;$(PACKAGELIB)/$(name)-run.README"
  1422. set -- $(package.closure)
  1423. for i
  1424. do cd $(INSTALLROOT)/$i
  1425. $(MAKE) --noexec $(-) --variants=$(variants:Q) $(=) package.strip=$(strip) recurse list.package.$(type) package.license.class=$(license:Q) cc-
  1426. done
  1427. } |
  1428. {
  1429. : > $tmp/HEAD
  1430. [[ '$(notice)' ]] && echo ";;;$tmp/HEAD;$(package.notice)"
  1431. cat > $tmp/README <<'!'
  1432. $(package.readme)
  1433. !
  1434. echo ";;;$tmp/README;README"
  1435. sort -t';' -k5,5 -u
  1436. : > $tmp/TAIL
  1437. [[ '$(notice)' ]] && echo ";;;$tmp/TAIL;$(package.notice)"
  1438. } |
  1439. $(PAX) --filter=- \
  1440. --to=ascii \
  1441. $(op:N=delta:??--format=$(format)?) \
  1442. --local \
  1443. --checksum=md5:$(PACKAGEGEN)/$(name)-run.sum \
  1444. --install=$(PACKAGEGEN)/$(name)-run.ins \
  1445. -wvf $(runtime) $(base) \
  1446. $(op:N=delta:?--format=gzip??) \
  1447. -s",^$tmp/,$(INSTALLOFFSET)/," \
  1448. $(PACKAGEROOT:C%.*%-s",^&/,,"%)
  1449. echo $(runtime) >> $(runtime:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst)
  1450. $(SUM) -x $(checksum) < $(runtime) > $(runtime:D:B:S=.$(checksum))
  1451. echo $(runtime:D:B:S=.$(checksum)) >> $(runtime:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst)
  1452. echo local > $(runtime:D:B=$(name)-run:S=.$(CC.HOSTTYPE).tim)
  1453. if [[ '$(incremental)' == 1 && '$(old.runtime)' ]]
  1454. then $(PAX) -rf $(runtime) -wvf $(old.new.runtime) -z $(old.runtime)
  1455. echo $(old.new.runtime) >> $(runtime:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst)
  1456. $(SUM) -x $(checksum) < $(old.new.runtime) > $(old.new.runtime:D:B:S=.$(checksum))
  1457. echo $(old.new.runtime:D:B:S=.$(checksum)) >> $(runtime:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst)
  1458. fi
  1459. rm -rf $tmp
  1460. fi
  1461. list.installed list.manifest :
  1462. set -- $(package.closure)
  1463. for i
  1464. do cd $(INSTALLROOT)/$i
  1465. ignore $(MAKE) --noexec $(-) $(=) $(<)
  1466. done