From ab46aedd86f681a46670e00383e529136c7eabbf Mon Sep 17 00:00:00 2001 From: jbj Date: Fri, 30 Apr 1999 15:55:45 +0000 Subject: [PATCH] resurrect toplevel tar target. spec file removal separate from source removal (Shing-Gene Yung). CVS patchset: 3042 CVS date: 1999/04/30 15:55:45 --- CHANGES | 2 ++ Makefile.am | 15 ++------------- build.c | 7 +++++-- build/build.c | 6 ++++++ build/rpmbuild.h | 21 +++++++++++---------- po/rpm.pot | 28 ++++++++++++++-------------- rpm.c | 9 +++++++-- rpm.spec | 2 +- 8 files changed, 48 insertions(+), 42 deletions(-) diff --git a/CHANGES b/CHANGES index 9b8aa04..c820854 100644 --- a/CHANGES +++ b/CHANGES @@ -9,6 +9,8 @@ - make sure that rpm-the-package auto-requires glibc. - fix: non-apache servers need "GET ... HTTP/1.0" by the book. - fix: %doc wrongly inherits lang from last entry in %files. + - resurrect toplevel tar target. + - spec file removal separate from source removal (Shing-Gene Yung). 2.94 -> 2.95 - fix: last update transaction set segfault bug in installer. diff --git a/Makefile.am b/Makefile.am index a5ead68..ac5999e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -61,7 +61,7 @@ rpmconvert_SOURCES = convertdb.c oldrpmdb.c rpmconvert_LDADD = $(mylibs) -lgdbm install-data-local: - @$(mkinstalldirs) $(DESTDIR)/var/lib/rpm + @$(mkinstalldirs) $(DESTDIR)$(varprefix)/lib/rpm @rm -f $(DESTDIR)/$(libdir)/rpmrc @ln -s rpm/rpmrc $(DESTDIR)/$(libdir)/rpmrc @rm -f $(DESTDIR)/$(libdir)/rpmpopt @@ -78,23 +78,12 @@ install-data-local: @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/SOURCES @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/SPECS @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/SRPMS - @$(mkinstalldirs) $(DESTDIR)/var/lib/rpm @$(mkinstalldirs) $(DESTDIR)/var/tmp -# FIXME: these should be checked .PHONY: tar tar: rm -rf /tmp/rpm-$(VERSION) - make installprefix=/tmp/rpm-$(VERSION)$(ROOT) install - $(mkinstalldirs) /tmp/rpm-$(VERSION)/usr/local/src/redhat/SOURCES - $(mkinstalldirs) /tmp/rpm-$(VERSION)/usr/local/src/redhat/SPECS - $(mkinstalldirs) /tmp/rpm-$(VERSION)/usr/local/src/redhat/SRPMS - $(mkinstalldirs) /tmp/rpm-$(VERSION)/usr/local/src/redhat/RPMS - $(mkinstalldirs) /tmp/rpm-$(VERSION)/usr/local/src/redhat/BUILD - $(mkinstalldirs) /tmp/rpm-$(VERSION)/var/local/lib/rpm - $(mkinstalldirs) /tmp/rpm-$(VERSION)/var/tmp -# Couldn't figure de ARCH value -# $(mkinstalldirs) /tmp/rpm-$(VERSION)/usr/local/src/redhat/RPMS/i386 + $(MAKE) DESTDIR=/tmp/rpm-$(VERSION) install cd /tmp/rpm-$(VERSION) ; tar cvf /tmp/rpm-$(VERSION).tar . .PHONY: noconfig diff --git a/build.c b/build.c index fcdff78..6571606 100644 --- a/build.c +++ b/build.c @@ -5,7 +5,6 @@ #include "build.h" #include "install.h" - static int checkSpec(Header h) { char *rootdir = NULL; @@ -264,6 +263,7 @@ int build(const char *arg, struct rpmBuildArguments *ba, const char *passPhrase, #define POPT_TARGETPLATFORM 1007 #define POPT_NOBUILD 1008 #define POPT_SHORTCIRCUIT 1009 +#define POPT_RMSPEC 1010 extern int noLang; static int noBuild = 0; @@ -279,6 +279,7 @@ static void buildArgCallback(poptContext con, enum poptCallbackReason reason, case POPT_NOLANG: data->noLang = 1; break; case POPT_SHORTCIRCUIT: data->shortCircuit = 1; break; case POPT_RMSOURCE: data->buildAmount |= RPMBUILD_RMSOURCE; break; + case POPT_RMSPEC: data->buildAmount |= RPMBUILD_RMSPEC; break; case POPT_RMBUILD: data->buildAmount |= RPMBUILD_RMBUILD; break; case POPT_BUILDROOT: if (data->buildRootOverride) { @@ -325,7 +326,9 @@ struct poptOption rpmBuildPoptTable[] = { { "nolang", '\0', 0, &noLang, POPT_NOLANG, N_("do not accept I18N msgstr's from specfile"), NULL}, { "rmsource", '\0', 0, 0, POPT_RMSOURCE, - N_("remove sources and specfile when done"), NULL}, + N_("remove sources when done"), NULL}, + { "rmspec", '\0', 0, 0, POPT_RMSPEC, + N_("remove specfile when done"), NULL}, { "short-circuit", '\0', 0, 0, POPT_SHORTCIRCUIT, N_("skip straight to specified stage (only for c,i)"), NULL }, { "target", '\0', POPT_ARG_STRING, 0, POPT_TARGETPLATFORM, diff --git a/build/build.c b/build/build.c index c33ee28..f830a32 100644 --- a/build/build.c +++ b/build/build.c @@ -7,7 +7,9 @@ static void doRmSource(Spec spec) struct Source *p; Package pkg; +#if 0 unlink(spec->specFile); +#endif for (p = spec->sources; p != NULL; p = p->next) { if (! (p->flags & RPMBUILD_ISNO)) { @@ -219,5 +221,9 @@ int buildSpec(Spec spec, int what, int test) doRmSource(spec); } + if (what & RPMBUILD_RMSPEC) { + unlink(spec->specFile); + } + return 0; } diff --git a/build/rpmbuild.h b/build/rpmbuild.h index b2308ec..de57eca 100644 --- a/build/rpmbuild.h +++ b/build/rpmbuild.h @@ -13,16 +13,17 @@ /* from build/build.h */ -#define RPMBUILD_PREP (1 << 0) -#define RPMBUILD_BUILD (1 << 1) -#define RPMBUILD_INSTALL (1 << 2) -#define RPMBUILD_CLEAN (1 << 3) -#define RPMBUILD_FILECHECK (1 << 4) -#define RPMBUILD_PACKAGESOURCE (1 << 5) -#define RPMBUILD_PACKAGEBINARY (1 << 6) -#define RPMBUILD_RMSOURCE (1 << 7) -#define RPMBUILD_RMBUILD (1 << 8) -#define RPMBUILD_STRINGBUF (1 << 9) /* only for doScript() */ +#define RPMBUILD_PREP (1 << 0) +#define RPMBUILD_BUILD (1 << 1) +#define RPMBUILD_INSTALL (1 << 2) +#define RPMBUILD_CLEAN (1 << 3) +#define RPMBUILD_FILECHECK (1 << 4) +#define RPMBUILD_PACKAGESOURCE (1 << 5) +#define RPMBUILD_PACKAGEBINARY (1 << 6) +#define RPMBUILD_RMSOURCE (1 << 7) +#define RPMBUILD_RMBUILD (1 << 8) +#define RPMBUILD_STRINGBUF (1 << 9) /* only for doScript() */ +#define RPMBUILD_RMSPEC (1 << 10) /* from build/misc.h */ diff --git a/po/rpm.pot b/po/rpm.pot index 1041841..685f9f6 100644 --- a/po/rpm.pot +++ b/po/rpm.pot @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 1999-04-29 17:08-0400\n" +"POT-Creation-Date: 1999-04-30 11:00-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1745,60 +1745,60 @@ msgstr "" msgid "line: %s" msgstr "" -#: ../build/files.c:1391 ../build/parsePrep.c:31 +#: ../build/files.c:1394 ../build/parsePrep.c:31 #, c-format msgid "Bad owner/group: %s" msgstr "" -#: ../build/files.c:1445 +#: ../build/files.c:1448 #, c-format msgid "Couldn't exec %s" msgstr "" -#: ../build/files.c:1449 +#: ../build/files.c:1452 #, c-format msgid "Couldn't fork %s" msgstr "" -#: ../build/files.c:1499 +#: ../build/files.c:1502 #, c-format msgid "%s failed" msgstr "" -#: ../build/files.c:1503 +#: ../build/files.c:1506 #, c-format msgid "failed to write all data to %s" msgstr "" -#: ../build/files.c:1537 +#: ../build/files.c:1540 msgid "Finding provides...\n" msgstr "" -#: ../build/files.c:1544 +#: ../build/files.c:1547 msgid "Failed to find provides" msgstr "" -#: ../build/files.c:1563 +#: ../build/files.c:1566 msgid "Finding requires...\n" msgstr "" -#: ../build/files.c:1570 +#: ../build/files.c:1573 msgid "Failed to find requires" msgstr "" -#: ../build/files.c:1604 +#: ../build/files.c:1607 msgid "Provides:" msgstr "" -#: ../build/files.c:1619 +#: ../build/files.c:1622 msgid "Prereqs:" msgstr "" -#: ../build/files.c:1631 +#: ../build/files.c:1634 msgid "Requires:" msgstr "" -#: ../build/files.c:1655 +#: ../build/files.c:1658 #, c-format msgid "Processing files: %s\n" msgstr "" diff --git a/rpm.c b/rpm.c index 0357290..4b719d5 100755 --- a/rpm.c +++ b/rpm.c @@ -898,6 +898,9 @@ int main(int argc, char ** argv) { if ((buildArgs.buildAmount & RPMBUILD_RMSOURCE) && bigMode == MODE_UNKNOWN) bigMode = MODE_BUILD; + + if ((buildArgs.buildAmount & RPMBUILD_RMSPEC) && bigMode == MODE_UNKNOWN) + bigMode = MODE_BUILD; if (initdb) { if (bigMode != MODE_UNKNOWN) @@ -946,9 +949,10 @@ int main(int argc, char ** argv) { argerror(_("unexpected query source")); if (!(bigMode == MODE_INSTALL || - (bigMode == MODE_BUILD && (buildArgs.buildAmount & RPMBUILD_RMSOURCE))) + (bigMode==MODE_BUILD && (buildArgs.buildAmount & RPMBUILD_RMSOURCE))|| + (bigMode==MODE_BUILD && (buildArgs.buildAmount & RPMBUILD_RMSPEC))) && force) - argerror(_("only installation, upgrading and rmsource may be forced")); + argerror(_("only installation, upgrading, rmsource and rmspec may be forced")); if (bigMode != MODE_INSTALL && badReloc) argerror(_("files may only be relocated during package installation")); @@ -1237,6 +1241,7 @@ int main(int argc, char ** argv) { if (bigMode == MODE_REBUILD) { buildArgs.buildAmount |= RPMBUILD_PACKAGEBINARY; buildArgs.buildAmount |= RPMBUILD_RMSOURCE; + buildArgs.buildAmount |= RPMBUILD_RMSPEC; buildArgs.buildAmount |= RPMBUILD_CLEAN; buildArgs.buildAmount |= RPMBUILD_RMBUILD; } diff --git a/rpm.spec b/rpm.spec index fa48312..c8e28cc 100644 --- a/rpm.spec +++ b/rpm.spec @@ -2,7 +2,7 @@ Summary: The Red Hat package management system. Name: rpm %define version 3.0.1 Version: %{version} -Release: 3 +Release: 4 Group: System Environment/Base Source: ftp://ftp.rpm.org/pub/rpm/dist/rpm-3.0.x/rpm-%{version}.tar.gz Copyright: GPL -- 2.7.4