1 (* Perform a complete Fedora OCaml rebuild, in build order. *)
10 let koji_target = "rawhide"
12 (* The name of the rebuild, and also the magic substring that must
13 * appear in the %changelog when the package has been rebuilt.
15 let rebuild_name = "OCaml 4.01.0"
17 (* Packages that have problems or we just don't want to build. *)
19 "ocaml-libvirt"; (* RHBZ#1009701 *)
20 "ocaml-lwt"; "ocaml-react"; (* loganjerry is handling *)
23 (* List of OCaml-related source package names. *)
25 let dirs = shlines "cd %s && ls -1d ocaml*" fedora_dir in
26 dirs @ [ "alt-ergo"; "apron"; "brltty"; "coccinelle"; "coq";
27 "cduce"; "frama-c"; "gappalib-coq"; "graphviz"; "hivex";
28 "js-of-ocaml"; "llvm"; "plplot"; "whenjobs"; "why3"; "xen" ]
31 List.filter (fun pkg -> not (List.mem pkg blocked)) source_packages
33 (* Dependencies of each package. (pkg, [deps ...]) *)
34 let pkg_deps = dependencies branch source_packages
36 (* Goal: rebuild all packages. *)
38 List.iter (fun pkg -> require (rebuilt pkg)) source_packages
40 (* Goal: That 'package' has been rebuilt and exists in Koji. *)
42 let deps = List.assoc pkg pkg_deps in
43 let specfile = fedora_specfile pkg branch in
45 (* Note the target must be both of these because the old verrel
46 * could exist as a koji build without it having been part of the
49 target (file_contains_string specfile rebuild_name &&
50 koji_build_exists (fedora_verrel pkg branch));
52 (* All dependent packages must have been done first. *)
53 List.iter (fun dep -> require (rebuilt dep)) deps;
55 (* A local test build must succeed. *)
56 require (local_build_succeeded pkg);
58 (* Rebuild the package in Koji. *)
59 koji_build pkg branch;
61 (* Wait for the build to appear in Koji repo. Note verrel may change. *)
62 koji_wait_repo koji_target (fedora_verrel pkg branch)
64 and local_build_succeeded pkg =
65 (* The specfile must have been updated. *)
66 require (specfile_updated pkg);
69 sprintf "fedora_ocaml_local_build_%s_%s" pkg (fedora_verrel pkg branch) in
71 target (memory_exists key);
73 (* Do a local test build to ensure the Koji build will work. *)
78 " (fedora_repo pkg branch)
79 (fedora_specfile pkg branch);
83 and specfile_updated pkg =
84 let repodir = fedora_repo pkg branch in
85 let specfile = fedora_specfile pkg branch in
87 (* XXX Automate common changes. *)
88 let title = rebuild_name ^ " rebuild." in
92 rm -rf x86_64 noarch *.src.rpm
93 rpmdev-bumpspec -c %s %s
94 echo 'Please make further changes as required to the spec file %s.spec'
95 echo '(Press return key)'
98 echo 'OK to commit this change? (press ^C if not)'
101 echo 'OK to push this change? (press ^C if not)'
105 (quote title) specfile