21 #define _RPMTS_INTERNAL
22 #define _RPMFI_INTERNAL
51 Data_Get_Struct(
self,
struct Spec_s, spec);
63 Data_Get_Struct(rb_iv_get(
self,
"ts"),
struct rpmts_s, ts);
77 VALUE ary = rb_ary_new();
80 for(src = spec->
sources; src != NULL; src = src->
next)
81 if(src->
flags & flags)
82 rb_ary_push(ary, rb_str_new2(src->
fullSource));
133 VALUE pkg_ary = rb_ary_new();
138 rb_ary_push(pkg_ary, Data_Wrap_Struct(
packageClass, 0, -1, pkg));
178 VALUE test_v = T_FALSE, flags_v;
179 rb_scan_args(argc, argv,
"11", &flags_v, &test_v);
182 switch(TYPE(test_v)) {
191 rb_raise(rb_eTypeError,
192 "Value for test must be either true or false");
196 Check_Type(flags_v, T_FIXNUM);
197 int flags = FIX2INT(flags_v);
203 if(error)
rpm_rb_raise(error,
"Building spec file failed");
static void _spec_free(Spec spec)
C destructor for the Spec class.
const char bson_timestamp_t * ts
static VALUE spec_get_sources(VALUE self)
Returns an array of all sources defined in the spec file.
VALUE rpmmc_wrap(rpmmc mc)
Wraps an already existing MacroContext struct in a Ruby class.
VALUE spec_wrap(Spec spec)
Wraps an already existing Spec_s structure in a Ruby class.
static VALUE spec_build(VALUE argc, VALUE *argv, VALUE self)
Builds a part of the spec file.
static rpmts _spec_get_ts(VALUE self)
Returns the hiddenly associated transaction set.
The structure used to store values parsed from a spec file.
void rpm_rb_raise(rpmRC error, char *message)
Raises a Ruby exception (RPM::Error).
Spec freeSpec(Spec spec)
Destroy a spec file control structure.
static Spec _spec_get_spec(VALUE self)
Returns the wrapped Spec structure.
const char const bson int mongo_write_concern int flags
static VALUE spec_get_macros(VALUE self)
Returns the macro context of the spec file.
RPM Ruby bindings "RPM" module.
enum rpmRC_e rpmRC
RPM return codes.
This is the only module users of librpmbuild should need to include.
Ruby access to RPM's Package struct.
VALUE specClass
The Ruby class representation of the Spec_s structure and methods.
struct rpmts_s * rpmts
The RPM Transaction Set.
void Init_spec(void)
Initializes the Ruby class.
VALUE rpmModule
The "RPM" Ruby module.
Ruby bindings for spec file access.
static VALUE spec_get_patches(VALUE self)
Returns an array of all patches defined in the spec file.
static VALUE spec_get_packages(VALUE self)
Returns all packages associated with the spec file.
VALUE packageClass
RPM::Package class that represents a package during build.
The structure used to store values for a package.
The Spec and Package data structures used during build.
Ruby bindings to RPM's macro context facility.
rpmRC buildSpec(rpmts ts, Spec spec, int what, int test)
Build stages state machine driver.
static VALUE _spec_get_sources(VALUE self, int flags)
A helper routine that returns a Ruby array containing all sources that match a specific set of OR'ed ...