michael@13: ## michael@13: ## rpm.patch.feature -- Annotated OpenPKG RPM Patch file michael@13: ## Copyright (c) 2000-2007 OpenPKG Foundation e.V. michael@13: ## Copyright (c) 2000-2007 Ralf S. Engelschall michael@13: ## michael@13: ## This file assembles changes to existing RPM source files between michael@13: ## the original RedHat RPM and the OpenPKG RPM variant. It can be michael@13: ## automatically applied to a vanilla RedHat RPM source tree with the michael@13: ## 'patch' tool to upgrade those files. Each patch snippet is annotated michael@13: ## with a short description. michael@13: ## michael@13: ## Created on: 13-Sep-2006 michael@13: ## michael@13: ## ATTENTION: THIS PATCH FILE WAS AUTO-GENERATED FROM AN OPENPKG michael@13: ## RPM CVS REPOSITORY, HENCE DO NOT EDIT THIS FILE. michael@13: ## michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Remove "tools" directory from sub-directory list because it contains michael@13: | things we are not interested in and which cause some build trouble michael@13: | anyway. michael@13: | Use a plain "rpmpopt" file without any trailing version. michael@13: | Adjust paths to conform to OpenPKG filesystem layout. michael@13: | Do not run the "installplatform" script, because not needed for OpenPKG. michael@13: +--------------------------------------------------------------------------- michael@13: Index: Makefile.am michael@13: --- Makefile.am 29 May 2003 18:20:28 -0000 1.1.1.17 michael@13: +++ Makefile.am 22 Jan 2004 21:42:02 -0000 1.2 michael@13: @@ -12,9 +12,9 @@ michael@13: xmlspec/examples/*.sh xmlspec/examples/*.lst \ michael@13: xmlspec/examples/*.xmlspec \ michael@13: po/*.in po/*.po po/rpm.pot \ michael@13: - rpm.magic rpmpopt-$(VERSION) rpmqv.c rpm.c michael@13: + rpm.magic rpmpopt rpmqv.c rpm.c michael@13: michael@13: -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: +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: michael@13: INCLUDES = \ michael@13: -I$(top_srcdir)/build \ michael@13: @@ -47,13 +47,10 @@ michael@13: michael@13: pkglibdir = @RPMCONFIGDIR@ michael@13: pkglib_PROGRAMS = rpmb rpmd rpmi rpmk rpmq michael@13: -pkglib_DATA = rpmrc rpmpopt-$(VERSION) macros michael@13: +pkglib_DATA = rpmrc rpmpopt macros michael@13: pkglib_SCRIPTS = find-provides find-requires mkinstalldirs \ michael@13: config.guess config.sub config.site michael@13: michael@13: -rpmpopt-$(VERSION): rpmpopt michael@13: - cp rpmpopt $@ michael@13: - michael@13: noinst_HEADERS = build.h debug.h system.h michael@13: michael@13: rpm_SOURCES = michael@13: @@ -124,32 +121,32 @@ michael@13: pkgsrcdir = $(prefix)/src/$(RPMCANONVENDOR) michael@13: michael@13: install-data-local: michael@13: - @$(mkinstalldirs) $(DESTDIR)$(varprefix)/lib/rpm michael@13: + @$(mkinstalldirs) $(DESTDIR)$(varprefix)/lib/openpkg michael@13: @rm -f $(DESTDIR)$(libdir)/rpmrc michael@13: @@LN_S@ rpm/rpmrc $(DESTDIR)$(libdir)/rpmrc michael@13: @rm -f $(DESTDIR)$(libdir)/rpmpopt michael@13: @@LN_S@ rpm/rpmpopt $(DESTDIR)$(libdir)/rpmpopt michael@13: @rm -f $(DESTDIR)$(libdir)/rpm/rpmt michael@13: - @@LN_S@ rpmb $(DESTDIR)$(libdir)/rpm/rpmt michael@13: - @rm -f $(DESTDIR)$(libdir)/rpm/rpme michael@13: - @@LN_S@ rpmi $(DESTDIR)$(libdir)/rpm/rpme michael@13: - @rm -f $(DESTDIR)$(libdir)/rpm/rpmu michael@13: - @@LN_S@ rpmi $(DESTDIR)$(libdir)/rpm/rpmu michael@13: - @rm -f $(DESTDIR)$(libdir)/rpm/rpmv michael@13: - @@LN_S@ rpmq $(DESTDIR)$(libdir)/rpm/rpmv michael@13: + @@LN_S@ rpmb $(DESTDIR)$(libdir)/openpkg/rpmt michael@13: + @rm -f $(DESTDIR)$(libdir)/openpkg/rpme michael@13: + @@LN_S@ rpmi $(DESTDIR)$(libdir)/openpkg/rpme michael@13: + @rm -f $(DESTDIR)$(libdir)/openpkg/rpmu michael@13: + @@LN_S@ rpmi $(DESTDIR)$(libdir)/openpkg/rpmu michael@13: + @rm -f $(DESTDIR)$(libdir)/openpkg/rpmv michael@13: + @@LN_S@ rpmq $(DESTDIR)$(libdir)/openpkg/rpmv michael@13: rm -f $(DESTDIR)$(bindir)/rpmbuild michael@13: - @LN_S@ ../lib/rpm/rpmb $(DESTDIR)$(bindir)/rpmbuild michael@13: + @LN_S@ ../lib/openpkg/rpmb $(DESTDIR)$(bindir)/rpmbuild michael@13: rm -f $(DESTDIR)$(bindir)/rpmquery michael@13: - @LN_S@ ../lib/rpm/rpmq $(DESTDIR)$(bindir)/rpmquery michael@13: + @LN_S@ ../lib/openpkg/rpmq $(DESTDIR)$(bindir)/rpmquery michael@13: rm -f $(DESTDIR)$(bindir)/rpmverify michael@13: - @LN_S@ ../lib/rpm/rpmv $(DESTDIR)$(bindir)/rpmverify michael@13: + @LN_S@ ../lib/openpkg/rpmv $(DESTDIR)$(bindir)/rpmverify michael@13: rm -f $(DESTDIR)$(bindir)/rpmsign michael@13: - @LN_S@ ../lib/rpm/rpmk $(DESTDIR)$(bindir)/rpmsign michael@13: + @LN_S@ ../lib/openpkg/rpmk $(DESTDIR)$(bindir)/rpmsign michael@13: rm -f $(DESTDIR)$(bindir)/rpmdb ; \ michael@13: - @LN_S@ ../lib/rpm/rpmd $(DESTDIR)$(bindir)/rpmdb ; \ michael@13: + @LN_S@ ../lib/openpkg/rpmd $(DESTDIR)$(bindir)/rpmdb ; \ michael@13: for bf in e i u ; do \ michael@13: rm -f $(DESTDIR)$(bindir)/rpm$$bf ; \ michael@13: - @LN_S@ ../lib/rpm/rpm$$bf $(DESTDIR)$(bindir)/rpm$$bf ; \ michael@13: + @LN_S@ ../lib/openpkg/rpm$$bf $(DESTDIR)$(bindir)/rpm$$bf ; \ michael@13: done michael@13: @for dir in BUILD RPMS SOURCES SPECS SRPMS ; do\ michael@13: $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/$$dir;\ michael@13: @@ -174,11 +171,6 @@ michael@13: *) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/@host_cpu@ ;;\ michael@13: esac michael@13: $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/noarch michael@13: - @case "@host_os@" in \ michael@13: - mint) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/m68kmint ;;\ michael@13: - solaris*|linux*) \ michael@13: - chmod u+x ./installplatform; DESTDIR="$(DESTDIR)" pkglibdir="$(pkglibdir)" ./installplatform rpmrc macros platform ;; \ michael@13: - esac michael@13: @$(mkinstalldirs) $(DESTDIR)/var/tmp michael@13: michael@13: .PHONY: setperms michael@13: @@ -198,10 +190,10 @@ michael@13: $(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(pkglibdir)/$$f ;\ michael@13: done michael@13: @$(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(pkglibdir) michael@13: - @$(__CHOWN) -R ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(varprefix)/lib/rpm michael@13: - -@$(__CHMOD) 0664 $(DESTDIR)$(varprefix)/lib/rpm/[A-Z]* michael@13: - -@$(__CHMOD) 0775 $(DESTDIR)$(varprefix)/lib/rpm michael@13: - -@$(__CHMOD) 0664 $(DESTDIR)$(varprefix)/lib/rpm/__db.* michael@13: + @$(__CHOWN) -R ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(varprefix)/lib/openpkg michael@13: + -@$(__CHMOD) 0664 $(DESTDIR)$(varprefix)/lib/openpkg/[A-Z]* michael@13: + -@$(__CHMOD) 0775 $(DESTDIR)$(varprefix)/lib/openpkg michael@13: + -@$(__CHMOD) 0664 $(DESTDIR)$(varprefix)/lib/openpkg/__db.* michael@13: michael@13: .PHONY: unsetgid michael@13: unsetgid: michael@13: @@ -244,7 +236,7 @@ michael@13: @sudo ./rpm -ta rpm-$(VERSION).tar.gz michael@13: michael@13: .PHONY: doxygen michael@13: -doxygen @WITH_APIDOCS_TARGET@: Doxyfile rpmpopt-@VERSION@ michael@13: +doxygen @WITH_APIDOCS_TARGET@: Doxyfile rpmpopt michael@13: rm -rf $@ michael@13: mkdir -p $@ michael@13: - [ X"@__DOXYGEN@" != Xno ] && @__DOXYGEN@ michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Remove "tools" directory from sub-directory list because it contains michael@13: | things we are not interested in and which cause some build trouble michael@13: | anyway. michael@13: | Use a plain "rpmpopt" file without any trailing version. michael@13: | Adjust paths to conform to OpenPKG filesystem layout. michael@13: | Do not run the "installplatform" script, because not needed for OpenPKG. michael@13: +--------------------------------------------------------------------------- michael@13: Index: Makefile.in michael@13: --- Makefile.in 16 Jul 2003 17:05:42 -0000 1.1.1.23 michael@13: +++ Makefile.in 22 Jan 2004 21:42:03 -0000 1.2 michael@13: @@ -265,10 +265,10 @@ michael@13: xmlspec/examples/*.sh xmlspec/examples/*.lst \ michael@13: xmlspec/examples/*.xmlspec \ michael@13: po/*.in po/*.po po/rpm.pot \ michael@13: - rpm.magic rpmpopt-$(VERSION) rpmqv.c rpm.c michael@13: + rpm.magic rpmpopt rpmqv.c rpm.c michael@13: michael@13: michael@13: -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: +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: michael@13: INCLUDES = \ michael@13: -I$(top_srcdir)/build \ michael@13: @@ -301,7 +301,7 @@ michael@13: bin_PROGRAMS = rpm2cpio michael@13: bin_SCRIPTS = gendiff michael@13: pkglib_PROGRAMS = rpmb rpmd rpmi rpmk rpmq michael@13: -pkglib_DATA = rpmrc rpmpopt-$(VERSION) macros michael@13: +pkglib_DATA = rpmrc rpmpopt macros michael@13: pkglib_SCRIPTS = find-provides find-requires mkinstalldirs \ michael@13: config.guess config.sub config.site michael@13: michael@13: @@ -1058,8 +1058,6 @@ michael@13: uninstall-rpmbinPROGRAMS michael@13: michael@13: michael@13: -rpmpopt-$(VERSION): rpmpopt michael@13: - cp rpmpopt $@ michael@13: rpm.o: rpmqv.c michael@13: $(COMPILE) -DIAM_RPMDB -DIAM_RPMEIU -DIAM_RPMK -DIAM_RPMQV -o $@ -c rpmqv.c michael@13: rpmb.o: rpmqv.c michael@13: @@ -1097,32 +1095,32 @@ michael@13: `make -s sources -C popt` michael@13: michael@13: install-data-local: michael@13: - @$(mkinstalldirs) $(DESTDIR)$(varprefix)/lib/rpm michael@13: + @$(mkinstalldirs) $(DESTDIR)$(varprefix)/lib/openpkg michael@13: @rm -f $(DESTDIR)$(libdir)/rpmrc michael@13: @@LN_S@ rpm/rpmrc $(DESTDIR)$(libdir)/rpmrc michael@13: @rm -f $(DESTDIR)$(libdir)/rpmpopt michael@13: @@LN_S@ rpm/rpmpopt $(DESTDIR)$(libdir)/rpmpopt michael@13: - @rm -f $(DESTDIR)$(libdir)/rpm/rpmt michael@13: - @@LN_S@ rpmb $(DESTDIR)$(libdir)/rpm/rpmt michael@13: - @rm -f $(DESTDIR)$(libdir)/rpm/rpme michael@13: - @@LN_S@ rpmi $(DESTDIR)$(libdir)/rpm/rpme michael@13: - @rm -f $(DESTDIR)$(libdir)/rpm/rpmu michael@13: - @@LN_S@ rpmi $(DESTDIR)$(libdir)/rpm/rpmu michael@13: - @rm -f $(DESTDIR)$(libdir)/rpm/rpmv michael@13: - @@LN_S@ rpmq $(DESTDIR)$(libdir)/rpm/rpmv michael@13: + @rm -f $(DESTDIR)$(libdir)/openpkg/rpmt michael@13: + @@LN_S@ rpmb $(DESTDIR)$(libdir)/openpkg/rpmt michael@13: + @rm -f $(DESTDIR)$(libdir)/openpkg/rpme michael@13: + @@LN_S@ rpmi $(DESTDIR)$(libdir)/openpkg/rpme michael@13: + @rm -f $(DESTDIR)$(libdir)/openpkg/rpmu michael@13: + @@LN_S@ rpmi $(DESTDIR)$(libdir)/openpkg/rpmu michael@13: + @rm -f $(DESTDIR)$(libdir)/openpkg/rpmv michael@13: + @@LN_S@ rpmq $(DESTDIR)$(libdir)/openpkg/rpmv michael@13: rm -f $(DESTDIR)$(bindir)/rpmbuild michael@13: - @LN_S@ ../lib/rpm/rpmb $(DESTDIR)$(bindir)/rpmbuild michael@13: + @LN_S@ ../lib/openpkg/rpmb $(DESTDIR)$(bindir)/rpmbuild michael@13: rm -f $(DESTDIR)$(bindir)/rpmquery michael@13: - @LN_S@ ../lib/rpm/rpmq $(DESTDIR)$(bindir)/rpmquery michael@13: + @LN_S@ ../lib/openpkg/rpmq $(DESTDIR)$(bindir)/rpmquery michael@13: rm -f $(DESTDIR)$(bindir)/rpmverify michael@13: - @LN_S@ ../lib/rpm/rpmv $(DESTDIR)$(bindir)/rpmverify michael@13: + @LN_S@ ../lib/openpkg/rpmv $(DESTDIR)$(bindir)/rpmverify michael@13: rm -f $(DESTDIR)$(bindir)/rpmsign michael@13: - @LN_S@ ../lib/rpm/rpmk $(DESTDIR)$(bindir)/rpmsign michael@13: + @LN_S@ ../lib/openpkg/rpmk $(DESTDIR)$(bindir)/rpmsign michael@13: rm -f $(DESTDIR)$(bindir)/rpmdb ; \ michael@13: - @LN_S@ ../lib/rpm/rpmd $(DESTDIR)$(bindir)/rpmdb ; \ michael@13: + @LN_S@ ../lib/openpkg/rpmd $(DESTDIR)$(bindir)/rpmdb ; \ michael@13: for bf in e i u ; do \ michael@13: rm -f $(DESTDIR)$(bindir)/rpm$$bf ; \ michael@13: - @LN_S@ ../lib/rpm/rpm$$bf $(DESTDIR)$(bindir)/rpm$$bf ; \ michael@13: + @LN_S@ ../lib/openpkg/rpm$$bf $(DESTDIR)$(bindir)/rpm$$bf ; \ michael@13: done michael@13: @for dir in BUILD RPMS SOURCES SPECS SRPMS ; do\ michael@13: $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/$$dir;\ michael@13: @@ -1147,11 +1145,6 @@ michael@13: *) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/@host_cpu@ ;;\ michael@13: esac michael@13: $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/noarch michael@13: - @case "@host_os@" in \ michael@13: - mint) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/m68kmint ;;\ michael@13: - solaris*|linux*) \ michael@13: - chmod u+x ./installplatform; DESTDIR="$(DESTDIR)" pkglibdir="$(pkglibdir)" ./installplatform rpmrc macros platform ;; \ michael@13: - esac michael@13: @$(mkinstalldirs) $(DESTDIR)/var/tmp michael@13: michael@13: .PHONY: setperms michael@13: @@ -1171,10 +1164,10 @@ michael@13: $(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(pkglibdir)/$$f ;\ michael@13: done michael@13: @$(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(pkglibdir) michael@13: - @$(__CHOWN) -R ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(varprefix)/lib/rpm michael@13: - -@$(__CHMOD) 0664 $(DESTDIR)$(varprefix)/lib/rpm/[A-Z]* michael@13: - -@$(__CHMOD) 0775 $(DESTDIR)$(varprefix)/lib/rpm michael@13: - -@$(__CHMOD) 0664 $(DESTDIR)$(varprefix)/lib/rpm/__db.* michael@13: + @$(__CHOWN) -R ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(varprefix)/lib/openpkg michael@13: + -@$(__CHMOD) 0664 $(DESTDIR)$(varprefix)/lib/openpkg/[A-Z]* michael@13: + -@$(__CHMOD) 0775 $(DESTDIR)$(varprefix)/lib/openpkg michael@13: + -@$(__CHMOD) 0664 $(DESTDIR)$(varprefix)/lib/openpkg/__db.* michael@13: michael@13: .PHONY: unsetgid michael@13: unsetgid: michael@13: @@ -1217,7 +1210,7 @@ michael@13: @sudo ./rpm -ta rpm-$(VERSION).tar.gz michael@13: michael@13: .PHONY: doxygen michael@13: -doxygen @WITH_APIDOCS_TARGET@: Doxyfile rpmpopt-@VERSION@ michael@13: +doxygen @WITH_APIDOCS_TARGET@: Doxyfile rpmpopt michael@13: rm -rf $@ michael@13: mkdir -p $@ michael@13: - [ X"@__DOXYGEN@" != Xno ] && @__DOXYGEN@ michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Add support for splitted source directories, i.e., source files michael@13: | alternatively can be placed into the .spec directory and are picked michael@13: | up there, too. michael@13: +--------------------------------------------------------------------------- michael@13: Index: build/build.c michael@13: --- build/build.c 4 Mar 2003 15:27:33 -0000 1.1.1.20 michael@13: +++ build/build.c 6 Feb 2004 15:37:57 -0000 1.4 michael@13: @@ -33,7 +33,15 @@ michael@13: michael@13: for (p = spec->sources; p != NULL; p = p->next) { michael@13: if (! (p->flags & RPMBUILD_ISNO)) { michael@13: +#ifndef OPENPKG michael@13: const char *fn = rpmGetPath("%{_sourcedir}/", p->source, NULL); michael@13: +#else michael@13: + const char *fn = rpmGetPath("%{_specdir}/", p->source, NULL); michael@13: + if (access(fn, F_OK) == -1) { michael@13: + fn = _free(fn); michael@13: + fn = rpmGetPath("%{_sourcedir}/", p->source, NULL); michael@13: + } michael@13: +#endif michael@13: rc = Unlink(fn); michael@13: fn = _free(fn); michael@13: } michael@13: @@ -42,7 +50,15 @@ michael@13: for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) { michael@13: for (p = pkg->icon; p != NULL; p = p->next) { michael@13: if (! (p->flags & RPMBUILD_ISNO)) { michael@13: +#ifndef OPENPKG michael@13: const char *fn = rpmGetPath("%{_sourcedir}/", p->source, NULL); michael@13: +#else michael@13: + const char *fn = rpmGetPath("%{_specdir}/", p->source, NULL); michael@13: + if (access(fn, F_OK) == -1) { michael@13: + fn = _free(fn); michael@13: + fn = rpmGetPath("%{_sourcedir}/", p->source, NULL); michael@13: + } michael@13: +#endif michael@13: rc = Unlink(fn); michael@13: fn = _free(fn); michael@13: } michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Add support for the OpenPKG custom .spec file sections %track michael@13: | (package build-time feature for performing vendor source tracking) michael@13: | and %test (package install-time feature for performing package michael@13: | run-time tests). michael@13: +--------------------------------------------------------------------------- michael@13: Index: build/build.c michael@13: --- build/build.c 4 Mar 2003 15:27:33 -0000 1.1.1.20 michael@13: +++ build/build.c 6 Feb 2004 15:37:57 -0000 1.4 michael@13: @@ -113,6 +129,14 @@ michael@13: mTemplate = "%{__spec_clean_template}"; michael@13: mPost = "%{__spec_clean_post}"; michael@13: break; michael@13: +#ifdef OPENPKG michael@13: + case RPMBUILD_TRACK: michael@13: + name = "%track"; michael@13: + sb = spec->track; michael@13: + mTemplate = "%{__spec_track_template}"; michael@13: + mPost = "%{__spec_track_post}"; michael@13: + break; michael@13: +#endif michael@13: case RPMBUILD_STRINGBUF: michael@13: default: michael@13: mTemplate = "%{___build_template}"; michael@13: @@ -169,7 +193,11 @@ michael@13: michael@13: (void) fputs(buildTemplate, fp); michael@13: michael@13: +#ifdef OPENPKG michael@13: + if (what != RPMBUILD_PREP && what != RPMBUILD_RMBUILD && spec->buildSubdir && what != RPMBUILD_TRACK) michael@13: +#else michael@13: if (what != RPMBUILD_PREP && what != RPMBUILD_RMBUILD && spec->buildSubdir) michael@13: +#endif michael@13: fprintf(fp, "cd %s\n", spec->buildSubdir); michael@13: michael@13: if (what == RPMBUILD_RMBUILD) { michael@13: @@ -215,6 +243,9 @@ michael@13: buildCmd = rpmExpand("%{___build_cmd}", " ", buildScript, NULL); michael@13: (void) poptParseArgvString(buildCmd, &argc, &argv); michael@13: michael@13: +#ifdef OPENPKG michael@13: + if (what != RPMBUILD_TRACK) michael@13: +#endif michael@13: rpmMessage(RPMMESS_NORMAL, _("Executing(%s): %s\n"), name, buildCmd); michael@13: if (!(child = fork())) { michael@13: michael@13: @@ -290,6 +323,12 @@ michael@13: /*@=boundsread@*/ michael@13: } michael@13: } else { michael@13: +#ifdef OPENPKG michael@13: + if ((what & RPMBUILD_TRACK) && michael@13: + (rc = doScript(spec, RPMBUILD_TRACK, NULL, NULL, test))) michael@13: + goto exit; michael@13: +#endif michael@13: + michael@13: if ((what & RPMBUILD_PREP) && michael@13: (rc = doScript(spec, RPMBUILD_PREP, NULL, NULL, test))) michael@13: goto exit; michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Unconditionally remove temporary files ("rpm-tmp.XXXXX") which michael@13: | were generated for the executed scripts. In OpenPKG we run the michael@13: | scripts in debug mode ("set -x") anyway, so we never need to michael@13: | see the whole generated script -- not even if it breaks. Instead michael@13: | we would just have temporary files staying around forever. michael@13: +--------------------------------------------------------------------------- michael@13: Index: build/build.c michael@13: --- build/build.c 4 Mar 2003 15:27:33 -0000 1.1.1.20 michael@13: +++ build/build.c 6 Feb 2004 15:37:57 -0000 1.4 michael@13: @@ -242,7 +273,9 @@ michael@13: michael@13: exit: michael@13: if (scriptName) { michael@13: +#ifndef OPENPKG michael@13: if (!rc) michael@13: +#endif michael@13: (void) Unlink(scriptName); michael@13: scriptName = _free(scriptName); michael@13: } michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | In OpenPKG we use per-package %{_sourcedir} and %{_specdir} michael@13: | definitions (macros have trailing ".../%{name}"). On removal michael@13: | of source(s) and .spec file, this per-package directory would michael@13: | be kept (usually /RPM/SRC//), because RPM does michael@13: | not know about this OpenPKG convention. So, let RPM try(!) to michael@13: | remove the two directories (if they are empty) and just ignore michael@13: | removal failures (if they are still not empty). michael@13: +--------------------------------------------------------------------------- michael@13: Index: build/build.c michael@13: --- build/build.c 4 Mar 2003 15:27:33 -0000 1.1.1.20 michael@13: +++ build/build.c 6 Feb 2004 15:37:57 -0000 1.4 michael@13: @@ -338,6 +377,21 @@ michael@13: if (what & RPMBUILD_RMSPEC) michael@13: (void) Unlink(spec->specFile); michael@13: michael@13: +#ifdef OPENPKG michael@13: + if (what & RPMBUILD_RMSOURCE) { michael@13: + const char *pn; michael@13: + pn = rpmGetPath("%{_sourcedir}", NULL); michael@13: + Rmdir(pn); /* ignore error, it is ok if it fails (usually with ENOTEMPTY) */ michael@13: + pn = _free(pn); michael@13: + } michael@13: + if (what & RPMBUILD_RMSPEC) { michael@13: + const char *pn; michael@13: + pn = rpmGetPath("%{_specdir}", NULL); michael@13: + Rmdir(pn); /* ignore error, it is ok if it fails (usually with ENOTEMPTY) */ michael@13: + pn = _free(pn); michael@13: + } michael@13: +#endif michael@13: + michael@13: exit: michael@13: if (rc && rpmlogGetNrecs() > 0) { michael@13: rpmMessage(RPMMESS_NORMAL, _("\n\nRPM build errors:\n")); michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Do not declare any files as %doc files by default. michael@13: +--------------------------------------------------------------------------- michael@13: Index: build/files.c michael@13: --- build/files.c 4 Mar 2003 17:04:13 -0000 1.1.1.20 michael@13: +++ build/files.c 6 Feb 2004 15:37:57 -0000 1.3 michael@13: @@ -1971,6 +1971,7 @@ michael@13: fl.defSpecdFlags = 0; michael@13: michael@13: fl.docDirCount = 0; michael@13: +#if 0 michael@13: fl.docDirs[fl.docDirCount++] = xstrdup("/usr/doc"); michael@13: fl.docDirs[fl.docDirCount++] = xstrdup("/usr/man"); michael@13: fl.docDirs[fl.docDirCount++] = xstrdup("/usr/info"); michael@13: @@ -1981,6 +1982,7 @@ michael@13: fl.docDirs[fl.docDirCount++] = rpmGetPath("%{_docdir}", NULL); michael@13: fl.docDirs[fl.docDirCount++] = rpmGetPath("%{_mandir}", NULL); michael@13: fl.docDirs[fl.docDirCount++] = rpmGetPath("%{_infodir}", NULL); michael@13: +#endif michael@13: michael@13: fl.fileList = NULL; michael@13: fl.fileListRecsAlloced = 0; michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Make sure the "Provides" headers are available for querying from the michael@13: | .src.rpm files. michael@13: +--------------------------------------------------------------------------- michael@13: Index: build/files.c michael@13: --- build/files.c 4 Mar 2003 17:04:13 -0000 1.1.1.20 michael@13: +++ build/files.c 6 Feb 2004 15:37:57 -0000 1.3 michael@13: @@ -2183,6 +2185,12 @@ michael@13: case RPMTAG_CHANGELOGTEXT: michael@13: case RPMTAG_URL: michael@13: case HEADER_I18NTABLE: michael@13: +#ifdef OPENPKG michael@13: + case RPMTAG_PROVIDENAME: michael@13: + case RPMTAG_PROVIDEVERSION: michael@13: + case RPMTAG_PROVIDEFLAGS: michael@13: + case RPMTAG_CLASS: michael@13: +#endif michael@13: if (ptr) michael@13: (void)headerAddEntry(spec->sourceHeader, tag, type, ptr, count); michael@13: /*@switchbreak@*/ break; michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Add support for splitted source directories, i.e., source files michael@13: | alternatively can be placed into the .spec directory and are picked michael@13: | up there, too. michael@13: +--------------------------------------------------------------------------- michael@13: Index: build/files.c michael@13: --- build/files.c 4 Mar 2003 17:04:13 -0000 1.1.1.20 michael@13: +++ build/files.c 6 Feb 2004 15:37:57 -0000 1.3 michael@13: @@ -2253,8 +2261,20 @@ michael@13: } michael@13: michael@13: { const char * sfn; michael@13: +#ifndef OPENPKG michael@13: sfn = rpmGetPath( ((srcPtr->flags & RPMBUILD_ISNO) ? "!" : ""), michael@13: "%{_sourcedir}/", srcPtr->source, NULL); michael@13: +#else michael@13: + const char *sfn2; michael@13: + sfn2 = rpmGetPath("%{_specdir}/", srcPtr->source, NULL); michael@13: + if (access(sfn2, F_OK) == 0) michael@13: + sfn = rpmGetPath( ((srcPtr->flags & RPMBUILD_ISNO) ? "!" : ""), michael@13: + "%{_specdir}/", srcPtr->source, NULL); michael@13: + else michael@13: + sfn = rpmGetPath( ((srcPtr->flags & RPMBUILD_ISNO) ? "!" : ""), michael@13: + "%{_sourcedir}/", srcPtr->source, NULL); michael@13: + sfn2 = _free(sfn2); michael@13: +#endif michael@13: appendLineStringBuf(sourceFiles, sfn); michael@13: sfn = _free(sfn); michael@13: } michael@13: @@ -2263,8 +2283,20 @@ michael@13: for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) { michael@13: for (srcPtr = pkg->icon; srcPtr != NULL; srcPtr = srcPtr->next) { michael@13: const char * sfn; michael@13: +#ifndef OPENPKG michael@13: sfn = rpmGetPath( ((srcPtr->flags & RPMBUILD_ISNO) ? "!" : ""), michael@13: "%{_sourcedir}/", srcPtr->source, NULL); michael@13: +#else michael@13: + const char *sfn2; michael@13: + sfn2 = rpmGetPath("%{_specdir}/", srcPtr->source, NULL); michael@13: + if (access(sfn2, F_OK) == 0) michael@13: + sfn = rpmGetPath( ((srcPtr->flags & RPMBUILD_ISNO) ? "!" : ""), michael@13: + "%{_specdir}/", srcPtr->source, NULL); michael@13: + else michael@13: + sfn = rpmGetPath( ((srcPtr->flags & RPMBUILD_ISNO) ? "!" : ""), michael@13: + "%{_sourcedir}/", srcPtr->source, NULL); michael@13: + sfn2 = _free(sfn2); michael@13: +#endif michael@13: appendLineStringBuf(sourceFiles, sfn); michael@13: sfn = _free(sfn); michael@13: } michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Add support for splitted source directories, i.e., source files michael@13: | alternatively can be placed into the .spec directory and are picked michael@13: | up there, too. michael@13: +--------------------------------------------------------------------------- michael@13: Index: build/parsePreamble.c michael@13: --- build/parsePreamble.c 3 Mar 2003 20:46:34 -0000 1.1.1.13 michael@13: +++ build/parsePreamble.c 6 Feb 2004 15:37:58 -0000 1.3 michael@13: @@ -366,7 +368,15 @@ michael@13: size_t nb, iconsize; michael@13: michael@13: /* XXX use rpmGenPath(rootdir, "%{_sourcedir}/", file) for icon path. */ michael@13: +#ifndef OPENPKG michael@13: fn = rpmGetPath("%{_sourcedir}/", file, NULL); michael@13: +#else michael@13: + fn = rpmGetPath("%{_specdir}/", file, NULL); michael@13: + if (access(fn, F_OK) == -1) { michael@13: + fn = _free(fn); michael@13: + fn = rpmGetPath("%{_sourcedir}/", file, NULL); michael@13: + } michael@13: +#endif michael@13: michael@13: fd = Fopen(fn, "r.ufdio"); michael@13: if (fd == NULL || Ferror(fd)) { michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | In OpenPKG, the RPM package contains own local versions of the michael@13: | "patch" and "tar" tools, so we cannot accept hard-coded names here. michael@13: | Instead we expand a variable to allow us to direct RPM to our tools. michael@13: | Additionally, pass option "-b" to patch(1) so it creates original michael@13: | files not only if a non-standard (not ".orig") suffix is used. michael@13: | Finally, add support for the GNU patch "-d" option for convenient michael@13: | changing into a subdirectory. michael@13: | Remove "unzip" support, because in OpenPKG there are less than michael@13: | a dozend packages requiring unpacking of .zip files. For these michael@13: | it is fully sufficient to explicitly require the "infozip" michael@13: | package (containing "unzip") and leaving the less portable michael@13: | "unzip" out of the bootstrap package. michael@13: +--------------------------------------------------------------------------- michael@13: Index: build/parsePrep.c michael@13: --- build/parsePrep.c 7 Aug 2002 14:20:45 -0000 1.1.1.10 michael@13: +++ build/parsePrep.c 6 Jun 2005 15:53:04 -0000 1.4 michael@13: @@ -66,7 +66,7 @@ michael@13: */ michael@13: /*@-boundswrite@*/ michael@13: /*@observer@*/ static char *doPatch(Spec spec, int c, int strip, const char *db, michael@13: - int reverse, int removeEmpties) michael@13: + int reverse, int removeEmpties, const char *subdir) michael@13: /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ michael@13: /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/ michael@13: { michael@13: @@ -76,6 +76,7 @@ michael@13: struct Source *sp; michael@13: rpmCompressedMagic compressed = COMPRESSED_NOT; michael@13: int urltype; michael@13: + const char *patcher; michael@13: michael@13: for (sp = spec->sources; sp != NULL; sp = sp->next) { michael@13: if ((sp->flags & RPMBUILD_ISPATCH) && (sp->num == c)) { michael@13: @@ -97,6 +106,10 @@ michael@13: strcat(args, "--suffix "); michael@13: strcat(args, db); michael@13: } michael@13: + if (subdir) { michael@13: + strcat(args, "-d "); michael@13: + strcat(args, subdir); michael@13: + } michael@13: if (reverse) { michael@13: strcat(args, " -R"); michael@13: } michael@13: @@ -124,6 +137,10 @@ michael@13: /*@notreached@*/ break; michael@13: } michael@13: michael@13: + patcher = rpmGetPath("%{_patchbin}", NULL); michael@13: + if (strcmp(patcher, "%{_patchbin}") == 0) michael@13: + patcher = "patch"; michael@13: + michael@13: if (compressed) { michael@13: const char *zipper = rpmGetPath( michael@13: (compressed == COMPRESSED_BZIP2 ? "%{_bzip2bin}" : "%{_gzipbin}"), michael@13: @@ -131,22 +148,23 @@ michael@13: michael@13: sprintf(buf, michael@13: "echo \"Patch #%d (%s):\"\n" michael@13: - "%s -d < %s | patch -p%d %s -s\n" michael@13: + "%s -d <%s | %s -p%d %s -s -b\n" michael@13: "STATUS=$?\n" michael@13: "if [ $STATUS -ne 0 ]; then\n" michael@13: " exit $STATUS\n" michael@13: "fi", michael@13: - c, /*@-unrecog@*/ (const char *) basename(fn), /*@=unrecog@*/ michael@13: + c, /*@-unrecog@*/ basename(fn), /*@=unrecog@*/ michael@13: zipper, michael@13: - fn, strip, args); michael@13: + fn, patcher, strip, args); michael@13: zipper = _free(zipper); michael@13: } else { michael@13: sprintf(buf, michael@13: "echo \"Patch #%d (%s):\"\n" michael@13: - "patch -p%d %s -s < %s", c, (const char *) basename(fn), michael@13: - strip, args, fn); michael@13: + "%s -p%d %s -s -b <%s", c, basename(fn), michael@13: + patcher, strip, args, fn); michael@13: } michael@13: michael@13: + patcher = _free(patcher); michael@13: urlfn = _free(urlfn); michael@13: return buf; michael@13: } michael@13: @@ -171,6 +189,7 @@ michael@13: struct Source *sp; michael@13: rpmCompressedMagic compressed = COMPRESSED_NOT; michael@13: int urltype; michael@13: + const char *tar; michael@13: michael@13: for (sp = spec->sources; sp != NULL; sp = sp->next) { michael@13: if ((sp->flags & RPMBUILD_ISSOURCE) && (sp->num == c)) { michael@13: @@ -228,6 +255,10 @@ michael@13: /*@notreached@*/ break; michael@13: } michael@13: michael@13: + tar = rpmGetPath("%{_tarbin}", NULL); michael@13: + if (strcmp(tar, "%{_tarbin}") == 0) michael@13: + tar = "tar"; michael@13: + michael@13: if (compressed != COMPRESSED_NOT) { michael@13: const char *zipper; michael@13: int needtar = 1; michael@13: @@ -240,6 +271,7 @@ michael@13: case COMPRESSED_BZIP2: michael@13: t = "%{_bzip2bin} -dc"; michael@13: break; michael@13: +#if 0 michael@13: case COMPRESSED_ZIP: michael@13: if (rpmIsVerbose() && !quietly) michael@13: t = "%{_unzipbin}"; michael@13: @@ -247,6 +279,7 @@ michael@13: t = "%{_unzipbin} -qq"; michael@13: needtar = 0; michael@13: break; michael@13: +#endif michael@13: } michael@13: zipper = rpmGetPath(t, NULL); michael@13: buf[0] = '\0'; michael@13: @@ -254,8 +287,13 @@ michael@13: zipper = _free(zipper); michael@13: *t++ = ' '; michael@13: t = stpcpy(t, fn); michael@13: - if (needtar) michael@13: - t = stpcpy( stpcpy( stpcpy(t, " | tar "), taropts), " -"); michael@13: + if (needtar) { michael@13: + t = stpcpy(t, " | "); michael@13: + t = stpcpy(t, tar); michael@13: + t = stpcpy(t, " "); michael@13: + t = stpcpy(t, taropts); michael@13: + t = stpcpy(t, " -"); michael@13: + } michael@13: t = stpcpy(t, michael@13: "\n" michael@13: "STATUS=$?\n" michael@13: @@ -264,11 +302,14 @@ michael@13: "fi"); michael@13: } else { michael@13: buf[0] = '\0'; michael@13: - t = stpcpy( stpcpy(buf, "tar "), taropts); michael@13: - *t++ = ' '; michael@13: + t = stpcpy(buf, tar); michael@13: + t = stpcpy(t, " "); michael@13: + t = stpcpy(t, taropts); michael@13: + t = stpcpy(t, " "); michael@13: t = stpcpy(t, fn); michael@13: } michael@13: michael@13: + tar = _free(tar); michael@13: urlfn = _free(urlfn); michael@13: return buf; michael@13: } michael@13: @@ -443,7 +484,7 @@ michael@13: /*@modifies spec->prep, rpmGlobalMacroContext, michael@13: fileSystem, internalState @*/ michael@13: { michael@13: - char *opt_b; michael@13: + char *opt_b, *opt_d; michael@13: int opt_P, opt_p, opt_R, opt_E; michael@13: char *s; michael@13: char buf[BUFSIZ], *bp; michael@13: @@ -453,6 +494,7 @@ michael@13: memset(patch_nums, 0, sizeof(patch_nums)); michael@13: opt_P = opt_p = opt_R = opt_E = 0; michael@13: opt_b = NULL; michael@13: + opt_d = NULL; michael@13: patch_index = 0; michael@13: michael@13: if (! strchr(" \t\n", line[6])) { michael@13: @@ -492,6 +534,15 @@ michael@13: spec->lineNum, spec->line); michael@13: return RPMERR_BADSPEC; michael@13: } michael@13: + } else if (!strcmp(s, "-d")) { michael@13: + /* orig suffix */ michael@13: + opt_d = strtok(NULL, " \t\n"); michael@13: + if (! opt_d) { michael@13: + rpmError(RPMERR_BADSPEC, michael@13: + _("line %d: Need arg to %%patch -d: %s\n"), michael@13: + spec->lineNum, spec->line); michael@13: + return RPMERR_BADSPEC; michael@13: + } michael@13: } else if (!strncmp(s, "-p", sizeof("-p")-1)) { michael@13: /* unfortunately, we must support -pX */ michael@13: if (! strchr(" \t\n", s[2])) { michael@13: @@ -530,14 +581,14 @@ michael@13: /* All args processed */ michael@13: michael@13: if (! opt_P) { michael@13: - s = doPatch(spec, 0, opt_p, opt_b, opt_R, opt_E); michael@13: + s = doPatch(spec, 0, opt_p, opt_b, opt_R, opt_E, opt_d); michael@13: if (s == NULL) michael@13: return RPMERR_BADSPEC; michael@13: appendLineStringBuf(spec->prep, s); michael@13: } michael@13: michael@13: for (x = 0; x < patch_index; x++) { michael@13: - s = doPatch(spec, patch_nums[x], opt_p, opt_b, opt_R, opt_E); michael@13: + s = doPatch(spec, patch_nums[x], opt_p, opt_b, opt_R, opt_E, opt_d); michael@13: if (s == NULL) michael@13: return RPMERR_BADSPEC; michael@13: appendLineStringBuf(spec->prep, s); michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Add support for splitted source directories, i.e., source files michael@13: | alternatively can be placed into the .spec directory and are picked michael@13: | up there, too. michael@13: +--------------------------------------------------------------------------- michael@13: Index: build/parsePrep.c michael@13: --- build/parsePrep.c 7 Aug 2002 14:20:45 -0000 1.1.1.10 michael@13: +++ build/parsePrep.c 6 Jun 2005 15:53:04 -0000 1.4 michael@13: @@ -87,7 +88,15 @@ michael@13: return NULL; michael@13: } michael@13: michael@13: +#ifndef OPENPKG michael@13: urlfn = rpmGetPath("%{_sourcedir}/", sp->source, NULL); michael@13: +#else michael@13: + urlfn = rpmGetPath("%{_specdir}/", sp->source, NULL); michael@13: + if (access(urlfn, F_OK) == -1) { michael@13: + urlfn = _free(urlfn); michael@13: + urlfn = rpmGetPath("%{_sourcedir}/", sp->source, NULL); michael@13: + } michael@13: +#endif michael@13: michael@13: args[0] = '\0'; michael@13: if (db) { michael@13: @@ -182,7 +201,15 @@ michael@13: return NULL; michael@13: } michael@13: michael@13: +#ifndef OPENPKG michael@13: urlfn = rpmGetPath("%{_sourcedir}/", sp->source, NULL); michael@13: +#else michael@13: + urlfn = rpmGetPath("%{_specdir}/", sp->source, NULL); michael@13: + if (access(urlfn, F_OK) == -1) { michael@13: + urlfn = _free(urlfn); michael@13: + urlfn = rpmGetPath("%{_sourcedir}/", sp->source, NULL); michael@13: + } michael@13: +#endif michael@13: michael@13: /*@-internalglobs@*/ /* FIX: shrug */ michael@13: taropts = ((rpmIsVerbose() && !quietly) ? "-xvvf" : "-xf"); michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Not everything on a system is RPM based (for instance OpenPKG is michael@13: | just an add-on to the system), so do not assume we can just require michael@13: | a package to provide "/bin/sh". michael@13: +--------------------------------------------------------------------------- michael@13: Index: build/parseScript.c michael@13: --- build/parseScript.c 23 Jun 2002 19:47:12 -0000 1.1.1.12 michael@13: +++ build/parseScript.c 30 Jan 2004 17:06:29 -0000 1.3 michael@13: @@ -261,6 +269,7 @@ michael@13: stripTrailingBlanksStringBuf(sb); michael@13: p = getStringBuf(sb); michael@13: michael@13: + if (progArgv[0] != NULL && strcmp(progArgv[0], "/bin/sh") != 0) michael@13: (void) addReqProv(spec, pkg->header, (tagflags | RPMSENSE_INTERP), progArgv[0], NULL, 0); michael@13: michael@13: /* Trigger script insertion is always delayed in order to */ michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Add support for splitted source directories, i.e., source files michael@13: | alternatively can be placed into the spec directory and are picked michael@13: | up there, too. michael@13: +--------------------------------------------------------------------------- michael@13: Index: build/spec.c michael@13: --- build/spec.c 4 Mar 2003 15:25:51 -0000 1.1.1.21 michael@13: +++ build/spec.c 30 Jan 2004 17:06:31 -0000 1.3 michael@13: @@ -334,7 +337,15 @@ michael@13: michael@13: if (tag != RPMTAG_ICON) { michael@13: /*@-nullpass@*/ /* LCL: varargs needs null annotate. */ michael@13: +#ifndef OPENPKG michael@13: const char *body = rpmGetPath("%{_sourcedir}/", p->source, NULL); michael@13: +#else michael@13: + const char *body = rpmGetPath("%{_specdir}/", p->source, NULL); michael@13: + if (access(body, F_OK) == -1) { michael@13: + body = _free(body); michael@13: + body = rpmGetPath("%{_sourcedir}/", p->source, NULL); michael@13: + } michael@13: +#endif michael@13: /*@=nullpass@*/ michael@13: michael@13: sprintf(buf, "%s%d", michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Do not build with warnings on, because we do no RPM development michael@13: | (so warnings are useless here), they cause some confusion inside michael@13: | Berkeley-DB and also slow down building. Instead, increase the michael@13: | optimization level. Additionally, disable static linking of RPM michael@13: | tools. Finally, use "shtool mkdir" as the "mkdir -p" fallback. michael@13: +--------------------------------------------------------------------------- michael@13: Index: configure.ac michael@13: --- configure.ac 2 Jul 2003 19:20:52 -0000 1.1.1.4 michael@13: +++ configure.ac 13 Sep 2006 13:39:07 -0000 michael@13: @@ -53,7 +53,7 @@ michael@13: AS=${AS-as} michael@13: AC_SUBST(AS) michael@13: if test "$ac_cv_prog_gcc" = yes; then michael@13: - CFLAGS="$CFLAGS -D_GNU_SOURCE -D_REENTRANT -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wno-char-subscripts" michael@13: + CFLAGS="$CFLAGS -O2 -D_GNU_SOURCE -D_REENTRANT" michael@13: fi michael@13: export CFLAGS michael@13: michael@13: @@ -142,6 +142,7 @@ michael@13: # just link it dynamically michael@13: LDFLAGS_STATIC="" michael@13: fi michael@13: +LDFLAGS_STATIC="" # OpenPKG wants dynamically linked RPM tools michael@13: LDFLAGS_STATIC="${LDFLAGS} ${LDFLAGS_STATIC}" # libtool format michael@13: AC_MSG_RESULT($LDFLAGS_STATIC) michael@13: AC_SUBST(LDFLAGS_STATIC) michael@13: @@ -201,7 +202,7 @@ michael@13: michael@13: if test X"$MKDIR_P" = X0 ; then michael@13: AC_MSG_RESULT(no) michael@13: - MKDIR_P="`echo ${prefix}/lib/rpm/mkinstalldirs`" michael@13: + MKDIR_P="@l_prefix@/lib/openpkg/shtool mkdir -f -p -m 755" michael@13: else michael@13: AC_MSG_RESULT(yes) michael@13: fi michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Disable the use of the internal zlib library, because michael@13: | we build against an external one. michael@13: +--------------------------------------------------------------------------- michael@13: Index: configure.ac michael@13: --- configure.ac 2 Jul 2003 19:20:52 -0000 1.1.1.4 michael@13: +++ configure.ac 13 Sep 2006 13:39:09 -0000 michael@13: @@ -310,7 +311,7 @@ michael@13: WITH_ZLIB_SUBDIR= michael@13: WITH_ZLIB_INCLUDE= michael@13: WITH_ZLIB_LIB= michael@13: -if test -d zlib ; then michael@13: +if false; then michael@13: WITH_ZLIB_SUBDIR=zlib michael@13: addlib \${top_builddir}/zlib michael@13: WITH_ZLIB_INCLUDE="-I\${top_srcdir}/${WITH_ZLIB_SUBDIR}" michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Disable unnecessary INCPATH checks, because in OpenPKG the michael@13: | externally used libraries are all explicitly given. And they just michael@13: | would make RPM pick up things which we do not want to be picked up. michael@13: +--------------------------------------------------------------------------- michael@13: Index: configure.ac michael@13: --- configure.ac 2 Jul 2003 19:20:52 -0000 1.1.1.4 michael@13: +++ configure.ac 13 Sep 2006 13:39:11 -0000 michael@13: @@ -324,38 +325,38 @@ michael@13: michael@13: localdone= michael@13: michael@13: -dirs=$prefix michael@13: -if test "$cross_compiling" != "yes"; then michael@13: - dirs="$dirs /usr/local" michael@13: -fi michael@13: -for dir in $dirs michael@13: -do michael@13: - case $dir in michael@13: - NONE|/usr) continue;; michael@13: - /usr/local) michael@13: - if test X$localdone != X ; then continue; fi michael@13: - localdone="$dir" michael@13: - ;; michael@13: - esac michael@13: - michael@13: - AC_MSG_CHECKING(for $dir/lib in LIBS) michael@13: - if test -d $dir/lib 2> /dev/null ; then michael@13: - addlib $dir/lib michael@13: - AC_MSG_RESULT(yes) michael@13: - else michael@13: - AC_MSG_RESULT(no) michael@13: - fi michael@13: - michael@13: - AC_MSG_CHECKING(for $dir/include in INCPATH) michael@13: - if test -d $dir/include 2>/dev/null ; then michael@13: - if [ "$dir" != "/usr/local" ] ; then michael@13: - INCPATH="$INCPATH -I$dir/include" michael@13: - fi michael@13: - AC_MSG_RESULT(yes) michael@13: - else michael@13: - AC_MSG_RESULT(no) michael@13: - fi michael@13: -done michael@13: +dnl dirs=$prefix michael@13: +dnl if test "$cross_compiling" != "yes"; then michael@13: +dnl dirs="$dirs /usr/local" michael@13: +dnl fi michael@13: +dnl for dir in $dirs michael@13: +dnl do michael@13: +dnl case $dir in michael@13: +dnl NONE|/usr) continue;; michael@13: +dnl /usr/local) michael@13: +dnl if test X$localdone != X ; then continue; fi michael@13: +dnl localdone="$dir" michael@13: +dnl ;; michael@13: +dnl esac michael@13: +dnl michael@13: +dnl AC_MSG_CHECKING(for $dir/lib in LIBS) michael@13: +dnl if test -d $dir/lib 2> /dev/null ; then michael@13: +dnl addlib $dir/lib michael@13: +dnl AC_MSG_RESULT(yes) michael@13: +dnl else michael@13: +dnl AC_MSG_RESULT(no) michael@13: +dnl fi michael@13: +dnl michael@13: +dnl AC_MSG_CHECKING(for $dir/include in INCPATH) michael@13: +dnl if test -d $dir/include 2>/dev/null ; then michael@13: +dnl if test "$dir" != "/usr/local"; then michael@13: +dnl INCPATH="$INCPATH -I$dir/include" michael@13: +dnl fi michael@13: +dnl AC_MSG_RESULT(yes) michael@13: +dnl else michael@13: +dnl AC_MSG_RESULT(no) michael@13: +dnl fi michael@13: +dnl done michael@13: michael@13: AC_MSG_CHECKING(for /usr/ucblib in LIBS) michael@13: if test -d /usr/ucblib ; then michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Adjust paths for OpenPKG filesystem layout. michael@13: +--------------------------------------------------------------------------- michael@13: Index: configure.ac michael@13: --- configure.ac 2 Jul 2003 19:20:52 -0000 1.1.1.4 michael@13: +++ configure.ac 13 Sep 2006 13:39:12 -0000 michael@13: @@ -1200,12 +1202,12 @@ michael@13: AC_SUBST(LOCALEDIR) michael@13: LIBDIR="`echo $libdir | sed 's-/lib$-/%{_lib}-'`" michael@13: AC_SUBST(LIBDIR) michael@13: -RPMCONFIGDIR="`echo ${usrprefix}/lib/rpm`" michael@13: +RPMCONFIGDIR="@l_prefix@/lib/openpkg" michael@13: AC_DEFINE_UNQUOTED(RPMCONFIGDIR, "$RPMCONFIGDIR", michael@13: [Full path to rpm global configuration directory (usually /usr/lib/rpm)]) michael@13: AC_SUBST(RPMCONFIGDIR) michael@13: michael@13: -SYSCONFIGDIR="`echo /etc/rpm`" michael@13: +SYSCONFIGDIR="@l_prefix@/etc/openpkg" michael@13: AC_DEFINE_UNQUOTED(SYSCONFIGDIR, "$SYSCONFIGDIR", michael@13: [Full path to rpm system configuration directory (usually /etc/rpm)]) michael@13: AC_SUBST(SYSCONFIGDIR) michael@13: @@ -1215,17 +1217,17 @@ michael@13: [Colon separated paths of macro files to read.]) michael@13: AC_SUBST(MACROFILES) michael@13: michael@13: -LIBRPMRC_FILENAME="${RPMCONFIGDIR}/rpmrc" michael@13: +LIBRPMRC_FILENAME="${SYSCONFIGDIR}/rpmrc" michael@13: AC_DEFINE_UNQUOTED(LIBRPMRC_FILENAME, "$LIBRPMRC_FILENAME", michael@13: [Full path to rpmrc configuration file (usually /usr/lib/rpm/rpmrc)]) michael@13: AC_SUBST(LIBRPMRC_FILENAME) michael@13: michael@13: -VENDORRPMRC_FILENAME="${RPMCONFIGDIR}/${RPMCANONVENDOR}/rpmrc" michael@13: +VENDORRPMRC_FILENAME="${SYSCONFIGDIR}/${RPMCANONVENDOR}/rpmrc" michael@13: AC_DEFINE_UNQUOTED(VENDORRPMRC_FILENAME, "$VENDORRPMRC_FILENAME", michael@13: [Full path to vendor rpmrc configuration file (usually /usr/lib/rpm/vendor/rpmrc)]) michael@13: AC_SUBST(VENDORRPMRC_FILENAME) michael@13: michael@13: -LIBRPMALIAS_FILENAME="${RPMCONFIGDIR}/rpmpopt-${VERSION}" michael@13: +LIBRPMALIAS_FILENAME="${RPMCONFIGDIR}/rpmpopt" michael@13: AC_DEFINE_UNQUOTED(LIBRPMALIAS_FILENAME, "$LIBRPMALIAS_FILENAME", michael@13: [Full path to rpmpopt configuration file (usually /usr/lib/rpm/rpmpopt)]) michael@13: AC_SUBST(LIBRPMALIAS_FILENAME) michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | If running as "susr", do not unpack source RPM packages with "susr" michael@13: | file ownerships as the OpenPKG Set-UID wrapper switches from "musr" michael@13: | to "susr" on "openpkg rpm -Uvh *.src.rpm". As a result the installed michael@13: | files could be never removed again by "musr". It is more consistent michael@13: | to always unpack as "musr" if possible. michael@13: +--------------------------------------------------------------------------- michael@13: Index: lib/psm.c michael@13: --- lib/psm.c 5 Jun 2003 12:43:18 -0000 1.1.1.6 michael@13: +++ lib/psm.c 13 Sep 2006 13:39:15 -0000 michael@13: @@ -314,6 +314,20 @@ michael@13: michael@13: fi->uid = getuid(); michael@13: fi->gid = getgid(); michael@13: +#ifdef OPENPKG michael@13: + if (fi->uid == 0) { michael@13: + char *muid_str; michael@13: + char *mgid_str; michael@13: + uid_t *muid; michael@13: + gid_t *mgid; michael@13: + if ((muid_str = rpmExpand("%{l_muid}", NULL)) != NULL) michael@13: + if ((muid = (uid_t)strtol(muid_str, (char **)NULL, 10)) > 0) michael@13: + fi->uid = muid; michael@13: + if ((mgid_str = rpmExpand("%{l_mgid}", NULL)) != NULL) michael@13: + if ((mgid = (gid_t)strtol(mgid_str, (char **)NULL, 10)) > 0) michael@13: + fi->gid = mgid; michael@13: + } michael@13: +#endif michael@13: fi->astriplen = 0; michael@13: fi->striplen = 0; michael@13: michael@13: @@ -352,6 +366,9 @@ michael@13: rpmrc = RPMRC_FAIL; michael@13: goto exit; michael@13: } michael@13: +#ifdef OPENPKG michael@13: + chown(_sourcedir, fi->uid, fi->gid); michael@13: +#endif michael@13: michael@13: _specdir = rpmGenPath(rpmtsRootDir(ts), "%{_specdir}", ""); michael@13: rpmrc = rpmMkdirPath(_specdir, "specdir"); michael@13: @@ -359,6 +376,9 @@ michael@13: rpmrc = RPMRC_FAIL; michael@13: goto exit; michael@13: } michael@13: +#ifdef OPENPKG michael@13: + chown(_specdir, fi->uid, fi->gid); michael@13: +#endif michael@13: michael@13: /* Build dnl/dil with {_sourcedir, _specdir} as values. */ michael@13: if (i < fi->fc) { michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | RPM has two platform id canonicalizations: hard-coded ones in michael@13: | the "rpm" program and defined ones in the rpmrc files. The michael@13: | hard-coded ones make the defined ones inconsistent. Additionally, michael@13: | in OpenPKG we know exactly what we do. So, disable the hard-coded michael@13: | canonicalizations and use only the defined ones. The only thing we michael@13: | do inside RPM is to reduce the platform version to major and minor michael@13: | version numbers in order to simplify the "rpmrc" files. Then, RPM michael@13: | allows to read the platform from an external program. Adjust the michael@13: | hard-coded path to this program and allow it to be overridden with michael@13: | the macro %{__platform}. Finally, change the default definition of michael@13: | %{_host} to not contain the vendor stuff to more conform to what michael@13: | %{_target} usually is defined to and what we are using throughout michael@13: | OpenPKG, too. michael@13: +--------------------------------------------------------------------------- michael@13: Index: lib/rpmrc.c michael@13: --- lib/rpmrc.c 4 Jun 2003 18:18:45 -0000 1.1.1.25 michael@13: +++ lib/rpmrc.c 6 Jun 2005 15:53:06 -0000 1.3 michael@13: @@ -27,7 +27,7 @@ michael@13: const char * macrofiles = MACROFILES; michael@13: michael@13: /*@observer@*/ /*@unchecked@*/ michael@13: -static const char * platform = "/etc/rpm/platform"; michael@13: +static const char * platform = "@l_prefix@/etc/openpkg/platform"; michael@13: /*@only@*/ /*@relnull@*/ /*@unchecked@*/ michael@13: static const char ** platpat = NULL; michael@13: /*@unchecked@*/ michael@13: @@ -861,7 +861,11 @@ michael@13: michael@13: platpat = xrealloc(platpat, (nplatpat + 2) * sizeof(*platpat)); michael@13: /*@-onlyunqglobaltrans@*/ michael@13: +#ifdef OPENPKG michael@13: + platpat[nplatpat] = rpmExpand("%{_host_cpu}-%{_host_os}", NULL); michael@13: +#else michael@13: platpat[nplatpat] = rpmExpand("%{_host_cpu}-%{_host_vendor}-%{_host_os}", (gnu && *gnu ? "-" : NULL), gnu, NULL); michael@13: +#endif michael@13: nplatpat++; michael@13: platpat[nplatpat] = NULL; michael@13: /*@=onlyunqglobaltrans@*/ michael@13: @@ -1055,14 +1059,35 @@ michael@13: /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ michael@13: /*@modifies *arch, *os, rpmGlobalMacroContext, fileSystem, internalState @*/ michael@13: { michael@13: +#ifdef OPENPKG michael@13: + static struct utsname un_real; michael@13: + /* utsname fields on some platforms (like HP-UX) are very small michael@13: + (about 8 characters). This is too small for OpenPKG, so cheat! */ michael@13: + static struct { michael@13: + char sysname[32]; michael@13: + char nodename[32]; michael@13: + char release[32]; michael@13: + char version[32]; michael@13: + char machine[32]; michael@13: + } un; michael@13: +#else michael@13: static struct utsname un; michael@13: +#endif michael@13: static int gotDefaults = 0; michael@13: char * chptr; michael@13: canonEntry canon; michael@13: int rc; michael@13: michael@13: while (!gotDefaults) { michael@13: +#ifdef OPENPKG michael@13: + const char *cp; michael@13: + cp = rpmExpand("%{?__platform}", NULL); michael@13: + if (cp == NULL || cp[0] == '\0') michael@13: + cp = platform; michael@13: + if (!rpmPlatform(cp)) { michael@13: +#else michael@13: if (!rpmPlatform(platform)) { michael@13: +#endif michael@13: const char * s; michael@13: s = rpmExpand("%{_host_cpu}", NULL); michael@13: if (s) { michael@13: @@ -1079,9 +1104,44 @@ michael@13: gotDefaults = 1; michael@13: break; michael@13: } michael@13: +#ifdef OPENPKG michael@13: + rc = uname(&un_real); michael@13: + strncpy(un.sysname, un_real.sysname, sizeof(un.sysname)); un.sysname [sizeof(un.sysname)-1] = '\0'; michael@13: + strncpy(un.nodename, un_real.nodename, sizeof(un.nodename)); un.nodename[sizeof(un.nodename)-1] = '\0'; michael@13: + strncpy(un.release, un_real.release, sizeof(un.release)); un.release [sizeof(un.release)-1] = '\0'; michael@13: + strncpy(un.version, un_real.version, sizeof(un.version)); un.version [sizeof(un.version)-1] = '\0'; michael@13: + strncpy(un.machine, un_real.machine, sizeof(un.machine)); un.machine [sizeof(un.machine)-1] = '\0'; michael@13: +#else michael@13: rc = uname(&un); michael@13: +#endif michael@13: if (rc < 0) return; michael@13: michael@13: +#ifdef OPENPKG michael@13: + { michael@13: + char *cp; michael@13: + char *cpR; michael@13: + int n; michael@13: + cpR = un.release; michael@13: + if ((n = strcspn(cpR, "0123456789")) > 0) michael@13: + cpR += n; michael@13: + if ((n = strspn(cpR, "0123456789.")) > 0) { michael@13: + /* terminate after "N.N.N...." prefix */ michael@13: + cpR[n] = '\0'; michael@13: + /* shorten to "N.N" if longer */ michael@13: + if ((cp = strchr(cpR, '.')) != NULL) { michael@13: + if ((cp = strchr(cp+1, '.')) != NULL) michael@13: + *cp = '\0'; michael@13: + } michael@13: + strcat(un.sysname, cpR); michael@13: + } michael@13: + /* fix up machine hardware name containing white-space as it michael@13: + * happens to be on Power Macs running MacOS X michael@13: + */ michael@13: + if (!strncmp(un.machine, "Power Macintosh", 15)) { michael@13: + sprintf(un.machine, "powerpc"); michael@13: + } michael@13: + } michael@13: +#else /* OPENPKG */ michael@13: #if !defined(__linux__) michael@13: #ifdef SNI michael@13: /* USUALLY un.sysname on sinix does start with the word "SINIX" michael@13: @@ -1298,6 +1358,7 @@ michael@13: } michael@13: } michael@13: # endif michael@13: +#endif /* OPENPKG */ michael@13: michael@13: /* the uname() result goes through the arch_canon table */ michael@13: canon = lookupInCanonTable(un.machine, michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | In verbose file listing output, give the owner and group fields more michael@13: | width and at the same time reduce the nlink and size fields to more michael@13: | typical sizes within OpenPKG. michael@13: +--------------------------------------------------------------------------- michael@13: Index: lib/query.c michael@13: --- lib/query.c 4 Jun 2003 18:24:14 -0000 1.1.1.13 michael@13: +++ lib/query.c 22 Jan 2004 21:42:24 -0000 1.2 michael@13: @@ -33,7 +33,11 @@ michael@13: /*@modifies *te @*/ michael@13: { michael@13: char sizefield[15]; michael@13: +#ifdef OPENPKG michael@13: + char ownerfield[13+1], groupfield[13+1]; michael@13: +#else michael@13: char ownerfield[8+1], groupfield[8+1]; michael@13: +#endif michael@13: char timefield[100]; michael@13: time_t when = mtime; /* important if sizeof(int_32) ! sizeof(time_t) */ michael@13: struct tm * tm; michael@13: @@ -58,7 +62,11 @@ michael@13: groupfield[sizeof(groupfield)-1] = '\0'; michael@13: michael@13: /* this is normally right */ michael@13: +#ifdef OPENPKG michael@13: + sprintf(sizefield, "%8u", size); michael@13: +#else michael@13: sprintf(sizefield, "%12u", size); michael@13: +#endif michael@13: michael@13: /* this knows too much about dev_t */ michael@13: michael@13: @@ -98,7 +106,11 @@ michael@13: (void)strftime(timefield, sizeof(timefield) - 1, fmt, tm); michael@13: } michael@13: michael@13: +#ifdef OPENPKG michael@13: + sprintf(te, "%s %d %-13s %-13s %8s %s %s", perms, michael@13: +#else michael@13: sprintf(te, "%s %4d %-8s%-8s %10s %s %s", perms, michael@13: +#endif michael@13: (int)nlink, ownerfield, groupfield, sizefield, timefield, namefield); michael@13: perms = _free(perms); michael@13: } michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Enable the exlusion of "%doc" files by default. michael@13: | Disable "check-files" feature, because it is useless in OpenPKG michael@13: | (we consistently use BuildRoot and our %files lists are fully michael@13: | autogenerated) and just makes problems on bootstrapping. michael@13: | Provide the possibility to optionally re-enable the old michael@13: | RPM 4.0.2 way of RPM database operation by defining the michael@13: | macro %{_rpmdb_private}. This is important for easily fixing michael@13: | corrupted/hanging RPM database (on upgrades, etc) or if you michael@13: | permanently have to operate RPM on a NFS filesystem where no michael@13: | rpc.lockd(8) support is available. michael@13: | Additionally, do not override the "_host_xx" macros because their michael@13: | value (derived from /etc/openpkg/platform) is already michael@13: | correctly set internally. michael@13: | Additionally, provide default macros for the %track and %test michael@13: | section expansion. michael@13: | Finally, provide default for introduced variable michael@13: | %{_force_oldpackage}, which, if non-zero, automatically enforces michael@13: | --oldpackage on all upgrade operations (this is useful on michael@13: | mass-upgrades from OpenPKG-CURRENT to OpenPKG-RELEASE). michael@13: +--------------------------------------------------------------------------- michael@13: Index: macros.in michael@13: --- macros.in 2 Jul 2003 19:20:52 -0000 1.1.1.14 michael@13: +++ macros.in 30 Jan 2004 17:06:27 -0000 1.3 michael@13: @@ -1,7 +1,7 @@ michael@13: #/*! \page config_macros Default configuration: @RPMCONFIGDIR@/macros michael@13: # \verbatim michael@13: # michael@13: -# $Id: macros.in,v 1.138.2.1 2003/07/02 19:14:06 jbj Exp $ michael@13: +# $Id: macros.in,v 1.2 2004/01/22 21:42:09 rse Exp $ michael@13: # michael@13: # This is a global RPM configuration file. All changes made here will michael@13: # be lost when the rpm package is upgraded. Any per-system configuration michael@13: @@ -206,7 +206,7 @@ michael@13: michael@13: # Boolean (i.e. 1 == "yes", 0 == "no") that controls whether files michael@13: # marked as %doc should be installed. michael@13: -#%_excludedocs michael@13: +%_excludedocs 1 michael@13: michael@13: # The port and machine name of a FTP proxy host running TIS firewall. michael@13: # michael@13: @@ -305,7 +305,7 @@ michael@13: # Returns list of unpackaged files, i.e. files in $RPM_BUILD_ROOT not packaged. michael@13: # michael@13: # Note: Disable (by commenting out) for legacy compatibility. michael@13: -%__check_files @RPMCONFIGDIR@/check-files %{buildroot} michael@13: +#%__check_files @RPMCONFIGDIR@/check-files %{buildroot} michael@13: michael@13: # michael@13: # Should unpackaged files in a build root terminate a build? michael@13: @@ -449,7 +449,7 @@ michael@13: michael@13: # Use a CDB database model for concurrent access. michael@13: # XXX Add "private" here for legacy interoperation transiting to glibc+nptl. michael@13: -%__dbi_cdb create cdb mpool mp_mmapsize=16Mb mp_size=1Mb michael@13: +%__dbi_cdb create cdb mpool mp_mmapsize=16Mb mp_size=1Mb %{?_rpmdb_private:private} michael@13: michael@13: %__dbi_other %{?_tmppath:tmpdir=%{_tmppath}} %{?__dbi_cdb} michael@13: michael@13: @@ -618,6 +618,10 @@ michael@13: # If non-zero, all erasures will be automagically repackaged. michael@13: %_repackage_all_erasures 0 michael@13: michael@13: +# If non-zero, automatically enforce --oldpackage for all upgrade operations michael@13: +# (useful on mass-upgrades from OpenPKG-CURRENT to OpenPKG-RELEASE) michael@13: +%_force_oldpackage 0 michael@13: + michael@13: # Verify digest/signature flags for various rpm modes: michael@13: # 1 --nohdrchk if set, don't check rpmdb headers michael@13: # michael@13: @@ -870,6 +874,26 @@ michael@13: #%{__spec_clean_post}\ michael@13: #%{nil} michael@13: michael@13: +%__spec_track_shell %{___build_shell} michael@13: +%__spec_track_args %{___build_args} michael@13: +%__spec_track_cmd %{___build_cmd} michael@13: +%__spec_track_pre %{___build_pre} michael@13: +%__spec_track_body %{___build_body} michael@13: +%__spec_track_post %{___build_post} michael@13: +%__spec_track_template #!%{__spec_track_shell}\ michael@13: +%{__spec_track_pre}\ michael@13: +%{nil} michael@13: + michael@13: +%__spec_test_shell %{___build_shell} michael@13: +%__spec_test_args %{___build_args} michael@13: +%__spec_test_cmd %{___build_cmd} michael@13: +%__spec_test_pre %{___build_pre} michael@13: +%__spec_test_body %{___build_body} michael@13: +%__spec_test_post %{___build_post} michael@13: +%__spec_test_template #!%{__spec_test_shell}\ michael@13: +%{__spec_test_pre}\ michael@13: +%{nil} michael@13: + michael@13: %__spec_rmbuild_shell %{___build_shell} michael@13: %__spec_rmbuild_args %{___build_args} michael@13: %__spec_rmbuild_cmd %{___build_cmd} michael@13: @@ -929,11 +953,11 @@ michael@13: %_build_cpu %{_host_cpu} michael@13: %_build_vendor %{_host_vendor} michael@13: %_build_os %{_host_os} michael@13: -%_host @host@ michael@13: -%_host_alias @host_alias@%{nil} michael@13: -%_host_cpu @host_cpu@ michael@13: -%_host_vendor @host_vendor@ michael@13: -%_host_os @host_os@ michael@13: +#%_host @host@ michael@13: +#%_host_alias @host_alias@%{nil} michael@13: +#%_host_cpu @host_cpu@ michael@13: +#%_host_vendor @host_vendor@ michael@13: +#%_host_os @host_os@ michael@13: %_target %{_host} michael@13: %_target_alias %{_host_alias} michael@13: %_target_cpu %{_host_cpu} michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Adjust path for OpenPKG filesystem layout. michael@13: +--------------------------------------------------------------------------- michael@13: Index: scripts/Makefile.am michael@13: --- scripts/Makefile.am 20 Jun 2003 19:04:49 -0000 1.1.1.11 michael@13: +++ scripts/Makefile.am 22 Jan 2004 21:42:34 -0000 1.2 michael@13: @@ -22,7 +22,7 @@ michael@13: michael@13: all: michael@13: michael@13: -configdir = ${prefix}/lib/rpm michael@13: +configdir = ${prefix}/lib/openpkg michael@13: config_SCRIPTS = \ michael@13: brp-compress brp-python-bytecompile brp-redhat \ michael@13: brp-strip brp-strip-comment-note \ michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Adjust path for OpenPKG filesystem layout. michael@13: +--------------------------------------------------------------------------- michael@13: Index: scripts/Makefile.in michael@13: --- scripts/Makefile.in 16 Jul 2003 17:05:49 -0000 1.1.1.14 michael@13: +++ scripts/Makefile.in 22 Jan 2004 21:42:34 -0000 1.2 michael@13: @@ -273,7 +273,7 @@ michael@13: michael@13: installprefix = $(DESTDIR) michael@13: michael@13: -configdir = ${prefix}/lib/rpm michael@13: +configdir = ${prefix}/lib/openpkg michael@13: config_SCRIPTS = \ michael@13: brp-compress brp-python-bytecompile brp-redhat \ michael@13: brp-strip brp-strip-comment-note \ michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Use GNU libtool's weaker -static (link with own static libraries) michael@13: | instead of the strong -all-static (link even with static libc, etc), michael@13: | because OpenPKG does not need to be fully static. michael@13: | Additionally, adjust the path to file(1)'s "magic" file. michael@13: +--------------------------------------------------------------------------- michael@13: Index: file/Makefile.am michael@13: --- file/Makefile.am 24 Jan 2003 19:41:56 -0000 1.1.1.1 michael@13: +++ file/Makefile.am 22 Jan 2004 21:42:21 -0000 1.2 michael@13: @@ -36,7 +36,7 @@ michael@13: #MAGIC = @datadir@/magic michael@13: #data_DATA = magic magic.mime magic.mgc magic.mime.mgc michael@13: michael@13: -pkglibdir = @prefix@/lib/rpm michael@13: +pkglibdir = @prefix@/lib/openpkg michael@13: pkglib_DATA = magic magic.mime magic.mgc magic.mime.mgc michael@13: MAGIC = $(pkglibdir)/magic michael@13: CPPFLAGS = -DMAGIC='"$(MAGIC)"' michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Use GNU libtool's weaker -static (link with own static libraries) michael@13: | instead of the strong -all-static (link even with static libc, etc), michael@13: | because OpenPKG does not need to be fully static. michael@13: | Additionally, adjust the path to file(1)'s "magic" file. michael@13: +--------------------------------------------------------------------------- michael@13: Index: file/Makefile.in michael@13: --- file/Makefile.in 16 Jul 2003 17:05:23 -0000 1.1.1.2 michael@13: +++ file/Makefile.in 22 Jan 2004 21:42:22 -0000 1.2 michael@13: @@ -39,7 +39,7 @@ michael@13: michael@13: #MAGIC = @datadir@/magic michael@13: #data_DATA = magic magic.mime magic.mgc magic.mime.mgc michael@13: -pkglibdir = @prefix@/lib/rpm michael@13: +pkglibdir = @prefix@/lib/openpkg michael@13: ACLOCAL = @ACLOCAL@ michael@13: AMDEP_FALSE = @AMDEP_FALSE@ michael@13: AMDEP_TRUE = @AMDEP_TRUE@ michael@13: @@ -159,7 +159,7 @@ michael@13: noinst_PROGRAMS = file michael@13: michael@13: file_SOURCES = file.c michael@13: -file_LDFLAGS = -all-static michael@13: +file_LDFLAGS = -static michael@13: file_LDADD = libfmagic.la michael@13: michael@13: man_MAGIC = magic.@fsect@ michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Use GNU libtool's weaker -static (link with own static libraries) michael@13: | instead of the strong -all-static (link even with static libc, etc), michael@13: | because OpenPKG does not need to be fully static. michael@13: | Additionally, disable the building of gettext stuff we don't need. michael@13: +--------------------------------------------------------------------------- michael@13: Index: popt/Makefile.am michael@13: --- popt/Makefile.am 6 Mar 2003 23:16:43 -0000 1.1.1.9 michael@13: +++ popt/Makefile.am 22 Jan 2004 21:42:28 -0000 1.2 michael@13: @@ -9,7 +9,7 @@ michael@13: po/*.in po/*.po po/popt.pot \ michael@13: popt.ps michael@13: michael@13: -SUBDIRS = intl po michael@13: +SUBDIRS = intl michael@13: michael@13: INCLUDES = -I. -I$(top_srcdir) michael@13: michael@13: @@ -17,13 +17,13 @@ michael@13: michael@13: noinst_PROGRAMS = test1 test2 test3 michael@13: test1_SOURCES = test1.c michael@13: -test1_LDFLAGS = -all-static michael@13: +test1_LDFLAGS = -static michael@13: test1_LDADD = $(usrlib_LTLIBRARIES) michael@13: test2_SOURCES = test2.c michael@13: -test2_LDFLAGS = -all-static michael@13: +test2_LDFLAGS = -static michael@13: test2_LDADD = $(usrlib_LTLIBRARIES) michael@13: test3_SOURCES = test3.c michael@13: -test3_LDFLAGS = -all-static michael@13: +test3_LDFLAGS = -static michael@13: test3_LDADD = $(usrlib_LTLIBRARIES) michael@13: michael@13: noinst_SCRIPTS = testit.sh michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Use GNU libtool's weaker -static (link with own static libraries) michael@13: | instead of the strong -all-static (link even with static libc, etc), michael@13: | because OpenPKG does not need to be fully static. michael@13: | Additionally, disable the building of gettext stuff we don't need. michael@13: +--------------------------------------------------------------------------- michael@13: Index: popt/Makefile.in michael@13: --- popt/Makefile.in 16 Jul 2003 17:04:49 -0000 1.1.1.14 michael@13: +++ popt/Makefile.in 22 Jan 2004 21:42:28 -0000 1.2 michael@13: @@ -163,7 +163,7 @@ michael@13: popt.ps michael@13: michael@13: michael@13: -SUBDIRS = intl po michael@13: +SUBDIRS = intl michael@13: michael@13: INCLUDES = -I. -I$(top_srcdir) michael@13: michael@13: @@ -171,13 +171,13 @@ michael@13: michael@13: noinst_PROGRAMS = test1 test2 test3 michael@13: test1_SOURCES = test1.c michael@13: -test1_LDFLAGS = -all-static michael@13: +test1_LDFLAGS = -static michael@13: test1_LDADD = $(usrlib_LTLIBRARIES) michael@13: test2_SOURCES = test2.c michael@13: -test2_LDFLAGS = -all-static michael@13: +test2_LDFLAGS = -static michael@13: test2_LDADD = $(usrlib_LTLIBRARIES) michael@13: test3_SOURCES = test3.c michael@13: -test3_LDFLAGS = -all-static michael@13: +test3_LDFLAGS = -static michael@13: test3_LDADD = $(usrlib_LTLIBRARIES) michael@13: michael@13: noinst_SCRIPTS = testit.sh michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Revert back to the old behaviour of passing to "exec" programs an michael@13: | extra "--" argument to separate options and arguments. Additionally, michael@13: | allow the "!#:+" constructs to be used multiple times and then each michael@13: | time eat another argument (instead of just eating an argument once michael@13: | and expanding this multiple times). michael@13: +--------------------------------------------------------------------------- michael@13: Index: popt/popt.c michael@13: --- popt/popt.c 22 Aug 2002 14:17:44 -0000 1.1.1.12 michael@13: +++ popt/popt.c 22 Jan 2004 21:42:28 -0000 1.2 michael@13: @@ -400,9 +400,7 @@ michael@13: } michael@13: michael@13: if (con->leftovers != NULL && con->numLeftovers > 0) { michael@13: -#if 0 michael@13: argv[argc++] = "--"; michael@13: -#endif michael@13: memcpy(argv + argc, con->leftovers, sizeof(*argv) * con->numLeftovers); michael@13: argc += con->numLeftovers; michael@13: } michael@13: @@ -580,10 +578,8 @@ michael@13: if (!(s[0] == '#' && s[1] == ':' && s[2] == '+')) michael@13: /*@switchbreak@*/ break; michael@13: /* XXX Make sure that findNextArg deletes only next arg. */ michael@13: - if (a == NULL) { michael@13: if ((a = findNextArg(con, 1, 1)) == NULL) michael@13: /*@switchbreak@*/ break; michael@13: - } michael@13: s += 3; michael@13: michael@13: alen = strlen(a); michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Dedefine the stdio variable BUFSIZ because it is usually just 1024 michael@13: | on some platforms (on Linux it is 8192) and unfortunately RPM uses michael@13: | it here for the macro expansion buffer. For OpenPKG the size 1024 is michael@13: | definetely too small. So increase this to a 16KB buffer. michael@13: +--------------------------------------------------------------------------- michael@13: Index: rpmio/macro.c michael@13: --- rpmio/macro.c 15 May 2003 13:42:01 -0000 1.1.1.7 michael@13: +++ rpmio/macro.c 22 Jan 2004 21:42:32 -0000 1.2 michael@13: @@ -50,6 +50,9 @@ michael@13: michael@13: #include "debug.h" michael@13: michael@13: +#undef BUFSIZ michael@13: +#define BUFSIZ 16384 michael@13: + michael@13: #if defined(__LCLINT__) michael@13: /*@-exportheader@*/ michael@13: extern const unsigned short int **__ctype_b_loc (void) /*@*/; michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Remove "unzip" support, because in OpenPKG there are less than michael@13: | a dozend packages requiring unpacking of .zip files. For these michael@13: | it is fully sufficient to explicitly require the "infozip" michael@13: | package (containing "unzip") and leaving the less portable michael@13: | "unzip" out of the bootstrap package. michael@13: +--------------------------------------------------------------------------- michael@13: Index: rpmio/macro.c michael@13: --- rpmio/macro.c 15 May 2003 13:42:01 -0000 1.1.1.7 michael@13: +++ rpmio/macro.c 22 Jan 2004 21:42:32 -0000 1.2 michael@13: @@ -1114,9 +1119,11 @@ michael@13: case 2: /* COMPRESSED_BZIP2 */ michael@13: sprintf(be, "%%_bzip2 %s", b); michael@13: break; michael@13: +#if 0 michael@13: case 3: /* COMPRESSED_ZIP */ michael@13: sprintf(be, "%%_unzip %s", b); michael@13: break; michael@13: +#endif michael@13: } michael@13: b = be; michael@13: } else if (STREQ("S", f, fn)) { michael@13: @@ -1717,9 +1725,11 @@ michael@13: michael@13: if ((magic[0] == 'B') && (magic[1] == 'Z')) { michael@13: *compressed = COMPRESSED_BZIP2; michael@13: +#if 0 michael@13: } else if ((magic[0] == 0120) && (magic[1] == 0113) && michael@13: (magic[2] == 0003) && (magic[3] == 0004)) { /* pkzip */ michael@13: *compressed = COMPRESSED_ZIP; michael@13: +#endif michael@13: } else if (((magic[0] == 0037) && (magic[1] == 0213)) || /* gzip */ michael@13: ((magic[0] == 0037) && (magic[1] == 0236)) || /* old gzip */ michael@13: ((magic[0] == 0037) && (magic[1] == 0036)) || /* pack */ michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Make sure that an %{error:} macro really stops further michael@13: | processing. Else it would be nothing more than a %{warn:}. michael@13: +--------------------------------------------------------------------------- michael@13: Index: rpmio/macro.c michael@13: --- rpmio/macro.c 15 May 2003 13:42:01 -0000 1.1.1.7 michael@13: +++ rpmio/macro.c 22 Jan 2004 21:42:32 -0000 1.2 michael@13: @@ -1329,7 +1337,7 @@ michael@13: STREQ("error", f, fn)) { michael@13: int waserror = 0; michael@13: if (STREQ("error", f, fn)) michael@13: - waserror = 1; michael@13: + waserror = 1, rc = 1; michael@13: if (g < ge) michael@13: doOutput(mb, waserror, g, gn); michael@13: else michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Reactivate build mode aliases which were removed in rpm-4.1 michael@13: | (and now should be available through "rpmbuild" only). michael@13: +--------------------------------------------------------------------------- michael@13: Index: rpmpopt.in michael@13: --- rpmpopt.in 24 Jan 2003 14:56:30 -0000 1.1.1.7 michael@13: +++ rpmpopt.in 22 Jan 2004 21:42:11 -0000 1.2 michael@13: @@ -147,28 +147,28 @@ michael@13: # Popt glue to preserve legacy CLI behavior. michael@13: # michael@13: # XXX popt exec parsing doesn't honor POPT_ARGFLAG_ONEDASH michael@13: -# XXX Build mode aliases, removed in rpm-4.1. michael@13: -#rpm exec --bp rpmb -bp michael@13: -#rpm exec --bc rpmb -bc michael@13: -#rpm exec --bi rpmb -bi michael@13: -#rpm exec --bl rpmb -bl michael@13: -#rpm exec --ba rpmb -ba michael@13: -#rpm exec --bb rpmb -bb michael@13: -#rpm exec --bs rpmb -bs michael@13: -#rpm exec --tp rpmb -tp michael@13: -#rpm exec --tc rpmb -tc michael@13: -#rpm exec --ti rpmb -ti michael@13: -#rpm exec --tl rpmb -tl michael@13: -#rpm exec --ta rpmb -ta michael@13: -#rpm exec --tb rpmb -tb michael@13: -#rpm exec --ts rpmb -ts michael@13: -#rpm exec --rebuild rpmb --rebuild michael@13: -#rpm exec --recompile rpmb --recompile michael@13: -#rpm exec --clean rpmb --clean michael@13: -#rpm exec --rmsource rpmb --rmsource michael@13: -#rpm exec --rmspec rpmb --rmspec michael@13: -#rpm exec --target rpmb --target michael@13: -#rpm exec --short-circuit rpmb --short-circuit michael@13: +rpm exec --bp rpmb -bp michael@13: +rpm exec --bc rpmb -bc michael@13: +rpm exec --bi rpmb -bi michael@13: +rpm exec --bl rpmb -bl michael@13: +rpm exec --ba rpmb -ba michael@13: +rpm exec --bb rpmb -bb michael@13: +rpm exec --bs rpmb -bs michael@13: +rpm exec --bt rpmb -bt michael@13: +rpm exec --tp rpmb -tp michael@13: +rpm exec --tc rpmb -tc michael@13: +rpm exec --ti rpmb -ti michael@13: +rpm exec --tl rpmb -tl michael@13: +rpm exec --ta rpmb -ta michael@13: +rpm exec --tb rpmb -tb michael@13: +rpm exec --ts rpmb -ts michael@13: +rpm exec --rebuild rpmb --rebuild michael@13: +rpm exec --recompile rpmb --recompile michael@13: +rpm exec --clean rpmb --clean michael@13: +rpm exec --rmsource rpmb --rmsource michael@13: +rpm exec --rmspec rpmb --rmspec michael@13: +rpm exec --target rpmb --target michael@13: +rpm exec --short-circuit rpmb --short-circuit michael@13: michael@13: rpm exec --initdb rpmd --initdb michael@13: rpm exec --rebuilddb rpmd --rebuilddb michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Allow "-bb --short-circuit" for continuing building a binary package michael@13: | after the %install step (usually previously fixed and repeated with michael@13: | "-bi --short-circuit". michael@13: +--------------------------------------------------------------------------- michael@13: Index: rpmqv.c michael@13: --- rpmqv.c 4 Mar 2003 15:32:57 -0000 1.1.1.8 michael@13: +++ rpmqv.c 6 Feb 2004 15:37:56 -0000 1.4 michael@13: @@ -682,6 +682,10 @@ michael@13: case 'b': michael@13: ba->buildAmount |= RPMBUILD_PACKAGEBINARY; michael@13: ba->buildAmount |= RPMBUILD_CLEAN; michael@13: +#ifdef OPENPKG michael@13: + if ((ba->buildChar == 'b') && ba->shortCircuit) michael@13: + /*@innerbreak@*/ break; michael@13: +#endif michael@13: /*@fallthrough@*/ michael@13: case 'i': michael@13: ba->buildAmount |= RPMBUILD_INSTALL; michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Because permissions and ownership on Berkeley-DB region files michael@13: | __db.XXX have to be already fixed in advance and those files cannot michael@13: | be created in advance on the command line with some reasonable michael@13: | default (as it is the case for the other files which are created michael@13: | with [rpm]db_load), so force Berkeley-DB to accept zero-sized files michael@13: | and create them (instead of thinking another process is currently michael@13: | creating them). michael@13: +--------------------------------------------------------------------------- michael@13: Index: db/env/env_region.c michael@13: --- db/env/env_region.c 18 Jan 2003 14:05:01 -0000 1.1.1.5 michael@13: +++ db/env/env_region.c 22 Jan 2004 21:42:17 -0000 1.2 michael@13: @@ -184,6 +184,24 @@ michael@13: } michael@13: michael@13: /* michael@13: + * OpenPKG hack: because permissions and ownership on Berkeley-DB michael@13: + * region files __db.XXX have to be already fixed in advance and michael@13: + * those files cannot be created in advance on the command line michael@13: + * with some reasonable default (as it is the case for the other michael@13: + * files which are created with [rpm]db_load), so force Berkeley-DB michael@13: + * to accept zero-sized files and create them (instead of thinking michael@13: + * another process is currently creating them). michael@13: + */ michael@13: + if (mbytes == 0 && bytes == 0) { michael@13: + if (F_ISSET(dbenv, DB_ENV_CREATE)) michael@13: + goto creation; michael@13: + else { michael@13: + ret = ENOENT; michael@13: + goto err; michael@13: + } michael@13: + } michael@13: + michael@13: + /* michael@13: * !!! michael@13: * A size_t is OK -- regions get mapped into memory, and so can't michael@13: * be larger than a size_t. michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Make sure RPM passes DB_CREATE to Berkeley-DB also if file exists, michael@13: | but is (still) zero-sized. michael@13: +--------------------------------------------------------------------------- michael@13: Index: rpmdb/db3.c michael@13: --- rpmdb/db3.c 3 Mar 2003 16:18:29 -0000 1.1.1.5 michael@13: +++ rpmdb/db3.c 22 Jan 2004 21:42:29 -0000 1.2 michael@13: @@ -1019,9 +1019,13 @@ michael@13: } else { /* dbhome is writable, check for persistent dbenv. */ michael@13: /*@-mods@*/ michael@13: const char * dbf = rpmGetPath(dbhome, "/__db.001", NULL); michael@13: + struct stat sb; michael@13: + long size = -1; michael@13: /*@=mods@*/ michael@13: michael@13: - if (access(dbf, F_OK) == -1) { michael@13: + if (stat(dbf, &sb) == 0) michael@13: + size = (long)sb.st_size; michael@13: + if (access(dbf, F_OK) == -1 || size == 0) { michael@13: /* ... non-existent (or unwritable) DBENV, will create ... */ michael@13: dbi->dbi_oeflags |= DB_CREATE; michael@13: dbi->dbi_eflags &= ~DB_JOINENV; michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Add internal feature variable %{_force_oldpackage} which, if michael@13: | non-zero, automatically enforces --oldpackage on all upgrade michael@13: | operations (this is useful on mass-upgrades from OpenPKG-CURRENT to michael@13: | OpenPKG-RELEASE). michael@13: +--------------------------------------------------------------------------- michael@13: Index: rpm.c michael@13: --- rpm.c 16 May 2002 16:55:25 -0000 1.1.1.23 michael@13: +++ rpm.c 22 Jan 2004 21:42:10 -0000 1.2 michael@13: @@ -1016,6 +1016,10 @@ michael@13: michael@13: if (oldPackage && !upgrade) michael@13: argerror(_("--oldpackage may only be used during upgrades")); michael@13: +#ifdef OPENPKG michael@13: + if (upgrade && rpmExpandNumeric("%{?_force_oldpackage}")) michael@13: + probFilter |= RPMPROB_FILTER_OLDPACKAGE; michael@13: +#endif michael@13: michael@13: if (noPgp && bigMode != MODE_CHECKSIG) michael@13: argerror(_("--nopgp may only be used during signature checking")); michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Add OpenPKG branding to make sure people do not intermix michael@13: | this RPM version with the stock RPM version. michael@13: +--------------------------------------------------------------------------- michael@13: Index: lib/poptALL.c michael@13: --- lib/poptALL.c 25 Jun 2003 19:10:01 -0000 1.1.1.3 michael@13: +++ lib/poptALL.c 22 Jan 2004 21:42:23 -0000 1.2 michael@13: @@ -102,7 +102,7 @@ michael@13: /*@globals rpmEVR, fileSystem @*/ michael@13: /*@modifies *fp, fileSystem @*/ michael@13: { michael@13: - fprintf(fp, _("RPM version %s\n"), rpmEVR); michael@13: + fprintf(fp, _("OpenPKG RPM %s\n"), rpmEVR); michael@13: } michael@13: michael@13: /** michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Add OpenPKG branding to make sure people do not intermix michael@13: | this RPM version with the stock RPM version. michael@13: +--------------------------------------------------------------------------- michael@13: Index: rpm.c michael@13: --- rpm.c 16 May 2002 16:55:25 -0000 1.1.1.23 michael@13: +++ rpm.c 22 Jan 2004 21:42:10 -0000 1.2 michael@13: @@ -235,7 +235,7 @@ michael@13: static void printHelpLine(char * prefix, char * help); michael@13: michael@13: static void printVersion(void) { michael@13: - fprintf(stdout, _("RPM version %s\n"), rpmEVR); michael@13: + fprintf(stdout, _("OpenPKG RPM %s\n"), rpmEVR); michael@13: } michael@13: michael@13: static void printBanner(void) { michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Add OpenPKG branding to make sure people do not intermix michael@13: | this RPM version with the stock RPM version. michael@13: +--------------------------------------------------------------------------- michael@13: Index: rpmqv.c michael@13: --- rpmqv.c 4 Mar 2003 15:32:57 -0000 1.1.1.8 michael@13: +++ rpmqv.c 6 Feb 2004 15:37:56 -0000 1.4 michael@13: @@ -126,7 +126,7 @@ michael@13: /*@globals rpmEVR, fileSystem @*/ michael@13: /*@modifies *fp, fileSystem @*/ michael@13: { michael@13: - fprintf(fp, _("RPM version %s\n"), rpmEVR); michael@13: + fprintf(fp, _("OpenPKG RPM %s\n"), rpmEVR); michael@13: } michael@13: michael@13: static void printBanner(FILE * fp) michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Add support for the OpenPKG custom .spec file sections %track michael@13: | (package build-time feature for performing vendor source tracking) michael@13: | and %test (package install-time feature for performing package michael@13: | run-time tests). michael@13: +--------------------------------------------------------------------------- michael@13: Index: rpmqv.c michael@13: --- rpmqv.c 4 Mar 2003 15:32:57 -0000 1.1.1.8 michael@13: +++ rpmqv.c 6 Feb 2004 15:37:56 -0000 1.4 michael@13: @@ -703,7 +707,19 @@ michael@13: /*@innerbreak@*/ break; michael@13: case 's': michael@13: ba->buildAmount |= RPMBUILD_PACKAGESOURCE; michael@13: + /* enforce no dependency checking */ michael@13: + ba->noDeps = 1; michael@13: /*@innerbreak@*/ break; michael@13: +#ifdef OPENPKG michael@13: + case 't': michael@13: + ba->buildAmount |= RPMBUILD_TRACK; michael@13: + /* enforce no dependency checking and expansion of %setup, %patch and %prep macros */ michael@13: + ba->noDeps = 1; michael@13: + rpmDefineMacro(NULL, "setup #", RMIL_CMDLINE); michael@13: + rpmDefineMacro(NULL, "patch #", RMIL_CMDLINE); michael@13: + rpmDefineMacro(NULL, "prep %%prep", RMIL_CMDLINE); michael@13: + /*@innerbreak@*/ break; michael@13: +#endif michael@13: } michael@13: michael@13: if (!poptPeekArg(optCon)) { michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Add support for the OpenPKG custom .spec file sections %track michael@13: | (package build-time feature for performing vendor source tracking) michael@13: | and %test (package install-time feature for performing package michael@13: | run-time tests). michael@13: +--------------------------------------------------------------------------- michael@13: Index: build/pack.c michael@13: --- build/pack.c 4 Mar 2003 17:03:17 -0000 1.1.1.20 michael@13: +++ build/pack.c 30 Jan 2004 17:06:29 -0000 1.2 michael@13: @@ -252,6 +252,15 @@ michael@13: return RPMERR_BADFILENAME; michael@13: } michael@13: } michael@13: +#ifdef OPENPKG michael@13: + if (pkg->testFile) { michael@13: + if (addFileToTag(spec, pkg->testFile, pkg->header, RPMTAG_TEST)) { michael@13: + rpmError(RPMERR_BADFILENAME, michael@13: + _("Could not open Test file: %s\n"), pkg->testFile); michael@13: + return RPMERR_BADFILENAME; michael@13: + } michael@13: + } michael@13: +#endif michael@13: michael@13: for (p = pkg->triggerFiles; p != NULL; p = p->next) { michael@13: (void) headerAddOrAppendEntry(pkg->header, RPMTAG_TRIGGERSCRIPTPROG, michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Add support for the OpenPKG custom .spec file sections %track michael@13: | (package build-time feature for performing vendor source tracking) michael@13: | and %test (package install-time feature for performing package michael@13: | run-time tests). michael@13: +--------------------------------------------------------------------------- michael@13: Index: build/parseBuildInstallClean.c michael@13: --- build/parseBuildInstallClean.c 3 Mar 2003 20:43:30 -0000 1.1.1.9 michael@13: +++ build/parseBuildInstallClean.c 30 Jan 2004 17:06:29 -0000 1.2 michael@13: @@ -29,6 +29,11 @@ michael@13: } else if (parsePart == PART_CLEAN) { michael@13: sbp = &(spec->clean); michael@13: name = "%clean"; michael@13: +#ifdef OPENPKG michael@13: + } else if (parsePart == PART_TRACK) { michael@13: + sbp = &(spec->track); michael@13: + name = "%track"; michael@13: +#endif michael@13: } michael@13: /*@=branchstate@*/ michael@13: michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Add support for the OpenPKG custom .spec file sections %track michael@13: | (package build-time feature for performing vendor source tracking) michael@13: | and %test (package install-time feature for performing package michael@13: | run-time tests). michael@13: +--------------------------------------------------------------------------- michael@13: Index: build/parseScript.c michael@13: --- build/parseScript.c 23 Jun 2002 19:47:12 -0000 1.1.1.12 michael@13: +++ build/parseScript.c 30 Jan 2004 17:06:29 -0000 1.3 michael@13: @@ -156,6 +156,14 @@ michael@13: progtag = RPMTAG_TRIGGERSCRIPTPROG; michael@13: partname = "%triggerpostun"; michael@13: break; michael@13: +#ifdef OPENPKG michael@13: + case PART_TEST: michael@13: + tag = RPMTAG_TEST; michael@13: + tagflags = RPMSENSE_SCRIPT_TEST; michael@13: + progtag = RPMTAG_TESTPROG; michael@13: + partname = "%test"; michael@13: + break; michael@13: +#endif michael@13: } michael@13: /*@=branchstate@*/ michael@13: michael@13: @@ -303,6 +312,11 @@ michael@13: case PART_VERIFYSCRIPT: michael@13: pkg->verifyFile = xstrdup(file); michael@13: break; michael@13: +#ifdef OPENPKG michael@13: + case PART_TEST: michael@13: + pkg->testFile = xstrdup(file); michael@13: + break; michael@13: +#endif michael@13: } michael@13: } michael@13: } michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Add support for the OpenPKG custom .spec file sections %track michael@13: | (package build-time feature for performing vendor source tracking) michael@13: | and %test (package install-time feature for performing package michael@13: | run-time tests). michael@13: +--------------------------------------------------------------------------- michael@13: Index: build/parseSpec.c michael@13: --- build/parseSpec.c 15 May 2003 13:38:57 -0000 1.1.1.15 michael@13: +++ build/parseSpec.c 30 Jan 2004 17:06:30 -0000 1.2 michael@13: @@ -43,6 +43,10 @@ michael@13: { PART_TRIGGERIN, 0, "%triggerin"}, michael@13: { PART_TRIGGERIN, 0, "%trigger"}, michael@13: { PART_VERIFYSCRIPT, 0, "%verifyscript"}, michael@13: +#ifdef OPENPKG michael@13: + { PART_TRACK, 0, "%track"}, michael@13: + { PART_TEST, 0, "%test"}, michael@13: +#endif michael@13: {0, 0, 0} michael@13: }; michael@13: michael@13: @@ -489,6 +493,15 @@ michael@13: parsePart = parseFiles(spec); michael@13: /*@switchbreak@*/ break; michael@13: michael@13: +#ifdef OPENPKG michael@13: + case PART_TRACK: michael@13: + parsePart = parseBuildInstallClean(spec, parsePart); michael@13: + /*@switchbreak@*/ break; michael@13: + case PART_TEST: michael@13: + parsePart = parseScript(spec, parsePart); michael@13: + /*@switchbreak@*/ break; michael@13: +#endif michael@13: + michael@13: case PART_NONE: /* XXX avoid gcc whining */ michael@13: case PART_LAST: michael@13: case PART_BUILDARCHITECTURES: michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Add support for the OpenPKG custom .spec file sections %track michael@13: | (package build-time feature for performing vendor source tracking) michael@13: | and %test (package install-time feature for performing package michael@13: | run-time tests). michael@13: +--------------------------------------------------------------------------- michael@13: Index: build/poptBT.c michael@13: --- build/poptBT.c 3 Mar 2003 20:04:12 -0000 1.1.1.3 michael@13: +++ build/poptBT.c 30 Jan 2004 17:06:30 -0000 1.2 michael@13: @@ -35,6 +35,9 @@ michael@13: #define POPT_BL 0x626c michael@13: #define POPT_BP 0x6270 michael@13: #define POPT_BS 0x6273 michael@13: +#ifdef OPENPKG michael@13: +#define POPT_BT 0x6274 michael@13: +#endif michael@13: #define POPT_TA 0x7461 michael@13: #define POPT_TB 0x7462 michael@13: #define POPT_TC 0x7463 michael@13: @@ -82,6 +85,9 @@ michael@13: case POPT_BL: michael@13: case POPT_BP: michael@13: case POPT_BS: michael@13: +#ifdef OPENPKG michael@13: + case POPT_BT: michael@13: +#endif michael@13: case POPT_TA: michael@13: case POPT_TB: michael@13: case POPT_TC: michael@13: @@ -177,6 +183,11 @@ michael@13: { "bs", 0, POPT_ARGFLAG_ONEDASH, 0, POPT_BS, michael@13: N_("build source package only from "), michael@13: N_("") }, michael@13: +#ifdef OPENPKG michael@13: + { "bt", 0, POPT_ARGFLAG_ONEDASH, 0, POPT_BT, michael@13: + N_("track versions of sources from "), michael@13: + N_("") }, michael@13: +#endif michael@13: michael@13: { "tp", 0, POPT_ARGFLAG_ONEDASH, 0, POPT_TP, michael@13: N_("build through %prep (unpack sources and apply patches) from "), michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Add support for the OpenPKG custom .spec file sections %track michael@13: | (package build-time feature for performing vendor source tracking) michael@13: | and %test (package install-time feature for performing package michael@13: | run-time tests). michael@13: +--------------------------------------------------------------------------- michael@13: Index: build/rpmbuild.h michael@13: --- build/rpmbuild.h 4 Mar 2003 17:03:07 -0000 1.1.1.13 michael@13: +++ build/rpmbuild.h 30 Jan 2004 17:06:30 -0000 1.2 michael@13: @@ -34,6 +34,9 @@ michael@13: RPMBUILD_RMSOURCE = (1 << 8), /*!< Remove source(s) and patch(s). */ michael@13: RPMBUILD_RMBUILD = (1 << 9), /*!< Remove build sub-tree. */ michael@13: RPMBUILD_STRINGBUF = (1 << 10), /*!< only for doScript() */ michael@13: +#ifdef OPENPKG michael@13: + RPMBUILD_TRACK = (1 << 12), /*!< Execute %%track. */ michael@13: +#endif michael@13: RPMBUILD_RMSPEC = (1 << 11) /*!< Remove spec file. */ michael@13: } rpmBuildFlags; michael@13: /*@=typeuse@*/ michael@13: @@ -69,7 +72,13 @@ michael@13: PART_VERIFYSCRIPT = 16, /*!< */ michael@13: PART_BUILDARCHITECTURES= 17,/*!< */ michael@13: PART_TRIGGERPOSTUN = 18, /*!< */ michael@13: +#ifdef OPENPKG michael@13: + PART_TRACK = 19, /*!< */ michael@13: + PART_TEST = 20, /*!< */ michael@13: + PART_LAST = 21 /*!< */ michael@13: +#else michael@13: PART_LAST = 19 /*!< */ michael@13: +#endif michael@13: } rpmParseState; michael@13: michael@13: #define STRIP_NOTHING 0 michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Add support for the OpenPKG custom .spec file sections %track michael@13: | (package build-time feature for performing vendor source tracking) michael@13: | and %test (package install-time feature for performing package michael@13: | run-time tests). michael@13: +--------------------------------------------------------------------------- michael@13: Index: build/rpmspec.h michael@13: --- build/rpmspec.h 4 Mar 2003 15:30:23 -0000 1.1.1.11 michael@13: +++ build/rpmspec.h 30 Jan 2004 17:06:30 -0000 1.2 michael@13: @@ -164,6 +164,10 @@ michael@13: StringBuf check; /*!< %check scriptlet. */ michael@13: /*@only@*/ michael@13: StringBuf clean; /*!< %clean scriptlet. */ michael@13: +#ifdef OPENPKG michael@13: +/*@only@*/ michael@13: + StringBuf track; /*!< %track scriptlet. */ michael@13: +#endif michael@13: michael@13: /*@owned@*/ michael@13: Package packages; /*!< Package list. */ michael@13: @@ -196,6 +200,10 @@ michael@13: const char * postUnFile; /*!< %postun scriptlet. */ michael@13: /*@only@*/ michael@13: const char * verifyFile; /*!< %verifyscript scriptlet. */ michael@13: +#ifdef OPENPKG michael@13: +/*@only@*/ michael@13: + const char * testFile; /*!< %test scriptlet. */ michael@13: +#endif michael@13: michael@13: /*@only@*/ michael@13: StringBuf specialDoc; michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Add support for the OpenPKG custom .spec file sections %track michael@13: | (package build-time feature for performing vendor source tracking) michael@13: | and %test (package install-time feature for performing package michael@13: | run-time tests). michael@13: +--------------------------------------------------------------------------- michael@13: Index: build/spec.c michael@13: --- build/spec.c 4 Mar 2003 15:25:51 -0000 1.1.1.21 michael@13: +++ build/spec.c 30 Jan 2004 17:06:31 -0000 1.3 michael@13: @@ -138,6 +138,9 @@ michael@13: p->preUnFile = NULL; michael@13: p->postUnFile = NULL; michael@13: p->verifyFile = NULL; michael@13: +#ifdef OPENPKG michael@13: + p->testFile = NULL; michael@13: +#endif michael@13: michael@13: p->specialDoc = NULL; michael@13: michael@13: @@ -444,6 +455,9 @@ michael@13: spec->install = NULL; michael@13: spec->check = NULL; michael@13: spec->clean = NULL; michael@13: +#ifdef OPENPKG michael@13: + spec->track = NULL; michael@13: +#endif michael@13: michael@13: spec->sources = NULL; michael@13: spec->packages = NULL; michael@13: @@ -491,6 +505,9 @@ michael@13: spec->install = freeStringBuf(spec->install); michael@13: spec->check = freeStringBuf(spec->check); michael@13: spec->clean = freeStringBuf(spec->clean); michael@13: +#ifdef OPENPKG michael@13: + spec->track = freeStringBuf(spec->track); michael@13: +#endif michael@13: michael@13: spec->buildRootURL = _free(spec->buildRootURL); michael@13: spec->buildSubdir = _free(spec->buildSubdir); michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Add support for the OpenPKG custom .spec file sections %track michael@13: | (package build-time feature for performing vendor source tracking) michael@13: | and %test (package install-time feature for performing package michael@13: | run-time tests). michael@13: +--------------------------------------------------------------------------- michael@13: Index: lib/rpmlib.h michael@13: --- lib/rpmlib.h 19 Jun 2003 17:39:35 -0000 1.1.1.26 michael@13: +++ lib/rpmlib.h 30 Jan 2004 17:06:31 -0000 1.2 michael@13: @@ -414,6 +414,12 @@ michael@13: RPMTAG_FILEDEPENDSN = 1144, michael@13: RPMTAG_DEPENDSDICT = 1145, michael@13: RPMTAG_SOURCEPKGID = 1146, michael@13: +#ifdef OPENPKG michael@13: + RPMTAG_TRACK = 1200, michael@13: + RPMTAG_TEST = 1201, michael@13: + RPMTAG_TESTPROG = 1202, michael@13: + RPMTAG_CLASS = 1203, michael@13: +#endif michael@13: /*@-enummemuse@*/ michael@13: RPMTAG_FIRSTFREE_TAG /*!< internal */ michael@13: /*@=enummemuse@*/ michael@13: @@ -488,6 +494,9 @@ michael@13: RPMSENSE_SCRIPT_BUILD = (1 << 21), /*!< %build build dependency. */ michael@13: RPMSENSE_SCRIPT_INSTALL = (1 << 22),/*!< %install build dependency. */ michael@13: RPMSENSE_SCRIPT_CLEAN = (1 << 23), /*!< %clean build dependency. */ michael@13: +#ifdef OPENPKG michael@13: + RPMSENSE_SCRIPT_TEST = (1 << 29), /*!< %test build dependency. */ michael@13: +#endif michael@13: RPMSENSE_RPMLIB = ((1 << 24) | RPMSENSE_PREREQ), /*!< rpmlib(feature) dependency. */ michael@13: /*@-enummemuse@*/ michael@13: RPMSENSE_TRIGGERPREIN = (1 << 25), /*!< @todo Implement %triggerprein. */ michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Add support for the OpenPKG custom .spec file sections %track michael@13: | (package build-time feature for performing vendor source tracking) michael@13: | and %test (package install-time feature for performing package michael@13: | run-time tests). michael@13: | Additionally, add support for "Class" header. michael@13: +--------------------------------------------------------------------------- michael@13: Index: rpmdb/tagtbl.c michael@13: --- rpmdb/tagtbl.c 2 Jul 2003 20:20:27 -0000 1.1.1.4 michael@13: +++ rpmdb/tagtbl.c 30 Jan 2004 17:06:32 -0000 1.2 michael@13: @@ -135,6 +135,12 @@ michael@13: { "RPMTAG_FILEDEPENDSN", 1144, }, michael@13: { "RPMTAG_DEPENDSDICT", 1145, }, michael@13: { "RPMTAG_SOURCEPKGID", 1146, }, michael@13: +#ifdef OPENPKG michael@13: + { "RPMTAG_TRACK", 1200, }, michael@13: + { "RPMTAG_TEST", 1201, }, michael@13: + { "RPMTAG_TESTPROG", 1202, }, michael@13: + { "RPMTAG_CLASS", 1203, }, michael@13: +#endif michael@13: { NULL, 0 } michael@13: }; michael@13: michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Add support for "Class" header. michael@13: +--------------------------------------------------------------------------- michael@13: Index: build/parsePreamble.c michael@13: --- build/parsePreamble.c 3 Mar 2003 20:46:34 -0000 1.1.1.13 michael@13: +++ build/parsePreamble.c 6 Feb 2004 15:37:58 -0000 1.3 michael@13: @@ -21,6 +21,7 @@ michael@13: RPMTAG_LICENSE, michael@13: RPMTAG_PACKAGER, michael@13: RPMTAG_DISTRIBUTION, michael@13: + RPMTAG_CLASS, michael@13: RPMTAG_DISTURL, michael@13: RPMTAG_VENDOR, michael@13: RPMTAG_ICON, michael@13: @@ -327,6 +328,7 @@ michael@13: { RPMTAG_VENDOR, "%{vendor}" }, michael@13: { RPMTAG_PACKAGER, "%{packager}" }, michael@13: { RPMTAG_DISTRIBUTION, "%{distribution}" }, michael@13: + { RPMTAG_CLASS, "%{class}" }, michael@13: { RPMTAG_DISTURL, "%{disturl}" }, michael@13: { -1, NULL } michael@13: }; michael@13: @@ -537,6 +547,7 @@ michael@13: (void) stashSt(spec, pkg->header, tag, lang); michael@13: /*@fallthrough@*/ michael@13: case RPMTAG_DISTRIBUTION: michael@13: + case RPMTAG_CLASS: michael@13: case RPMTAG_VENDOR: michael@13: case RPMTAG_LICENSE: michael@13: case RPMTAG_PACKAGER: michael@13: @@ -743,6 +754,7 @@ michael@13: {RPMTAG_LICENSE, 0, 0, "copyright"}, michael@13: {RPMTAG_LICENSE, 0, 0, "license"}, michael@13: {RPMTAG_DISTRIBUTION, 0, 0, "distribution"}, michael@13: + {RPMTAG_CLASS, 0, 0, "class"}, michael@13: {RPMTAG_DISTURL, 0, 0, "disturl"}, michael@13: {RPMTAG_VENDOR, 0, 0, "vendor"}, michael@13: {RPMTAG_GROUP, 0, 1, "group"},