summaryrefslogtreecommitdiff
path: root/build.c
diff options
context:
space:
mode:
authorjbj <devnull@localhost>1998-12-01 17:18:38 +0000
committerjbj <devnull@localhost>1998-12-01 17:18:38 +0000
commit234db2e2f68fe57220371d2d46f9c68897223eff (patch)
treee39fe98920afb58cc53e316118c6b787c2f82ec4 /build.c
parent5f72265982d9fc3de1bc506dbea33dc64d5700a3 (diff)
downloadlibrpm-tizen-234db2e2f68fe57220371d2d46f9c68897223eff.tar.gz
librpm-tizen-234db2e2f68fe57220371d2d46f9c68897223eff.tar.bz2
librpm-tizen-234db2e2f68fe57220371d2d46f9c68897223eff.zip
Start separating build options.
I18N for popt tables. CVS patchset: 2568 CVS date: 1998/12/01 17:18:38
Diffstat (limited to 'build.c')
-rw-r--r--build.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/build.c b/build.c
index b9977170c..68b86f099 100644
--- a/build.c
+++ b/build.c
@@ -1,5 +1,7 @@
#include "system.h"
+
#include "build/rpmbuild.h"
+#include "popt/popt.h"
#include "build.h"
#ifdef DYING
@@ -185,3 +187,48 @@ int build(char *arg, int buildAmount, char *passPhrase,
return 0;
}
+
+#define POPT_USECATALOG 1000
+#define POPT_NOLANG 1001
+#define POPT_RMSOURCE 1002
+#define POPT_RMBUILD 1003
+#define POPT_BUILDROOT 1004
+
+extern int noLang;
+static int useCatalog = 0;
+
+static void buildArgCallback(poptContext con, enum poptCallbackReason reason,
+ const struct poptOption * opt, const char * arg,
+ struct rpmBuildArguments * data)
+{
+ switch (opt->val) {
+ case POPT_USECATALOG: data->useCatalog = 1; break;
+ case POPT_NOLANG: data->noLang = 1; break;
+ case POPT_RMSOURCE: data->buildAmount |= RPMBUILD_RMSOURCE; break;
+ case POPT_RMBUILD: data->buildAmount |= RPMBUILD_RMBUILD; break;
+ case POPT_BUILDROOT:
+ if (data->buildRootOverride) {
+ fprintf(stderr, _("buildroot already specified"));
+ exit(EXIT_FAILURE);
+ }
+ data->buildRootOverride = strdup(arg);
+ break;
+ }
+}
+
+struct poptOption rpmBuildPoptTable[] = {
+ { NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA,
+ buildArgCallback, 0, NULL, NULL },
+ { "buildroot", '\0', POPT_ARG_STRING, 0, POPT_BUILDROOT,
+ N_("override build root"), "DIRECTORY" },
+ { "clean", '\0', 0, 0, POPT_RMBUILD,
+ N_("remove build tree when done"), NULL},
+ { "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},
+ { "usecatalog", '\0', 0, &useCatalog, POPT_USECATALOG,
+ N_("lookup I18N strings in specfile catalog"), NULL},
+ { 0, 0, 0, 0, 0, NULL, NULL }
+};
+