openpkg/rpm.patch.feature

Tue, 29 Mar 2011 19:46:35 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 29 Mar 2011 19:46:35 +0200
changeset 333
4ecfc2416fd8
parent 13
cb59d6afeb61
child 336
fa72b60f59c9
permissions
-rw-r--r--

Correct and introduce slightly needed logic, leading to better reliability:
Update bash(1) patch logic, correct several buildconf make location
errors, correct failed bash(1) configure invocation, enable perl(1) to
build with unpathed make(1), patch rpm(1) to correctly link with
internal libdb(3), and lastly unsuscessfully try to reorganize rpm patch
hunks.

michael@13 1 ##
michael@13 2 ## rpm.patch.feature -- Annotated OpenPKG RPM Patch file
michael@13 3 ## Copyright (c) 2000-2007 OpenPKG Foundation e.V. <http://openpkg.net/>
michael@13 4 ## Copyright (c) 2000-2007 Ralf S. Engelschall <http://engelschall.com/>
michael@13 5 ##
michael@13 6 ## This file assembles changes to existing RPM source files between
michael@13 7 ## the original RedHat RPM and the OpenPKG RPM variant. It can be
michael@13 8 ## automatically applied to a vanilla RedHat RPM source tree with the
michael@13 9 ## 'patch' tool to upgrade those files. Each patch snippet is annotated
michael@13 10 ## with a short description.
michael@13 11 ##
michael@13 12 ## Created on: 13-Sep-2006
michael@13 13 ##
michael@13 14 ## ATTENTION: THIS PATCH FILE WAS AUTO-GENERATED FROM AN OPENPKG
michael@13 15 ## RPM CVS REPOSITORY, HENCE DO NOT EDIT THIS FILE.
michael@13 16 ##
michael@13 17
michael@13 18 +---------------------------------------------------------------------------
michael@13 19 | Remove "tools" directory from sub-directory list because it contains
michael@13 20 | things we are not interested in and which cause some build trouble
michael@13 21 | anyway.
michael@13 22 | Use a plain "rpmpopt" file without any trailing version.
michael@13 23 | Adjust paths to conform to OpenPKG filesystem layout.
michael@13 24 | Do not run the "installplatform" script, because not needed for OpenPKG.
michael@13 25 +---------------------------------------------------------------------------
michael@13 26 Index: Makefile.am
michael@13 27 --- Makefile.am 29 May 2003 18:20:28 -0000 1.1.1.17
michael@13 28 +++ Makefile.am 22 Jan 2004 21:42:02 -0000 1.2
michael@13 29 @@ -12,9 +12,9 @@
michael@13 30 xmlspec/examples/*.sh xmlspec/examples/*.lst \
michael@13 31 xmlspec/examples/*.xmlspec \
michael@13 32 po/*.in po/*.po po/rpm.pot \
michael@13 33 - rpm.magic rpmpopt-$(VERSION) rpmqv.c rpm.c
michael@13 34 + rpm.magic rpmpopt rpmqv.c rpm.c
michael@13 35
michael@13 36 -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 .
michael@13 37 +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 .
michael@13 38
michael@13 39 INCLUDES = \
michael@13 40 -I$(top_srcdir)/build \
michael@13 41 @@ -47,13 +47,10 @@
michael@13 42
michael@13 43 pkglibdir = @RPMCONFIGDIR@
michael@13 44 pkglib_PROGRAMS = rpmb rpmd rpmi rpmk rpmq
michael@13 45 -pkglib_DATA = rpmrc rpmpopt-$(VERSION) macros
michael@13 46 +pkglib_DATA = rpmrc rpmpopt macros
michael@13 47 pkglib_SCRIPTS = find-provides find-requires mkinstalldirs \
michael@13 48 config.guess config.sub config.site
michael@13 49
michael@13 50 -rpmpopt-$(VERSION): rpmpopt
michael@13 51 - cp rpmpopt $@
michael@13 52 -
michael@13 53 noinst_HEADERS = build.h debug.h system.h
michael@13 54
michael@13 55 rpm_SOURCES =
michael@13 56 @@ -124,32 +121,32 @@
michael@13 57 pkgsrcdir = $(prefix)/src/$(RPMCANONVENDOR)
michael@13 58
michael@13 59 install-data-local:
michael@13 60 - @$(mkinstalldirs) $(DESTDIR)$(varprefix)/lib/rpm
michael@13 61 + @$(mkinstalldirs) $(DESTDIR)$(varprefix)/lib/openpkg
michael@13 62 @rm -f $(DESTDIR)$(libdir)/rpmrc
michael@13 63 @@LN_S@ rpm/rpmrc $(DESTDIR)$(libdir)/rpmrc
michael@13 64 @rm -f $(DESTDIR)$(libdir)/rpmpopt
michael@13 65 @@LN_S@ rpm/rpmpopt $(DESTDIR)$(libdir)/rpmpopt
michael@13 66 @rm -f $(DESTDIR)$(libdir)/rpm/rpmt
michael@13 67 - @@LN_S@ rpmb $(DESTDIR)$(libdir)/rpm/rpmt
michael@13 68 - @rm -f $(DESTDIR)$(libdir)/rpm/rpme
michael@13 69 - @@LN_S@ rpmi $(DESTDIR)$(libdir)/rpm/rpme
michael@13 70 - @rm -f $(DESTDIR)$(libdir)/rpm/rpmu
michael@13 71 - @@LN_S@ rpmi $(DESTDIR)$(libdir)/rpm/rpmu
michael@13 72 - @rm -f $(DESTDIR)$(libdir)/rpm/rpmv
michael@13 73 - @@LN_S@ rpmq $(DESTDIR)$(libdir)/rpm/rpmv
michael@13 74 + @@LN_S@ rpmb $(DESTDIR)$(libdir)/openpkg/rpmt
michael@13 75 + @rm -f $(DESTDIR)$(libdir)/openpkg/rpme
michael@13 76 + @@LN_S@ rpmi $(DESTDIR)$(libdir)/openpkg/rpme
michael@13 77 + @rm -f $(DESTDIR)$(libdir)/openpkg/rpmu
michael@13 78 + @@LN_S@ rpmi $(DESTDIR)$(libdir)/openpkg/rpmu
michael@13 79 + @rm -f $(DESTDIR)$(libdir)/openpkg/rpmv
michael@13 80 + @@LN_S@ rpmq $(DESTDIR)$(libdir)/openpkg/rpmv
michael@13 81 rm -f $(DESTDIR)$(bindir)/rpmbuild
michael@13 82 - @LN_S@ ../lib/rpm/rpmb $(DESTDIR)$(bindir)/rpmbuild
michael@13 83 + @LN_S@ ../lib/openpkg/rpmb $(DESTDIR)$(bindir)/rpmbuild
michael@13 84 rm -f $(DESTDIR)$(bindir)/rpmquery
michael@13 85 - @LN_S@ ../lib/rpm/rpmq $(DESTDIR)$(bindir)/rpmquery
michael@13 86 + @LN_S@ ../lib/openpkg/rpmq $(DESTDIR)$(bindir)/rpmquery
michael@13 87 rm -f $(DESTDIR)$(bindir)/rpmverify
michael@13 88 - @LN_S@ ../lib/rpm/rpmv $(DESTDIR)$(bindir)/rpmverify
michael@13 89 + @LN_S@ ../lib/openpkg/rpmv $(DESTDIR)$(bindir)/rpmverify
michael@13 90 rm -f $(DESTDIR)$(bindir)/rpmsign
michael@13 91 - @LN_S@ ../lib/rpm/rpmk $(DESTDIR)$(bindir)/rpmsign
michael@13 92 + @LN_S@ ../lib/openpkg/rpmk $(DESTDIR)$(bindir)/rpmsign
michael@13 93 rm -f $(DESTDIR)$(bindir)/rpmdb ; \
michael@13 94 - @LN_S@ ../lib/rpm/rpmd $(DESTDIR)$(bindir)/rpmdb ; \
michael@13 95 + @LN_S@ ../lib/openpkg/rpmd $(DESTDIR)$(bindir)/rpmdb ; \
michael@13 96 for bf in e i u ; do \
michael@13 97 rm -f $(DESTDIR)$(bindir)/rpm$$bf ; \
michael@13 98 - @LN_S@ ../lib/rpm/rpm$$bf $(DESTDIR)$(bindir)/rpm$$bf ; \
michael@13 99 + @LN_S@ ../lib/openpkg/rpm$$bf $(DESTDIR)$(bindir)/rpm$$bf ; \
michael@13 100 done
michael@13 101 @for dir in BUILD RPMS SOURCES SPECS SRPMS ; do\
michael@13 102 $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/$$dir;\
michael@13 103 @@ -174,11 +171,6 @@
michael@13 104 *) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/@host_cpu@ ;;\
michael@13 105 esac
michael@13 106 $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/noarch
michael@13 107 - @case "@host_os@" in \
michael@13 108 - mint) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/m68kmint ;;\
michael@13 109 - solaris*|linux*) \
michael@13 110 - chmod u+x ./installplatform; DESTDIR="$(DESTDIR)" pkglibdir="$(pkglibdir)" ./installplatform rpmrc macros platform ;; \
michael@13 111 - esac
michael@13 112 @$(mkinstalldirs) $(DESTDIR)/var/tmp
michael@13 113
michael@13 114 .PHONY: setperms
michael@13 115 @@ -198,10 +190,10 @@
michael@13 116 $(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(pkglibdir)/$$f ;\
michael@13 117 done
michael@13 118 @$(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(pkglibdir)
michael@13 119 - @$(__CHOWN) -R ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(varprefix)/lib/rpm
michael@13 120 - -@$(__CHMOD) 0664 $(DESTDIR)$(varprefix)/lib/rpm/[A-Z]*
michael@13 121 - -@$(__CHMOD) 0775 $(DESTDIR)$(varprefix)/lib/rpm
michael@13 122 - -@$(__CHMOD) 0664 $(DESTDIR)$(varprefix)/lib/rpm/__db.*
michael@13 123 + @$(__CHOWN) -R ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(varprefix)/lib/openpkg
michael@13 124 + -@$(__CHMOD) 0664 $(DESTDIR)$(varprefix)/lib/openpkg/[A-Z]*
michael@13 125 + -@$(__CHMOD) 0775 $(DESTDIR)$(varprefix)/lib/openpkg
michael@13 126 + -@$(__CHMOD) 0664 $(DESTDIR)$(varprefix)/lib/openpkg/__db.*
michael@13 127
michael@13 128 .PHONY: unsetgid
michael@13 129 unsetgid:
michael@13 130 @@ -244,7 +236,7 @@
michael@13 131 @sudo ./rpm -ta rpm-$(VERSION).tar.gz
michael@13 132
michael@13 133 .PHONY: doxygen
michael@13 134 -doxygen @WITH_APIDOCS_TARGET@: Doxyfile rpmpopt-@VERSION@
michael@13 135 +doxygen @WITH_APIDOCS_TARGET@: Doxyfile rpmpopt
michael@13 136 rm -rf $@
michael@13 137 mkdir -p $@
michael@13 138 - [ X"@__DOXYGEN@" != Xno ] && @__DOXYGEN@
michael@13 139
michael@13 140 +---------------------------------------------------------------------------
michael@13 141 | Remove "tools" directory from sub-directory list because it contains
michael@13 142 | things we are not interested in and which cause some build trouble
michael@13 143 | anyway.
michael@13 144 | Use a plain "rpmpopt" file without any trailing version.
michael@13 145 | Adjust paths to conform to OpenPKG filesystem layout.
michael@13 146 | Do not run the "installplatform" script, because not needed for OpenPKG.
michael@13 147 +---------------------------------------------------------------------------
michael@13 148 Index: Makefile.in
michael@13 149 --- Makefile.in 16 Jul 2003 17:05:42 -0000 1.1.1.23
michael@13 150 +++ Makefile.in 22 Jan 2004 21:42:03 -0000 1.2
michael@13 151 @@ -265,10 +265,10 @@
michael@13 152 xmlspec/examples/*.sh xmlspec/examples/*.lst \
michael@13 153 xmlspec/examples/*.xmlspec \
michael@13 154 po/*.in po/*.po po/rpm.pot \
michael@13 155 - rpm.magic rpmpopt-$(VERSION) rpmqv.c rpm.c
michael@13 156 + rpm.magic rpmpopt rpmqv.c rpm.c
michael@13 157
michael@13 158
michael@13 159 -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 .
michael@13 160 +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 .
michael@13 161
michael@13 162 INCLUDES = \
michael@13 163 -I$(top_srcdir)/build \
michael@13 164 @@ -301,7 +301,7 @@
michael@13 165 bin_PROGRAMS = rpm2cpio
michael@13 166 bin_SCRIPTS = gendiff
michael@13 167 pkglib_PROGRAMS = rpmb rpmd rpmi rpmk rpmq
michael@13 168 -pkglib_DATA = rpmrc rpmpopt-$(VERSION) macros
michael@13 169 +pkglib_DATA = rpmrc rpmpopt macros
michael@13 170 pkglib_SCRIPTS = find-provides find-requires mkinstalldirs \
michael@13 171 config.guess config.sub config.site
michael@13 172
michael@13 173 @@ -1058,8 +1058,6 @@
michael@13 174 uninstall-rpmbinPROGRAMS
michael@13 175
michael@13 176
michael@13 177 -rpmpopt-$(VERSION): rpmpopt
michael@13 178 - cp rpmpopt $@
michael@13 179 rpm.o: rpmqv.c
michael@13 180 $(COMPILE) -DIAM_RPMDB -DIAM_RPMEIU -DIAM_RPMK -DIAM_RPMQV -o $@ -c rpmqv.c
michael@13 181 rpmb.o: rpmqv.c
michael@13 182 @@ -1097,32 +1095,32 @@
michael@13 183 `make -s sources -C popt`
michael@13 184
michael@13 185 install-data-local:
michael@13 186 - @$(mkinstalldirs) $(DESTDIR)$(varprefix)/lib/rpm
michael@13 187 + @$(mkinstalldirs) $(DESTDIR)$(varprefix)/lib/openpkg
michael@13 188 @rm -f $(DESTDIR)$(libdir)/rpmrc
michael@13 189 @@LN_S@ rpm/rpmrc $(DESTDIR)$(libdir)/rpmrc
michael@13 190 @rm -f $(DESTDIR)$(libdir)/rpmpopt
michael@13 191 @@LN_S@ rpm/rpmpopt $(DESTDIR)$(libdir)/rpmpopt
michael@13 192 - @rm -f $(DESTDIR)$(libdir)/rpm/rpmt
michael@13 193 - @@LN_S@ rpmb $(DESTDIR)$(libdir)/rpm/rpmt
michael@13 194 - @rm -f $(DESTDIR)$(libdir)/rpm/rpme
michael@13 195 - @@LN_S@ rpmi $(DESTDIR)$(libdir)/rpm/rpme
michael@13 196 - @rm -f $(DESTDIR)$(libdir)/rpm/rpmu
michael@13 197 - @@LN_S@ rpmi $(DESTDIR)$(libdir)/rpm/rpmu
michael@13 198 - @rm -f $(DESTDIR)$(libdir)/rpm/rpmv
michael@13 199 - @@LN_S@ rpmq $(DESTDIR)$(libdir)/rpm/rpmv
michael@13 200 + @rm -f $(DESTDIR)$(libdir)/openpkg/rpmt
michael@13 201 + @@LN_S@ rpmb $(DESTDIR)$(libdir)/openpkg/rpmt
michael@13 202 + @rm -f $(DESTDIR)$(libdir)/openpkg/rpme
michael@13 203 + @@LN_S@ rpmi $(DESTDIR)$(libdir)/openpkg/rpme
michael@13 204 + @rm -f $(DESTDIR)$(libdir)/openpkg/rpmu
michael@13 205 + @@LN_S@ rpmi $(DESTDIR)$(libdir)/openpkg/rpmu
michael@13 206 + @rm -f $(DESTDIR)$(libdir)/openpkg/rpmv
michael@13 207 + @@LN_S@ rpmq $(DESTDIR)$(libdir)/openpkg/rpmv
michael@13 208 rm -f $(DESTDIR)$(bindir)/rpmbuild
michael@13 209 - @LN_S@ ../lib/rpm/rpmb $(DESTDIR)$(bindir)/rpmbuild
michael@13 210 + @LN_S@ ../lib/openpkg/rpmb $(DESTDIR)$(bindir)/rpmbuild
michael@13 211 rm -f $(DESTDIR)$(bindir)/rpmquery
michael@13 212 - @LN_S@ ../lib/rpm/rpmq $(DESTDIR)$(bindir)/rpmquery
michael@13 213 + @LN_S@ ../lib/openpkg/rpmq $(DESTDIR)$(bindir)/rpmquery
michael@13 214 rm -f $(DESTDIR)$(bindir)/rpmverify
michael@13 215 - @LN_S@ ../lib/rpm/rpmv $(DESTDIR)$(bindir)/rpmverify
michael@13 216 + @LN_S@ ../lib/openpkg/rpmv $(DESTDIR)$(bindir)/rpmverify
michael@13 217 rm -f $(DESTDIR)$(bindir)/rpmsign
michael@13 218 - @LN_S@ ../lib/rpm/rpmk $(DESTDIR)$(bindir)/rpmsign
michael@13 219 + @LN_S@ ../lib/openpkg/rpmk $(DESTDIR)$(bindir)/rpmsign
michael@13 220 rm -f $(DESTDIR)$(bindir)/rpmdb ; \
michael@13 221 - @LN_S@ ../lib/rpm/rpmd $(DESTDIR)$(bindir)/rpmdb ; \
michael@13 222 + @LN_S@ ../lib/openpkg/rpmd $(DESTDIR)$(bindir)/rpmdb ; \
michael@13 223 for bf in e i u ; do \
michael@13 224 rm -f $(DESTDIR)$(bindir)/rpm$$bf ; \
michael@13 225 - @LN_S@ ../lib/rpm/rpm$$bf $(DESTDIR)$(bindir)/rpm$$bf ; \
michael@13 226 + @LN_S@ ../lib/openpkg/rpm$$bf $(DESTDIR)$(bindir)/rpm$$bf ; \
michael@13 227 done
michael@13 228 @for dir in BUILD RPMS SOURCES SPECS SRPMS ; do\
michael@13 229 $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/$$dir;\
michael@13 230 @@ -1147,11 +1145,6 @@
michael@13 231 *) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/@host_cpu@ ;;\
michael@13 232 esac
michael@13 233 $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/noarch
michael@13 234 - @case "@host_os@" in \
michael@13 235 - mint) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/m68kmint ;;\
michael@13 236 - solaris*|linux*) \
michael@13 237 - chmod u+x ./installplatform; DESTDIR="$(DESTDIR)" pkglibdir="$(pkglibdir)" ./installplatform rpmrc macros platform ;; \
michael@13 238 - esac
michael@13 239 @$(mkinstalldirs) $(DESTDIR)/var/tmp
michael@13 240
michael@13 241 .PHONY: setperms
michael@13 242 @@ -1171,10 +1164,10 @@
michael@13 243 $(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(pkglibdir)/$$f ;\
michael@13 244 done
michael@13 245 @$(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(pkglibdir)
michael@13 246 - @$(__CHOWN) -R ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(varprefix)/lib/rpm
michael@13 247 - -@$(__CHMOD) 0664 $(DESTDIR)$(varprefix)/lib/rpm/[A-Z]*
michael@13 248 - -@$(__CHMOD) 0775 $(DESTDIR)$(varprefix)/lib/rpm
michael@13 249 - -@$(__CHMOD) 0664 $(DESTDIR)$(varprefix)/lib/rpm/__db.*
michael@13 250 + @$(__CHOWN) -R ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(varprefix)/lib/openpkg
michael@13 251 + -@$(__CHMOD) 0664 $(DESTDIR)$(varprefix)/lib/openpkg/[A-Z]*
michael@13 252 + -@$(__CHMOD) 0775 $(DESTDIR)$(varprefix)/lib/openpkg
michael@13 253 + -@$(__CHMOD) 0664 $(DESTDIR)$(varprefix)/lib/openpkg/__db.*
michael@13 254
michael@13 255 .PHONY: unsetgid
michael@13 256 unsetgid:
michael@13 257 @@ -1217,7 +1210,7 @@
michael@13 258 @sudo ./rpm -ta rpm-$(VERSION).tar.gz
michael@13 259
michael@13 260 .PHONY: doxygen
michael@13 261 -doxygen @WITH_APIDOCS_TARGET@: Doxyfile rpmpopt-@VERSION@
michael@13 262 +doxygen @WITH_APIDOCS_TARGET@: Doxyfile rpmpopt
michael@13 263 rm -rf $@
michael@13 264 mkdir -p $@
michael@13 265 - [ X"@__DOXYGEN@" != Xno ] && @__DOXYGEN@
michael@13 266
michael@13 267 +---------------------------------------------------------------------------
michael@13 268 | Add support for splitted source directories, i.e., source files
michael@13 269 | alternatively can be placed into the .spec directory and are picked
michael@13 270 | up there, too.
michael@13 271 +---------------------------------------------------------------------------
michael@13 272 Index: build/build.c
michael@13 273 --- build/build.c 4 Mar 2003 15:27:33 -0000 1.1.1.20
michael@13 274 +++ build/build.c 6 Feb 2004 15:37:57 -0000 1.4
michael@13 275 @@ -33,7 +33,15 @@
michael@13 276
michael@13 277 for (p = spec->sources; p != NULL; p = p->next) {
michael@13 278 if (! (p->flags & RPMBUILD_ISNO)) {
michael@13 279 +#ifndef OPENPKG
michael@13 280 const char *fn = rpmGetPath("%{_sourcedir}/", p->source, NULL);
michael@13 281 +#else
michael@13 282 + const char *fn = rpmGetPath("%{_specdir}/", p->source, NULL);
michael@13 283 + if (access(fn, F_OK) == -1) {
michael@13 284 + fn = _free(fn);
michael@13 285 + fn = rpmGetPath("%{_sourcedir}/", p->source, NULL);
michael@13 286 + }
michael@13 287 +#endif
michael@13 288 rc = Unlink(fn);
michael@13 289 fn = _free(fn);
michael@13 290 }
michael@13 291 @@ -42,7 +50,15 @@
michael@13 292 for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
michael@13 293 for (p = pkg->icon; p != NULL; p = p->next) {
michael@13 294 if (! (p->flags & RPMBUILD_ISNO)) {
michael@13 295 +#ifndef OPENPKG
michael@13 296 const char *fn = rpmGetPath("%{_sourcedir}/", p->source, NULL);
michael@13 297 +#else
michael@13 298 + const char *fn = rpmGetPath("%{_specdir}/", p->source, NULL);
michael@13 299 + if (access(fn, F_OK) == -1) {
michael@13 300 + fn = _free(fn);
michael@13 301 + fn = rpmGetPath("%{_sourcedir}/", p->source, NULL);
michael@13 302 + }
michael@13 303 +#endif
michael@13 304 rc = Unlink(fn);
michael@13 305 fn = _free(fn);
michael@13 306 }
michael@13 307
michael@13 308 +---------------------------------------------------------------------------
michael@13 309 | Add support for the OpenPKG custom .spec file sections %track
michael@13 310 | (package build-time feature for performing vendor source tracking)
michael@13 311 | and %test (package install-time feature for performing package
michael@13 312 | run-time tests).
michael@13 313 +---------------------------------------------------------------------------
michael@13 314 Index: build/build.c
michael@13 315 --- build/build.c 4 Mar 2003 15:27:33 -0000 1.1.1.20
michael@13 316 +++ build/build.c 6 Feb 2004 15:37:57 -0000 1.4
michael@13 317 @@ -113,6 +129,14 @@
michael@13 318 mTemplate = "%{__spec_clean_template}";
michael@13 319 mPost = "%{__spec_clean_post}";
michael@13 320 break;
michael@13 321 +#ifdef OPENPKG
michael@13 322 + case RPMBUILD_TRACK:
michael@13 323 + name = "%track";
michael@13 324 + sb = spec->track;
michael@13 325 + mTemplate = "%{__spec_track_template}";
michael@13 326 + mPost = "%{__spec_track_post}";
michael@13 327 + break;
michael@13 328 +#endif
michael@13 329 case RPMBUILD_STRINGBUF:
michael@13 330 default:
michael@13 331 mTemplate = "%{___build_template}";
michael@13 332 @@ -169,7 +193,11 @@
michael@13 333
michael@13 334 (void) fputs(buildTemplate, fp);
michael@13 335
michael@13 336 +#ifdef OPENPKG
michael@13 337 + if (what != RPMBUILD_PREP && what != RPMBUILD_RMBUILD && spec->buildSubdir && what != RPMBUILD_TRACK)
michael@13 338 +#else
michael@13 339 if (what != RPMBUILD_PREP && what != RPMBUILD_RMBUILD && spec->buildSubdir)
michael@13 340 +#endif
michael@13 341 fprintf(fp, "cd %s\n", spec->buildSubdir);
michael@13 342
michael@13 343 if (what == RPMBUILD_RMBUILD) {
michael@13 344 @@ -215,6 +243,9 @@
michael@13 345 buildCmd = rpmExpand("%{___build_cmd}", " ", buildScript, NULL);
michael@13 346 (void) poptParseArgvString(buildCmd, &argc, &argv);
michael@13 347
michael@13 348 +#ifdef OPENPKG
michael@13 349 + if (what != RPMBUILD_TRACK)
michael@13 350 +#endif
michael@13 351 rpmMessage(RPMMESS_NORMAL, _("Executing(%s): %s\n"), name, buildCmd);
michael@13 352 if (!(child = fork())) {
michael@13 353
michael@13 354 @@ -290,6 +323,12 @@
michael@13 355 /*@=boundsread@*/
michael@13 356 }
michael@13 357 } else {
michael@13 358 +#ifdef OPENPKG
michael@13 359 + if ((what & RPMBUILD_TRACK) &&
michael@13 360 + (rc = doScript(spec, RPMBUILD_TRACK, NULL, NULL, test)))
michael@13 361 + goto exit;
michael@13 362 +#endif
michael@13 363 +
michael@13 364 if ((what & RPMBUILD_PREP) &&
michael@13 365 (rc = doScript(spec, RPMBUILD_PREP, NULL, NULL, test)))
michael@13 366 goto exit;
michael@13 367
michael@13 368 +---------------------------------------------------------------------------
michael@13 369 | Unconditionally remove temporary files ("rpm-tmp.XXXXX") which
michael@13 370 | were generated for the executed scripts. In OpenPKG we run the
michael@13 371 | scripts in debug mode ("set -x") anyway, so we never need to
michael@13 372 | see the whole generated script -- not even if it breaks. Instead
michael@13 373 | we would just have temporary files staying around forever.
michael@13 374 +---------------------------------------------------------------------------
michael@13 375 Index: build/build.c
michael@13 376 --- build/build.c 4 Mar 2003 15:27:33 -0000 1.1.1.20
michael@13 377 +++ build/build.c 6 Feb 2004 15:37:57 -0000 1.4
michael@13 378 @@ -242,7 +273,9 @@
michael@13 379
michael@13 380 exit:
michael@13 381 if (scriptName) {
michael@13 382 +#ifndef OPENPKG
michael@13 383 if (!rc)
michael@13 384 +#endif
michael@13 385 (void) Unlink(scriptName);
michael@13 386 scriptName = _free(scriptName);
michael@13 387 }
michael@13 388
michael@13 389 +---------------------------------------------------------------------------
michael@13 390 | In OpenPKG we use per-package %{_sourcedir} and %{_specdir}
michael@13 391 | definitions (macros have trailing ".../%{name}"). On removal
michael@13 392 | of source(s) and .spec file, this per-package directory would
michael@13 393 | be kept (usually <prefix>/RPM/SRC/<name>/), because RPM does
michael@13 394 | not know about this OpenPKG convention. So, let RPM try(!) to
michael@13 395 | remove the two directories (if they are empty) and just ignore
michael@13 396 | removal failures (if they are still not empty).
michael@13 397 +---------------------------------------------------------------------------
michael@13 398 Index: build/build.c
michael@13 399 --- build/build.c 4 Mar 2003 15:27:33 -0000 1.1.1.20
michael@13 400 +++ build/build.c 6 Feb 2004 15:37:57 -0000 1.4
michael@13 401 @@ -338,6 +377,21 @@
michael@13 402 if (what & RPMBUILD_RMSPEC)
michael@13 403 (void) Unlink(spec->specFile);
michael@13 404
michael@13 405 +#ifdef OPENPKG
michael@13 406 + if (what & RPMBUILD_RMSOURCE) {
michael@13 407 + const char *pn;
michael@13 408 + pn = rpmGetPath("%{_sourcedir}", NULL);
michael@13 409 + Rmdir(pn); /* ignore error, it is ok if it fails (usually with ENOTEMPTY) */
michael@13 410 + pn = _free(pn);
michael@13 411 + }
michael@13 412 + if (what & RPMBUILD_RMSPEC) {
michael@13 413 + const char *pn;
michael@13 414 + pn = rpmGetPath("%{_specdir}", NULL);
michael@13 415 + Rmdir(pn); /* ignore error, it is ok if it fails (usually with ENOTEMPTY) */
michael@13 416 + pn = _free(pn);
michael@13 417 + }
michael@13 418 +#endif
michael@13 419 +
michael@13 420 exit:
michael@13 421 if (rc && rpmlogGetNrecs() > 0) {
michael@13 422 rpmMessage(RPMMESS_NORMAL, _("\n\nRPM build errors:\n"));
michael@13 423
michael@13 424 +---------------------------------------------------------------------------
michael@13 425 | Do not declare any files as %doc files by default.
michael@13 426 +---------------------------------------------------------------------------
michael@13 427 Index: build/files.c
michael@13 428 --- build/files.c 4 Mar 2003 17:04:13 -0000 1.1.1.20
michael@13 429 +++ build/files.c 6 Feb 2004 15:37:57 -0000 1.3
michael@13 430 @@ -1971,6 +1971,7 @@
michael@13 431 fl.defSpecdFlags = 0;
michael@13 432
michael@13 433 fl.docDirCount = 0;
michael@13 434 +#if 0
michael@13 435 fl.docDirs[fl.docDirCount++] = xstrdup("/usr/doc");
michael@13 436 fl.docDirs[fl.docDirCount++] = xstrdup("/usr/man");
michael@13 437 fl.docDirs[fl.docDirCount++] = xstrdup("/usr/info");
michael@13 438 @@ -1981,6 +1982,7 @@
michael@13 439 fl.docDirs[fl.docDirCount++] = rpmGetPath("%{_docdir}", NULL);
michael@13 440 fl.docDirs[fl.docDirCount++] = rpmGetPath("%{_mandir}", NULL);
michael@13 441 fl.docDirs[fl.docDirCount++] = rpmGetPath("%{_infodir}", NULL);
michael@13 442 +#endif
michael@13 443
michael@13 444 fl.fileList = NULL;
michael@13 445 fl.fileListRecsAlloced = 0;
michael@13 446
michael@13 447 +---------------------------------------------------------------------------
michael@13 448 | Make sure the "Provides" headers are available for querying from the
michael@13 449 | .src.rpm files.
michael@13 450 +---------------------------------------------------------------------------
michael@13 451 Index: build/files.c
michael@13 452 --- build/files.c 4 Mar 2003 17:04:13 -0000 1.1.1.20
michael@13 453 +++ build/files.c 6 Feb 2004 15:37:57 -0000 1.3
michael@13 454 @@ -2183,6 +2185,12 @@
michael@13 455 case RPMTAG_CHANGELOGTEXT:
michael@13 456 case RPMTAG_URL:
michael@13 457 case HEADER_I18NTABLE:
michael@13 458 +#ifdef OPENPKG
michael@13 459 + case RPMTAG_PROVIDENAME:
michael@13 460 + case RPMTAG_PROVIDEVERSION:
michael@13 461 + case RPMTAG_PROVIDEFLAGS:
michael@13 462 + case RPMTAG_CLASS:
michael@13 463 +#endif
michael@13 464 if (ptr)
michael@13 465 (void)headerAddEntry(spec->sourceHeader, tag, type, ptr, count);
michael@13 466 /*@switchbreak@*/ break;
michael@13 467
michael@13 468 +---------------------------------------------------------------------------
michael@13 469 | Add support for splitted source directories, i.e., source files
michael@13 470 | alternatively can be placed into the .spec directory and are picked
michael@13 471 | up there, too.
michael@13 472 +---------------------------------------------------------------------------
michael@13 473 Index: build/files.c
michael@13 474 --- build/files.c 4 Mar 2003 17:04:13 -0000 1.1.1.20
michael@13 475 +++ build/files.c 6 Feb 2004 15:37:57 -0000 1.3
michael@13 476 @@ -2253,8 +2261,20 @@
michael@13 477 }
michael@13 478
michael@13 479 { const char * sfn;
michael@13 480 +#ifndef OPENPKG
michael@13 481 sfn = rpmGetPath( ((srcPtr->flags & RPMBUILD_ISNO) ? "!" : ""),
michael@13 482 "%{_sourcedir}/", srcPtr->source, NULL);
michael@13 483 +#else
michael@13 484 + const char *sfn2;
michael@13 485 + sfn2 = rpmGetPath("%{_specdir}/", srcPtr->source, NULL);
michael@13 486 + if (access(sfn2, F_OK) == 0)
michael@13 487 + sfn = rpmGetPath( ((srcPtr->flags & RPMBUILD_ISNO) ? "!" : ""),
michael@13 488 + "%{_specdir}/", srcPtr->source, NULL);
michael@13 489 + else
michael@13 490 + sfn = rpmGetPath( ((srcPtr->flags & RPMBUILD_ISNO) ? "!" : ""),
michael@13 491 + "%{_sourcedir}/", srcPtr->source, NULL);
michael@13 492 + sfn2 = _free(sfn2);
michael@13 493 +#endif
michael@13 494 appendLineStringBuf(sourceFiles, sfn);
michael@13 495 sfn = _free(sfn);
michael@13 496 }
michael@13 497 @@ -2263,8 +2283,20 @@
michael@13 498 for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
michael@13 499 for (srcPtr = pkg->icon; srcPtr != NULL; srcPtr = srcPtr->next) {
michael@13 500 const char * sfn;
michael@13 501 +#ifndef OPENPKG
michael@13 502 sfn = rpmGetPath( ((srcPtr->flags & RPMBUILD_ISNO) ? "!" : ""),
michael@13 503 "%{_sourcedir}/", srcPtr->source, NULL);
michael@13 504 +#else
michael@13 505 + const char *sfn2;
michael@13 506 + sfn2 = rpmGetPath("%{_specdir}/", srcPtr->source, NULL);
michael@13 507 + if (access(sfn2, F_OK) == 0)
michael@13 508 + sfn = rpmGetPath( ((srcPtr->flags & RPMBUILD_ISNO) ? "!" : ""),
michael@13 509 + "%{_specdir}/", srcPtr->source, NULL);
michael@13 510 + else
michael@13 511 + sfn = rpmGetPath( ((srcPtr->flags & RPMBUILD_ISNO) ? "!" : ""),
michael@13 512 + "%{_sourcedir}/", srcPtr->source, NULL);
michael@13 513 + sfn2 = _free(sfn2);
michael@13 514 +#endif
michael@13 515 appendLineStringBuf(sourceFiles, sfn);
michael@13 516 sfn = _free(sfn);
michael@13 517 }
michael@13 518
michael@13 519 +---------------------------------------------------------------------------
michael@13 520 | Add support for splitted source directories, i.e., source files
michael@13 521 | alternatively can be placed into the .spec directory and are picked
michael@13 522 | up there, too.
michael@13 523 +---------------------------------------------------------------------------
michael@13 524 Index: build/parsePreamble.c
michael@13 525 --- build/parsePreamble.c 3 Mar 2003 20:46:34 -0000 1.1.1.13
michael@13 526 +++ build/parsePreamble.c 6 Feb 2004 15:37:58 -0000 1.3
michael@13 527 @@ -366,7 +368,15 @@
michael@13 528 size_t nb, iconsize;
michael@13 529
michael@13 530 /* XXX use rpmGenPath(rootdir, "%{_sourcedir}/", file) for icon path. */
michael@13 531 +#ifndef OPENPKG
michael@13 532 fn = rpmGetPath("%{_sourcedir}/", file, NULL);
michael@13 533 +#else
michael@13 534 + fn = rpmGetPath("%{_specdir}/", file, NULL);
michael@13 535 + if (access(fn, F_OK) == -1) {
michael@13 536 + fn = _free(fn);
michael@13 537 + fn = rpmGetPath("%{_sourcedir}/", file, NULL);
michael@13 538 + }
michael@13 539 +#endif
michael@13 540
michael@13 541 fd = Fopen(fn, "r.ufdio");
michael@13 542 if (fd == NULL || Ferror(fd)) {
michael@13 543
michael@13 544 +---------------------------------------------------------------------------
michael@13 545 | In OpenPKG, the RPM package contains own local versions of the
michael@13 546 | "patch" and "tar" tools, so we cannot accept hard-coded names here.
michael@13 547 | Instead we expand a variable to allow us to direct RPM to our tools.
michael@13 548 | Additionally, pass option "-b" to patch(1) so it creates original
michael@13 549 | files not only if a non-standard (not ".orig") suffix is used.
michael@13 550 | Finally, add support for the GNU patch "-d" option for convenient
michael@13 551 | changing into a subdirectory.
michael@13 552 | Remove "unzip" support, because in OpenPKG there are less than
michael@13 553 | a dozend packages requiring unpacking of .zip files. For these
michael@13 554 | it is fully sufficient to explicitly require the "infozip"
michael@13 555 | package (containing "unzip") and leaving the less portable
michael@13 556 | "unzip" out of the bootstrap package.
michael@13 557 +---------------------------------------------------------------------------
michael@13 558 Index: build/parsePrep.c
michael@13 559 --- build/parsePrep.c 7 Aug 2002 14:20:45 -0000 1.1.1.10
michael@13 560 +++ build/parsePrep.c 6 Jun 2005 15:53:04 -0000 1.4
michael@13 561 @@ -66,7 +66,7 @@
michael@13 562 */
michael@13 563 /*@-boundswrite@*/
michael@13 564 /*@observer@*/ static char *doPatch(Spec spec, int c, int strip, const char *db,
michael@13 565 - int reverse, int removeEmpties)
michael@13 566 + int reverse, int removeEmpties, const char *subdir)
michael@13 567 /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
michael@13 568 /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/
michael@13 569 {
michael@13 570 @@ -76,6 +76,7 @@
michael@13 571 struct Source *sp;
michael@13 572 rpmCompressedMagic compressed = COMPRESSED_NOT;
michael@13 573 int urltype;
michael@13 574 + const char *patcher;
michael@13 575
michael@13 576 for (sp = spec->sources; sp != NULL; sp = sp->next) {
michael@13 577 if ((sp->flags & RPMBUILD_ISPATCH) && (sp->num == c)) {
michael@13 578 @@ -97,6 +106,10 @@
michael@13 579 strcat(args, "--suffix ");
michael@13 580 strcat(args, db);
michael@13 581 }
michael@13 582 + if (subdir) {
michael@13 583 + strcat(args, "-d ");
michael@13 584 + strcat(args, subdir);
michael@13 585 + }
michael@13 586 if (reverse) {
michael@13 587 strcat(args, " -R");
michael@13 588 }
michael@13 589 @@ -124,6 +137,10 @@
michael@13 590 /*@notreached@*/ break;
michael@13 591 }
michael@13 592
michael@13 593 + patcher = rpmGetPath("%{_patchbin}", NULL);
michael@13 594 + if (strcmp(patcher, "%{_patchbin}") == 0)
michael@13 595 + patcher = "patch";
michael@13 596 +
michael@13 597 if (compressed) {
michael@13 598 const char *zipper = rpmGetPath(
michael@13 599 (compressed == COMPRESSED_BZIP2 ? "%{_bzip2bin}" : "%{_gzipbin}"),
michael@13 600 @@ -131,22 +148,23 @@
michael@13 601
michael@13 602 sprintf(buf,
michael@13 603 "echo \"Patch #%d (%s):\"\n"
michael@13 604 - "%s -d < %s | patch -p%d %s -s\n"
michael@13 605 + "%s -d <%s | %s -p%d %s -s -b\n"
michael@13 606 "STATUS=$?\n"
michael@13 607 "if [ $STATUS -ne 0 ]; then\n"
michael@13 608 " exit $STATUS\n"
michael@13 609 "fi",
michael@13 610 - c, /*@-unrecog@*/ (const char *) basename(fn), /*@=unrecog@*/
michael@13 611 + c, /*@-unrecog@*/ basename(fn), /*@=unrecog@*/
michael@13 612 zipper,
michael@13 613 - fn, strip, args);
michael@13 614 + fn, patcher, strip, args);
michael@13 615 zipper = _free(zipper);
michael@13 616 } else {
michael@13 617 sprintf(buf,
michael@13 618 "echo \"Patch #%d (%s):\"\n"
michael@13 619 - "patch -p%d %s -s < %s", c, (const char *) basename(fn),
michael@13 620 - strip, args, fn);
michael@13 621 + "%s -p%d %s -s -b <%s", c, basename(fn),
michael@13 622 + patcher, strip, args, fn);
michael@13 623 }
michael@13 624
michael@13 625 + patcher = _free(patcher);
michael@13 626 urlfn = _free(urlfn);
michael@13 627 return buf;
michael@13 628 }
michael@13 629 @@ -171,6 +189,7 @@
michael@13 630 struct Source *sp;
michael@13 631 rpmCompressedMagic compressed = COMPRESSED_NOT;
michael@13 632 int urltype;
michael@13 633 + const char *tar;
michael@13 634
michael@13 635 for (sp = spec->sources; sp != NULL; sp = sp->next) {
michael@13 636 if ((sp->flags & RPMBUILD_ISSOURCE) && (sp->num == c)) {
michael@13 637 @@ -228,6 +255,10 @@
michael@13 638 /*@notreached@*/ break;
michael@13 639 }
michael@13 640
michael@13 641 + tar = rpmGetPath("%{_tarbin}", NULL);
michael@13 642 + if (strcmp(tar, "%{_tarbin}") == 0)
michael@13 643 + tar = "tar";
michael@13 644 +
michael@13 645 if (compressed != COMPRESSED_NOT) {
michael@13 646 const char *zipper;
michael@13 647 int needtar = 1;
michael@13 648 @@ -240,6 +271,7 @@
michael@13 649 case COMPRESSED_BZIP2:
michael@13 650 t = "%{_bzip2bin} -dc";
michael@13 651 break;
michael@13 652 +#if 0
michael@13 653 case COMPRESSED_ZIP:
michael@13 654 if (rpmIsVerbose() && !quietly)
michael@13 655 t = "%{_unzipbin}";
michael@13 656 @@ -247,6 +279,7 @@
michael@13 657 t = "%{_unzipbin} -qq";
michael@13 658 needtar = 0;
michael@13 659 break;
michael@13 660 +#endif
michael@13 661 }
michael@13 662 zipper = rpmGetPath(t, NULL);
michael@13 663 buf[0] = '\0';
michael@13 664 @@ -254,8 +287,13 @@
michael@13 665 zipper = _free(zipper);
michael@13 666 *t++ = ' ';
michael@13 667 t = stpcpy(t, fn);
michael@13 668 - if (needtar)
michael@13 669 - t = stpcpy( stpcpy( stpcpy(t, " | tar "), taropts), " -");
michael@13 670 + if (needtar) {
michael@13 671 + t = stpcpy(t, " | ");
michael@13 672 + t = stpcpy(t, tar);
michael@13 673 + t = stpcpy(t, " ");
michael@13 674 + t = stpcpy(t, taropts);
michael@13 675 + t = stpcpy(t, " -");
michael@13 676 + }
michael@13 677 t = stpcpy(t,
michael@13 678 "\n"
michael@13 679 "STATUS=$?\n"
michael@13 680 @@ -264,11 +302,14 @@
michael@13 681 "fi");
michael@13 682 } else {
michael@13 683 buf[0] = '\0';
michael@13 684 - t = stpcpy( stpcpy(buf, "tar "), taropts);
michael@13 685 - *t++ = ' ';
michael@13 686 + t = stpcpy(buf, tar);
michael@13 687 + t = stpcpy(t, " ");
michael@13 688 + t = stpcpy(t, taropts);
michael@13 689 + t = stpcpy(t, " ");
michael@13 690 t = stpcpy(t, fn);
michael@13 691 }
michael@13 692
michael@13 693 + tar = _free(tar);
michael@13 694 urlfn = _free(urlfn);
michael@13 695 return buf;
michael@13 696 }
michael@13 697 @@ -443,7 +484,7 @@
michael@13 698 /*@modifies spec->prep, rpmGlobalMacroContext,
michael@13 699 fileSystem, internalState @*/
michael@13 700 {
michael@13 701 - char *opt_b;
michael@13 702 + char *opt_b, *opt_d;
michael@13 703 int opt_P, opt_p, opt_R, opt_E;
michael@13 704 char *s;
michael@13 705 char buf[BUFSIZ], *bp;
michael@13 706 @@ -453,6 +494,7 @@
michael@13 707 memset(patch_nums, 0, sizeof(patch_nums));
michael@13 708 opt_P = opt_p = opt_R = opt_E = 0;
michael@13 709 opt_b = NULL;
michael@13 710 + opt_d = NULL;
michael@13 711 patch_index = 0;
michael@13 712
michael@13 713 if (! strchr(" \t\n", line[6])) {
michael@13 714 @@ -492,6 +534,15 @@
michael@13 715 spec->lineNum, spec->line);
michael@13 716 return RPMERR_BADSPEC;
michael@13 717 }
michael@13 718 + } else if (!strcmp(s, "-d")) {
michael@13 719 + /* orig suffix */
michael@13 720 + opt_d = strtok(NULL, " \t\n");
michael@13 721 + if (! opt_d) {
michael@13 722 + rpmError(RPMERR_BADSPEC,
michael@13 723 + _("line %d: Need arg to %%patch -d: %s\n"),
michael@13 724 + spec->lineNum, spec->line);
michael@13 725 + return RPMERR_BADSPEC;
michael@13 726 + }
michael@13 727 } else if (!strncmp(s, "-p", sizeof("-p")-1)) {
michael@13 728 /* unfortunately, we must support -pX */
michael@13 729 if (! strchr(" \t\n", s[2])) {
michael@13 730 @@ -530,14 +581,14 @@
michael@13 731 /* All args processed */
michael@13 732
michael@13 733 if (! opt_P) {
michael@13 734 - s = doPatch(spec, 0, opt_p, opt_b, opt_R, opt_E);
michael@13 735 + s = doPatch(spec, 0, opt_p, opt_b, opt_R, opt_E, opt_d);
michael@13 736 if (s == NULL)
michael@13 737 return RPMERR_BADSPEC;
michael@13 738 appendLineStringBuf(spec->prep, s);
michael@13 739 }
michael@13 740
michael@13 741 for (x = 0; x < patch_index; x++) {
michael@13 742 - s = doPatch(spec, patch_nums[x], opt_p, opt_b, opt_R, opt_E);
michael@13 743 + s = doPatch(spec, patch_nums[x], opt_p, opt_b, opt_R, opt_E, opt_d);
michael@13 744 if (s == NULL)
michael@13 745 return RPMERR_BADSPEC;
michael@13 746 appendLineStringBuf(spec->prep, s);
michael@13 747
michael@13 748 +---------------------------------------------------------------------------
michael@13 749 | Add support for splitted source directories, i.e., source files
michael@13 750 | alternatively can be placed into the .spec directory and are picked
michael@13 751 | up there, too.
michael@13 752 +---------------------------------------------------------------------------
michael@13 753 Index: build/parsePrep.c
michael@13 754 --- build/parsePrep.c 7 Aug 2002 14:20:45 -0000 1.1.1.10
michael@13 755 +++ build/parsePrep.c 6 Jun 2005 15:53:04 -0000 1.4
michael@13 756 @@ -87,7 +88,15 @@
michael@13 757 return NULL;
michael@13 758 }
michael@13 759
michael@13 760 +#ifndef OPENPKG
michael@13 761 urlfn = rpmGetPath("%{_sourcedir}/", sp->source, NULL);
michael@13 762 +#else
michael@13 763 + urlfn = rpmGetPath("%{_specdir}/", sp->source, NULL);
michael@13 764 + if (access(urlfn, F_OK) == -1) {
michael@13 765 + urlfn = _free(urlfn);
michael@13 766 + urlfn = rpmGetPath("%{_sourcedir}/", sp->source, NULL);
michael@13 767 + }
michael@13 768 +#endif
michael@13 769
michael@13 770 args[0] = '\0';
michael@13 771 if (db) {
michael@13 772 @@ -182,7 +201,15 @@
michael@13 773 return NULL;
michael@13 774 }
michael@13 775
michael@13 776 +#ifndef OPENPKG
michael@13 777 urlfn = rpmGetPath("%{_sourcedir}/", sp->source, NULL);
michael@13 778 +#else
michael@13 779 + urlfn = rpmGetPath("%{_specdir}/", sp->source, NULL);
michael@13 780 + if (access(urlfn, F_OK) == -1) {
michael@13 781 + urlfn = _free(urlfn);
michael@13 782 + urlfn = rpmGetPath("%{_sourcedir}/", sp->source, NULL);
michael@13 783 + }
michael@13 784 +#endif
michael@13 785
michael@13 786 /*@-internalglobs@*/ /* FIX: shrug */
michael@13 787 taropts = ((rpmIsVerbose() && !quietly) ? "-xvvf" : "-xf");
michael@13 788
michael@13 789 +---------------------------------------------------------------------------
michael@13 790 | Not everything on a system is RPM based (for instance OpenPKG is
michael@13 791 | just an add-on to the system), so do not assume we can just require
michael@13 792 | a package to provide "/bin/sh".
michael@13 793 +---------------------------------------------------------------------------
michael@13 794 Index: build/parseScript.c
michael@13 795 --- build/parseScript.c 23 Jun 2002 19:47:12 -0000 1.1.1.12
michael@13 796 +++ build/parseScript.c 30 Jan 2004 17:06:29 -0000 1.3
michael@13 797 @@ -261,6 +269,7 @@
michael@13 798 stripTrailingBlanksStringBuf(sb);
michael@13 799 p = getStringBuf(sb);
michael@13 800
michael@13 801 + if (progArgv[0] != NULL && strcmp(progArgv[0], "/bin/sh") != 0)
michael@13 802 (void) addReqProv(spec, pkg->header, (tagflags | RPMSENSE_INTERP), progArgv[0], NULL, 0);
michael@13 803
michael@13 804 /* Trigger script insertion is always delayed in order to */
michael@13 805
michael@13 806 +---------------------------------------------------------------------------
michael@13 807 | Add support for splitted source directories, i.e., source files
michael@13 808 | alternatively can be placed into the spec directory and are picked
michael@13 809 | up there, too.
michael@13 810 +---------------------------------------------------------------------------
michael@13 811 Index: build/spec.c
michael@13 812 --- build/spec.c 4 Mar 2003 15:25:51 -0000 1.1.1.21
michael@13 813 +++ build/spec.c 30 Jan 2004 17:06:31 -0000 1.3
michael@13 814 @@ -334,7 +337,15 @@
michael@13 815
michael@13 816 if (tag != RPMTAG_ICON) {
michael@13 817 /*@-nullpass@*/ /* LCL: varargs needs null annotate. */
michael@13 818 +#ifndef OPENPKG
michael@13 819 const char *body = rpmGetPath("%{_sourcedir}/", p->source, NULL);
michael@13 820 +#else
michael@13 821 + const char *body = rpmGetPath("%{_specdir}/", p->source, NULL);
michael@13 822 + if (access(body, F_OK) == -1) {
michael@13 823 + body = _free(body);
michael@13 824 + body = rpmGetPath("%{_sourcedir}/", p->source, NULL);
michael@13 825 + }
michael@13 826 +#endif
michael@13 827 /*@=nullpass@*/
michael@13 828
michael@13 829 sprintf(buf, "%s%d",
michael@13 830
michael@13 831 +---------------------------------------------------------------------------
michael@13 832 | Do not build with warnings on, because we do no RPM development
michael@13 833 | (so warnings are useless here), they cause some confusion inside
michael@13 834 | Berkeley-DB and also slow down building. Instead, increase the
michael@13 835 | optimization level. Additionally, disable static linking of RPM
michael@13 836 | tools. Finally, use "shtool mkdir" as the "mkdir -p" fallback.
michael@13 837 +---------------------------------------------------------------------------
michael@13 838 Index: configure.ac
michael@13 839 --- configure.ac 2 Jul 2003 19:20:52 -0000 1.1.1.4
michael@13 840 +++ configure.ac 13 Sep 2006 13:39:07 -0000
michael@13 841 @@ -53,7 +53,7 @@
michael@13 842 AS=${AS-as}
michael@13 843 AC_SUBST(AS)
michael@13 844 if test "$ac_cv_prog_gcc" = yes; then
michael@13 845 - CFLAGS="$CFLAGS -D_GNU_SOURCE -D_REENTRANT -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wno-char-subscripts"
michael@13 846 + CFLAGS="$CFLAGS -O2 -D_GNU_SOURCE -D_REENTRANT"
michael@13 847 fi
michael@13 848 export CFLAGS
michael@13 849
michael@13 850 @@ -142,6 +142,7 @@
michael@13 851 # just link it dynamically
michael@13 852 LDFLAGS_STATIC=""
michael@13 853 fi
michael@13 854 +LDFLAGS_STATIC="" # OpenPKG wants dynamically linked RPM tools
michael@13 855 LDFLAGS_STATIC="${LDFLAGS} ${LDFLAGS_STATIC}" # libtool format
michael@13 856 AC_MSG_RESULT($LDFLAGS_STATIC)
michael@13 857 AC_SUBST(LDFLAGS_STATIC)
michael@13 858 @@ -201,7 +202,7 @@
michael@13 859
michael@13 860 if test X"$MKDIR_P" = X0 ; then
michael@13 861 AC_MSG_RESULT(no)
michael@13 862 - MKDIR_P="`echo ${prefix}/lib/rpm/mkinstalldirs`"
michael@13 863 + MKDIR_P="@l_prefix@/lib/openpkg/shtool mkdir -f -p -m 755"
michael@13 864 else
michael@13 865 AC_MSG_RESULT(yes)
michael@13 866 fi
michael@13 867
michael@13 868 +---------------------------------------------------------------------------
michael@13 869 | Disable the use of the internal zlib library, because
michael@13 870 | we build against an external one.
michael@13 871 +---------------------------------------------------------------------------
michael@13 872 Index: configure.ac
michael@13 873 --- configure.ac 2 Jul 2003 19:20:52 -0000 1.1.1.4
michael@13 874 +++ configure.ac 13 Sep 2006 13:39:09 -0000
michael@13 875 @@ -310,7 +311,7 @@
michael@13 876 WITH_ZLIB_SUBDIR=
michael@13 877 WITH_ZLIB_INCLUDE=
michael@13 878 WITH_ZLIB_LIB=
michael@13 879 -if test -d zlib ; then
michael@13 880 +if false; then
michael@13 881 WITH_ZLIB_SUBDIR=zlib
michael@13 882 addlib \${top_builddir}/zlib
michael@13 883 WITH_ZLIB_INCLUDE="-I\${top_srcdir}/${WITH_ZLIB_SUBDIR}"
michael@13 884
michael@13 885 +---------------------------------------------------------------------------
michael@13 886 | Disable unnecessary INCPATH checks, because in OpenPKG the
michael@13 887 | externally used libraries are all explicitly given. And they just
michael@13 888 | would make RPM pick up things which we do not want to be picked up.
michael@13 889 +---------------------------------------------------------------------------
michael@13 890 Index: configure.ac
michael@13 891 --- configure.ac 2 Jul 2003 19:20:52 -0000 1.1.1.4
michael@13 892 +++ configure.ac 13 Sep 2006 13:39:11 -0000
michael@13 893 @@ -324,38 +325,38 @@
michael@13 894
michael@13 895 localdone=
michael@13 896
michael@13 897 -dirs=$prefix
michael@13 898 -if test "$cross_compiling" != "yes"; then
michael@13 899 - dirs="$dirs /usr/local"
michael@13 900 -fi
michael@13 901 -for dir in $dirs
michael@13 902 -do
michael@13 903 - case $dir in
michael@13 904 - NONE|/usr) continue;;
michael@13 905 - /usr/local)
michael@13 906 - if test X$localdone != X ; then continue; fi
michael@13 907 - localdone="$dir"
michael@13 908 - ;;
michael@13 909 - esac
michael@13 910 -
michael@13 911 - AC_MSG_CHECKING(for $dir/lib in LIBS)
michael@13 912 - if test -d $dir/lib 2> /dev/null ; then
michael@13 913 - addlib $dir/lib
michael@13 914 - AC_MSG_RESULT(yes)
michael@13 915 - else
michael@13 916 - AC_MSG_RESULT(no)
michael@13 917 - fi
michael@13 918 -
michael@13 919 - AC_MSG_CHECKING(for $dir/include in INCPATH)
michael@13 920 - if test -d $dir/include 2>/dev/null ; then
michael@13 921 - if [ "$dir" != "/usr/local" ] ; then
michael@13 922 - INCPATH="$INCPATH -I$dir/include"
michael@13 923 - fi
michael@13 924 - AC_MSG_RESULT(yes)
michael@13 925 - else
michael@13 926 - AC_MSG_RESULT(no)
michael@13 927 - fi
michael@13 928 -done
michael@13 929 +dnl dirs=$prefix
michael@13 930 +dnl if test "$cross_compiling" != "yes"; then
michael@13 931 +dnl dirs="$dirs /usr/local"
michael@13 932 +dnl fi
michael@13 933 +dnl for dir in $dirs
michael@13 934 +dnl do
michael@13 935 +dnl case $dir in
michael@13 936 +dnl NONE|/usr) continue;;
michael@13 937 +dnl /usr/local)
michael@13 938 +dnl if test X$localdone != X ; then continue; fi
michael@13 939 +dnl localdone="$dir"
michael@13 940 +dnl ;;
michael@13 941 +dnl esac
michael@13 942 +dnl
michael@13 943 +dnl AC_MSG_CHECKING(for $dir/lib in LIBS)
michael@13 944 +dnl if test -d $dir/lib 2> /dev/null ; then
michael@13 945 +dnl addlib $dir/lib
michael@13 946 +dnl AC_MSG_RESULT(yes)
michael@13 947 +dnl else
michael@13 948 +dnl AC_MSG_RESULT(no)
michael@13 949 +dnl fi
michael@13 950 +dnl
michael@13 951 +dnl AC_MSG_CHECKING(for $dir/include in INCPATH)
michael@13 952 +dnl if test -d $dir/include 2>/dev/null ; then
michael@13 953 +dnl if test "$dir" != "/usr/local"; then
michael@13 954 +dnl INCPATH="$INCPATH -I$dir/include"
michael@13 955 +dnl fi
michael@13 956 +dnl AC_MSG_RESULT(yes)
michael@13 957 +dnl else
michael@13 958 +dnl AC_MSG_RESULT(no)
michael@13 959 +dnl fi
michael@13 960 +dnl done
michael@13 961
michael@13 962 AC_MSG_CHECKING(for /usr/ucblib in LIBS)
michael@13 963 if test -d /usr/ucblib ; then
michael@13 964
michael@13 965 +---------------------------------------------------------------------------
michael@13 966 | Adjust paths for OpenPKG filesystem layout.
michael@13 967 +---------------------------------------------------------------------------
michael@13 968 Index: configure.ac
michael@13 969 --- configure.ac 2 Jul 2003 19:20:52 -0000 1.1.1.4
michael@13 970 +++ configure.ac 13 Sep 2006 13:39:12 -0000
michael@333 971 @@ -1200,12 +1201,12 @@
michael@13 972 AC_SUBST(LOCALEDIR)
michael@13 973 LIBDIR="`echo $libdir | sed 's-/lib$-/%{_lib}-'`"
michael@13 974 AC_SUBST(LIBDIR)
michael@13 975 -RPMCONFIGDIR="`echo ${usrprefix}/lib/rpm`"
michael@13 976 +RPMCONFIGDIR="@l_prefix@/lib/openpkg"
michael@13 977 AC_DEFINE_UNQUOTED(RPMCONFIGDIR, "$RPMCONFIGDIR",
michael@13 978 [Full path to rpm global configuration directory (usually /usr/lib/rpm)])
michael@13 979 AC_SUBST(RPMCONFIGDIR)
michael@13 980
michael@13 981 -SYSCONFIGDIR="`echo /etc/rpm`"
michael@13 982 +SYSCONFIGDIR="@l_prefix@/etc/openpkg"
michael@13 983 AC_DEFINE_UNQUOTED(SYSCONFIGDIR, "$SYSCONFIGDIR",
michael@13 984 [Full path to rpm system configuration directory (usually /etc/rpm)])
michael@13 985 AC_SUBST(SYSCONFIGDIR)
michael@333 986 @@ -1215,17 +1216,17 @@
michael@13 987 [Colon separated paths of macro files to read.])
michael@13 988 AC_SUBST(MACROFILES)
michael@13 989
michael@13 990 -LIBRPMRC_FILENAME="${RPMCONFIGDIR}/rpmrc"
michael@13 991 +LIBRPMRC_FILENAME="${SYSCONFIGDIR}/rpmrc"
michael@13 992 AC_DEFINE_UNQUOTED(LIBRPMRC_FILENAME, "$LIBRPMRC_FILENAME",
michael@13 993 [Full path to rpmrc configuration file (usually /usr/lib/rpm/rpmrc)])
michael@13 994 AC_SUBST(LIBRPMRC_FILENAME)
michael@13 995
michael@13 996 -VENDORRPMRC_FILENAME="${RPMCONFIGDIR}/${RPMCANONVENDOR}/rpmrc"
michael@13 997 +VENDORRPMRC_FILENAME="${SYSCONFIGDIR}/${RPMCANONVENDOR}/rpmrc"
michael@13 998 AC_DEFINE_UNQUOTED(VENDORRPMRC_FILENAME, "$VENDORRPMRC_FILENAME",
michael@13 999 [Full path to vendor rpmrc configuration file (usually /usr/lib/rpm/vendor/rpmrc)])
michael@13 1000 AC_SUBST(VENDORRPMRC_FILENAME)
michael@13 1001
michael@13 1002 -LIBRPMALIAS_FILENAME="${RPMCONFIGDIR}/rpmpopt-${VERSION}"
michael@13 1003 +LIBRPMALIAS_FILENAME="${RPMCONFIGDIR}/rpmpopt"
michael@13 1004 AC_DEFINE_UNQUOTED(LIBRPMALIAS_FILENAME, "$LIBRPMALIAS_FILENAME",
michael@13 1005 [Full path to rpmpopt configuration file (usually /usr/lib/rpm/rpmpopt)])
michael@13 1006 AC_SUBST(LIBRPMALIAS_FILENAME)
michael@13 1007
michael@13 1008 +---------------------------------------------------------------------------
michael@13 1009 | If running as "susr", do not unpack source RPM packages with "susr"
michael@13 1010 | file ownerships as the OpenPKG Set-UID wrapper switches from "musr"
michael@13 1011 | to "susr" on "openpkg rpm -Uvh *.src.rpm". As a result the installed
michael@13 1012 | files could be never removed again by "musr". It is more consistent
michael@13 1013 | to always unpack as "musr" if possible.
michael@13 1014 +---------------------------------------------------------------------------
michael@13 1015 Index: lib/psm.c
michael@13 1016 --- lib/psm.c 5 Jun 2003 12:43:18 -0000 1.1.1.6
michael@13 1017 +++ lib/psm.c 13 Sep 2006 13:39:15 -0000
michael@13 1018 @@ -314,6 +314,20 @@
michael@13 1019
michael@13 1020 fi->uid = getuid();
michael@13 1021 fi->gid = getgid();
michael@13 1022 +#ifdef OPENPKG
michael@13 1023 + if (fi->uid == 0) {
michael@13 1024 + char *muid_str;
michael@13 1025 + char *mgid_str;
michael@13 1026 + uid_t *muid;
michael@13 1027 + gid_t *mgid;
michael@13 1028 + if ((muid_str = rpmExpand("%{l_muid}", NULL)) != NULL)
michael@13 1029 + if ((muid = (uid_t)strtol(muid_str, (char **)NULL, 10)) > 0)
michael@13 1030 + fi->uid = muid;
michael@13 1031 + if ((mgid_str = rpmExpand("%{l_mgid}", NULL)) != NULL)
michael@13 1032 + if ((mgid = (gid_t)strtol(mgid_str, (char **)NULL, 10)) > 0)
michael@13 1033 + fi->gid = mgid;
michael@13 1034 + }
michael@13 1035 +#endif
michael@13 1036 fi->astriplen = 0;
michael@13 1037 fi->striplen = 0;
michael@13 1038
michael@13 1039 @@ -352,6 +366,9 @@
michael@13 1040 rpmrc = RPMRC_FAIL;
michael@13 1041 goto exit;
michael@13 1042 }
michael@13 1043 +#ifdef OPENPKG
michael@13 1044 + chown(_sourcedir, fi->uid, fi->gid);
michael@13 1045 +#endif
michael@13 1046
michael@13 1047 _specdir = rpmGenPath(rpmtsRootDir(ts), "%{_specdir}", "");
michael@13 1048 rpmrc = rpmMkdirPath(_specdir, "specdir");
michael@13 1049 @@ -359,6 +376,9 @@
michael@13 1050 rpmrc = RPMRC_FAIL;
michael@13 1051 goto exit;
michael@13 1052 }
michael@13 1053 +#ifdef OPENPKG
michael@13 1054 + chown(_specdir, fi->uid, fi->gid);
michael@13 1055 +#endif
michael@13 1056
michael@13 1057 /* Build dnl/dil with {_sourcedir, _specdir} as values. */
michael@13 1058 if (i < fi->fc) {
michael@13 1059
michael@13 1060 +---------------------------------------------------------------------------
michael@13 1061 | RPM has two platform id canonicalizations: hard-coded ones in
michael@13 1062 | the "rpm" program and defined ones in the rpmrc files. The
michael@13 1063 | hard-coded ones make the defined ones inconsistent. Additionally,
michael@13 1064 | in OpenPKG we know exactly what we do. So, disable the hard-coded
michael@13 1065 | canonicalizations and use only the defined ones. The only thing we
michael@13 1066 | do inside RPM is to reduce the platform version to major and minor
michael@13 1067 | version numbers in order to simplify the "rpmrc" files. Then, RPM
michael@13 1068 | allows to read the platform from an external program. Adjust the
michael@13 1069 | hard-coded path to this program and allow it to be overridden with
michael@13 1070 | the macro %{__platform}. Finally, change the default definition of
michael@13 1071 | %{_host} to not contain the vendor stuff to more conform to what
michael@13 1072 | %{_target} usually is defined to and what we are using throughout
michael@13 1073 | OpenPKG, too.
michael@13 1074 +---------------------------------------------------------------------------
michael@13 1075 Index: lib/rpmrc.c
michael@13 1076 --- lib/rpmrc.c 4 Jun 2003 18:18:45 -0000 1.1.1.25
michael@13 1077 +++ lib/rpmrc.c 6 Jun 2005 15:53:06 -0000 1.3
michael@13 1078 @@ -27,7 +27,7 @@
michael@13 1079 const char * macrofiles = MACROFILES;
michael@13 1080
michael@13 1081 /*@observer@*/ /*@unchecked@*/
michael@13 1082 -static const char * platform = "/etc/rpm/platform";
michael@13 1083 +static const char * platform = "@l_prefix@/etc/openpkg/platform";
michael@13 1084 /*@only@*/ /*@relnull@*/ /*@unchecked@*/
michael@13 1085 static const char ** platpat = NULL;
michael@13 1086 /*@unchecked@*/
michael@13 1087 @@ -861,7 +861,11 @@
michael@13 1088
michael@13 1089 platpat = xrealloc(platpat, (nplatpat + 2) * sizeof(*platpat));
michael@13 1090 /*@-onlyunqglobaltrans@*/
michael@13 1091 +#ifdef OPENPKG
michael@13 1092 + platpat[nplatpat] = rpmExpand("%{_host_cpu}-%{_host_os}", NULL);
michael@13 1093 +#else
michael@13 1094 platpat[nplatpat] = rpmExpand("%{_host_cpu}-%{_host_vendor}-%{_host_os}", (gnu && *gnu ? "-" : NULL), gnu, NULL);
michael@13 1095 +#endif
michael@13 1096 nplatpat++;
michael@13 1097 platpat[nplatpat] = NULL;
michael@13 1098 /*@=onlyunqglobaltrans@*/
michael@13 1099 @@ -1055,14 +1059,35 @@
michael@13 1100 /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
michael@13 1101 /*@modifies *arch, *os, rpmGlobalMacroContext, fileSystem, internalState @*/
michael@13 1102 {
michael@13 1103 +#ifdef OPENPKG
michael@13 1104 + static struct utsname un_real;
michael@13 1105 + /* utsname fields on some platforms (like HP-UX) are very small
michael@13 1106 + (about 8 characters). This is too small for OpenPKG, so cheat! */
michael@13 1107 + static struct {
michael@13 1108 + char sysname[32];
michael@13 1109 + char nodename[32];
michael@13 1110 + char release[32];
michael@13 1111 + char version[32];
michael@13 1112 + char machine[32];
michael@13 1113 + } un;
michael@13 1114 +#else
michael@13 1115 static struct utsname un;
michael@13 1116 +#endif
michael@13 1117 static int gotDefaults = 0;
michael@13 1118 char * chptr;
michael@13 1119 canonEntry canon;
michael@13 1120 int rc;
michael@13 1121
michael@13 1122 while (!gotDefaults) {
michael@13 1123 +#ifdef OPENPKG
michael@13 1124 + const char *cp;
michael@13 1125 + cp = rpmExpand("%{?__platform}", NULL);
michael@13 1126 + if (cp == NULL || cp[0] == '\0')
michael@13 1127 + cp = platform;
michael@13 1128 + if (!rpmPlatform(cp)) {
michael@13 1129 +#else
michael@13 1130 if (!rpmPlatform(platform)) {
michael@13 1131 +#endif
michael@13 1132 const char * s;
michael@13 1133 s = rpmExpand("%{_host_cpu}", NULL);
michael@13 1134 if (s) {
michael@13 1135 @@ -1079,9 +1104,44 @@
michael@13 1136 gotDefaults = 1;
michael@13 1137 break;
michael@13 1138 }
michael@13 1139 +#ifdef OPENPKG
michael@13 1140 + rc = uname(&un_real);
michael@13 1141 + strncpy(un.sysname, un_real.sysname, sizeof(un.sysname)); un.sysname [sizeof(un.sysname)-1] = '\0';
michael@13 1142 + strncpy(un.nodename, un_real.nodename, sizeof(un.nodename)); un.nodename[sizeof(un.nodename)-1] = '\0';
michael@13 1143 + strncpy(un.release, un_real.release, sizeof(un.release)); un.release [sizeof(un.release)-1] = '\0';
michael@13 1144 + strncpy(un.version, un_real.version, sizeof(un.version)); un.version [sizeof(un.version)-1] = '\0';
michael@13 1145 + strncpy(un.machine, un_real.machine, sizeof(un.machine)); un.machine [sizeof(un.machine)-1] = '\0';
michael@13 1146 +#else
michael@13 1147 rc = uname(&un);
michael@13 1148 +#endif
michael@13 1149 if (rc < 0) return;
michael@13 1150
michael@13 1151 +#ifdef OPENPKG
michael@13 1152 + {
michael@13 1153 + char *cp;
michael@13 1154 + char *cpR;
michael@13 1155 + int n;
michael@13 1156 + cpR = un.release;
michael@13 1157 + if ((n = strcspn(cpR, "0123456789")) > 0)
michael@13 1158 + cpR += n;
michael@13 1159 + if ((n = strspn(cpR, "0123456789.")) > 0) {
michael@13 1160 + /* terminate after "N.N.N...." prefix */
michael@13 1161 + cpR[n] = '\0';
michael@13 1162 + /* shorten to "N.N" if longer */
michael@13 1163 + if ((cp = strchr(cpR, '.')) != NULL) {
michael@13 1164 + if ((cp = strchr(cp+1, '.')) != NULL)
michael@13 1165 + *cp = '\0';
michael@13 1166 + }
michael@13 1167 + strcat(un.sysname, cpR);
michael@13 1168 + }
michael@13 1169 + /* fix up machine hardware name containing white-space as it
michael@13 1170 + * happens to be on Power Macs running MacOS X
michael@13 1171 + */
michael@13 1172 + if (!strncmp(un.machine, "Power Macintosh", 15)) {
michael@13 1173 + sprintf(un.machine, "powerpc");
michael@13 1174 + }
michael@13 1175 + }
michael@13 1176 +#else /* OPENPKG */
michael@13 1177 #if !defined(__linux__)
michael@13 1178 #ifdef SNI
michael@13 1179 /* USUALLY un.sysname on sinix does start with the word "SINIX"
michael@13 1180 @@ -1298,6 +1358,7 @@
michael@13 1181 }
michael@13 1182 }
michael@13 1183 # endif
michael@13 1184 +#endif /* OPENPKG */
michael@13 1185
michael@13 1186 /* the uname() result goes through the arch_canon table */
michael@13 1187 canon = lookupInCanonTable(un.machine,
michael@13 1188
michael@13 1189 +---------------------------------------------------------------------------
michael@13 1190 | In verbose file listing output, give the owner and group fields more
michael@13 1191 | width and at the same time reduce the nlink and size fields to more
michael@13 1192 | typical sizes within OpenPKG.
michael@13 1193 +---------------------------------------------------------------------------
michael@13 1194 Index: lib/query.c
michael@13 1195 --- lib/query.c 4 Jun 2003 18:24:14 -0000 1.1.1.13
michael@13 1196 +++ lib/query.c 22 Jan 2004 21:42:24 -0000 1.2
michael@13 1197 @@ -33,7 +33,11 @@
michael@13 1198 /*@modifies *te @*/
michael@13 1199 {
michael@13 1200 char sizefield[15];
michael@13 1201 +#ifdef OPENPKG
michael@13 1202 + char ownerfield[13+1], groupfield[13+1];
michael@13 1203 +#else
michael@13 1204 char ownerfield[8+1], groupfield[8+1];
michael@13 1205 +#endif
michael@13 1206 char timefield[100];
michael@13 1207 time_t when = mtime; /* important if sizeof(int_32) ! sizeof(time_t) */
michael@13 1208 struct tm * tm;
michael@13 1209 @@ -58,7 +62,11 @@
michael@13 1210 groupfield[sizeof(groupfield)-1] = '\0';
michael@13 1211
michael@13 1212 /* this is normally right */
michael@13 1213 +#ifdef OPENPKG
michael@13 1214 + sprintf(sizefield, "%8u", size);
michael@13 1215 +#else
michael@13 1216 sprintf(sizefield, "%12u", size);
michael@13 1217 +#endif
michael@13 1218
michael@13 1219 /* this knows too much about dev_t */
michael@13 1220
michael@13 1221 @@ -98,7 +106,11 @@
michael@13 1222 (void)strftime(timefield, sizeof(timefield) - 1, fmt, tm);
michael@13 1223 }
michael@13 1224
michael@13 1225 +#ifdef OPENPKG
michael@13 1226 + sprintf(te, "%s %d %-13s %-13s %8s %s %s", perms,
michael@13 1227 +#else
michael@13 1228 sprintf(te, "%s %4d %-8s%-8s %10s %s %s", perms,
michael@13 1229 +#endif
michael@13 1230 (int)nlink, ownerfield, groupfield, sizefield, timefield, namefield);
michael@13 1231 perms = _free(perms);
michael@13 1232 }
michael@13 1233
michael@13 1234 +---------------------------------------------------------------------------
michael@13 1235 | Enable the exlusion of "%doc" files by default.
michael@13 1236 | Disable "check-files" feature, because it is useless in OpenPKG
michael@13 1237 | (we consistently use BuildRoot and our %files lists are fully
michael@13 1238 | autogenerated) and just makes problems on bootstrapping.
michael@13 1239 | Provide the possibility to optionally re-enable the old
michael@13 1240 | RPM 4.0.2 way of RPM database operation by defining the
michael@13 1241 | macro %{_rpmdb_private}. This is important for easily fixing
michael@13 1242 | corrupted/hanging RPM database (on upgrades, etc) or if you
michael@13 1243 | permanently have to operate RPM on a NFS filesystem where no
michael@13 1244 | rpc.lockd(8) support is available.
michael@13 1245 | Additionally, do not override the "_host_xx" macros because their
michael@13 1246 | value (derived from <prefix>/etc/openpkg/platform) is already
michael@13 1247 | correctly set internally.
michael@13 1248 | Additionally, provide default macros for the %track and %test
michael@13 1249 | section expansion.
michael@13 1250 | Finally, provide default for introduced variable
michael@13 1251 | %{_force_oldpackage}, which, if non-zero, automatically enforces
michael@13 1252 | --oldpackage on all upgrade operations (this is useful on
michael@13 1253 | mass-upgrades from OpenPKG-CURRENT to OpenPKG-RELEASE).
michael@13 1254 +---------------------------------------------------------------------------
michael@13 1255 Index: macros.in
michael@13 1256 --- macros.in 2 Jul 2003 19:20:52 -0000 1.1.1.14
michael@13 1257 +++ macros.in 30 Jan 2004 17:06:27 -0000 1.3
michael@13 1258 @@ -1,7 +1,7 @@
michael@13 1259 #/*! \page config_macros Default configuration: @RPMCONFIGDIR@/macros
michael@13 1260 # \verbatim
michael@13 1261 #
michael@13 1262 -# $Id: macros.in,v 1.138.2.1 2003/07/02 19:14:06 jbj Exp $
michael@13 1263 +# $Id: macros.in,v 1.2 2004/01/22 21:42:09 rse Exp $
michael@13 1264 #
michael@13 1265 # This is a global RPM configuration file. All changes made here will
michael@13 1266 # be lost when the rpm package is upgraded. Any per-system configuration
michael@13 1267 @@ -206,7 +206,7 @@
michael@13 1268
michael@13 1269 # Boolean (i.e. 1 == "yes", 0 == "no") that controls whether files
michael@13 1270 # marked as %doc should be installed.
michael@13 1271 -#%_excludedocs
michael@13 1272 +%_excludedocs 1
michael@13 1273
michael@13 1274 # The port and machine name of a FTP proxy host running TIS firewall.
michael@13 1275 #
michael@13 1276 @@ -305,7 +305,7 @@
michael@13 1277 # Returns list of unpackaged files, i.e. files in $RPM_BUILD_ROOT not packaged.
michael@13 1278 #
michael@13 1279 # Note: Disable (by commenting out) for legacy compatibility.
michael@13 1280 -%__check_files @RPMCONFIGDIR@/check-files %{buildroot}
michael@13 1281 +#%__check_files @RPMCONFIGDIR@/check-files %{buildroot}
michael@13 1282
michael@13 1283 #
michael@13 1284 # Should unpackaged files in a build root terminate a build?
michael@13 1285 @@ -449,7 +449,7 @@
michael@13 1286
michael@13 1287 # Use a CDB database model for concurrent access.
michael@13 1288 # XXX Add "private" here for legacy interoperation transiting to glibc+nptl.
michael@13 1289 -%__dbi_cdb create cdb mpool mp_mmapsize=16Mb mp_size=1Mb
michael@13 1290 +%__dbi_cdb create cdb mpool mp_mmapsize=16Mb mp_size=1Mb %{?_rpmdb_private:private}
michael@13 1291
michael@13 1292 %__dbi_other %{?_tmppath:tmpdir=%{_tmppath}} %{?__dbi_cdb}
michael@13 1293
michael@13 1294 @@ -618,6 +618,10 @@
michael@13 1295 # If non-zero, all erasures will be automagically repackaged.
michael@13 1296 %_repackage_all_erasures 0
michael@13 1297
michael@13 1298 +# If non-zero, automatically enforce --oldpackage for all upgrade operations
michael@13 1299 +# (useful on mass-upgrades from OpenPKG-CURRENT to OpenPKG-RELEASE)
michael@13 1300 +%_force_oldpackage 0
michael@13 1301 +
michael@13 1302 # Verify digest/signature flags for various rpm modes:
michael@13 1303 # 1 --nohdrchk if set, don't check rpmdb headers
michael@13 1304 #
michael@13 1305 @@ -870,6 +874,26 @@
michael@13 1306 #%{__spec_clean_post}\
michael@13 1307 #%{nil}
michael@13 1308
michael@13 1309 +%__spec_track_shell %{___build_shell}
michael@13 1310 +%__spec_track_args %{___build_args}
michael@13 1311 +%__spec_track_cmd %{___build_cmd}
michael@13 1312 +%__spec_track_pre %{___build_pre}
michael@13 1313 +%__spec_track_body %{___build_body}
michael@13 1314 +%__spec_track_post %{___build_post}
michael@13 1315 +%__spec_track_template #!%{__spec_track_shell}\
michael@13 1316 +%{__spec_track_pre}\
michael@13 1317 +%{nil}
michael@13 1318 +
michael@13 1319 +%__spec_test_shell %{___build_shell}
michael@13 1320 +%__spec_test_args %{___build_args}
michael@13 1321 +%__spec_test_cmd %{___build_cmd}
michael@13 1322 +%__spec_test_pre %{___build_pre}
michael@13 1323 +%__spec_test_body %{___build_body}
michael@13 1324 +%__spec_test_post %{___build_post}
michael@13 1325 +%__spec_test_template #!%{__spec_test_shell}\
michael@13 1326 +%{__spec_test_pre}\
michael@13 1327 +%{nil}
michael@13 1328 +
michael@13 1329 %__spec_rmbuild_shell %{___build_shell}
michael@13 1330 %__spec_rmbuild_args %{___build_args}
michael@13 1331 %__spec_rmbuild_cmd %{___build_cmd}
michael@13 1332 @@ -929,11 +953,11 @@
michael@13 1333 %_build_cpu %{_host_cpu}
michael@13 1334 %_build_vendor %{_host_vendor}
michael@13 1335 %_build_os %{_host_os}
michael@13 1336 -%_host @host@
michael@13 1337 -%_host_alias @host_alias@%{nil}
michael@13 1338 -%_host_cpu @host_cpu@
michael@13 1339 -%_host_vendor @host_vendor@
michael@13 1340 -%_host_os @host_os@
michael@13 1341 +#%_host @host@
michael@13 1342 +#%_host_alias @host_alias@%{nil}
michael@13 1343 +#%_host_cpu @host_cpu@
michael@13 1344 +#%_host_vendor @host_vendor@
michael@13 1345 +#%_host_os @host_os@
michael@13 1346 %_target %{_host}
michael@13 1347 %_target_alias %{_host_alias}
michael@13 1348 %_target_cpu %{_host_cpu}
michael@13 1349
michael@13 1350 +---------------------------------------------------------------------------
michael@13 1351 | Adjust path for OpenPKG filesystem layout.
michael@13 1352 +---------------------------------------------------------------------------
michael@13 1353 Index: scripts/Makefile.am
michael@13 1354 --- scripts/Makefile.am 20 Jun 2003 19:04:49 -0000 1.1.1.11
michael@13 1355 +++ scripts/Makefile.am 22 Jan 2004 21:42:34 -0000 1.2
michael@13 1356 @@ -22,7 +22,7 @@
michael@13 1357
michael@13 1358 all:
michael@13 1359
michael@13 1360 -configdir = ${prefix}/lib/rpm
michael@13 1361 +configdir = ${prefix}/lib/openpkg
michael@13 1362 config_SCRIPTS = \
michael@13 1363 brp-compress brp-python-bytecompile brp-redhat \
michael@13 1364 brp-strip brp-strip-comment-note \
michael@13 1365
michael@13 1366 +---------------------------------------------------------------------------
michael@13 1367 | Adjust path for OpenPKG filesystem layout.
michael@13 1368 +---------------------------------------------------------------------------
michael@13 1369 Index: scripts/Makefile.in
michael@13 1370 --- scripts/Makefile.in 16 Jul 2003 17:05:49 -0000 1.1.1.14
michael@13 1371 +++ scripts/Makefile.in 22 Jan 2004 21:42:34 -0000 1.2
michael@13 1372 @@ -273,7 +273,7 @@
michael@13 1373
michael@13 1374 installprefix = $(DESTDIR)
michael@13 1375
michael@13 1376 -configdir = ${prefix}/lib/rpm
michael@13 1377 +configdir = ${prefix}/lib/openpkg
michael@13 1378 config_SCRIPTS = \
michael@13 1379 brp-compress brp-python-bytecompile brp-redhat \
michael@13 1380 brp-strip brp-strip-comment-note \
michael@13 1381
michael@13 1382 +---------------------------------------------------------------------------
michael@13 1383 | Use GNU libtool's weaker -static (link with own static libraries)
michael@13 1384 | instead of the strong -all-static (link even with static libc, etc),
michael@13 1385 | because OpenPKG does not need to be fully static.
michael@13 1386 | Additionally, adjust the path to file(1)'s "magic" file.
michael@13 1387 +---------------------------------------------------------------------------
michael@13 1388 Index: file/Makefile.am
michael@13 1389 --- file/Makefile.am 24 Jan 2003 19:41:56 -0000 1.1.1.1
michael@13 1390 +++ file/Makefile.am 22 Jan 2004 21:42:21 -0000 1.2
michael@13 1391 @@ -36,7 +36,7 @@
michael@13 1392 #MAGIC = @datadir@/magic
michael@13 1393 #data_DATA = magic magic.mime magic.mgc magic.mime.mgc
michael@13 1394
michael@13 1395 -pkglibdir = @prefix@/lib/rpm
michael@13 1396 +pkglibdir = @prefix@/lib/openpkg
michael@13 1397 pkglib_DATA = magic magic.mime magic.mgc magic.mime.mgc
michael@13 1398 MAGIC = $(pkglibdir)/magic
michael@13 1399 CPPFLAGS = -DMAGIC='"$(MAGIC)"'
michael@13 1400
michael@13 1401 +---------------------------------------------------------------------------
michael@13 1402 | Use GNU libtool's weaker -static (link with own static libraries)
michael@13 1403 | instead of the strong -all-static (link even with static libc, etc),
michael@13 1404 | because OpenPKG does not need to be fully static.
michael@13 1405 | Additionally, adjust the path to file(1)'s "magic" file.
michael@13 1406 +---------------------------------------------------------------------------
michael@13 1407 Index: file/Makefile.in
michael@13 1408 --- file/Makefile.in 16 Jul 2003 17:05:23 -0000 1.1.1.2
michael@13 1409 +++ file/Makefile.in 22 Jan 2004 21:42:22 -0000 1.2
michael@13 1410 @@ -39,7 +39,7 @@
michael@13 1411
michael@13 1412 #MAGIC = @datadir@/magic
michael@13 1413 #data_DATA = magic magic.mime magic.mgc magic.mime.mgc
michael@13 1414 -pkglibdir = @prefix@/lib/rpm
michael@13 1415 +pkglibdir = @prefix@/lib/openpkg
michael@13 1416 ACLOCAL = @ACLOCAL@
michael@13 1417 AMDEP_FALSE = @AMDEP_FALSE@
michael@13 1418 AMDEP_TRUE = @AMDEP_TRUE@
michael@13 1419 @@ -159,7 +159,7 @@
michael@13 1420 noinst_PROGRAMS = file
michael@13 1421
michael@13 1422 file_SOURCES = file.c
michael@13 1423 -file_LDFLAGS = -all-static
michael@13 1424 +file_LDFLAGS = -static
michael@13 1425 file_LDADD = libfmagic.la
michael@13 1426
michael@13 1427 man_MAGIC = magic.@fsect@
michael@13 1428
michael@13 1429 +---------------------------------------------------------------------------
michael@13 1430 | Use GNU libtool's weaker -static (link with own static libraries)
michael@13 1431 | instead of the strong -all-static (link even with static libc, etc),
michael@13 1432 | because OpenPKG does not need to be fully static.
michael@13 1433 | Additionally, disable the building of gettext stuff we don't need.
michael@13 1434 +---------------------------------------------------------------------------
michael@13 1435 Index: popt/Makefile.am
michael@13 1436 --- popt/Makefile.am 6 Mar 2003 23:16:43 -0000 1.1.1.9
michael@13 1437 +++ popt/Makefile.am 22 Jan 2004 21:42:28 -0000 1.2
michael@13 1438 @@ -9,7 +9,7 @@
michael@13 1439 po/*.in po/*.po po/popt.pot \
michael@13 1440 popt.ps
michael@13 1441
michael@13 1442 -SUBDIRS = intl po
michael@13 1443 +SUBDIRS = intl
michael@13 1444
michael@13 1445 INCLUDES = -I. -I$(top_srcdir)
michael@13 1446
michael@13 1447 @@ -17,13 +17,13 @@
michael@13 1448
michael@13 1449 noinst_PROGRAMS = test1 test2 test3
michael@13 1450 test1_SOURCES = test1.c
michael@13 1451 -test1_LDFLAGS = -all-static
michael@13 1452 +test1_LDFLAGS = -static
michael@13 1453 test1_LDADD = $(usrlib_LTLIBRARIES)
michael@13 1454 test2_SOURCES = test2.c
michael@13 1455 -test2_LDFLAGS = -all-static
michael@13 1456 +test2_LDFLAGS = -static
michael@13 1457 test2_LDADD = $(usrlib_LTLIBRARIES)
michael@13 1458 test3_SOURCES = test3.c
michael@13 1459 -test3_LDFLAGS = -all-static
michael@13 1460 +test3_LDFLAGS = -static
michael@13 1461 test3_LDADD = $(usrlib_LTLIBRARIES)
michael@13 1462
michael@13 1463 noinst_SCRIPTS = testit.sh
michael@13 1464
michael@13 1465 +---------------------------------------------------------------------------
michael@13 1466 | Use GNU libtool's weaker -static (link with own static libraries)
michael@13 1467 | instead of the strong -all-static (link even with static libc, etc),
michael@13 1468 | because OpenPKG does not need to be fully static.
michael@13 1469 | Additionally, disable the building of gettext stuff we don't need.
michael@13 1470 +---------------------------------------------------------------------------
michael@13 1471 Index: popt/Makefile.in
michael@13 1472 --- popt/Makefile.in 16 Jul 2003 17:04:49 -0000 1.1.1.14
michael@13 1473 +++ popt/Makefile.in 22 Jan 2004 21:42:28 -0000 1.2
michael@13 1474 @@ -163,7 +163,7 @@
michael@13 1475 popt.ps
michael@13 1476
michael@13 1477
michael@13 1478 -SUBDIRS = intl po
michael@13 1479 +SUBDIRS = intl
michael@13 1480
michael@13 1481 INCLUDES = -I. -I$(top_srcdir)
michael@13 1482
michael@13 1483 @@ -171,13 +171,13 @@
michael@13 1484
michael@13 1485 noinst_PROGRAMS = test1 test2 test3
michael@13 1486 test1_SOURCES = test1.c
michael@13 1487 -test1_LDFLAGS = -all-static
michael@13 1488 +test1_LDFLAGS = -static
michael@13 1489 test1_LDADD = $(usrlib_LTLIBRARIES)
michael@13 1490 test2_SOURCES = test2.c
michael@13 1491 -test2_LDFLAGS = -all-static
michael@13 1492 +test2_LDFLAGS = -static
michael@13 1493 test2_LDADD = $(usrlib_LTLIBRARIES)
michael@13 1494 test3_SOURCES = test3.c
michael@13 1495 -test3_LDFLAGS = -all-static
michael@13 1496 +test3_LDFLAGS = -static
michael@13 1497 test3_LDADD = $(usrlib_LTLIBRARIES)
michael@13 1498
michael@13 1499 noinst_SCRIPTS = testit.sh
michael@13 1500
michael@13 1501 +---------------------------------------------------------------------------
michael@13 1502 | Revert back to the old behaviour of passing to "exec" programs an
michael@13 1503 | extra "--" argument to separate options and arguments. Additionally,
michael@13 1504 | allow the "!#:+" constructs to be used multiple times and then each
michael@13 1505 | time eat another argument (instead of just eating an argument once
michael@13 1506 | and expanding this multiple times).
michael@13 1507 +---------------------------------------------------------------------------
michael@13 1508 Index: popt/popt.c
michael@13 1509 --- popt/popt.c 22 Aug 2002 14:17:44 -0000 1.1.1.12
michael@13 1510 +++ popt/popt.c 22 Jan 2004 21:42:28 -0000 1.2
michael@13 1511 @@ -400,9 +400,7 @@
michael@13 1512 }
michael@13 1513
michael@13 1514 if (con->leftovers != NULL && con->numLeftovers > 0) {
michael@13 1515 -#if 0
michael@13 1516 argv[argc++] = "--";
michael@13 1517 -#endif
michael@13 1518 memcpy(argv + argc, con->leftovers, sizeof(*argv) * con->numLeftovers);
michael@13 1519 argc += con->numLeftovers;
michael@13 1520 }
michael@13 1521 @@ -580,10 +578,8 @@
michael@13 1522 if (!(s[0] == '#' && s[1] == ':' && s[2] == '+'))
michael@13 1523 /*@switchbreak@*/ break;
michael@13 1524 /* XXX Make sure that findNextArg deletes only next arg. */
michael@13 1525 - if (a == NULL) {
michael@13 1526 if ((a = findNextArg(con, 1, 1)) == NULL)
michael@13 1527 /*@switchbreak@*/ break;
michael@13 1528 - }
michael@13 1529 s += 3;
michael@13 1530
michael@13 1531 alen = strlen(a);
michael@13 1532
michael@13 1533 +---------------------------------------------------------------------------
michael@13 1534 | Dedefine the stdio variable BUFSIZ because it is usually just 1024
michael@13 1535 | on some platforms (on Linux it is 8192) and unfortunately RPM uses
michael@13 1536 | it here for the macro expansion buffer. For OpenPKG the size 1024 is
michael@13 1537 | definetely too small. So increase this to a 16KB buffer.
michael@13 1538 +---------------------------------------------------------------------------
michael@13 1539 Index: rpmio/macro.c
michael@13 1540 --- rpmio/macro.c 15 May 2003 13:42:01 -0000 1.1.1.7
michael@13 1541 +++ rpmio/macro.c 22 Jan 2004 21:42:32 -0000 1.2
michael@13 1542 @@ -50,6 +50,9 @@
michael@13 1543
michael@13 1544 #include "debug.h"
michael@13 1545
michael@13 1546 +#undef BUFSIZ
michael@13 1547 +#define BUFSIZ 16384
michael@13 1548 +
michael@13 1549 #if defined(__LCLINT__)
michael@13 1550 /*@-exportheader@*/
michael@13 1551 extern const unsigned short int **__ctype_b_loc (void) /*@*/;
michael@13 1552
michael@13 1553 +---------------------------------------------------------------------------
michael@13 1554 | Remove "unzip" support, because in OpenPKG there are less than
michael@13 1555 | a dozend packages requiring unpacking of .zip files. For these
michael@13 1556 | it is fully sufficient to explicitly require the "infozip"
michael@13 1557 | package (containing "unzip") and leaving the less portable
michael@13 1558 | "unzip" out of the bootstrap package.
michael@13 1559 +---------------------------------------------------------------------------
michael@13 1560 Index: rpmio/macro.c
michael@13 1561 --- rpmio/macro.c 15 May 2003 13:42:01 -0000 1.1.1.7
michael@13 1562 +++ rpmio/macro.c 22 Jan 2004 21:42:32 -0000 1.2
michael@333 1563 @@ -1116,9 +1119,11 @@
michael@13 1564 case 2: /* COMPRESSED_BZIP2 */
michael@13 1565 sprintf(be, "%%_bzip2 %s", b);
michael@13 1566 break;
michael@13 1567 +#if 0
michael@13 1568 case 3: /* COMPRESSED_ZIP */
michael@13 1569 sprintf(be, "%%_unzip %s", b);
michael@13 1570 break;
michael@13 1571 +#endif
michael@13 1572 }
michael@13 1573 b = be;
michael@13 1574 } else if (STREQ("S", f, fn)) {
michael@333 1575 @@ -1720,9 +1725,11 @@
michael@13 1576
michael@13 1577 if ((magic[0] == 'B') && (magic[1] == 'Z')) {
michael@13 1578 *compressed = COMPRESSED_BZIP2;
michael@13 1579 +#if 0
michael@13 1580 } else if ((magic[0] == 0120) && (magic[1] == 0113) &&
michael@13 1581 (magic[2] == 0003) && (magic[3] == 0004)) { /* pkzip */
michael@13 1582 *compressed = COMPRESSED_ZIP;
michael@13 1583 +#endif
michael@13 1584 } else if (((magic[0] == 0037) && (magic[1] == 0213)) || /* gzip */
michael@13 1585 ((magic[0] == 0037) && (magic[1] == 0236)) || /* old gzip */
michael@13 1586 ((magic[0] == 0037) && (magic[1] == 0036)) || /* pack */
michael@13 1587
michael@13 1588 +---------------------------------------------------------------------------
michael@13 1589 | Make sure that an %{error:<msg>} macro really stops further
michael@13 1590 | processing. Else it would be nothing more than a %{warn:<msg>}.
michael@13 1591 +---------------------------------------------------------------------------
michael@13 1592 Index: rpmio/macro.c
michael@13 1593 --- rpmio/macro.c 15 May 2003 13:42:01 -0000 1.1.1.7
michael@13 1594 +++ rpmio/macro.c 22 Jan 2004 21:42:32 -0000 1.2
michael@333 1595 @@ -1332,7 +1337,7 @@
michael@13 1596 STREQ("error", f, fn)) {
michael@13 1597 int waserror = 0;
michael@13 1598 if (STREQ("error", f, fn))
michael@13 1599 - waserror = 1;
michael@13 1600 + waserror = 1, rc = 1;
michael@13 1601 if (g < ge)
michael@13 1602 doOutput(mb, waserror, g, gn);
michael@13 1603 else
michael@13 1604
michael@13 1605 +---------------------------------------------------------------------------
michael@13 1606 | Reactivate build mode aliases which were removed in rpm-4.1
michael@13 1607 | (and now should be available through "rpmbuild" only).
michael@13 1608 +---------------------------------------------------------------------------
michael@13 1609 Index: rpmpopt.in
michael@13 1610 --- rpmpopt.in 24 Jan 2003 14:56:30 -0000 1.1.1.7
michael@13 1611 +++ rpmpopt.in 22 Jan 2004 21:42:11 -0000 1.2
michael@13 1612 @@ -147,28 +147,28 @@
michael@13 1613 # Popt glue to preserve legacy CLI behavior.
michael@13 1614 #
michael@13 1615 # XXX popt exec parsing doesn't honor POPT_ARGFLAG_ONEDASH
michael@13 1616 -# XXX Build mode aliases, removed in rpm-4.1.
michael@13 1617 -#rpm exec --bp rpmb -bp
michael@13 1618 -#rpm exec --bc rpmb -bc
michael@13 1619 -#rpm exec --bi rpmb -bi
michael@13 1620 -#rpm exec --bl rpmb -bl
michael@13 1621 -#rpm exec --ba rpmb -ba
michael@13 1622 -#rpm exec --bb rpmb -bb
michael@13 1623 -#rpm exec --bs rpmb -bs
michael@13 1624 -#rpm exec --tp rpmb -tp
michael@13 1625 -#rpm exec --tc rpmb -tc
michael@13 1626 -#rpm exec --ti rpmb -ti
michael@13 1627 -#rpm exec --tl rpmb -tl
michael@13 1628 -#rpm exec --ta rpmb -ta
michael@13 1629 -#rpm exec --tb rpmb -tb
michael@13 1630 -#rpm exec --ts rpmb -ts
michael@13 1631 -#rpm exec --rebuild rpmb --rebuild
michael@13 1632 -#rpm exec --recompile rpmb --recompile
michael@13 1633 -#rpm exec --clean rpmb --clean
michael@13 1634 -#rpm exec --rmsource rpmb --rmsource
michael@13 1635 -#rpm exec --rmspec rpmb --rmspec
michael@13 1636 -#rpm exec --target rpmb --target
michael@13 1637 -#rpm exec --short-circuit rpmb --short-circuit
michael@13 1638 +rpm exec --bp rpmb -bp
michael@13 1639 +rpm exec --bc rpmb -bc
michael@13 1640 +rpm exec --bi rpmb -bi
michael@13 1641 +rpm exec --bl rpmb -bl
michael@13 1642 +rpm exec --ba rpmb -ba
michael@13 1643 +rpm exec --bb rpmb -bb
michael@13 1644 +rpm exec --bs rpmb -bs
michael@13 1645 +rpm exec --bt rpmb -bt
michael@13 1646 +rpm exec --tp rpmb -tp
michael@13 1647 +rpm exec --tc rpmb -tc
michael@13 1648 +rpm exec --ti rpmb -ti
michael@13 1649 +rpm exec --tl rpmb -tl
michael@13 1650 +rpm exec --ta rpmb -ta
michael@13 1651 +rpm exec --tb rpmb -tb
michael@13 1652 +rpm exec --ts rpmb -ts
michael@13 1653 +rpm exec --rebuild rpmb --rebuild
michael@13 1654 +rpm exec --recompile rpmb --recompile
michael@13 1655 +rpm exec --clean rpmb --clean
michael@13 1656 +rpm exec --rmsource rpmb --rmsource
michael@13 1657 +rpm exec --rmspec rpmb --rmspec
michael@13 1658 +rpm exec --target rpmb --target
michael@13 1659 +rpm exec --short-circuit rpmb --short-circuit
michael@13 1660
michael@13 1661 rpm exec --initdb rpmd --initdb
michael@13 1662 rpm exec --rebuilddb rpmd --rebuilddb
michael@13 1663
michael@13 1664 +---------------------------------------------------------------------------
michael@13 1665 | Allow "-bb --short-circuit" for continuing building a binary package
michael@13 1666 | after the %install step (usually previously fixed and repeated with
michael@13 1667 | "-bi --short-circuit".
michael@13 1668 +---------------------------------------------------------------------------
michael@13 1669 Index: rpmqv.c
michael@13 1670 --- rpmqv.c 4 Mar 2003 15:32:57 -0000 1.1.1.8
michael@13 1671 +++ rpmqv.c 6 Feb 2004 15:37:56 -0000 1.4
michael@13 1672 @@ -682,6 +682,10 @@
michael@13 1673 case 'b':
michael@13 1674 ba->buildAmount |= RPMBUILD_PACKAGEBINARY;
michael@13 1675 ba->buildAmount |= RPMBUILD_CLEAN;
michael@13 1676 +#ifdef OPENPKG
michael@13 1677 + if ((ba->buildChar == 'b') && ba->shortCircuit)
michael@13 1678 + /*@innerbreak@*/ break;
michael@13 1679 +#endif
michael@13 1680 /*@fallthrough@*/
michael@13 1681 case 'i':
michael@13 1682 ba->buildAmount |= RPMBUILD_INSTALL;
michael@13 1683
michael@13 1684 +---------------------------------------------------------------------------
michael@13 1685 | Because permissions and ownership on Berkeley-DB region files
michael@13 1686 | __db.XXX have to be already fixed in advance and those files cannot
michael@13 1687 | be created in advance on the command line with some reasonable
michael@13 1688 | default (as it is the case for the other files which are created
michael@13 1689 | with [rpm]db_load), so force Berkeley-DB to accept zero-sized files
michael@13 1690 | and create them (instead of thinking another process is currently
michael@13 1691 | creating them).
michael@13 1692 +---------------------------------------------------------------------------
michael@13 1693 Index: db/env/env_region.c
michael@13 1694 --- db/env/env_region.c 18 Jan 2003 14:05:01 -0000 1.1.1.5
michael@13 1695 +++ db/env/env_region.c 22 Jan 2004 21:42:17 -0000 1.2
michael@13 1696 @@ -184,6 +184,24 @@
michael@13 1697 }
michael@13 1698
michael@13 1699 /*
michael@13 1700 + * OpenPKG hack: because permissions and ownership on Berkeley-DB
michael@13 1701 + * region files __db.XXX have to be already fixed in advance and
michael@13 1702 + * those files cannot be created in advance on the command line
michael@13 1703 + * with some reasonable default (as it is the case for the other
michael@13 1704 + * files which are created with [rpm]db_load), so force Berkeley-DB
michael@13 1705 + * to accept zero-sized files and create them (instead of thinking
michael@13 1706 + * another process is currently creating them).
michael@13 1707 + */
michael@13 1708 + if (mbytes == 0 && bytes == 0) {
michael@13 1709 + if (F_ISSET(dbenv, DB_ENV_CREATE))
michael@13 1710 + goto creation;
michael@13 1711 + else {
michael@13 1712 + ret = ENOENT;
michael@13 1713 + goto err;
michael@13 1714 + }
michael@13 1715 + }
michael@13 1716 +
michael@13 1717 + /*
michael@13 1718 * !!!
michael@13 1719 * A size_t is OK -- regions get mapped into memory, and so can't
michael@13 1720 * be larger than a size_t.
michael@13 1721
michael@13 1722 +---------------------------------------------------------------------------
michael@13 1723 | Make sure RPM passes DB_CREATE to Berkeley-DB also if file exists,
michael@13 1724 | but is (still) zero-sized.
michael@13 1725 +---------------------------------------------------------------------------
michael@13 1726 Index: rpmdb/db3.c
michael@13 1727 --- rpmdb/db3.c 3 Mar 2003 16:18:29 -0000 1.1.1.5
michael@13 1728 +++ rpmdb/db3.c 22 Jan 2004 21:42:29 -0000 1.2
michael@13 1729 @@ -1019,9 +1019,13 @@
michael@13 1730 } else { /* dbhome is writable, check for persistent dbenv. */
michael@13 1731 /*@-mods@*/
michael@13 1732 const char * dbf = rpmGetPath(dbhome, "/__db.001", NULL);
michael@13 1733 + struct stat sb;
michael@13 1734 + long size = -1;
michael@13 1735 /*@=mods@*/
michael@13 1736
michael@13 1737 - if (access(dbf, F_OK) == -1) {
michael@13 1738 + if (stat(dbf, &sb) == 0)
michael@13 1739 + size = (long)sb.st_size;
michael@13 1740 + if (access(dbf, F_OK) == -1 || size == 0) {
michael@13 1741 /* ... non-existent (or unwritable) DBENV, will create ... */
michael@13 1742 dbi->dbi_oeflags |= DB_CREATE;
michael@13 1743 dbi->dbi_eflags &= ~DB_JOINENV;
michael@13 1744
michael@13 1745 +---------------------------------------------------------------------------
michael@13 1746 | Add internal feature variable %{_force_oldpackage} which, if
michael@13 1747 | non-zero, automatically enforces --oldpackage on all upgrade
michael@13 1748 | operations (this is useful on mass-upgrades from OpenPKG-CURRENT to
michael@13 1749 | OpenPKG-RELEASE).
michael@13 1750 +---------------------------------------------------------------------------
michael@13 1751 Index: rpm.c
michael@13 1752 --- rpm.c 16 May 2002 16:55:25 -0000 1.1.1.23
michael@13 1753 +++ rpm.c 22 Jan 2004 21:42:10 -0000 1.2
michael@13 1754 @@ -1016,6 +1016,10 @@
michael@13 1755
michael@13 1756 if (oldPackage && !upgrade)
michael@13 1757 argerror(_("--oldpackage may only be used during upgrades"));
michael@13 1758 +#ifdef OPENPKG
michael@13 1759 + if (upgrade && rpmExpandNumeric("%{?_force_oldpackage}"))
michael@13 1760 + probFilter |= RPMPROB_FILTER_OLDPACKAGE;
michael@13 1761 +#endif
michael@13 1762
michael@13 1763 if (noPgp && bigMode != MODE_CHECKSIG)
michael@13 1764 argerror(_("--nopgp may only be used during signature checking"));
michael@13 1765
michael@13 1766 +---------------------------------------------------------------------------
michael@13 1767 | Add OpenPKG branding to make sure people do not intermix
michael@13 1768 | this RPM version with the stock RPM version.
michael@13 1769 +---------------------------------------------------------------------------
michael@13 1770 Index: lib/poptALL.c
michael@13 1771 --- lib/poptALL.c 25 Jun 2003 19:10:01 -0000 1.1.1.3
michael@13 1772 +++ lib/poptALL.c 22 Jan 2004 21:42:23 -0000 1.2
michael@13 1773 @@ -102,7 +102,7 @@
michael@13 1774 /*@globals rpmEVR, fileSystem @*/
michael@13 1775 /*@modifies *fp, fileSystem @*/
michael@13 1776 {
michael@13 1777 - fprintf(fp, _("RPM version %s\n"), rpmEVR);
michael@13 1778 + fprintf(fp, _("OpenPKG RPM %s\n"), rpmEVR);
michael@13 1779 }
michael@13 1780
michael@13 1781 /**
michael@13 1782
michael@13 1783 +---------------------------------------------------------------------------
michael@13 1784 | Add OpenPKG branding to make sure people do not intermix
michael@13 1785 | this RPM version with the stock RPM version.
michael@13 1786 +---------------------------------------------------------------------------
michael@13 1787 Index: rpm.c
michael@13 1788 --- rpm.c 16 May 2002 16:55:25 -0000 1.1.1.23
michael@13 1789 +++ rpm.c 22 Jan 2004 21:42:10 -0000 1.2
michael@13 1790 @@ -235,7 +235,7 @@
michael@13 1791 static void printHelpLine(char * prefix, char * help);
michael@13 1792
michael@13 1793 static void printVersion(void) {
michael@13 1794 - fprintf(stdout, _("RPM version %s\n"), rpmEVR);
michael@13 1795 + fprintf(stdout, _("OpenPKG RPM %s\n"), rpmEVR);
michael@13 1796 }
michael@13 1797
michael@13 1798 static void printBanner(void) {
michael@13 1799
michael@13 1800 +---------------------------------------------------------------------------
michael@13 1801 | Add OpenPKG branding to make sure people do not intermix
michael@13 1802 | this RPM version with the stock RPM version.
michael@13 1803 +---------------------------------------------------------------------------
michael@13 1804 Index: rpmqv.c
michael@13 1805 --- rpmqv.c 4 Mar 2003 15:32:57 -0000 1.1.1.8
michael@13 1806 +++ rpmqv.c 6 Feb 2004 15:37:56 -0000 1.4
michael@13 1807 @@ -126,7 +126,7 @@
michael@13 1808 /*@globals rpmEVR, fileSystem @*/
michael@13 1809 /*@modifies *fp, fileSystem @*/
michael@13 1810 {
michael@13 1811 - fprintf(fp, _("RPM version %s\n"), rpmEVR);
michael@13 1812 + fprintf(fp, _("OpenPKG RPM %s\n"), rpmEVR);
michael@13 1813 }
michael@13 1814
michael@13 1815 static void printBanner(FILE * fp)
michael@13 1816
michael@13 1817 +---------------------------------------------------------------------------
michael@13 1818 | Add support for the OpenPKG custom .spec file sections %track
michael@13 1819 | (package build-time feature for performing vendor source tracking)
michael@13 1820 | and %test (package install-time feature for performing package
michael@13 1821 | run-time tests).
michael@13 1822 +---------------------------------------------------------------------------
michael@13 1823 Index: rpmqv.c
michael@13 1824 --- rpmqv.c 4 Mar 2003 15:32:57 -0000 1.1.1.8
michael@13 1825 +++ rpmqv.c 6 Feb 2004 15:37:56 -0000 1.4
michael@13 1826 @@ -703,7 +707,19 @@
michael@13 1827 /*@innerbreak@*/ break;
michael@13 1828 case 's':
michael@13 1829 ba->buildAmount |= RPMBUILD_PACKAGESOURCE;
michael@13 1830 + /* enforce no dependency checking */
michael@13 1831 + ba->noDeps = 1;
michael@13 1832 /*@innerbreak@*/ break;
michael@13 1833 +#ifdef OPENPKG
michael@13 1834 + case 't':
michael@13 1835 + ba->buildAmount |= RPMBUILD_TRACK;
michael@13 1836 + /* enforce no dependency checking and expansion of %setup, %patch and %prep macros */
michael@13 1837 + ba->noDeps = 1;
michael@13 1838 + rpmDefineMacro(NULL, "setup #", RMIL_CMDLINE);
michael@13 1839 + rpmDefineMacro(NULL, "patch #", RMIL_CMDLINE);
michael@13 1840 + rpmDefineMacro(NULL, "prep %%prep", RMIL_CMDLINE);
michael@13 1841 + /*@innerbreak@*/ break;
michael@13 1842 +#endif
michael@13 1843 }
michael@13 1844
michael@13 1845 if (!poptPeekArg(optCon)) {
michael@13 1846
michael@13 1847 +---------------------------------------------------------------------------
michael@13 1848 | Add support for the OpenPKG custom .spec file sections %track
michael@13 1849 | (package build-time feature for performing vendor source tracking)
michael@13 1850 | and %test (package install-time feature for performing package
michael@13 1851 | run-time tests).
michael@13 1852 +---------------------------------------------------------------------------
michael@13 1853 Index: build/pack.c
michael@13 1854 --- build/pack.c 4 Mar 2003 17:03:17 -0000 1.1.1.20
michael@13 1855 +++ build/pack.c 30 Jan 2004 17:06:29 -0000 1.2
michael@13 1856 @@ -252,6 +252,15 @@
michael@13 1857 return RPMERR_BADFILENAME;
michael@13 1858 }
michael@13 1859 }
michael@13 1860 +#ifdef OPENPKG
michael@13 1861 + if (pkg->testFile) {
michael@13 1862 + if (addFileToTag(spec, pkg->testFile, pkg->header, RPMTAG_TEST)) {
michael@13 1863 + rpmError(RPMERR_BADFILENAME,
michael@13 1864 + _("Could not open Test file: %s\n"), pkg->testFile);
michael@13 1865 + return RPMERR_BADFILENAME;
michael@13 1866 + }
michael@13 1867 + }
michael@13 1868 +#endif
michael@13 1869
michael@13 1870 for (p = pkg->triggerFiles; p != NULL; p = p->next) {
michael@13 1871 (void) headerAddOrAppendEntry(pkg->header, RPMTAG_TRIGGERSCRIPTPROG,
michael@13 1872
michael@13 1873 +---------------------------------------------------------------------------
michael@13 1874 | Add support for the OpenPKG custom .spec file sections %track
michael@13 1875 | (package build-time feature for performing vendor source tracking)
michael@13 1876 | and %test (package install-time feature for performing package
michael@13 1877 | run-time tests).
michael@13 1878 +---------------------------------------------------------------------------
michael@13 1879 Index: build/parseBuildInstallClean.c
michael@13 1880 --- build/parseBuildInstallClean.c 3 Mar 2003 20:43:30 -0000 1.1.1.9
michael@13 1881 +++ build/parseBuildInstallClean.c 30 Jan 2004 17:06:29 -0000 1.2
michael@13 1882 @@ -29,6 +29,11 @@
michael@13 1883 } else if (parsePart == PART_CLEAN) {
michael@13 1884 sbp = &(spec->clean);
michael@13 1885 name = "%clean";
michael@13 1886 +#ifdef OPENPKG
michael@13 1887 + } else if (parsePart == PART_TRACK) {
michael@13 1888 + sbp = &(spec->track);
michael@13 1889 + name = "%track";
michael@13 1890 +#endif
michael@13 1891 }
michael@13 1892 /*@=branchstate@*/
michael@13 1893
michael@13 1894
michael@13 1895 +---------------------------------------------------------------------------
michael@13 1896 | Add support for the OpenPKG custom .spec file sections %track
michael@13 1897 | (package build-time feature for performing vendor source tracking)
michael@13 1898 | and %test (package install-time feature for performing package
michael@13 1899 | run-time tests).
michael@13 1900 +---------------------------------------------------------------------------
michael@13 1901 Index: build/parseScript.c
michael@13 1902 --- build/parseScript.c 23 Jun 2002 19:47:12 -0000 1.1.1.12
michael@13 1903 +++ build/parseScript.c 30 Jan 2004 17:06:29 -0000 1.3
michael@13 1904 @@ -156,6 +156,14 @@
michael@13 1905 progtag = RPMTAG_TRIGGERSCRIPTPROG;
michael@13 1906 partname = "%triggerpostun";
michael@13 1907 break;
michael@13 1908 +#ifdef OPENPKG
michael@13 1909 + case PART_TEST:
michael@13 1910 + tag = RPMTAG_TEST;
michael@13 1911 + tagflags = RPMSENSE_SCRIPT_TEST;
michael@13 1912 + progtag = RPMTAG_TESTPROG;
michael@13 1913 + partname = "%test";
michael@13 1914 + break;
michael@13 1915 +#endif
michael@13 1916 }
michael@13 1917 /*@=branchstate@*/
michael@13 1918
michael@13 1919 @@ -303,6 +312,11 @@
michael@13 1920 case PART_VERIFYSCRIPT:
michael@13 1921 pkg->verifyFile = xstrdup(file);
michael@13 1922 break;
michael@13 1923 +#ifdef OPENPKG
michael@13 1924 + case PART_TEST:
michael@13 1925 + pkg->testFile = xstrdup(file);
michael@13 1926 + break;
michael@13 1927 +#endif
michael@13 1928 }
michael@13 1929 }
michael@13 1930 }
michael@13 1931
michael@13 1932 +---------------------------------------------------------------------------
michael@13 1933 | Add support for the OpenPKG custom .spec file sections %track
michael@13 1934 | (package build-time feature for performing vendor source tracking)
michael@13 1935 | and %test (package install-time feature for performing package
michael@13 1936 | run-time tests).
michael@13 1937 +---------------------------------------------------------------------------
michael@13 1938 Index: build/parseSpec.c
michael@13 1939 --- build/parseSpec.c 15 May 2003 13:38:57 -0000 1.1.1.15
michael@13 1940 +++ build/parseSpec.c 30 Jan 2004 17:06:30 -0000 1.2
michael@13 1941 @@ -43,6 +43,10 @@
michael@13 1942 { PART_TRIGGERIN, 0, "%triggerin"},
michael@13 1943 { PART_TRIGGERIN, 0, "%trigger"},
michael@13 1944 { PART_VERIFYSCRIPT, 0, "%verifyscript"},
michael@13 1945 +#ifdef OPENPKG
michael@13 1946 + { PART_TRACK, 0, "%track"},
michael@13 1947 + { PART_TEST, 0, "%test"},
michael@13 1948 +#endif
michael@13 1949 {0, 0, 0}
michael@13 1950 };
michael@13 1951
michael@13 1952 @@ -489,6 +493,15 @@
michael@13 1953 parsePart = parseFiles(spec);
michael@13 1954 /*@switchbreak@*/ break;
michael@13 1955
michael@13 1956 +#ifdef OPENPKG
michael@13 1957 + case PART_TRACK:
michael@13 1958 + parsePart = parseBuildInstallClean(spec, parsePart);
michael@13 1959 + /*@switchbreak@*/ break;
michael@13 1960 + case PART_TEST:
michael@13 1961 + parsePart = parseScript(spec, parsePart);
michael@13 1962 + /*@switchbreak@*/ break;
michael@13 1963 +#endif
michael@13 1964 +
michael@13 1965 case PART_NONE: /* XXX avoid gcc whining */
michael@13 1966 case PART_LAST:
michael@13 1967 case PART_BUILDARCHITECTURES:
michael@13 1968
michael@13 1969 +---------------------------------------------------------------------------
michael@13 1970 | Add support for the OpenPKG custom .spec file sections %track
michael@13 1971 | (package build-time feature for performing vendor source tracking)
michael@13 1972 | and %test (package install-time feature for performing package
michael@13 1973 | run-time tests).
michael@13 1974 +---------------------------------------------------------------------------
michael@13 1975 Index: build/poptBT.c
michael@13 1976 --- build/poptBT.c 3 Mar 2003 20:04:12 -0000 1.1.1.3
michael@13 1977 +++ build/poptBT.c 30 Jan 2004 17:06:30 -0000 1.2
michael@13 1978 @@ -35,6 +35,9 @@
michael@13 1979 #define POPT_BL 0x626c
michael@13 1980 #define POPT_BP 0x6270
michael@13 1981 #define POPT_BS 0x6273
michael@13 1982 +#ifdef OPENPKG
michael@13 1983 +#define POPT_BT 0x6274
michael@13 1984 +#endif
michael@13 1985 #define POPT_TA 0x7461
michael@13 1986 #define POPT_TB 0x7462
michael@13 1987 #define POPT_TC 0x7463
michael@13 1988 @@ -82,6 +85,9 @@
michael@13 1989 case POPT_BL:
michael@13 1990 case POPT_BP:
michael@13 1991 case POPT_BS:
michael@13 1992 +#ifdef OPENPKG
michael@13 1993 + case POPT_BT:
michael@13 1994 +#endif
michael@13 1995 case POPT_TA:
michael@13 1996 case POPT_TB:
michael@13 1997 case POPT_TC:
michael@13 1998 @@ -177,6 +183,11 @@
michael@13 1999 { "bs", 0, POPT_ARGFLAG_ONEDASH, 0, POPT_BS,
michael@13 2000 N_("build source package only from <specfile>"),
michael@13 2001 N_("<specfile>") },
michael@13 2002 +#ifdef OPENPKG
michael@13 2003 + { "bt", 0, POPT_ARGFLAG_ONEDASH, 0, POPT_BT,
michael@13 2004 + N_("track versions of sources from <specfile>"),
michael@13 2005 + N_("<specfile>") },
michael@13 2006 +#endif
michael@13 2007
michael@13 2008 { "tp", 0, POPT_ARGFLAG_ONEDASH, 0, POPT_TP,
michael@13 2009 N_("build through %prep (unpack sources and apply patches) from <tarball>"),
michael@13 2010
michael@13 2011 +---------------------------------------------------------------------------
michael@13 2012 | Add support for the OpenPKG custom .spec file sections %track
michael@13 2013 | (package build-time feature for performing vendor source tracking)
michael@13 2014 | and %test (package install-time feature for performing package
michael@13 2015 | run-time tests).
michael@13 2016 +---------------------------------------------------------------------------
michael@13 2017 Index: build/rpmbuild.h
michael@13 2018 --- build/rpmbuild.h 4 Mar 2003 17:03:07 -0000 1.1.1.13
michael@13 2019 +++ build/rpmbuild.h 30 Jan 2004 17:06:30 -0000 1.2
michael@13 2020 @@ -34,6 +34,9 @@
michael@13 2021 RPMBUILD_RMSOURCE = (1 << 8), /*!< Remove source(s) and patch(s). */
michael@13 2022 RPMBUILD_RMBUILD = (1 << 9), /*!< Remove build sub-tree. */
michael@13 2023 RPMBUILD_STRINGBUF = (1 << 10), /*!< only for doScript() */
michael@13 2024 +#ifdef OPENPKG
michael@13 2025 + RPMBUILD_TRACK = (1 << 12), /*!< Execute %%track. */
michael@13 2026 +#endif
michael@13 2027 RPMBUILD_RMSPEC = (1 << 11) /*!< Remove spec file. */
michael@13 2028 } rpmBuildFlags;
michael@13 2029 /*@=typeuse@*/
michael@13 2030 @@ -69,7 +72,13 @@
michael@13 2031 PART_VERIFYSCRIPT = 16, /*!< */
michael@13 2032 PART_BUILDARCHITECTURES= 17,/*!< */
michael@13 2033 PART_TRIGGERPOSTUN = 18, /*!< */
michael@13 2034 +#ifdef OPENPKG
michael@13 2035 + PART_TRACK = 19, /*!< */
michael@13 2036 + PART_TEST = 20, /*!< */
michael@13 2037 + PART_LAST = 21 /*!< */
michael@13 2038 +#else
michael@13 2039 PART_LAST = 19 /*!< */
michael@13 2040 +#endif
michael@13 2041 } rpmParseState;
michael@13 2042
michael@13 2043 #define STRIP_NOTHING 0
michael@13 2044
michael@13 2045 +---------------------------------------------------------------------------
michael@13 2046 | Add support for the OpenPKG custom .spec file sections %track
michael@13 2047 | (package build-time feature for performing vendor source tracking)
michael@13 2048 | and %test (package install-time feature for performing package
michael@13 2049 | run-time tests).
michael@13 2050 +---------------------------------------------------------------------------
michael@13 2051 Index: build/rpmspec.h
michael@13 2052 --- build/rpmspec.h 4 Mar 2003 15:30:23 -0000 1.1.1.11
michael@13 2053 +++ build/rpmspec.h 30 Jan 2004 17:06:30 -0000 1.2
michael@13 2054 @@ -164,6 +164,10 @@
michael@13 2055 StringBuf check; /*!< %check scriptlet. */
michael@13 2056 /*@only@*/
michael@13 2057 StringBuf clean; /*!< %clean scriptlet. */
michael@13 2058 +#ifdef OPENPKG
michael@13 2059 +/*@only@*/
michael@13 2060 + StringBuf track; /*!< %track scriptlet. */
michael@13 2061 +#endif
michael@13 2062
michael@13 2063 /*@owned@*/
michael@13 2064 Package packages; /*!< Package list. */
michael@13 2065 @@ -196,6 +200,10 @@
michael@13 2066 const char * postUnFile; /*!< %postun scriptlet. */
michael@13 2067 /*@only@*/
michael@13 2068 const char * verifyFile; /*!< %verifyscript scriptlet. */
michael@13 2069 +#ifdef OPENPKG
michael@13 2070 +/*@only@*/
michael@13 2071 + const char * testFile; /*!< %test scriptlet. */
michael@13 2072 +#endif
michael@13 2073
michael@13 2074 /*@only@*/
michael@13 2075 StringBuf specialDoc;
michael@13 2076
michael@13 2077 +---------------------------------------------------------------------------
michael@13 2078 | Add support for the OpenPKG custom .spec file sections %track
michael@13 2079 | (package build-time feature for performing vendor source tracking)
michael@13 2080 | and %test (package install-time feature for performing package
michael@13 2081 | run-time tests).
michael@13 2082 +---------------------------------------------------------------------------
michael@13 2083 Index: build/spec.c
michael@13 2084 --- build/spec.c 4 Mar 2003 15:25:51 -0000 1.1.1.21
michael@13 2085 +++ build/spec.c 30 Jan 2004 17:06:31 -0000 1.3
michael@13 2086 @@ -138,6 +138,9 @@
michael@13 2087 p->preUnFile = NULL;
michael@13 2088 p->postUnFile = NULL;
michael@13 2089 p->verifyFile = NULL;
michael@13 2090 +#ifdef OPENPKG
michael@13 2091 + p->testFile = NULL;
michael@13 2092 +#endif
michael@13 2093
michael@13 2094 p->specialDoc = NULL;
michael@13 2095
michael@13 2096 @@ -444,6 +455,9 @@
michael@13 2097 spec->install = NULL;
michael@13 2098 spec->check = NULL;
michael@13 2099 spec->clean = NULL;
michael@13 2100 +#ifdef OPENPKG
michael@13 2101 + spec->track = NULL;
michael@13 2102 +#endif
michael@13 2103
michael@13 2104 spec->sources = NULL;
michael@13 2105 spec->packages = NULL;
michael@13 2106 @@ -491,6 +505,9 @@
michael@13 2107 spec->install = freeStringBuf(spec->install);
michael@13 2108 spec->check = freeStringBuf(spec->check);
michael@13 2109 spec->clean = freeStringBuf(spec->clean);
michael@13 2110 +#ifdef OPENPKG
michael@13 2111 + spec->track = freeStringBuf(spec->track);
michael@13 2112 +#endif
michael@13 2113
michael@13 2114 spec->buildRootURL = _free(spec->buildRootURL);
michael@13 2115 spec->buildSubdir = _free(spec->buildSubdir);
michael@13 2116
michael@13 2117 +---------------------------------------------------------------------------
michael@13 2118 | Add support for the OpenPKG custom .spec file sections %track
michael@13 2119 | (package build-time feature for performing vendor source tracking)
michael@13 2120 | and %test (package install-time feature for performing package
michael@13 2121 | run-time tests).
michael@13 2122 +---------------------------------------------------------------------------
michael@13 2123 Index: lib/rpmlib.h
michael@13 2124 --- lib/rpmlib.h 19 Jun 2003 17:39:35 -0000 1.1.1.26
michael@13 2125 +++ lib/rpmlib.h 30 Jan 2004 17:06:31 -0000 1.2
michael@13 2126 @@ -414,6 +414,12 @@
michael@13 2127 RPMTAG_FILEDEPENDSN = 1144,
michael@13 2128 RPMTAG_DEPENDSDICT = 1145,
michael@13 2129 RPMTAG_SOURCEPKGID = 1146,
michael@13 2130 +#ifdef OPENPKG
michael@13 2131 + RPMTAG_TRACK = 1200,
michael@13 2132 + RPMTAG_TEST = 1201,
michael@13 2133 + RPMTAG_TESTPROG = 1202,
michael@13 2134 + RPMTAG_CLASS = 1203,
michael@13 2135 +#endif
michael@13 2136 /*@-enummemuse@*/
michael@13 2137 RPMTAG_FIRSTFREE_TAG /*!< internal */
michael@13 2138 /*@=enummemuse@*/
michael@13 2139 @@ -488,6 +494,9 @@
michael@13 2140 RPMSENSE_SCRIPT_BUILD = (1 << 21), /*!< %build build dependency. */
michael@13 2141 RPMSENSE_SCRIPT_INSTALL = (1 << 22),/*!< %install build dependency. */
michael@13 2142 RPMSENSE_SCRIPT_CLEAN = (1 << 23), /*!< %clean build dependency. */
michael@13 2143 +#ifdef OPENPKG
michael@13 2144 + RPMSENSE_SCRIPT_TEST = (1 << 29), /*!< %test build dependency. */
michael@13 2145 +#endif
michael@13 2146 RPMSENSE_RPMLIB = ((1 << 24) | RPMSENSE_PREREQ), /*!< rpmlib(feature) dependency. */
michael@13 2147 /*@-enummemuse@*/
michael@13 2148 RPMSENSE_TRIGGERPREIN = (1 << 25), /*!< @todo Implement %triggerprein. */
michael@13 2149
michael@13 2150 +---------------------------------------------------------------------------
michael@13 2151 | Add support for the OpenPKG custom .spec file sections %track
michael@13 2152 | (package build-time feature for performing vendor source tracking)
michael@13 2153 | and %test (package install-time feature for performing package
michael@13 2154 | run-time tests).
michael@13 2155 | Additionally, add support for "Class" header.
michael@13 2156 +---------------------------------------------------------------------------
michael@13 2157 Index: rpmdb/tagtbl.c
michael@13 2158 --- rpmdb/tagtbl.c 2 Jul 2003 20:20:27 -0000 1.1.1.4
michael@13 2159 +++ rpmdb/tagtbl.c 30 Jan 2004 17:06:32 -0000 1.2
michael@13 2160 @@ -135,6 +135,12 @@
michael@13 2161 { "RPMTAG_FILEDEPENDSN", 1144, },
michael@13 2162 { "RPMTAG_DEPENDSDICT", 1145, },
michael@13 2163 { "RPMTAG_SOURCEPKGID", 1146, },
michael@13 2164 +#ifdef OPENPKG
michael@13 2165 + { "RPMTAG_TRACK", 1200, },
michael@13 2166 + { "RPMTAG_TEST", 1201, },
michael@13 2167 + { "RPMTAG_TESTPROG", 1202, },
michael@13 2168 + { "RPMTAG_CLASS", 1203, },
michael@13 2169 +#endif
michael@13 2170 { NULL, 0 }
michael@13 2171 };
michael@13 2172
michael@13 2173
michael@13 2174 +---------------------------------------------------------------------------
michael@13 2175 | Add support for "Class" header.
michael@13 2176 +---------------------------------------------------------------------------
michael@13 2177 Index: build/parsePreamble.c
michael@13 2178 --- build/parsePreamble.c 3 Mar 2003 20:46:34 -0000 1.1.1.13
michael@13 2179 +++ build/parsePreamble.c 6 Feb 2004 15:37:58 -0000 1.3
michael@13 2180 @@ -21,6 +21,7 @@
michael@13 2181 RPMTAG_LICENSE,
michael@13 2182 RPMTAG_PACKAGER,
michael@13 2183 RPMTAG_DISTRIBUTION,
michael@13 2184 + RPMTAG_CLASS,
michael@13 2185 RPMTAG_DISTURL,
michael@13 2186 RPMTAG_VENDOR,
michael@13 2187 RPMTAG_ICON,
michael@13 2188 @@ -327,6 +328,7 @@
michael@13 2189 { RPMTAG_VENDOR, "%{vendor}" },
michael@13 2190 { RPMTAG_PACKAGER, "%{packager}" },
michael@13 2191 { RPMTAG_DISTRIBUTION, "%{distribution}" },
michael@13 2192 + { RPMTAG_CLASS, "%{class}" },
michael@13 2193 { RPMTAG_DISTURL, "%{disturl}" },
michael@13 2194 { -1, NULL }
michael@13 2195 };
michael@13 2196 @@ -537,6 +547,7 @@
michael@13 2197 (void) stashSt(spec, pkg->header, tag, lang);
michael@13 2198 /*@fallthrough@*/
michael@13 2199 case RPMTAG_DISTRIBUTION:
michael@13 2200 + case RPMTAG_CLASS:
michael@13 2201 case RPMTAG_VENDOR:
michael@13 2202 case RPMTAG_LICENSE:
michael@13 2203 case RPMTAG_PACKAGER:
michael@13 2204 @@ -743,6 +754,7 @@
michael@13 2205 {RPMTAG_LICENSE, 0, 0, "copyright"},
michael@13 2206 {RPMTAG_LICENSE, 0, 0, "license"},
michael@13 2207 {RPMTAG_DISTRIBUTION, 0, 0, "distribution"},
michael@13 2208 + {RPMTAG_CLASS, 0, 0, "class"},
michael@13 2209 {RPMTAG_DISTURL, 0, 0, "disturl"},
michael@13 2210 {RPMTAG_VENDOR, 0, 0, "vendor"},
michael@13 2211 {RPMTAG_GROUP, 0, 1, "group"},

mercurial