added rpmbuild options, but not enough to properly handle
[build.git] / spec2make.c
index a0144f1..712ce68 100644 (file)
@@ -6,7 +6,6 @@
  * Mark Huang <mlhuang@cs.princeton.edu>
  * Copyright (C) 2006 The Trustees of Princeton University
  *
- * $Id$
  */
 
 #include <stdio.h>
 #include <rpm/rpmbuild.h>
 #include <rpm/rpmspec.h>
 
+/* from f10 and up, Spec is renamed rpmSpec */
+#ifndef _RPMTYPES_H
+#define rpmSpec Spec
+#endif
+
+#ifndef PATH_MAX
+#include <linux/limits.h>
+#endif
+
 extern size_t strnlen(const char *s, size_t maxlen);
 
 /* the structure describing the options we take and the defaults */
 static struct poptOption optionsTable[] = {
+  { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmBuildPoptTable, 0,
+    "Build options with [ <specfile> | <tarball> | <source package> ]:",
+    NULL },
   { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmcliAllPoptTable, 0,
     "Common options for all rpm modes and executables:",
     NULL },
@@ -34,7 +46,7 @@ static struct poptOption optionsTable[] = {
 };
 
 /* Stolen from rpm/build/spec.c:rpmspecQuery() */
-Spec
+rpmSpec
 rpmspecGet(rpmts ts, const char * arg)
 {
   char * buildRoot = NULL;
@@ -59,7 +71,7 @@ main(int argc, char *argv[])
   poptContext context;
   rpmts ts = NULL;
   int ec = 0;
-  Spec spec;
+  rpmSpec spec;
   struct Source *source;
   Package pkg;
   const char *name, *version, *release, *arch, *unused;
@@ -139,7 +151,6 @@ main(int argc, char *argv[])
          strncpy(sourcename,fullSource,len);
          sourcename[len]='\0';
          printf ("%s.source := SOURCES/%s\n",package_name,basename(sourcename));
-         printf ("%s.codebase := CODEBASES/%s\n",package_name,package_name);
          break;
        }
       }