rpm.patch.feature 37 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045
  1. ##
  2. ## rpm.patch.feature -- Annotated patch file
  3. ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2003 Cable & Wireless <http://www.cw.com/>
  6. ##
  7. ## This file assembles changes to existing RPM source files between
  8. ## the original RedHat RPM and the OpenPKG RPM variant. It can be
  9. ## automatically applied to a vanilla RedHat RPM source tree with the
  10. ## 'patch' tool to upgrade those files. Each patch snippet is annotated
  11. ## with a short description.
  12. ##
  13. ## Created on: 28-Aug-2003
  14. ##
  15. ## ATTENTION: THIS PATCH FILE WAS AUTO-GENERATED FROM AN OPENPKG
  16. ## RPM CVS REPOSITORY, HENCE DO NOT EDIT THIS FILE.
  17. ##
  18. +---------------------------------------------------------------------------
  19. | Remove "tools" directory from sub-directory list because it contains
  20. | things we are not interested in and which cause some build trouble
  21. | anyway.
  22. | Use a plain "rpmpopt" file without any trailing version.
  23. | Adjust paths to conform to OpenPKG filesystem layout.
  24. +---------------------------------------------------------------------------
  25. Index: Makefile.am
  26. --- Makefile.am 29 May 2003 18:20:28 -0000 1.1.1.17
  27. +++ Makefile.am 26 Aug 2003 08:14:57 -0000
  28. @@ -12,9 +12,9 @@
  29. xmlspec/examples/*.sh xmlspec/examples/*.lst \
  30. xmlspec/examples/*.xmlspec \
  31. po/*.in po/*.po po/rpm.pot \
  32. - rpm.magic rpmpopt-$(VERSION) rpmqv.c rpm.c
  33. + rpm.magic rpmpopt rpmqv.c rpm.c
  34. -SUBDIRS = intl po @WITH_ZLIB_SUBDIR@ @WITH_ELFUTILS_SUBDIR@ file @WITH_DB_SUBDIR@ popt @WITH_BEECRYPT_SUBDIR@ rpmio rpmdb lib build misc @WITH_PYTHON_SUBDIR@ tools scripts tests doc .
  35. +SUBDIRS = intl @WITH_ZLIB_SUBDIR@ @WITH_ELFUTILS_SUBDIR@ file @WITH_DB_SUBDIR@ popt @WITH_BEECRYPT_SUBDIR@ rpmio rpmdb lib build misc @WITH_PYTHON_SUBDIR@ scripts tests doc .
  36. INCLUDES = \
  37. -I$(top_srcdir)/build \
  38. @@ -47,13 +47,10 @@
  39. pkglibdir = @RPMCONFIGDIR@
  40. pkglib_PROGRAMS = rpmb rpmd rpmi rpmk rpmq
  41. -pkglib_DATA = rpmrc rpmpopt-$(VERSION) macros
  42. +pkglib_DATA = rpmrc rpmpopt macros
  43. pkglib_SCRIPTS = find-provides find-requires mkinstalldirs \
  44. config.guess config.sub config.site
  45. -rpmpopt-$(VERSION): rpmpopt
  46. - cp rpmpopt $@
  47. -
  48. noinst_HEADERS = build.h debug.h system.h
  49. rpm_SOURCES =
  50. @@ -124,32 +121,32 @@
  51. pkgsrcdir = $(prefix)/src/$(RPMCANONVENDOR)
  52. install-data-local:
  53. - @$(mkinstalldirs) $(DESTDIR)$(varprefix)/lib/rpm
  54. + @$(mkinstalldirs) $(DESTDIR)$(varprefix)/lib/openpkg
  55. @rm -f $(DESTDIR)$(libdir)/rpmrc
  56. @@LN_S@ rpm/rpmrc $(DESTDIR)$(libdir)/rpmrc
  57. @rm -f $(DESTDIR)$(libdir)/rpmpopt
  58. @@LN_S@ rpm/rpmpopt $(DESTDIR)$(libdir)/rpmpopt
  59. @rm -f $(DESTDIR)$(libdir)/rpm/rpmt
  60. - @@LN_S@ rpmb $(DESTDIR)$(libdir)/rpm/rpmt
  61. - @rm -f $(DESTDIR)$(libdir)/rpm/rpme
  62. - @@LN_S@ rpmi $(DESTDIR)$(libdir)/rpm/rpme
  63. - @rm -f $(DESTDIR)$(libdir)/rpm/rpmu
  64. - @@LN_S@ rpmi $(DESTDIR)$(libdir)/rpm/rpmu
  65. - @rm -f $(DESTDIR)$(libdir)/rpm/rpmv
  66. - @@LN_S@ rpmq $(DESTDIR)$(libdir)/rpm/rpmv
  67. + @@LN_S@ rpmb $(DESTDIR)$(libdir)/openpkg/rpmt
  68. + @rm -f $(DESTDIR)$(libdir)/openpkg/rpme
  69. + @@LN_S@ rpmi $(DESTDIR)$(libdir)/openpkg/rpme
  70. + @rm -f $(DESTDIR)$(libdir)/openpkg/rpmu
  71. + @@LN_S@ rpmi $(DESTDIR)$(libdir)/openpkg/rpmu
  72. + @rm -f $(DESTDIR)$(libdir)/openpkg/rpmv
  73. + @@LN_S@ rpmq $(DESTDIR)$(libdir)/openpkg/rpmv
  74. rm -f $(DESTDIR)$(bindir)/rpmbuild
  75. - @LN_S@ ../lib/rpm/rpmb $(DESTDIR)$(bindir)/rpmbuild
  76. + @LN_S@ ../lib/openpkg/rpmb $(DESTDIR)$(bindir)/rpmbuild
  77. rm -f $(DESTDIR)$(bindir)/rpmquery
  78. - @LN_S@ ../lib/rpm/rpmq $(DESTDIR)$(bindir)/rpmquery
  79. + @LN_S@ ../lib/openpkg/rpmq $(DESTDIR)$(bindir)/rpmquery
  80. rm -f $(DESTDIR)$(bindir)/rpmverify
  81. - @LN_S@ ../lib/rpm/rpmv $(DESTDIR)$(bindir)/rpmverify
  82. + @LN_S@ ../lib/openpkg/rpmv $(DESTDIR)$(bindir)/rpmverify
  83. rm -f $(DESTDIR)$(bindir)/rpmsign
  84. - @LN_S@ ../lib/rpm/rpmk $(DESTDIR)$(bindir)/rpmsign
  85. + @LN_S@ ../lib/openpkg/rpmk $(DESTDIR)$(bindir)/rpmsign
  86. rm -f $(DESTDIR)$(bindir)/rpmdb ; \
  87. - @LN_S@ ../lib/rpm/rpmd $(DESTDIR)$(bindir)/rpmdb ; \
  88. + @LN_S@ ../lib/openpkg/rpmd $(DESTDIR)$(bindir)/rpmdb ; \
  89. for bf in e i u ; do \
  90. rm -f $(DESTDIR)$(bindir)/rpm$$bf ; \
  91. - @LN_S@ ../lib/rpm/rpm$$bf $(DESTDIR)$(bindir)/rpm$$bf ; \
  92. + @LN_S@ ../lib/openpkg/rpm$$bf $(DESTDIR)$(bindir)/rpm$$bf ; \
  93. done
  94. @for dir in BUILD RPMS SOURCES SPECS SRPMS ; do\
  95. $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/$$dir;\
  96. @@ -198,10 +195,10 @@
  97. $(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(pkglibdir)/$$f ;\
  98. done
  99. @$(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(pkglibdir)
  100. - @$(__CHOWN) -R ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(varprefix)/lib/rpm
  101. - -@$(__CHMOD) 0664 $(DESTDIR)$(varprefix)/lib/rpm/[A-Z]*
  102. - -@$(__CHMOD) 0775 $(DESTDIR)$(varprefix)/lib/rpm
  103. - -@$(__CHMOD) 0664 $(DESTDIR)$(varprefix)/lib/rpm/__db.*
  104. + @$(__CHOWN) -R ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(varprefix)/lib/openpkg
  105. + -@$(__CHMOD) 0664 $(DESTDIR)$(varprefix)/lib/openpkg/[A-Z]*
  106. + -@$(__CHMOD) 0775 $(DESTDIR)$(varprefix)/lib/openpkg
  107. + -@$(__CHMOD) 0664 $(DESTDIR)$(varprefix)/lib/openpkg/__db.*
  108. .PHONY: unsetgid
  109. unsetgid:
  110. @@ -244,7 +241,7 @@
  111. @sudo ./rpm -ta rpm-$(VERSION).tar.gz
  112. .PHONY: doxygen
  113. -doxygen @WITH_APIDOCS_TARGET@: Doxyfile rpmpopt-@VERSION@
  114. +doxygen @WITH_APIDOCS_TARGET@: Doxyfile rpmpopt
  115. rm -rf $@
  116. mkdir -p $@
  117. - [ X"@__DOXYGEN@" != Xno ] && @__DOXYGEN@
  118. +---------------------------------------------------------------------------
  119. | Remove "tools" directory from sub-directory list because it contains
  120. | things we are not interested in and which cause some build trouble
  121. | anyway.
  122. | Use a plain "rpmpopt" file without any trailing version.
  123. | Adjust paths to conform to OpenPKG filesystem layout.
  124. +---------------------------------------------------------------------------
  125. Index: Makefile.in
  126. --- Makefile.in 16 Jul 2003 17:05:42 -0000 1.1.1.23
  127. +++ Makefile.in 26 Aug 2003 08:15:04 -0000
  128. @@ -265,10 +265,10 @@
  129. xmlspec/examples/*.sh xmlspec/examples/*.lst \
  130. xmlspec/examples/*.xmlspec \
  131. po/*.in po/*.po po/rpm.pot \
  132. - rpm.magic rpmpopt-$(VERSION) rpmqv.c rpm.c
  133. + rpm.magic rpmpopt rpmqv.c rpm.c
  134. -SUBDIRS = intl po @WITH_ZLIB_SUBDIR@ @WITH_ELFUTILS_SUBDIR@ file @WITH_DB_SUBDIR@ popt @WITH_BEECRYPT_SUBDIR@ rpmio rpmdb lib build misc @WITH_PYTHON_SUBDIR@ tools scripts tests doc .
  135. +SUBDIRS = intl @WITH_ZLIB_SUBDIR@ @WITH_ELFUTILS_SUBDIR@ file @WITH_DB_SUBDIR@ popt @WITH_BEECRYPT_SUBDIR@ rpmio rpmdb lib build misc @WITH_PYTHON_SUBDIR@ scripts tests doc .
  136. INCLUDES = \
  137. -I$(top_srcdir)/build \
  138. @@ -301,7 +301,7 @@
  139. bin_PROGRAMS = rpm2cpio
  140. bin_SCRIPTS = gendiff
  141. pkglib_PROGRAMS = rpmb rpmd rpmi rpmk rpmq
  142. -pkglib_DATA = rpmrc rpmpopt-$(VERSION) macros
  143. +pkglib_DATA = rpmrc rpmpopt macros
  144. pkglib_SCRIPTS = find-provides find-requires mkinstalldirs \
  145. config.guess config.sub config.site
  146. @@ -1058,8 +1058,6 @@
  147. uninstall-rpmbinPROGRAMS
  148. -rpmpopt-$(VERSION): rpmpopt
  149. - cp rpmpopt $@
  150. rpm.o: rpmqv.c
  151. $(COMPILE) -DIAM_RPMDB -DIAM_RPMEIU -DIAM_RPMK -DIAM_RPMQV -o $@ -c rpmqv.c
  152. rpmb.o: rpmqv.c
  153. @@ -1097,32 +1095,32 @@
  154. `make -s sources -C popt`
  155. install-data-local:
  156. - @$(mkinstalldirs) $(DESTDIR)$(varprefix)/lib/rpm
  157. + @$(mkinstalldirs) $(DESTDIR)$(varprefix)/lib/openpkg
  158. @rm -f $(DESTDIR)$(libdir)/rpmrc
  159. @@LN_S@ rpm/rpmrc $(DESTDIR)$(libdir)/rpmrc
  160. @rm -f $(DESTDIR)$(libdir)/rpmpopt
  161. @@LN_S@ rpm/rpmpopt $(DESTDIR)$(libdir)/rpmpopt
  162. - @rm -f $(DESTDIR)$(libdir)/rpm/rpmt
  163. - @@LN_S@ rpmb $(DESTDIR)$(libdir)/rpm/rpmt
  164. - @rm -f $(DESTDIR)$(libdir)/rpm/rpme
  165. - @@LN_S@ rpmi $(DESTDIR)$(libdir)/rpm/rpme
  166. - @rm -f $(DESTDIR)$(libdir)/rpm/rpmu
  167. - @@LN_S@ rpmi $(DESTDIR)$(libdir)/rpm/rpmu
  168. - @rm -f $(DESTDIR)$(libdir)/rpm/rpmv
  169. - @@LN_S@ rpmq $(DESTDIR)$(libdir)/rpm/rpmv
  170. + @rm -f $(DESTDIR)$(libdir)/openpkg/rpmt
  171. + @@LN_S@ rpmb $(DESTDIR)$(libdir)/openpkg/rpmt
  172. + @rm -f $(DESTDIR)$(libdir)/openpkg/rpme
  173. + @@LN_S@ rpmi $(DESTDIR)$(libdir)/openpkg/rpme
  174. + @rm -f $(DESTDIR)$(libdir)/openpkg/rpmu
  175. + @@LN_S@ rpmi $(DESTDIR)$(libdir)/openpkg/rpmu
  176. + @rm -f $(DESTDIR)$(libdir)/openpkg/rpmv
  177. + @@LN_S@ rpmq $(DESTDIR)$(libdir)/openpkg/rpmv
  178. rm -f $(DESTDIR)$(bindir)/rpmbuild
  179. - @LN_S@ ../lib/rpm/rpmb $(DESTDIR)$(bindir)/rpmbuild
  180. + @LN_S@ ../lib/openpkg/rpmb $(DESTDIR)$(bindir)/rpmbuild
  181. rm -f $(DESTDIR)$(bindir)/rpmquery
  182. - @LN_S@ ../lib/rpm/rpmq $(DESTDIR)$(bindir)/rpmquery
  183. + @LN_S@ ../lib/openpkg/rpmq $(DESTDIR)$(bindir)/rpmquery
  184. rm -f $(DESTDIR)$(bindir)/rpmverify
  185. - @LN_S@ ../lib/rpm/rpmv $(DESTDIR)$(bindir)/rpmverify
  186. + @LN_S@ ../lib/openpkg/rpmv $(DESTDIR)$(bindir)/rpmverify
  187. rm -f $(DESTDIR)$(bindir)/rpmsign
  188. - @LN_S@ ../lib/rpm/rpmk $(DESTDIR)$(bindir)/rpmsign
  189. + @LN_S@ ../lib/openpkg/rpmk $(DESTDIR)$(bindir)/rpmsign
  190. rm -f $(DESTDIR)$(bindir)/rpmdb ; \
  191. - @LN_S@ ../lib/rpm/rpmd $(DESTDIR)$(bindir)/rpmdb ; \
  192. + @LN_S@ ../lib/openpkg/rpmd $(DESTDIR)$(bindir)/rpmdb ; \
  193. for bf in e i u ; do \
  194. rm -f $(DESTDIR)$(bindir)/rpm$$bf ; \
  195. - @LN_S@ ../lib/rpm/rpm$$bf $(DESTDIR)$(bindir)/rpm$$bf ; \
  196. + @LN_S@ ../lib/openpkg/rpm$$bf $(DESTDIR)$(bindir)/rpm$$bf ; \
  197. done
  198. @for dir in BUILD RPMS SOURCES SPECS SRPMS ; do\
  199. $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/$$dir;\
  200. @@ -1171,10 +1169,10 @@
  201. $(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(pkglibdir)/$$f ;\
  202. done
  203. @$(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(pkglibdir)
  204. - @$(__CHOWN) -R ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(varprefix)/lib/rpm
  205. - -@$(__CHMOD) 0664 $(DESTDIR)$(varprefix)/lib/rpm/[A-Z]*
  206. - -@$(__CHMOD) 0775 $(DESTDIR)$(varprefix)/lib/rpm
  207. - -@$(__CHMOD) 0664 $(DESTDIR)$(varprefix)/lib/rpm/__db.*
  208. + @$(__CHOWN) -R ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(varprefix)/lib/openpkg
  209. + -@$(__CHMOD) 0664 $(DESTDIR)$(varprefix)/lib/openpkg/[A-Z]*
  210. + -@$(__CHMOD) 0775 $(DESTDIR)$(varprefix)/lib/openpkg
  211. + -@$(__CHMOD) 0664 $(DESTDIR)$(varprefix)/lib/openpkg/__db.*
  212. .PHONY: unsetgid
  213. unsetgid:
  214. @@ -1217,7 +1215,7 @@
  215. @sudo ./rpm -ta rpm-$(VERSION).tar.gz
  216. .PHONY: doxygen
  217. -doxygen @WITH_APIDOCS_TARGET@: Doxyfile rpmpopt-@VERSION@
  218. +doxygen @WITH_APIDOCS_TARGET@: Doxyfile rpmpopt
  219. rm -rf $@
  220. mkdir -p $@
  221. - [ X"@__DOXYGEN@" != Xno ] && @__DOXYGEN@
  222. +---------------------------------------------------------------------------
  223. | Add support for splitted source directories, i.e., source files
  224. | alternatively can be placed into the .spec directory and are picked
  225. | up there, too.
  226. +---------------------------------------------------------------------------
  227. Index: build/build.c
  228. --- build/build.c 4 Mar 2003 15:27:33 -0000 1.1.1.20
  229. +++ build/build.c 24 Aug 2003 13:10:15 -0000
  230. @@ -33,7 +33,15 @@
  231. for (p = spec->sources; p != NULL; p = p->next) {
  232. if (! (p->flags & RPMBUILD_ISNO)) {
  233. +#ifndef OPENPKG
  234. const char *fn = rpmGetPath("%{_sourcedir}/", p->source, NULL);
  235. +#else
  236. + const char *fn = rpmGetPath("%{_specdir}/", p->source, NULL);
  237. + if (access(fn, F_OK) == -1) {
  238. + fn = _free(fn);
  239. + fn = rpmGetPath("%{_sourcedir}/", p->source, NULL);
  240. + }
  241. +#endif
  242. rc = Unlink(fn);
  243. fn = _free(fn);
  244. }
  245. @@ -42,7 +50,15 @@
  246. for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
  247. for (p = pkg->icon; p != NULL; p = p->next) {
  248. if (! (p->flags & RPMBUILD_ISNO)) {
  249. +#ifndef OPENPKG
  250. const char *fn = rpmGetPath("%{_sourcedir}/", p->source, NULL);
  251. +#else
  252. + const char *fn = rpmGetPath("%{_specdir}/", p->source, NULL);
  253. + if (access(fn, F_OK) == -1) {
  254. + fn = _free(fn);
  255. + fn = rpmGetPath("%{_sourcedir}/", p->source, NULL);
  256. + }
  257. +#endif
  258. rc = Unlink(fn);
  259. fn = _free(fn);
  260. }
  261. +---------------------------------------------------------------------------
  262. | Make sure the "Provides" headers are available for querying from the
  263. | .src.rpm files.
  264. +---------------------------------------------------------------------------
  265. Index: build/files.c
  266. --- build/files.c 4 Mar 2003 17:04:13 -0000 1.1.1.20
  267. +++ build/files.c 25 Aug 2003 09:42:08 -0000
  268. @@ -2183,6 +2183,11 @@
  269. case RPMTAG_CHANGELOGTEXT:
  270. case RPMTAG_URL:
  271. case HEADER_I18NTABLE:
  272. +#ifdef OPENPKG
  273. + case RPMTAG_PROVIDENAME:
  274. + case RPMTAG_PROVIDEVERSION:
  275. + case RPMTAG_PROVIDEFLAGS:
  276. +#endif
  277. if (ptr)
  278. (void)headerAddEntry(spec->sourceHeader, tag, type, ptr, count);
  279. /*@switchbreak@*/ break;
  280. +---------------------------------------------------------------------------
  281. | Add support for splitted source directories, i.e., source files
  282. | alternatively can be placed into the .spec directory and are picked
  283. | up there, too.
  284. +---------------------------------------------------------------------------
  285. Index: build/files.c
  286. --- build/files.c 4 Mar 2003 17:04:13 -0000 1.1.1.20
  287. +++ build/files.c 25 Aug 2003 09:42:08 -0000
  288. @@ -2253,8 +2258,20 @@
  289. }
  290. { const char * sfn;
  291. +#ifndef OPENPKG
  292. sfn = rpmGetPath( ((srcPtr->flags & RPMBUILD_ISNO) ? "!" : ""),
  293. "%{_sourcedir}/", srcPtr->source, NULL);
  294. +#else
  295. + const char *sfn2;
  296. + sfn2 = rpmGetPath("%{_specdir}/", srcPtr->source, NULL);
  297. + if (access(sfn2, F_OK) == 0)
  298. + sfn = rpmGetPath( ((srcPtr->flags & RPMBUILD_ISNO) ? "!" : ""),
  299. + "%{_specdir}/", srcPtr->source, NULL);
  300. + else
  301. + sfn = rpmGetPath( ((srcPtr->flags & RPMBUILD_ISNO) ? "!" : ""),
  302. + "%{_sourcedir}/", srcPtr->source, NULL);
  303. + sfn2 = _free(sfn2);
  304. +#endif
  305. appendLineStringBuf(sourceFiles, sfn);
  306. sfn = _free(sfn);
  307. }
  308. @@ -2263,8 +2280,20 @@
  309. for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
  310. for (srcPtr = pkg->icon; srcPtr != NULL; srcPtr = srcPtr->next) {
  311. const char * sfn;
  312. +#ifndef OPENPKG
  313. sfn = rpmGetPath( ((srcPtr->flags & RPMBUILD_ISNO) ? "!" : ""),
  314. "%{_sourcedir}/", srcPtr->source, NULL);
  315. +#else
  316. + const char *sfn2;
  317. + sfn2 = rpmGetPath("%{_specdir}/", srcPtr->source, NULL);
  318. + if (access(sfn2, F_OK) == 0)
  319. + sfn = rpmGetPath( ((srcPtr->flags & RPMBUILD_ISNO) ? "!" : ""),
  320. + "%{_specdir}/", srcPtr->source, NULL);
  321. + else
  322. + sfn = rpmGetPath( ((srcPtr->flags & RPMBUILD_ISNO) ? "!" : ""),
  323. + "%{_sourcedir}/", srcPtr->source, NULL);
  324. + sfn2 = _free(sfn2);
  325. +#endif
  326. appendLineStringBuf(sourceFiles, sfn);
  327. sfn = _free(sfn);
  328. }
  329. +---------------------------------------------------------------------------
  330. | Add support for splitted source directories, i.e., source files
  331. | alternatively can be placed into the .spec directory and are picked
  332. | up there, too.
  333. +---------------------------------------------------------------------------
  334. Index: build/parsePreamble.c
  335. --- build/parsePreamble.c 3 Mar 2003 20:46:34 -0000 1.1.1.13
  336. +++ build/parsePreamble.c 24 Aug 2003 13:10:15 -0000
  337. @@ -366,7 +366,15 @@
  338. size_t nb, iconsize;
  339. /* XXX use rpmGenPath(rootdir, "%{_sourcedir}/", file) for icon path. */
  340. +#ifndef OPENPKG
  341. fn = rpmGetPath("%{_sourcedir}/", file, NULL);
  342. +#else
  343. + fn = rpmGetPath("%{_specdir}/", file, NULL);
  344. + if (access(fn, F_OK) == -1) {
  345. + fn = _free(fn);
  346. + fn = rpmGetPath("%{_sourcedir}/", file, NULL);
  347. + }
  348. +#endif
  349. fd = Fopen(fn, "r.ufdio");
  350. if (fd == NULL || Ferror(fd)) {
  351. +---------------------------------------------------------------------------
  352. | In OpenPKG, the RPM package contains own local versions of the
  353. | "patch" and "tar" tools, so we cannot accept hard-coded names here.
  354. | Instead we expand a variable to allow us to direct RPM to our tools.
  355. +---------------------------------------------------------------------------
  356. Index: build/parsePrep.c
  357. --- build/parsePrep.c 7 Aug 2002 14:20:45 -0000 1.1.1.10
  358. +++ build/parsePrep.c 28 Aug 2003 08:13:15 -0000
  359. @@ -76,6 +76,7 @@
  360. struct Source *sp;
  361. rpmCompressedMagic compressed = COMPRESSED_NOT;
  362. int urltype;
  363. + const char *patcher;
  364. for (sp = spec->sources; sp != NULL; sp = sp->next) {
  365. if ((sp->flags & RPMBUILD_ISPATCH) && (sp->num == c)) {
  366. @@ -124,6 +133,10 @@
  367. /*@notreached@*/ break;
  368. }
  369. + patcher = rpmGetPath("%{_patchbin}", NULL);
  370. + if (strcmp(patcher, "%{_patchbin}") == 0)
  371. + patcher = "patch";
  372. +
  373. if (compressed) {
  374. const char *zipper = rpmGetPath(
  375. (compressed == COMPRESSED_BZIP2 ? "%{_bzip2bin}" : "%{_gzipbin}"),
  376. @@ -131,22 +144,23 @@
  377. sprintf(buf,
  378. "echo \"Patch #%d (%s):\"\n"
  379. - "%s -d < %s | patch -p%d %s -s\n"
  380. + "%s -d < %s | %s -p%d %s -s\n"
  381. "STATUS=$?\n"
  382. "if [ $STATUS -ne 0 ]; then\n"
  383. " exit $STATUS\n"
  384. "fi",
  385. c, /*@-unrecog@*/ (const char *) basename(fn), /*@=unrecog@*/
  386. zipper,
  387. - fn, strip, args);
  388. + fn, patcher, strip, args);
  389. zipper = _free(zipper);
  390. } else {
  391. sprintf(buf,
  392. "echo \"Patch #%d (%s):\"\n"
  393. - "patch -p%d %s -s < %s", c, (const char *) basename(fn),
  394. - strip, args, fn);
  395. + "%s -p%d %s -s < %s", c, (const char *) basename(fn),
  396. + patcher, strip, args, fn);
  397. }
  398. + patcher = _free(patcher);
  399. urlfn = _free(urlfn);
  400. return buf;
  401. }
  402. @@ -171,6 +185,7 @@
  403. struct Source *sp;
  404. rpmCompressedMagic compressed = COMPRESSED_NOT;
  405. int urltype;
  406. + const char *tar;
  407. for (sp = spec->sources; sp != NULL; sp = sp->next) {
  408. if ((sp->flags & RPMBUILD_ISSOURCE) && (sp->num == c)) {
  409. @@ -228,6 +251,10 @@
  410. /*@notreached@*/ break;
  411. }
  412. + tar = rpmGetPath("%{_tarbin}", NULL);
  413. + if (strcmp(tar, "%{_tarbin}") == 0)
  414. + tar = "tar";
  415. +
  416. if (compressed != COMPRESSED_NOT) {
  417. const char *zipper;
  418. int needtar = 1;
  419. @@ -254,8 +281,13 @@
  420. zipper = _free(zipper);
  421. *t++ = ' ';
  422. t = stpcpy(t, fn);
  423. - if (needtar)
  424. - t = stpcpy( stpcpy( stpcpy(t, " | tar "), taropts), " -");
  425. + if (needtar) {
  426. + t = stpcpy(t, " | ");
  427. + t = stpcpy(t, tar);
  428. + t = stpcpy(t, " ");
  429. + t = stpcpy(t, taropts);
  430. + t = stpcpy(t, " -");
  431. + }
  432. t = stpcpy(t,
  433. "\n"
  434. "STATUS=$?\n"
  435. @@ -264,11 +296,14 @@
  436. "fi");
  437. } else {
  438. buf[0] = '\0';
  439. - t = stpcpy( stpcpy(buf, "tar "), taropts);
  440. - *t++ = ' ';
  441. + t = stpcpy(buf, tar);
  442. + t = stpcpy(t, " ");
  443. + t = stpcpy(t, taropts);
  444. + t = stpcpy(t, " ");
  445. t = stpcpy(t, fn);
  446. }
  447. + tar = _free(tar);
  448. urlfn = _free(urlfn);
  449. return buf;
  450. }
  451. +---------------------------------------------------------------------------
  452. | Add support for splitted source directories, i.e., source files
  453. | alternatively can be placed into the .spec directory and are picked
  454. | up there, too.
  455. +---------------------------------------------------------------------------
  456. Index: build/parsePrep.c
  457. --- build/parsePrep.c 7 Aug 2002 14:20:45 -0000 1.1.1.10
  458. +++ build/parsePrep.c 28 Aug 2003 08:13:15 -0000
  459. @@ -87,7 +88,15 @@
  460. return NULL;
  461. }
  462. +#ifndef OPENPKG
  463. urlfn = rpmGetPath("%{_sourcedir}/", sp->source, NULL);
  464. +#else
  465. + urlfn = rpmGetPath("%{_specdir}/", sp->source, NULL);
  466. + if (access(urlfn, F_OK) == -1) {
  467. + urlfn = _free(urlfn);
  468. + urlfn = rpmGetPath("%{_sourcedir}/", sp->source, NULL);
  469. + }
  470. +#endif
  471. args[0] = '\0';
  472. if (db) {
  473. @@ -182,7 +197,15 @@
  474. return NULL;
  475. }
  476. +#ifndef OPENPKG
  477. urlfn = rpmGetPath("%{_sourcedir}/", sp->source, NULL);
  478. +#else
  479. + urlfn = rpmGetPath("%{_specdir}/", sp->source, NULL);
  480. + if (access(urlfn, F_OK) == -1) {
  481. + urlfn = _free(urlfn);
  482. + urlfn = rpmGetPath("%{_sourcedir}/", sp->source, NULL);
  483. + }
  484. +#endif
  485. /*@-internalglobs@*/ /* FIX: shrug */
  486. taropts = ((rpmIsVerbose() && !quietly) ? "-xvvf" : "-xf");
  487. +---------------------------------------------------------------------------
  488. | Not everything on a system is RPM based (for instance OpenPKG is
  489. | just an add-on to the system), so do not assume we can just require
  490. | a package to provide "/bin/sh".
  491. +---------------------------------------------------------------------------
  492. Index: build/parseScript.c
  493. --- build/parseScript.c 23 Jun 2002 19:47:12 -0000 1.1.1.12
  494. +++ build/parseScript.c 24 Aug 2003 13:10:15 -0000
  495. @@ -261,6 +261,7 @@
  496. stripTrailingBlanksStringBuf(sb);
  497. p = getStringBuf(sb);
  498. + if (progArgv[0] != NULL && strcmp(progArgv[0], "/bin/sh") != 0)
  499. (void) addReqProv(spec, pkg->header, (tagflags | RPMSENSE_INTERP), progArgv[0], NULL, 0);
  500. /* Trigger script insertion is always delayed in order to */
  501. +---------------------------------------------------------------------------
  502. | Add support for splitted source directories, i.e., source files
  503. | alternatively can be placed into the spec directory and are picked
  504. | up there, too.
  505. +---------------------------------------------------------------------------
  506. Index: build/spec.c
  507. --- build/spec.c 4 Mar 2003 15:25:51 -0000 1.1.1.21
  508. +++ build/spec.c 24 Aug 2003 13:10:15 -0000
  509. @@ -334,7 +334,15 @@
  510. if (tag != RPMTAG_ICON) {
  511. /*@-nullpass@*/ /* LCL: varargs needs null annotate. */
  512. +#ifndef OPENPKG
  513. const char *body = rpmGetPath("%{_sourcedir}/", p->source, NULL);
  514. +#else
  515. + const char *body = rpmGetPath("%{_specdir}/", p->source, NULL);
  516. + if (access(body, F_OK) == -1) {
  517. + body = _free(body);
  518. + body = rpmGetPath("%{_sourcedir}/", p->source, NULL);
  519. + }
  520. +#endif
  521. /*@=nullpass@*/
  522. sprintf(buf, "%s%d",
  523. +---------------------------------------------------------------------------
  524. | Do not build with warnings on, because we do no RPM development
  525. | (so warnings are useless here), they cause some confusion inside
  526. | Berkeley-DB and also slow down building. Instead, increase the
  527. | optimization level. Additionally, disable static linking of RPM
  528. | tools. Finally, use "shtool mkdir" as the "mkdir -p" fallback.
  529. +---------------------------------------------------------------------------
  530. Index: configure.ac
  531. --- configure.ac 2 Jul 2003 19:20:52 -0000 1.1.1.4
  532. +++ configure.ac 26 Aug 2003 08:06:43 -0000
  533. @@ -53,7 +53,7 @@
  534. AS=${AS-as}
  535. AC_SUBST(AS)
  536. if test "$ac_cv_prog_gcc" = yes; then
  537. - CFLAGS="$CFLAGS -D_GNU_SOURCE -D_REENTRANT -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wno-char-subscripts"
  538. + CFLAGS="$CFLAGS -pipe -O2 -D_GNU_SOURCE -D_REENTRANT"
  539. fi
  540. export CFLAGS
  541. @@ -142,6 +142,7 @@
  542. # just link it dynamically
  543. LDFLAGS_STATIC=""
  544. fi
  545. +LDFLAGS_STATIC="" # OpenPKG wants dynamically linked RPM tools
  546. LDFLAGS_STATIC="${LDFLAGS} ${LDFLAGS_STATIC}" # libtool format
  547. AC_MSG_RESULT($LDFLAGS_STATIC)
  548. AC_SUBST(LDFLAGS_STATIC)
  549. @@ -201,7 +202,7 @@
  550. if test X"$MKDIR_P" = X0 ; then
  551. AC_MSG_RESULT(no)
  552. - MKDIR_P="`echo ${prefix}/lib/rpm/mkinstalldirs`"
  553. + MKDIR_P="@l_prefix@/lib/openpkg/shtool mkdir -f -p -m 755"
  554. else
  555. AC_MSG_RESULT(yes)
  556. fi
  557. +---------------------------------------------------------------------------
  558. | Adjust paths for OpenPKG filesystem layout.
  559. +---------------------------------------------------------------------------
  560. Index: configure.ac
  561. --- configure.ac 2 Jul 2003 19:20:52 -0000 1.1.1.4
  562. +++ configure.ac 26 Aug 2003 08:06:43 -0000
  563. @@ -1200,12 +1202,12 @@
  564. AC_SUBST(LOCALEDIR)
  565. LIBDIR="`echo $libdir | sed 's-/lib$-/%{_lib}-'`"
  566. AC_SUBST(LIBDIR)
  567. -RPMCONFIGDIR="`echo ${usrprefix}/lib/rpm`"
  568. +RPMCONFIGDIR="@l_prefix@/lib/openpkg"
  569. AC_DEFINE_UNQUOTED(RPMCONFIGDIR, "$RPMCONFIGDIR",
  570. [Full path to rpm global configuration directory (usually /usr/lib/rpm)])
  571. AC_SUBST(RPMCONFIGDIR)
  572. -SYSCONFIGDIR="`echo /etc/rpm`"
  573. +SYSCONFIGDIR="@l_prefix@/etc/openpkg"
  574. AC_DEFINE_UNQUOTED(SYSCONFIGDIR, "$SYSCONFIGDIR",
  575. [Full path to rpm system configuration directory (usually /etc/rpm)])
  576. AC_SUBST(SYSCONFIGDIR)
  577. @@ -1215,17 +1217,17 @@
  578. [Colon separated paths of macro files to read.])
  579. AC_SUBST(MACROFILES)
  580. -LIBRPMRC_FILENAME="${RPMCONFIGDIR}/rpmrc"
  581. +LIBRPMRC_FILENAME="${SYSCONFIGDIR}/rpmrc"
  582. AC_DEFINE_UNQUOTED(LIBRPMRC_FILENAME, "$LIBRPMRC_FILENAME",
  583. [Full path to rpmrc configuration file (usually /usr/lib/rpm/rpmrc)])
  584. AC_SUBST(LIBRPMRC_FILENAME)
  585. -VENDORRPMRC_FILENAME="${RPMCONFIGDIR}/${RPMCANONVENDOR}/rpmrc"
  586. +VENDORRPMRC_FILENAME="${SYSCONFIGDIR}/${RPMCANONVENDOR}/rpmrc"
  587. AC_DEFINE_UNQUOTED(VENDORRPMRC_FILENAME, "$VENDORRPMRC_FILENAME",
  588. [Full path to vendor rpmrc configuration file (usually /usr/lib/rpm/vendor/rpmrc)])
  589. AC_SUBST(VENDORRPMRC_FILENAME)
  590. -LIBRPMALIAS_FILENAME="${RPMCONFIGDIR}/rpmpopt-${VERSION}"
  591. +LIBRPMALIAS_FILENAME="${RPMCONFIGDIR}/rpmpopt"
  592. AC_DEFINE_UNQUOTED(LIBRPMALIAS_FILENAME, "$LIBRPMALIAS_FILENAME",
  593. [Full path to rpmpopt configuration file (usually /usr/lib/rpm/rpmpopt)])
  594. AC_SUBST(LIBRPMALIAS_FILENAME)
  595. +---------------------------------------------------------------------------
  596. | RPM has two platform id canonicalizations: hard-coded ones in
  597. | the "rpm" program and defined ones in the rpmrc files. The
  598. | hard-coded ones make the defined ones inconsistent. Additionally,
  599. | in OpenPKG we know exactly what we do. So, disable the hard-coded
  600. | canonicalizations and use only the defined ones. The only thing we
  601. | do inside RPM is to reduce the platform version to major and minor
  602. | version numbers in order to simplify the "rpmrc" files. Then, RPM
  603. | allows to read the platform from an external program. Adjust the
  604. | hard-coded path to this program and allow it to be overridden with
  605. | the macro %{__platform}. Finally, change the default definition of
  606. | %{_host} to not contain the vendor stuff to more conform to what
  607. | %{_target} usually is defined to and what we are using throughout
  608. | OpenPKG, too.
  609. +---------------------------------------------------------------------------
  610. Index: lib/rpmrc.c
  611. --- lib/rpmrc.c 4 Jun 2003 18:18:45 -0000 1.1.1.25
  612. +++ lib/rpmrc.c 26 Aug 2003 07:25:49 -0000
  613. @@ -27,7 +27,7 @@
  614. const char * macrofiles = MACROFILES;
  615. /*@observer@*/ /*@unchecked@*/
  616. -static const char * platform = "/etc/rpm/platform";
  617. +static const char * platform = "@l_prefix@/etc/openpkg/platform";
  618. /*@only@*/ /*@relnull@*/ /*@unchecked@*/
  619. static const char ** platpat = NULL;
  620. /*@unchecked@*/
  621. @@ -861,7 +861,11 @@
  622. platpat = xrealloc(platpat, (nplatpat + 2) * sizeof(*platpat));
  623. /*@-onlyunqglobaltrans@*/
  624. +#ifdef OPENPKG
  625. + platpat[nplatpat] = rpmExpand("%{_host_cpu}-%{_host_os}", NULL);
  626. +#else
  627. platpat[nplatpat] = rpmExpand("%{_host_cpu}-%{_host_vendor}-%{_host_os}", (gnu && *gnu ? "-" : NULL), gnu, NULL);
  628. +#endif
  629. nplatpat++;
  630. platpat[nplatpat] = NULL;
  631. /*@=onlyunqglobaltrans@*/
  632. @@ -1062,7 +1066,15 @@
  633. int rc;
  634. while (!gotDefaults) {
  635. +#ifdef OPENPKG
  636. + const char *cp;
  637. + cp = rpmExpand("%{?__platform}", NULL);
  638. + if (cp == NULL || cp[0] == '\0')
  639. + cp = platform;
  640. + if (!rpmPlatform(cp)) {
  641. +#else
  642. if (!rpmPlatform(platform)) {
  643. +#endif
  644. const char * s;
  645. s = rpmExpand("%{_host_cpu}", NULL);
  646. if (s) {
  647. @@ -1082,6 +1094,32 @@
  648. rc = uname(&un);
  649. if (rc < 0) return;
  650. +#ifdef OPENPKG
  651. + {
  652. + char *cp;
  653. + char *cpR;
  654. + int n;
  655. + cpR = un.release;
  656. + if ((n = strcspn(cpR, "0123456789")) > 0)
  657. + cpR += n;
  658. + if ((n = strspn(cpR,"0123456789.")) > 0) {
  659. + /* terminate after "N.N.N...." prefix */
  660. + cpR[n] = '\0';
  661. + /* shorten to "N.N" if longer */
  662. + if ((cp = strchr(cpR, '.')) != NULL) {
  663. + if ((cp = strchr(cp+1, '.')) != NULL)
  664. + *cp = '\0';
  665. + }
  666. + strcat(un.sysname, cpR);
  667. + }
  668. + /* fix up machine hardware name containing white-space as it
  669. + * happens to be on Power Macs running MacOS X
  670. + */
  671. + if (!strncmp(un.machine, "Power Macintosh", 15)) {
  672. + sprintf(un.machine, "powerpc");
  673. + }
  674. + }
  675. +#else /* OPENPKG */
  676. #if !defined(__linux__)
  677. #ifdef SNI
  678. /* USUALLY un.sysname on sinix does start with the word "SINIX"
  679. @@ -1298,6 +1336,7 @@
  680. }
  681. }
  682. # endif
  683. +#endif /* OPENPKG */
  684. /* the uname() result goes through the arch_canon table */
  685. canon = lookupInCanonTable(un.machine,
  686. +---------------------------------------------------------------------------
  687. | Disable "check-files" feature, because it is useless in OpenPKG
  688. | (we consistently use BuildRoot and our %files lists are fully
  689. | autogenerated) and just makes problems on bootstrapping.
  690. | Additionally, do not override the "_host_xx" macros because their
  691. | value (derived from <prefix>/etc/openpkg/platform) is already
  692. | correctly set internally.
  693. +---------------------------------------------------------------------------
  694. Index: macros.in
  695. --- macros.in 2 Jul 2003 19:20:52 -0000 1.1.1.14
  696. +++ macros.in 25 Aug 2003 18:23:11 -0000
  697. @@ -305,7 +305,7 @@
  698. # Returns list of unpackaged files, i.e. files in $RPM_BUILD_ROOT not packaged.
  699. #
  700. # Note: Disable (by commenting out) for legacy compatibility.
  701. -%__check_files @RPMCONFIGDIR@/check-files %{buildroot}
  702. +#%__check_files @RPMCONFIGDIR@/check-files %{buildroot}
  703. #
  704. # Should unpackaged files in a build root terminate a build?
  705. @@ -929,11 +929,11 @@
  706. %_build_cpu %{_host_cpu}
  707. %_build_vendor %{_host_vendor}
  708. %_build_os %{_host_os}
  709. -%_host @host@
  710. -%_host_alias @host_alias@%{nil}
  711. -%_host_cpu @host_cpu@
  712. -%_host_vendor @host_vendor@
  713. -%_host_os @host_os@
  714. +#%_host @host@
  715. +#%_host_alias @host_alias@%{nil}
  716. +#%_host_cpu @host_cpu@
  717. +#%_host_vendor @host_vendor@
  718. +#%_host_os @host_os@
  719. %_target %{_host}
  720. %_target_alias %{_host_alias}
  721. %_target_cpu %{_host_cpu}
  722. +---------------------------------------------------------------------------
  723. | Adjust path for OpenPKG filesystem layout.
  724. +---------------------------------------------------------------------------
  725. Index: scripts/Makefile.am
  726. --- scripts/Makefile.am 20 Jun 2003 19:04:49 -0000 1.1.1.11
  727. +++ scripts/Makefile.am 26 Aug 2003 07:45:36 -0000
  728. @@ -22,7 +22,7 @@
  729. all:
  730. -configdir = ${prefix}/lib/rpm
  731. +configdir = ${prefix}/lib/openpkg
  732. config_SCRIPTS = \
  733. brp-compress brp-python-bytecompile brp-redhat \
  734. brp-strip brp-strip-comment-note \
  735. +---------------------------------------------------------------------------
  736. | Adjust path for OpenPKG filesystem layout.
  737. +---------------------------------------------------------------------------
  738. Index: scripts/Makefile.in
  739. --- scripts/Makefile.in 16 Jul 2003 17:05:49 -0000 1.1.1.14
  740. +++ scripts/Makefile.in 26 Aug 2003 07:45:45 -0000
  741. @@ -273,7 +273,7 @@
  742. installprefix = $(DESTDIR)
  743. -configdir = ${prefix}/lib/rpm
  744. +configdir = ${prefix}/lib/openpkg
  745. config_SCRIPTS = \
  746. brp-compress brp-python-bytecompile brp-redhat \
  747. brp-strip brp-strip-comment-note \
  748. +---------------------------------------------------------------------------
  749. | Use GNU libtool's weaker -static (link with own static libraries)
  750. | instead of the strong -all-static (link even with static libc, etc),
  751. | because OpenPKG does not need to be fully static.
  752. | Additionally, adjust the path to file(1)'s "magic" file.
  753. +---------------------------------------------------------------------------
  754. Index: file/Makefile.am
  755. --- file/Makefile.am 24 Jan 2003 19:41:56 -0000 1.1.1.1
  756. +++ file/Makefile.am 26 Aug 2003 07:44:31 -0000
  757. @@ -36,7 +36,7 @@
  758. #MAGIC = @datadir@/magic
  759. #data_DATA = magic magic.mime magic.mgc magic.mime.mgc
  760. -pkglibdir = @prefix@/lib/rpm
  761. +pkglibdir = @prefix@/lib/openpkg
  762. pkglib_DATA = magic magic.mime magic.mgc magic.mime.mgc
  763. MAGIC = $(pkglibdir)/magic
  764. CPPFLAGS = -DMAGIC='"$(MAGIC)"'
  765. +---------------------------------------------------------------------------
  766. | Use GNU libtool's weaker -static (link with own static libraries)
  767. | instead of the strong -all-static (link even with static libc, etc),
  768. | because OpenPKG does not need to be fully static.
  769. | Additionally, adjust the path to file(1)'s "magic" file.
  770. +---------------------------------------------------------------------------
  771. Index: file/Makefile.in
  772. --- file/Makefile.in 16 Jul 2003 17:05:23 -0000 1.1.1.2
  773. +++ file/Makefile.in 26 Aug 2003 07:44:20 -0000
  774. @@ -39,7 +39,7 @@
  775. #MAGIC = @datadir@/magic
  776. #data_DATA = magic magic.mime magic.mgc magic.mime.mgc
  777. -pkglibdir = @prefix@/lib/rpm
  778. +pkglibdir = @prefix@/lib/openpkg
  779. ACLOCAL = @ACLOCAL@
  780. AMDEP_FALSE = @AMDEP_FALSE@
  781. AMDEP_TRUE = @AMDEP_TRUE@
  782. @@ -159,7 +159,7 @@
  783. noinst_PROGRAMS = file
  784. file_SOURCES = file.c
  785. -file_LDFLAGS = -all-static
  786. +file_LDFLAGS = -static
  787. file_LDADD = libfmagic.la
  788. man_MAGIC = magic.@fsect@
  789. +---------------------------------------------------------------------------
  790. | Use GNU libtool's weaker -static (link with own static libraries)
  791. | instead of the strong -all-static (link even with static libc, etc),
  792. | because OpenPKG does not need to be fully static.
  793. | Additionally, disable the building of gettext stuff we don't need.
  794. +---------------------------------------------------------------------------
  795. Index: popt/Makefile.am
  796. --- popt/Makefile.am 6 Mar 2003 23:16:43 -0000 1.1.1.9
  797. +++ popt/Makefile.am 26 Aug 2003 07:42:34 -0000
  798. @@ -9,7 +9,7 @@
  799. po/*.in po/*.po po/popt.pot \
  800. popt.ps
  801. -SUBDIRS = intl po
  802. +SUBDIRS = intl
  803. INCLUDES = -I. -I$(top_srcdir)
  804. @@ -17,13 +17,13 @@
  805. noinst_PROGRAMS = test1 test2 test3
  806. test1_SOURCES = test1.c
  807. -test1_LDFLAGS = -all-static
  808. +test1_LDFLAGS = -static
  809. test1_LDADD = $(usrlib_LTLIBRARIES)
  810. test2_SOURCES = test2.c
  811. -test2_LDFLAGS = -all-static
  812. +test2_LDFLAGS = -static
  813. test2_LDADD = $(usrlib_LTLIBRARIES)
  814. test3_SOURCES = test3.c
  815. -test3_LDFLAGS = -all-static
  816. +test3_LDFLAGS = -static
  817. test3_LDADD = $(usrlib_LTLIBRARIES)
  818. noinst_SCRIPTS = testit.sh
  819. +---------------------------------------------------------------------------
  820. | Use GNU libtool's weaker -static (link with own static libraries)
  821. | instead of the strong -all-static (link even with static libc, etc),
  822. | because OpenPKG does not need to be fully static.
  823. | Additionally, disable the building of gettext stuff we don't need.
  824. +---------------------------------------------------------------------------
  825. Index: popt/Makefile.in
  826. --- popt/Makefile.in 16 Jul 2003 17:04:49 -0000 1.1.1.14
  827. +++ popt/Makefile.in 26 Aug 2003 07:42:51 -0000
  828. @@ -163,7 +163,7 @@
  829. popt.ps
  830. -SUBDIRS = intl po
  831. +SUBDIRS = intl
  832. INCLUDES = -I. -I$(top_srcdir)
  833. @@ -171,13 +171,13 @@
  834. noinst_PROGRAMS = test1 test2 test3
  835. test1_SOURCES = test1.c
  836. -test1_LDFLAGS = -all-static
  837. +test1_LDFLAGS = -static
  838. test1_LDADD = $(usrlib_LTLIBRARIES)
  839. test2_SOURCES = test2.c
  840. -test2_LDFLAGS = -all-static
  841. +test2_LDFLAGS = -static
  842. test2_LDADD = $(usrlib_LTLIBRARIES)
  843. test3_SOURCES = test3.c
  844. -test3_LDFLAGS = -all-static
  845. +test3_LDFLAGS = -static
  846. test3_LDADD = $(usrlib_LTLIBRARIES)
  847. noinst_SCRIPTS = testit.sh
  848. +---------------------------------------------------------------------------
  849. | Revert back to the old behaviour of passing to "exec" programs an
  850. | extra "--" argument to separate options and arguments. Additionally,
  851. | allow the "!#:+" constructs to be used multiple times and then each
  852. | time eat another argument (instead of just eating an argument once
  853. | and expanding this multiple times).
  854. +---------------------------------------------------------------------------
  855. Index: popt/popt.c
  856. --- popt/popt.c 22 Aug 2002 14:17:44 -0000 1.1.1.12
  857. +++ popt/popt.c 24 Aug 2003 13:10:16 -0000
  858. @@ -400,9 +400,7 @@
  859. }
  860. if (con->leftovers != NULL && con->numLeftovers > 0) {
  861. -#if 0
  862. argv[argc++] = "--";
  863. -#endif
  864. memcpy(argv + argc, con->leftovers, sizeof(*argv) * con->numLeftovers);
  865. argc += con->numLeftovers;
  866. }
  867. @@ -580,10 +578,8 @@
  868. if (!(s[0] == '#' && s[1] == ':' && s[2] == '+'))
  869. /*@switchbreak@*/ break;
  870. /* XXX Make sure that findNextArg deletes only next arg. */
  871. - if (a == NULL) {
  872. if ((a = findNextArg(con, 1, 1)) == NULL)
  873. /*@switchbreak@*/ break;
  874. - }
  875. s += 3;
  876. alen = strlen(a);
  877. +---------------------------------------------------------------------------
  878. | Dedefine the stdio variable BUFSIZ because it is usually just 1024
  879. | on some platforms (on Linux it is 8192) and unfortunately RPM uses
  880. | it here for the macro expansion buffer. For OpenPKG the size 1024 is
  881. | definetely too small. So increase this to a 16KB buffer.
  882. +---------------------------------------------------------------------------
  883. Index: rpmio/macro.c
  884. --- rpmio/macro.c 15 May 2003 13:42:01 -0000 1.1.1.7
  885. +++ rpmio/macro.c 26 Aug 2003 07:31:04 -0000
  886. @@ -50,6 +50,9 @@
  887. #include "debug.h"
  888. +#undef BUFSIZ
  889. +#define BUFSIZ 16384
  890. +
  891. #if defined(__LCLINT__)
  892. /*@-exportheader@*/
  893. extern const unsigned short int **__ctype_b_loc (void) /*@*/;
  894. +---------------------------------------------------------------------------
  895. | Reactivate build mode aliases which were removed in rpm-4.1
  896. | (and now should be available through "rpmbuild" only).
  897. +---------------------------------------------------------------------------
  898. Index: rpmpopt.in
  899. --- rpmpopt.in 24 Jan 2003 14:56:30 -0000 1.1.1.7
  900. +++ rpmpopt.in 25 Aug 2003 09:32:31 -0000
  901. @@ -147,28 +147,27 @@
  902. # Popt glue to preserve legacy CLI behavior.
  903. #
  904. # XXX popt exec parsing doesn't honor POPT_ARGFLAG_ONEDASH
  905. -# XXX Build mode aliases, removed in rpm-4.1.
  906. -#rpm exec --bp rpmb -bp
  907. -#rpm exec --bc rpmb -bc
  908. -#rpm exec --bi rpmb -bi
  909. -#rpm exec --bl rpmb -bl
  910. -#rpm exec --ba rpmb -ba
  911. -#rpm exec --bb rpmb -bb
  912. -#rpm exec --bs rpmb -bs
  913. -#rpm exec --tp rpmb -tp
  914. -#rpm exec --tc rpmb -tc
  915. -#rpm exec --ti rpmb -ti
  916. -#rpm exec --tl rpmb -tl
  917. -#rpm exec --ta rpmb -ta
  918. -#rpm exec --tb rpmb -tb
  919. -#rpm exec --ts rpmb -ts
  920. -#rpm exec --rebuild rpmb --rebuild
  921. -#rpm exec --recompile rpmb --recompile
  922. -#rpm exec --clean rpmb --clean
  923. -#rpm exec --rmsource rpmb --rmsource
  924. -#rpm exec --rmspec rpmb --rmspec
  925. -#rpm exec --target rpmb --target
  926. -#rpm exec --short-circuit rpmb --short-circuit
  927. +rpm exec --bp rpmb -bp
  928. +rpm exec --bc rpmb -bc
  929. +rpm exec --bi rpmb -bi
  930. +rpm exec --bl rpmb -bl
  931. +rpm exec --ba rpmb -ba
  932. +rpm exec --bb rpmb -bb
  933. +rpm exec --bs rpmb -bs
  934. +rpm exec --tp rpmb -tp
  935. +rpm exec --tc rpmb -tc
  936. +rpm exec --ti rpmb -ti
  937. +rpm exec --tl rpmb -tl
  938. +rpm exec --ta rpmb -ta
  939. +rpm exec --tb rpmb -tb
  940. +rpm exec --ts rpmb -ts
  941. +rpm exec --rebuild rpmb --rebuild
  942. +rpm exec --recompile rpmb --recompile
  943. +rpm exec --clean rpmb --clean
  944. +rpm exec --rmsource rpmb --rmsource
  945. +rpm exec --rmspec rpmb --rmspec
  946. +rpm exec --target rpmb --target
  947. +rpm exec --short-circuit rpmb --short-circuit
  948. rpm exec --initdb rpmd --initdb
  949. rpm exec --rebuilddb rpmd --rebuilddb