commit b615e12f435fc9516402cc67bd587687e41a8943 Author: Silvan Calarco Date: Wed May 4 02:31:45 2011 +0200 Initial commit diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..94a9ed0 --- /dev/null +++ b/COPYING @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..df764fd --- /dev/null +++ b/ChangeLog @@ -0,0 +1,245 @@ +Changes in version 0.8.5 20110320 +- sync a lot of small fixes and changes to date +- added autoport cron job and /etc/sysconfig/autoport configuration +--------------------------------------------------------------------------------- + +Changes in version 0.8.4 20100905 +- autodist: + * archive patches after successful buildinstall operation + * print job variables names at job start + * use LANG=C before date command +- autoport: + * fix command line parsing with +3 archs specified as -x option +--------------------------------------------------------------------------------- + +Changes in version 0.8.3 20100902 +- autoport: + * added support for staged builds by adding config defined options to autospec + * enable force mode and send srpm when run with -np + * added support for multiple architectures as -x options +--------------------------------------------------------------------------------- + +Changes in version 0.8.2 20100822 +- autoport: + * launch autoport-fix-environment using sudo; sudoers.d file provided +--------------------------------------------------------------------------------- + +Changes in version 0.8.1 20100821 +- autodist: + * export LANG=C before launching autospec for autoport to parse original messages +--------------------------------------------------------------------------------- + +Changes in version 0.8.0 20100820 +- autodist: + * save hidden staging specfiles (preprended by '.') + * various fixes +- autoport-fix-environment: + * added external suid script to have permissions to modify library directories +- autoport: + * lots of implementations for cross-platform and multi-arch builds + * added -v (verbose) option +- configuration files updated; added distdb.ppc +--------------------------------------------------------------------------------- + +Changes in version 0.7.1 20100624 +- update to current configuration +- autodist: minor fixed +- autoport: new script obsoleting autocross +--------------------------------------------------------------------------------- + +Changes in version 0.7.0 20100105 +- lots of changes for cross platform build support +- added updated distdb file +- added distdb.arm and distdb.x86_64 +- added new autocross tool for batch cross plaftorm ports +--------------------------------------------------------------------------------- + +Changes in version 0.6.3 20100110 +- added daily cron openmamba-autodist-cleanold +- distdb: updated to current status +--------------------------------------------------------------------------------- + +Changes in version 0.6.2 20091226 +- autodist: + * sync changes to present release +- distdb: + * updated +--------------------------------------------------------------------------------- + +Changes in version 0.6.1 20090721 +- autodist: + * write pre-update specfile after applying update patches + * fix support for delayed repository + * other minor fixes +- autodist-tool: + * added support for parametring build environment paths +--------------------------------------------------------------------------------- + +Changes in version 0.6.0 20090419 +- autodist: + * added support for running as autodist user in /var/autodist + * support RPM build environment relocation using autospec + * generate logs in $HOME/.autodist/ when not run as autodist user +--------------------------------------------------------------------------------- + +Changes in version 0.5.3 20090418 +- autodist: + * added version update check from updated specfile against autodist and delayed repository +--------------------------------------------------------------------------------- + +Changes in version 0.5.2 20090406 +- autodist: + * added version check agains specfile before sending +- autodist-tool: + * added skip operation +--------------------------------------------------------------------------------- +Changes in version 0.5.1 20090202 +- autodist: + * added pidfile support when used with -a option +--------------------------------------------------------------------------------- +Changes in version 0.5 20090125 +- autodist: + * major update with many improvements and fixes +--------------------------------------------------------------------------------- +Changes in version 0.4.4.1 +- autodist: + * fixed creation of pre$operation specfile copies + * ignore skippedlist for rebuild packages (+0) in -a mode +--------------------------------------------------------------------------------- +Changes in version 0.4.4 +- autodist: + * added --rebuild option and rebuild support from manual.in file (when version is set to +0) + * prepare: added support for multiple repository as download sources using srcpkglist from + distromatic >= 0.9.0; see AUTODIST_REPOSITORY var in configuration file + * many fixes +- autodist-tool: + * rename tool from autodist-makepatch + * added schedule command +--------------------------------------------------------------------------------- +Changes in version 0.4.3 +- autodist: + * added support for pluggable distdb directory (etc/autodist/distdb.d) + * added distdb/embedded.db and distdb/openmamba-website.db + * disabled --force-build option for automatic builds + * use serverity=1 as default for manual builds + * fix creation pre-operation specfile copies +- distdb: + * updated +--------------------------------------------------------------------------------- +Changes in version 0.4.2 +- autodist: + * fix server command passed on manual send operation + * fix: apply patches on "autoupdate" operation also +- autodist-makepatch: + * new tool added +--------------------------------------------------------------------------------- +Changes in version 0.4.1 +- autodist: + * many improvements to automatic builds + * moved to repository input and output files + * scan for *.skip in repository for skipped files + * scan for *.in in repository for input files +--------------------------------------------------------------------------------- +Changes in version 0.4.0 +- autodist: + * many improvements to automatic builds + * automatic builds: added support for patches + * added configuration directory /etc/autodist + * added configuration file /etc/autodist/config + * distdb and blacklist updated and moved to configuration directory +--------------------------------------------------------------------------------- +Changes in version 0.3.3 +- autodist: + * update: use launch_pkg_loop instead of launch_loop +--------------------------------------------------------------------------------- +Changes in version 0.3.2 +- autodist: + * many fixes +- Makefile: + * add empty /var/autodist/successlist +--------------------------------------------------------------------------------- +Changes in version 0.3.1 +- Makefile: + * change /var/log/autodist in /var/autodist/log + * add /var/autodist/log/update subdirs + * install default (empty) blacklist +--------------------------------------------------------------------------------- +Changes in version 0.3.0 +- license updated to GPL version 3 +- autodist: + * added automatic batch build operation (-a) + * added quiet output option (-q) + * added update option (-u) + * severity has now three levels: 0 (don't stop) 1 (skip current) 2 (abort) +- distdb: + * moved to localstatedir + * small updates +--------------------------------------------------------------------------------- +Changes in version 0.2.7 +- autodist: + set don't use (-) for cross_platform_cpu when build is not cross-target +--------------------------------------------------------------------------------- +Changes in version 0.2.6 +- autodist: + improved support for --arch to allow builds for specified target only; + added arch name translation for i*86 targets + split rpm and srpm send operation to avoid multiple srpms transfers +- distdb: + add autodist_onlycross variable to avoid non-cross build on specified + targets + define cross_target_cpu for i586 arch too to allow build from different + targets +--------------------------------------------------------------------------------- +Changes in version 0.2.5 +- autodist: + remove old failed and ok logs if found +- distdb: + add u_boot_all target +--------------------------------------------------------------------------------- +Changes in version 0.2.4 +- autodist: use separate log directories and files for each operation and + package; +- distdb: + addded kernel_embedded_all target +--------------------------------------------------------------------------------- +Changes in version 0.2.3 +- distdb: + add x86_64 cross toolchain support +--------------------------------------------------------------------------------- +Changes in version 0.2.2 +- distdb: + add ARM hard/soft float little/big endian targets in toolchain build + add kernel_mamba_all target +--------------------------------------------------------------------------------- +Changes in version 0.2.1 +- distdb update for a cross toolchain build +--------------------------------------------------------------------------------- +Changes in version 0.2 +- added -i option (install packages using autospec) +- distdb updates with basic cross-platform packages support +--------------------------------------------------------------------------------- +Changes in version 0.1 +- added support for parametric target +- new distdb file syntax, multiple packages and variables are supported +- new -t option to simulate programs execution +- new --server option to specify send server number passed to autospec +- new --force option for autospec (force packages build) +- use autospec for build operation +- added operation time console information +- various fixes +--------------------------------------------------------------------------------- +Changes in version 0.0.3 +- added command -p (prepare) +- added option -v (verbose) +- fixes in tail function +--------------------------------------------------------------------------------- +Changes in version 0.0.2 +- use autospec -a5 for kernel build +--------------------------------------------------------------------------------- +Changes in version 0.0.1.1 +- fixed tail_file output with longlines +- clockwise direction for progress indicator +--------------------------------------------------------------------------------- +Changes in version 0.0.1 +- first release +--------------------------------------------------------------------------------- diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..8d7527d --- /dev/null +++ b/Makefile @@ -0,0 +1,114 @@ +# Makefile for autodist +# Copyright (C) 2006-2009 by Silvan Calarco +# +PACKAGE = autodist + +include VERSION + +prefix = /usr +exec_prefix = ${prefix} +sysconfdir = /etc +sbindir = ${exec_prefix}/sbin +bindir = ${exec_prefix}/bin +datadir = ${prefix}/share +initrddir = ${sysconfdir}/rc.d/init.d +mandir = ${prefix}/usr/share/man +sysconfigdir= ${sysconfdir}/sysconfig +configdir = ${sysconfdir}/autodist +localstatedir= /var +piddir= ${localstatedir}/run/autodist + +srcdir = . +DESTDIR = + +INSTALL = /usr/bin/install +INSTALL_PROGRAM = ${INSTALL} -m 755 +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_DIR = ${INSTALL} -d -m 755 +INSTALL_SCRIPT = ${INSTALL_PROGRAM} + +pck_datadir = $(localstatedir)/$(PACKAGE) +pck_logdir = $(localstatedir)/$(PACKAGE)/log + +distdir = $(PACKAGE)-$(VERSION) +dist_archive = $(distdir).tar.bz2 + +default: + +install-dirs: + @$(INSTALL_DIR) $(DESTDIR)$(configdir)/scripts + @$(INSTALL_DIR) $(DESTDIR)$(configdir)/distdb.d + @$(INSTALL_DIR) $(DESTDIR)$(sysconfdir)/sudoers.d + @$(INSTALL_DIR) $(DESTDIR)$(sysconfdir)/cron.hourly + @$(INSTALL_DIR) $(DESTDIR)$(sysconfdir)/cron.daily + @$(INSTALL_DIR) $(DESTDIR)$(sysconfdir)/sysconfig + @$(INSTALL_DIR) $(DESTDIR)$(bindir) + @$(INSTALL_DIR) $(DESTDIR)$(pck_datadir) + @$(INSTALL_DIR) $(DESTDIR)$(pck_datadir)/template/autoupdate/spec-patches-build/old + @$(INSTALL_DIR) $(DESTDIR)$(pck_datadir)/template/autoupdate/spec-patches-update/old + @$(INSTALL_DIR) $(DESTDIR)$(pck_logdir)/prepare/{ok,failed} + @$(INSTALL_DIR) $(DESTDIR)$(pck_logdir)/update/{ok,failed} + @$(INSTALL_DIR) $(DESTDIR)$(pck_logdir)/build/{ok,failed} + @$(INSTALL_DIR) $(DESTDIR)$(pck_logdir)/install/{ok,failed} + @$(INSTALL_DIR) $(DESTDIR)$(pck_logdir)/send/{ok,failed} + @$(INSTALL_DIR) $(DESTDIR)$(pck_datadir)/RPM/{SPECS,SRPMS,BUILD,SOURCES,RPMS/{noarch,i586,ppc,x86_64,arm}} + @$(INSTALL_DIR) $(DESTDIR)$(piddir) + +install-programs: + @$(INSTALL_SCRIPT) autodist $(DESTDIR)$(bindir)/autodist + @$(INSTALL_SCRIPT) autodist-tool $(DESTDIR)$(bindir)/autodist-tool + @$(INSTALL_SCRIPT) autoport $(DESTDIR)$(bindir)/autoport + @$(INSTALL_SCRIPT) autoport-fix-environment $(DESTDIR)$(bindir)/autoport-fix-environment + @$(INSTALL_SCRIPT) etc/autodist/scripts/* $(DESTDIR)$(configdir)/scripts/ + +install-data: + @$(INSTALL_DATA) etc/autodist/config $(DESTDIR)$(configdir)/config + @$(INSTALL_DATA) etc/autodist/distdb $(DESTDIR)$(configdir)/distdb + @$(INSTALL_DATA) etc/autodist/distdb.i586 $(DESTDIR)$(configdir)/distdb.i586 + @$(INSTALL_DATA) etc/autodist/distdb.arm $(DESTDIR)$(configdir)/distdb.arm + @$(INSTALL_DATA) etc/autodist/distdb.x86_64 $(DESTDIR)$(configdir)/distdb.x86_64 + @$(INSTALL_DATA) etc/autodist/distdb.ppc $(DESTDIR)$(configdir)/distdb.ppc + @$(INSTALL_DATA) etc/autodist/unstage $(DESTDIR)$(configdir)/unstage + @$(INSTALL_DATA) etc/autodist/unstage.i586 $(DESTDIR)$(configdir)/unstage.i586 + @$(INSTALL_DATA) etc/autodist/unstage.arm $(DESTDIR)$(configdir)/unstage.arm + @$(INSTALL_DATA) etc/autodist/unstage.x86_64 $(DESTDIR)$(configdir)/unstage.x86_64 + @$(INSTALL_DATA) etc/autodist/unstage.ppc $(DESTDIR)$(configdir)/unstage.ppc + @$(INSTALL_DATA) etc/autodist/distdb.d/*.db $(DESTDIR)$(configdir)/distdb.d/ + @$(INSTALL_DATA) etc/autodist/blacklist $(DESTDIR)$(configdir)/blacklist + @$(INSTALL_DATA) etc/autodist/distdb.d/* $(DESTDIR)$(configdir)/distdb.d/ + @$(INSTALL_DATA) etc/sudoers.d/autoport $(DESTDIR)$(sysconfdir)/sudoers.d/autoport + @$(INSTALL_SCRIPT) etc/sysconfig/autoport $(DESTDIR)$(sysconfdir)/sysconfig/autoport + @$(INSTALL_SCRIPT) etc/cron.hourly/65-openmamba-autobuild-autoport $(DESTDIR)$(sysconfdir)/cron.hourly/ + @$(INSTALL_SCRIPT) etc/cron.daily/40-openmamba-autodist-cleanold $(DESTDIR)$(sysconfdir)/cron.daily/ + @$(INSTALL_DATA) autospec-conf $(DESTDIR)$(pck_datadir)/.autospec + @touch $(DESTDIR)$(pck_datadir)/template/autoupdate/auto.success + @touch $(DESTDIR)$(pck_datadir)/template/autoupdate/auto.skip + +install: \ + install-dirs \ + install-programs \ + install-data + +clean: + rm -f $(dist_archive) + +dist: clean + @case `sed 15q ChangeLog` in \ + *"$(VERSION)"*) : ;; \ + *) \ + echo "ChangeLog not updated; not releasing" 1>&2;\ + exit 1;; \ + esac + @rm -f $(dist_archive);\ + tar cf - --exclude=$(dist_archive) -C .. $(distdir) |\ + bzip2 -9 -c > $(dist_archive) + @echo "file \`$(dist_archive)' created" + @sed -i "s|^LOGDIR=.*|LOGDIR=$(pck_logdir)|" autodist + @sed -i "s|^VERSION=.*|VERSION=$(VERSION)|" autodist + @sed -i "s|^VERSION=.*|VERSION=$(VERSION)|" autoport + @sed -i "s|^VERSION=.*|VERSION=$(VERSION)|" autoport-fix-environment + +dist-rpm: dist + @rpm_sourcedir=`rpm --eval=%{_sourcedir}`;\ + mv -f $(dist_archive) $$rpm_sourcedir;\ + echo "and saved as \`$$rpm_sourcedir/$(dist_archive)'" diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..11440d4 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +VERSION = 0.8.5 diff --git a/autodist b/autodist new file mode 100755 index 0000000..a740429 --- /dev/null +++ b/autodist @@ -0,0 +1,1147 @@ +#!/bin/bash +# +# Autodist -- batch build tool for RPM based distributions +# Copyright (C) 2006-2010 by Silvan Calarco +# +# Released under the terms of the GNU GPL release 3 license +# +VERSION=0.8.3 +me=(${0##*/} $VERSION "Sat Aug 20 2010") +exec 3>`readlink /proc/self/fd/0` + +function usage() { + echo "\ +${me[0]} ${me[1]} +"$"Copyright (C) 2006-2010 Silvan Calarco "" +"$"Released under the terms of the GNU GPL v3 license" + echo " +"$"Batch build tool for bulding a whole distribution and much more."" + +"$"Usage"": + $me [operations ...] [options ...] [job ...] [-- autospec_args] + +"$"Operations"": + -a,--autobuild "$"Start batch build operations (implies -p -u -b -s --severity 1)"" + -p,--prepare "$"Prepare packages (download and prepare for update)"" + -u,--update "$"Update packages"" + -b,--build "$"Build packages"" + -i,--install "$"Install packages on local system"" + -s,--send "$"Send packages to repository"" + +"$"Options"": + -c,--cleanlogs "$"Clean all logs before starting"" + -d,--debug "$"Enable print of debugging information"" + -h,--help "$"Print this help, then exit"" + -t,--test "$"Just simulate the execution of programs"" + -q,--quiet "$"Be quiet (don't display tail of error logs)"" + -r,--rebuild "$"Rebuild packages"" + -v,--verbose "$"Be verbose"" + --force "$"Pass force parameter to autospec"" + --repository "$"Pass given repository as base for operations"" + --server num "$"Pass given server number to autospec for send operation"" + --severity num "$"Error handling level: + 0: don't stop (default) + 1: skip current job on error + 2: abort on error"" + --arch "$"Build packages for specified target architecture"" + + job "$"Job specification in the form pkg#version, job#version, job/pkg#version, examples: + glibc#2.11.1 + kernel-extra + kernel-packages/lirc"" + autospec_args "$"Send specified arguments to autospec"" +" + +} + +[ $# -gt 0 ] || { usage ; exit 1; } + +DATE_NOW=`LANG=C date +%s` +BUILDTIME=`date -Iseconds` +SYSCONFDIR=/etc/autodist +LOCALSTATEDIR=/var/autodist +[ "$USER" = "autodist" ] && USERCONFDIR=$LOCALSTATEDIR || USERCONFDIR=$HOME/.autodist +LOGBASEDIR=$USERCONFDIR/log +RPMTMPPATH=/var/tmp/autodist +SCRIPTDIR=$SYSCONFDIR/scripts + +DISTDB=$SYSCONFDIR/distdb +DISTDBDIR=$SYSCONFDIR/distdb.d/ +BLACKLIST=$SYSCONFDIR/blacklist +LEGACYLIST=$SYSCONFDIR/legacy +BUILDARCH=`rpm --eval %{_build_cpu}` +TARGETARCH=$BUILDARCH +CONFIGFILE=$SYSCONFDIR/config +SCRIPT_UPDATE_SPECFILE=$SCRIPTDIR/update-specfile +AUTOSPEC_CMD="/usr/bin/autospec" +PIDFILE="/var/run/autodist/autodist.pid" + +# Configuration defaults normally overriden in configuration file +AUTOBUILD_MAXNUM=50 +AUTOBUILD_DATEFROM=20070101 +GNOME_VER=2.24.0 +AUTODIST_REPOSITORY= +SEND_SERVER= + +[ -r $CONFIGFILE ] && . $CONFIGFILE + + +eval `autospec -q --eval="srpms_dir"` +eval `autospec -q --eval="rpms_dir"` +eval `autospec -q --eval="spec_dir"` +eval `autospec -q --eval="source_dir"` +eval `autospec -q --eval="tmppath_dir"` + +# init environment especially to have a full PATH when executed by crond with +# system init PATH +. /etc/profile +. /etc/profile.d/*.sh +export PATH + +# error handling severity: 0=don't stop; 1=skip; 2=stop +SEVERITY=1 + +for ((i=1; i<=$#; i++)); do + case ${!i} in + -a|--autobuild) do_autobuild=1; + do_prepare=1; + do_update=1; + do_build=1; + do_send=1; + SEVERITY=1 + [ -e $PIDFILE ] && { + PIDCHECK=`cat $PIDFILE` + [ "$PIDCHECK" -a -e /proc/$PIDCHECK ] && { + echo "Error: autodist -a already running with PID=$PIDCHECK.Aborting." + exit 1 + } + } + + ;; + -c|--cleanlogs) do_cleanlogs=1 ;; + -h|--help) usage + exit 0 + ;; + -p|--prepare) do_prepare=1 ;; + -u|--update) do_update=1 ;; + -r|--rebuild) rebuild_packages=1 ;; + -b|--build) do_build=1 ;; + -d|--debug) debug=1 ;; + -i|--install) do_install=1 ;; + -s|--send) do_send=1 ;; + -t|--test) simulate=1 ;; + -q|--quiet) quiet=1 ;; + -v|--verbose) verbose=1 ;; + --force) SEND_FORCE="--force" + SEND_FORCE_BUILD="--force-build" + ;; + --server) let i+=1 + [ "${!i}" ] || { + echo "Error: server parameter not given, aborting." + exit 1 + } + SEND_SERVER="${!i}" + ;; + --repository) let i+=1 + [ "${!i}" ] || { + echo "Error: repository parameter not given, aborting." + exit 1 + } + AUTODIST_REPOSITORY="${!i}" + ;; + --severity) let i+=1 + [ "${!i}" ] || { + echo "Error: severity parameter not given, aborting." + exit 1 + } + SEVERITY=${!i} + ;; + --arch) let i+=1 + [ "${!i}" ] || { + echo "Error: arch parameter not given, aborting." + exit 1 + } + TARGETARCH=${!i} + ;; + -*) if [ "${!i}" = "--" ]; then + AUTOSPEC_ARGS_MODE=1 + elif [ "$AUTOSPEC_ARGS_MODE" ]; then + AUTOSPEC_ARGS="$AUTOSPEC_ARGS ${!i}" + else + echo "ERROR: invalid option \`${!i}'; aborting." + exit 1 + fi + ;; + *) if [ "$AUTOSPEC_ARGS_MODE" != "1" ]; then + JOBNAME[${#TARGET[@]}]="${!i/\#*}" + [ "${!i/*\#}" != "${!i}" ] && JOBVER[${#TARGET[@]}]="+${!i/*\#}" + else + AUTOSPEC_ARGS="$AUTOSPEC_ARGS ${!i}" + fi + ;; + esac +done + +[ "$AUTODIST_REPOSITORY" ] || AUTODIST_REPOSITORY=devel-autodist +[ "$SEND_SERVER" ] || SEND_SERVER=$AUTODIST_REPOSITORY + +SEND_SERVER_CMD="--server $SEND_SERVER" +AUTOUPDATEDIR=${LOCAL_REPS_BASE_DIR}/$AUTODIST_REPOSITORY/autoupdate/ +[ -r $AUTOUPDATEDIR ] || { + AUTOUPDATEDIR=$USERCONFDIR/$AUTODIST_REPOSITORY/autoupdate + mkdir -p $AUTOUPDATEDIR +} + +SOURCESDIR=$AUTOUPDATEDIR/sources/ +SUCCESSLISTDIR=$AUTOUPDATEDIR +SKIPPEDLISTDIR=$AUTOUPDATEDIR + +SRCPKGLIST=${LOCAL_REPS_BASE_DIR}/$AUTODIST_REPOSITORY/srcpkglist +[ -r $SRCPKGLIST ] || { + SRCPKGLIST=$USERCONFDIR/$AUTODIST_REPOSITORY/srcpkglist + if [ ! -r $SRCPKGLIST -o "`find $SRCPKGLIST -mmin +60`" ]; then + mkdir -p $USERCONFDIR/$AUTODIST_REPOSITORY + curl -s $REPS_BASE_URL/$AUTODIST_REPOSITORY/srcpkglist -o $USERCONFDIR/$AUTODIST_REPOSITORY/srcpkglist || { + echo "Error: unable to fetch $REPS_BASE_DIR/$AUTODIST_REPOSITORY/srcpkglist" + exit 1 + } + fi +} + +[ "$AUTODIST_DELAYED_REPOSITORY" ] && { + SRCPKGLIST_DELAYED=${LOCAL_REPS_BASE_DIR}/$AUTODIST_DELAYED_REPOSITORY/srcpkglist + [ -r $SRCPKGLIST_DELAYED ] || { + SRCPKGLIST_DELAYED=$USERCONFDIR/$AUTODIST_DELAYED_REPOSITORY/srcpkglist + if [ ! -r $SRCPKGLIST_DELAYED -o "`find $SRCPKGLIST -mmin +60`" ]; then + mkdir -p $USERCONFDIR/$AUTODIST_DELAYED_REPOSITORY + curl -s $REPS_BASE_URL/$AUTODIST_DELAYED_REPOSITORY/srcpkglist -o $USERCONFDIR/$AUTODIST_DELAYED_REPOSITORY/srcpkglist || { + echo "Error: unable to fetch $REPS_BASE_DIR/$AUTODIST_DELAYED_REPOSITORY/srcpkglist" + exit 1 + } + fi + } +} + +# perform arch names conversions +case $BUILDARCH in + i386|i486|i686) BUILDARCH=i586 ;; +esac + +case $TARGETARCH in + i386|i486|i686) TARGETARCH=i586 ;; +esac + +[ -e "$DISTDB" ] || { + echo "ERROR: missing distdb file $DISTDB; aborting." + exit 1 +} + +[ -e $LOGBASEDIR ] || { + mkdir -p $LOGBASEDIR/prepare/{ok,failed} + mkdir -p $LOGBASEDIR/update/{ok,failed} + mkdir -p $LOGBASEDIR/build/{ok,failed} + mkdir -p $LOGBASEDIR/install/{ok,failed} + mkdir -p $LOGBASEDIR/send/{ok,failed} +} + +#[ "$PACKAGE" ] || { +# echo "ERROR: missing target; aborting." +# usage +# exit 1 +#} + +. $DISTDB +[ -e $DISTDB.$TARGETARCH ] && . $DISTDB.$TARGETARCH +[ -d $DISTDBDIR ] && \ + for f in `ls $DISTDBDIR/*.db`; do + . $f + done + +function tempfile() { + local tmpfile + tmpfile=`mktemp -q -t $me.XXXXXXXX` || { + echo "ERROR: cannot create temporary files." >&2 + exit 1 + } + trap "rm -f $tmpfile" 0 1 2 5 15 + + > $tmpfile || { + echo "ERROR: cannot write to temporary files." >&2 + exit 1 + } + echo $tmpfile +} + +function version_compare() +{ + local A B + A=$1 + B=$2 + + if [ ${A/[a-zA-Z_]*} -gt ${B/[a-zA-Z_]*} ]; then + return 1 + elif [ ${A/[a-zA-Z_]*} -lt ${B/[a-zA-Z_]*} ]; then + return 2 + else + if [[ "$A" > "$B" ]]; then + return 1 + elif [[ "$A" < "$B" ]]; then + return 2 + fi + fi + return 0 + +} + +function version_find_bigger() +{ + local VER1 VER2 FPOS CUTVER1 CUTVER2 + + VER1=$1 + VER2=$2 + FPOS=1 + while true; do + CUTVER1=`echo $VER1. | cut -d. -f $FPOS` + CUTVER2=`echo $VER2. | cut -d. -f $FPOS` + if [ "$CUTVER1" -a ! "$CUTVER2" ]; then + return 1 + elif [ "$CUTVER2" -a ! "$CUTVER1" ]; then + return 2 + elif [ ! "$CUTVER1" -a "$CUTVER2" ]; then + return 0 + else + version_compare $CUTVER1 $CUTVER2 + case $? in + 1) return 1 ;; + 2) return 2 ;; + esac + fi + FPOS=`expr $FPOS + 1` + done + return 0 +} + +#for target in ${TARGET[*]}; do +# echo ${target[*]} +#done +#exit 1 + +function tail_file() { + local elapsedtime elapsedstring elapsedcount phase lastprinttime newtime begintime lines c + c=0 + lines=0 + begintime=`LANG=C date +%s` + lastlinetime=$begintime + lastprinttime=0 + + while read line; do + echo "$line" >> $1 + let lines+=1 + newtime=`LANG=C date +%s` + let difftime=$newtime-$lastprinttime + + case $verbose in + 1) echo "$line" + ;; + *) + if [ $difftime -gt 1 ]; then + let c+=1 + lastprinttime=$newtime + let elapsedtime=$newtime-$begintime + [ $elapsedtime -gt 0 ] && let speed=$lines/$elapsedtime + + case $c in + 1) phase="|" ;; + 2) phase="/" ;; + 3) phase="-" ;; + 4) phase="\\" + let c=0 ;; + esac + elapsedstring="`expr $elapsedtime % 60`s" + elapsedcount=`expr $elapsedtime / 60` + [ $elapsedcount -gt 0 ] && elapsedstring="`expr $elapsedcount % 60`m $elapsedstring" + elapsedcount=`expr $elapsedcount / 60` + [ $elapsedcount -gt 0 ] && elapsedstring="${elapsedcount}h $elapsedstring" + echo -n -e "\r$2 $phase ($lines lines, $elapsedstring, $speed l/s)" + fi + ;; + esac + #echo -n -e "\rTailing...$phase (sleeped $diffdate seconds, $lines output lines) " + #savedate=newdate + done +} + +get_job_vector() { + # note: if JOB_NAME contains a "-" translate it to "_" + local JTARGET=${1/\/*} + local JPKG= + [ "$JTARGET" != "$1" ] && JPKG="${1/*\/}" + local JNAME=`echo $JTARGET | tr - _` + + # resolve JOB_NAME from distdb + local jobtmpfile=`tempfile` + # hack to get an array variable named as $j assigned to the JOB array + echo "echo \${$JNAME[*]}" > $jobtmpfile + + JOB=(`. $jobtmpfile`) + rm -f $jobtmpfile + + if [ ${#JOB[*]} -eq 0 ]; then + # create a default job with given JOB_NAME + JOB=($JTARGET "" "") + elif [ ${#JOB[*]} -eq 1 ]; then + # no variables defined, add an empty job + JOB=(${JOB[*]} "" "") + elif [ "${JPKG}" ]; then + TMPJOB=($JPKG) + for i in `seq 4 ${#JOB[*]}`; do + TMPJOB=(${TMPJOB[*]} "${JOB[$i]}") + done + JOB=${TMPJOB[*]} + fi + JOB_PKGS=(${JOB[0]//,/ }) + JOB_VARNAMES=(${JOB[1]//,/ }) +} + +function launch_pkgs_loop() { +# This function iterates the passed operation for each package (column) in job +# +# $1: operation (prepare, update, build, send, install) +# $2: options +# $3: job variables (e.g. i386,std) + + local JOB_VALUES JOB_ARGS JOB_IDX DEFINES_STRING i a PKGLINE + local cross_target_cpu autodist_crossonly operation + + # evaluate job variables + JOB_VALUES=(${3//,/ }) + JOB_IDX=$4 + + [ "$debug" = "1" ] && JOB_ARGS="--debug " || JOB_ARGS="" + [ $JOB_IDX ] || JOB_IDX=0 + operation="$1" + passed_arguments="$2" + ret=0 + DEFINES_STRING="" + + if [ "$TARGETARCH" != "$BUILDARCH" ]; then + TARGET_PLATFORM=`rpm --target ${TARGETARCH} --eval %{_target_platform}` + JOB_ARGS="$JOB_ARGS-A \"${TARGETARCH}\" --root /usr/${TARGET_PLATFORM} " + DEFINES_STRING="--define _host_cpu=\"${TARGETARCH}\",_target_cpu=\"${TARGETARCH}\"" + fi + + cross_target_cpu="" + autodist_crossonly="" + patch_operation=$operation + + for i in `seq 1 ${#JOB_VALUES[*]}`; do + [ "${JOB_VALUES[$i-1]}" = "-" ] || \ + case ${JOB_VARNAMES[$i-1]} in + %build_and_install) + [ "$operation" = "build" ] && operation=buildinstall + break + ;; + %*) + echo "!! Warning: skipping unknown internal variable: ${JOB_VARNAMES[$i-1]}" + break + ;; + autodist_crossonly) + autodist_crossonly=1 + ;; + cross_target_cpu) + cross_target_cpu="${JOB_VALUES[$i-1]}" + # don't specify cross_target_cpu for non-cross-target builds + if [ "$cross_target_cpu" = "$TARGETARCH" ]; then + # set cross_target_cpu as don't use + JOB_VALUES[$i-1]="-" + else + [ "$DEFINES_STRING" ] && + DEFINES_STRING="${DEFINES_STRING}," || + DEFINES_STRING="--define " + DEFINES_STRING="${DEFINES_STRING}${JOB_VARNAMES[$i-1]}=$cross_target_cpu" + fi + ;; + target) + # specific target build was specified, don't build packages containing explicit different target + [ "$BUILDARCH" != "$TARGETARCH" -a "${JOB_VALUES[$i-1]}" != "$TARGETARCH" ] && return 0; + JOB_ARGS="$JOB_ARGS-A \"${JOB_VALUES[$i-1]}\" " + ;; + *) + if [ "${JOB_VALUES[$i-1]}" ]; then + [ "$DEFINES_STRING" ] && + DEFINES_STRING="${DEFINES_STRING}," || + DEFINES_STRING="--define " + DEFINES_STRING="${DEFINES_STRING}${JOB_VARNAMES[$i-1]}=${JOB_VALUES[$i-1]}" + fi + ;; + esac + done + # don't build cross package for the same arch as target arch + [[ ( "$autodist_crossonly" = "1" ) && ( "$cross_target_cpu" = "$TARGETARCH" ) ]] && return 0; + + JOB_ARGS="$JOB_ARGS$DEFINES_STRING" + + [ "$patch_operation" = "buildinstall" ] && patch_operation=build + [ "$patch_operation" = "autoupdate" ] && patch_operation=update + + # launch loop for each package + for pkg in ${JOB_PKGS[*]}; do + + case $operation in + autoupdate|update|build|buildinstall) + [ -e $spec_dir/$pkg.spec ] || { + case $SEVERITY in + 0) ;; + 1) echo "!! Error: spec filename must be the same as package name or invalid job name; skipping $pkg package." + continue ;; + *) echo "!! Error: spec filename must be the same as package name or invalid job name; aborting." + exit 1 ;; + esac + } + + # apply patches + SPEC_DATE=`stat $spec_dir/$pkg.spec --printf=%y` + if [ $JOB_IDX -eq 0 -a "$do_autobuild" ]; then + # preserve specfile modification date + if [ -e $AUTOUPDATEDIR/spec-patches-$patch_operation/$pkg.spec.patch ]; then + echo -n "== " + patch -p1 $spec_dir/$pkg.spec $AUTOUPDATEDIR/spec-patches-$patch_operation/$pkg.spec.patch || { + case $SEVERITY in + 0) ;; + 1) echo "%! Error: could not apply patch to specfile; skipping $pkg package." + ret=1 + continue ;; + *) echo "!! Error: could not apply patch to specfile; aborting." + exit 1 ;; + esac + } + [ "$operation" = "update" -o "$operation" = "autoupdate" ] && return 0 + fi + fi + $SCRIPT_UPDATE_SPECFILE $spec_dir/$pkg.spec + ;; + esac + + [ -e $spec_dir/$pkg.spec ] && { + SPEC_EPOCH=`grep "Epoch:" $spec_dir/$pkg.spec | sed "s|Epoch:[[:space:]]*||"` + SPEC_VERSION=`grep "Version:" $spec_dir/$pkg.spec | sed "s|Version:[[:space:]]*||"` + SPEC_RELEASE=`grep "Release:" $spec_dir/$pkg.spec | sed "s|Release:[[:space:]]*||"` + } + + unset LOGFILE_SUFFIX + for a in ${JOB_VALUES[*]}; do + tr_job=`echo $a | tr / _` + LOGFILE_SUFFIX=${LOGFILE_SUFFIX}__$tr_job + done + LOGFILE_SUFFIX=$LOGFILE_SUFFIX.$TARGETARCH + [ "$JOB_NAME" = "${pkg}" ] && + LOGFILE_PKG_NAME=${pkg}${LOGFILE_SUFFIX} || + LOGFILE_PKG_NAME=${JOB_NAME}_${pkg}${LOGFILE_SUFFIX} + LOGFILE_PKG=${LOGDIR}/${LOGFILE_PKG_NAME} + + # clean previous logs for this package + [ -e ${LOGDIR}/ok/${LOGFILE_PKG_NAME}${LOGFILE_SUFFIX} ] && + rm -f ${LOGDIR}/ok/${LOGFILE_PKG_NAME}${LOGFILE_SUFFIX} + [ -e ${LOGDIR}/failed/${LOGFILE_PKG_NAME}${LOGFILE_SUFFIX} ] && + rm -f ${LOGDIR}/failed/${LOGFILE_PKG_NAME}-${LOGFILE_SUFFIX} + + [ -e "$SRCPKGLIST" ] && PKGLINE=`grep "^${pkg} " $SRCPKGLIST` || PKGLINE= + [ -e "$SRCPKGLIST_DELAYED" ] && PKGLINE_DELAYED=`grep "^${pkg} " $SRCPKGLIST_DELAYED` || PKGLINE_DELAYED= + + case $operation in + prepare) + command_opts="-a1" + if [ "$PKGLINE" ]; then + set -- $PKGLINE + [[ $4 =~ "^[0-9]+$" ]] && REPNAME=${AUTODIST_REPOSITORIES[$4]} || REPNAME="$4" + if [ "$REPNAME" ]; then + command_opts="$command_opts --server ${REPNAME}" + else + echo "Warning: undefined repository $4 in srcpkglist, check AUTODIST_REPOSITORIES in configuration file" + fi + else + echo "Warning: package $pkg is missing in srcpkglist file" + fi + ;; + rebuild) command_opts="-a4 --rebuild" ;; + autoupdate) command_opts="-a2:4" ;; + update) + # skip package in job if up to date + if [ "$PKGLINE" ]; then + set -- $PKGLINE + # warning: assuming version is passed first + version_find_bigger ${passed_arguments/ *} $2 + [ $? -eq 1 ] || { + echo "Warning: skipping ${pkg} package already up to date." + continue + } + fi + command_opts="-a3:4" ;; + build) + # skip package in job if it is in the delayed repository + if [ "$PKGLINE_DELAYED" -a "$do_autobuild" ]; then + set -- $PKGLINE_DELAYED + if [ "$SPEC_VERSION-$SPEC_RELEASE" = "$2-$6" ]; then + echo "Warning: skipping ${pkg} package build because already present in delayed repository." + continue + fi + fi + command_opts="-a5:6" ;; + buildinstall) + # skip package in job if up to date + if [ "$PKGLINE" ]; then + set -- $PKGLINE + # warning: assuming version is passed first + version_find_bigger $SPEC_VERSION $2 + [ $? -eq 0 ] && { + version_find_bigger $SPEC_RELEASE $6 + if [ $? -ne 1 ]; then + echo "Warning: skipping ${pkg} package already up to date." + continue + fi + } + fi + # skip package in job if it is in the delayed repository + if [ "$PKGLINE_DELAYED" -a "$do_autobuild" ]; then + set -- $PKGLINE_DELAYED + if [ "$SPEC_VERSION-$SPEC_RELEASE" = "$2-$6" ]; then + echo "Warning: skipping ${pkg} package build because already present in delayed repository." + continue + fi + fi + command_opts="-a5,6,10,11 --force-install" ;; + send) + # skip package in job if up to date + if [ "$PKGLINE" -a "$do_autobuild" ]; then + set -- $PKGLINE + # warning: assuming version is passed first + version_find_bigger $SPEC_VERSION $2 + [ $? -eq 0 ] && { + version_find_bigger $SPEC_RELEASE $6 + if [ $? -ne 1 ]; then + echo "Warning: skipping ${pkg} package already up to date." + continue + fi + } + fi + # skip package in job if it is in the delayed repository + if [ "$PKGLINE_DELAYED" -a "$do_autobuild" ]; then + set -- $PKGLINE_DELAYED + if [ "$SPEC_VERSION-$SPEC_RELEASE" = "$2-$6" ]; then + echo "Warning: skipping ${pkg} package send because already present in delayed repository." + continue + fi + fi + command_opts="-a10" ;; + install) command_opts="-a11" ;; + *) + echo "!! Internal error: unknown operation $operation; aborting." + exit 1 + ;; + esac + + command="$AUTOSPEC_CMD -u $pkg $command_opts $passed_arguments $JOB_ARGS" + + tmpfile=`tempfile` + tmpfile1=`tempfile` + echo -n "== "`log_date`" $JOB_NAME with args: $JOB_ARGS..." >> $LOGFILE + echo " +=> $command" >> $LOGFILE_PKG + [ "$verbose" ] && echo "== "`log_date`" $JOB_NAME with args: $JOB_ARGS... +=> $command" + + if [ "$simulate" ]; then + echo "Command: $command" + else +# eval "$command 2>&1 && echo '0'>$tmpfile1 || echo '1'>$tmpfile1" | tail_file $tmpfile "== $pkg (${JOB_VALUES[*]})..." + (export LANG=C; $command 2>&1; echo $? >$tmpfile1) | tail_file $tmpfile "== $pkg (${JOB_VALUES[*]})..." + if [ -e $tmpfile1 ]; then + ret=`cat $tmpfile1` + rm -f $tmpfile1 + else + ret=0 + fi + + cat $tmpfile >> $LOGFILE_PKG + + if [ $ret -gt 0 ]; then + echo " FAILED (ret=$ret)" + echo " FAILED (ret=$ret)" >> $LOGFILE + [ "$quiet" ] || { + echo "=> $command" + echo + echo " == begin of output log ==" + echo + tail -n 40 $tmpfile + echo + echo " == end of output log ==" + echo + } + mv $LOGFILE_PKG $LOGDIR/failed/ + echo "?= See $LOGDIR/failed/${LOGFILE_PKG_NAME}" + case $operation in + autoupdate|update) + ;; + build|buildinstall) + # copy new patches to sourcesdir for sharing + [ "$do_autobuild" ] && { + PATCHES=`diff $spec_dir/$pkg.spec $spec_dir/.$pkg.spec.autodist.preupdate | grep "> Patch" | sed "s|.*[[:space:]]\([^[:space:]]*\)|\1|"` + for p in $PATCHES; do + echo "== Copying patch $p to public dir" + [ -e $source_dir/$p ] && cp $source_dir/$p $SOURCESDIR/ + done + } + ;; + esac + [ $SEVERITY -gt 0 ] && { + rm -f $tmpfile + return $ret + } + else + echo + echo " OK" >> $LOGFILE + mv $LOGFILE_PKG $LOGDIR/ok/ + + case $operation in + prepare) + cp $spec_dir/$pkg.spec $spec_dir/.$pkg.spec.autodist.preupdate + ;; + rebuild) + cp $spec_dir/$pkg.spec $spec_dir/.$pkg.spec.autodist.prebuild + ;; + update|autoupdate) + cp $spec_dir/$pkg.spec $spec_dir/.$pkg.spec.autodist.prebuild + SPEC_EPOCH=`grep "Epoch:" $spec_dir/$pkg.spec | sed "s|Epoch:[[:space:]]*||"` + SPEC_VERSION=`grep "Version:" $spec_dir/$pkg.spec | sed "s|Version:[[:space:]]*||"` + SPEC_RELEASE=`grep "Release:" $spec_dir/$pkg.spec | sed "s|Release:[[:space:]]*||"` + if [ "$PKGLINE" ]; then + set -- $PKGLINE + echo "== Specfile updated from version $2-$6 to $SPEC_VERSION-$SPEC_RELEASE" + if [ "`echo $SPEC_VERSION | grep -i alpha`" -o \ + "`echo $SPEC_VERSION | grep -i beta`" -o \ + "`echo $SPEC_VERSION | grep -i rc`" -o \ + "`echo $SPEC_VERSION | grep -i pre`" -o \ + "`echo $SPEC_VERSION | grep -i pl`" ]; then + if [ ! "`echo $2 | grep -i alpha`" -a \ + ! "`echo $2 | grep -i beta`" -a \ + ! "`echo $2 | grep -i rc`" -a \ + ! "`echo $2 | grep -i pre`" -a \ + ! "`echo $2 | grep -i pl`" ]; then + echo "!! Looks like an update to an unstable release; skipping." + [ $SEVERITY -gt 0 ] && { + rm -f $tmpfile + return 3 + } + fi + fi + fi + ;; + buildinstall|send) + if [ $JOB_IDX -eq $JOB_LAST -a "$do_autobuild" ]; then + # archive patches + [ -e $AUTOUPDATEDIR/spec-patches-update/$pkg.spec.patch ] && \ + mv $AUTOUPDATEDIR/spec-patches-update/$pkg.spec.patch \ + $AUTOUPDATEDIR/spec-patches-update/old/ + [ -e $AUTOUPDATEDIR/spec-patches-build/$pkg.spec.patch ] && \ + mv $AUTOUPDATEDIR/spec-patches-build/$pkg.spec.patch \ + $AUTOUPDATEDIR/spec-patches-build/old/ + PATCHES=`diff $spec_dir/$pkg.spec $spec_dir/.$pkg.spec.autodist.preupdate | grep "> Patch" | sed "s|.*[[:space:]]\([^[:space:]]*\)|\1|"` + for p in $PATCHES; do + [ -e $SOURCESDIR/$p ] && rm -f $SOURCESDIR/$p + done + fi + ;; + esac + fi + rm -f $tmpfile + fi + done + return $ret +} + +function launch_job_loop() { + # Iterates launch_pkgs_loop for each of the lines of current job + # (defined from JOB_FIRST to JOB_LAST) + # This is needed for build, send and install operations + for j in `seq $JOB_FIRST $JOB_LAST`; do + launch_pkgs_loop "$1" "$2" "${JOBS[$j]}" $j + [ $? -gt 0 ] && return 1; + done + return 0 +} + +function log_date() { + echo -n `LANG=C date +%Y%m%d@%H%M%S` +} + +for a in $LOGBASEDIR/{,prepare/{,ok,failed},update/{,ok,failed},build/{,ok,failed},install/{,ok,failed},send/{,ok,failed}}; do + + [ ! -w $a ] && { + echo "!! Error: directory $a is missing or read-only; aborting." + exit 1 + } + + [ "$do_cleanlogs" ] && { + find $a -type f -exec rm -f {} \; + } + +done + +echo "%% Autodist started with PID $$ @ `LANG=C date`" + +# autobuild: add jobs ordered by oldest builds +if [ "$do_autobuild" = "1" ]; then + trap "rm -f $PIDFILE; exit 1" SIGQUIT SIGINT SIGKILL SIGTERM + echo $$ > $PIDFILE + [ -e "$SRCPKGLIST" ] || { + echo "ERROR: missing srcpkglist file $SRCPKGLIST; aborting." + exit 1 + } + srctmpfile=`tempfile` + cat $AUTOUPDATEDIR/*.in > $srctmpfile + cat $SRCPKGLIST | sort --key=3 >> $srctmpfile + + pkgtmpfile=`tempfile` + [ "$pkgtmpfile" ] || { + echo "ERROR: cannot create temporary files; aborting." + exit 1 + } + + ## when autobuilding always rebuild packages + #SEND_FORCE_BUILD="--force-build" + AUTOBUILD_NUMADDED=0 + BUILDDATE=0 + PKGCOUNT=`wc -l $srctmpfile | awk '{ print $1 }'` + SKIPPEDCOUNT=0 + BLACKLISTCOUNT=0 + SUCCESSLISTCOUNT=0 + + > $pkgtmpfile + +# cat $srctmpfile | sort --key=3 | \ + while read line; do + set -- $line + PKGNAME=${1} + VERSION=${2} + BUILDDATE=${3} + SOURCEREP=${4} + RELEASE=${5} + EPOCH=${6} + + # skip duplicates + grep "^$PKGNAME " $pkgtmpfile >/dev/null && continue + + # check blacklist + awk '{ print $1 }' $BLACKLIST | grep "^$PKGNAME$" >/dev/null && { + BLACKLISTCOUNT=`expr $BLACKLISTCOUNT + 1` + #echo "?= Job $PKGNAME is in the blacklist; skipping" + continue + } + + if [ "${VERSION:0:1}" == "+" -a "$VERSION" != "+0" ]; then + TRVER=`echo ${VERSION:1} | tr - .` + get_job_vector $PKGNAME + NEED_REBUILD=0 + if [ ${#JOB_PKGS[*]} -gt 1 ]; then + # jobs are not fully rebuilt + for j in ${JOB_PKGS[*]}; do + REPVER=`grep "^$j " $SRCPKGLIST | gawk '{ print $2 }'` + version_find_bigger $TRVER $REPVER + [ $? -eq 1 ] && NEED_REBUILD=1 + done + else + # single packages are rebuilt if scheduled + NEED_REBUILD=1 + fi + if [ "$NEED_REBUILD" = "0" ]; then + echo "?= Job $PKGNAME is already up to date; skipping" + continue + fi + elif [ "$VERSION" != "+0" ]; then + + # check successlist + SUCCESSLINE=`awk '{ print $1" "$2 }' $SUCCESSLISTDIR/*.success | grep -m1 "^$PKGNAME "` + if [ "$SUCCESSLINE" ]; then + set -- $SUCCESSLINE + SUCCESSTIME=$2 + [ "$SUCCESSTIME" ] || SUCCESSTIME=0 + SUCCESSDAYS=`expr \( $DATE_NOW - $SUCCESSTIME \) / 86400` + if [ "$SUCCESSDAYS" -le "$AUTOBUILD_SUCCESS_DAYS" ]; then + SUCCESSLISTCOUNT=`expr $SUCCESSLISTCOUNT + 1` + #echo "?= Job $PKGNAME has been in the successlist for $SUCCESSDAYS days; skipping" + continue + else + sed -i "/^$PKGNAME /d" $SUCCESSLISTDIR/*.success + fi + fi + + # check skippedlist + SKIPPEDLINE=`awk '{ print $1" "$2 }' $SKIPPEDLISTDIR/*.skip | grep -m1 "^$PKGNAME "` + if [ "$SKIPPEDLINE" ]; then + set -- $SKIPPEDLINE + SKIPPEDTIME=$2 + SKIPPEDDAYS=`expr \( $DATE_NOW - $SKIPPEDTIME \) / 86400` + if [ "$SKIPPEDDAYS" -le "$AUTOBUILD_SKIP_DAYS" ]; then + SKIPPEDCOUNT=`expr $SKIPPEDCOUNT + 1` +# echo "?= Package $PKGNAME has been in the skippedlist for $SKIPPEDDAYS days; skipping" + continue + else + sed -i "/^$PKGNAME /d" $SKIPPEDLISTDIR/*.skip + fi + fi + + # check legacylist + awk '{ print $1 }' $LEGACYLIST | grep "^$PKGNAME$" >/dev/null && { + echo "?= Job $PKGNAME is in the legacy list; skipping automatic update" + echo "$PKGNAME $DATE_NOW 100" >> $SKIPPEDLISTDIR/auto.skip + continue + } + + fi + + if [ $AUTOBUILD_NUMADDED -ge $AUTOBUILD_MAXNUM ]; then + break + elif [ $BUILDDATE -ge $AUTOBUILD_DATEFROM -o $BUILDDATE -eq 0 ]; then + AUTOBUILD_NUMADDED=`expr $AUTOBUILD_NUMADDED + 1` + echo "$PKGNAME $VERSION" >> $pkgtmpfile + fi + done < $srctmpfile + + echo "%% Total pkgs: $PKGCOUNT, skipped list: $SKIPPEDCOUNT, blacklist: $BLACKLISTCOUNT, success list: $SUCCESSLISTCOUNT" + + while read line; do + set -- $line + PKGNAME=${1} + VERSION=${2} + JOBVER[${#JOBNAME[@]}]=$VERSION + JOBNAME[${#JOBNAME[@]}]=$PKGNAME + done < $pkgtmpfile + + echo "%% autoupdate jobs: ${JOBNAME[*]}" + rm -f $pkgtmpfile $srctmpfile +fi + + +echo "%% ${#JOBNAME[*]} job(s) scheduled" +echo "%% Starting main jobs loop" +for JOB_NUM in `seq 1 ${#JOBNAME[*]}`; do + JOB_NAME=${JOBNAME[$JOB_NUM-1]} + JOB_VER=${JOBVER[$JOB_NUM-1]} + JOB_VER=`echo $JOB_VER | tr - .` + + # resolve JOB_NAME from distdb + get_job_vector $JOB_NAME + JOB_NAME=${JOB_NAME/*\/} + + [ "$quiet" ] || echo " +== =======================$JOB_NAME=============================" + echo -n "%% Doing $JOB_NAME (" + for k in ${JOB_VARNAMES[*]}; do + [ "$k" != "${JOB_VARNAMES[0]}" ] && echo -n " " + echo -n "%${k}" + done + echo ") job" + + DATE_NOW=`LANG=C date +%s` + JOBS=() + for k in `seq 3 ${#JOB[*]}`; do + JOBS=(${JOBS[*]} "${JOB[$k-1]}") + done + + JOB_NUMBER=${#JOBS[*]} + JOB_FIRST=0 + JOB_LAST=`expr $JOB_NUMBER - 1` + + if [ "$do_prepare" ]; then + LOGDIR=$LOGBASEDIR/prepare + LOGFILE=$LOGDIR/last + > $LOGFILE + echo "%% Starting PREPARE operation @ `LANG=C date`" + echo "%% "`log_date`" Starting PREPARE operation" > $LOGFILE + launch_pkgs_loop prepare "$AUTOSPEC_ARGS --force" || { + case $SEVERITY in + 0) ;; + 1) echo "%! Error during package prepare; skipping $JOB_NAME job." + continue ;; + *) echo "!! Error during package prepare; aborting." + exit 1 ;; + esac + } + if [ ! "$do_update" -a "$do_autobuild" = "1" ]; then + [ "${AUTOSPEC_ARGS/--changelog}" = "${AUTOSPEC_ARGS}" ] && + AUTOSPEC_ARGS="$AUTOSPEC_ARGS --changelog \"automatic rebuild by autodist\"" + launch_pkgs_loop rebuild "$AUTOSPEC_ARGS" || { + case $SEVERITY in + 0) ;; + 1) echo "%! Error during package update for rebuild; skipping $JOB_NAME job." + continue ;; + *) echo "!! Error during package update for rebuild; aborting." + exit 1 ;; + esac + } + fi + fi + + if [ "$do_update" ]; then + LOGDIR=$LOGBASEDIR/update + LOGFILE=$LOGDIR/last + echo "%% Starting UPDATE operation @ `LANG=C date`" + echo "%% "`log_date`" Starting UPDATE operation" > $LOGFILE + + if [ "${JOB_VER:0:1}" != "+" -o "${JOB_VER}" = "+0" ]; then +# --force-update \ + # check legacylist + awk '{ print $1 }' $LEGACYLIST | grep "^$JOB_NAME$" >/dev/null && { + echo "?= Job $JOB_NAME is in the legacy list; forcing rebuild" + ret=1 + } || { + [ "${AUTOSPEC_ARGS/--changelog}" = "${AUTOSPEC_ARGS}" ] && + AUTOSPEC_ARGS="$AUTOSPEC_ARGS --changelog \"automatic update by autodist\"" + launch_pkgs_loop autoupdate "$AUTOSPEC_ARGS $SEND_FORCE \ + --define gnomever=$GNOME_VER" + ret=$? + } + if [ $ret != 0 ]; then + if [ ! "$rebuild_packages" -a "${JOB_VER}" != "+0" ]; then + [ $ret -ge 2 -a "$do_autobuild" ] && { + echo "%% Adding $JOB_NAME job to skipped list." + echo "$JOB_NAME $DATE_NOW $?" >> $SKIPPEDLISTDIR/auto.skip + } + case $SEVERITY in + 0) ;; + 1) echo "%! Error during package update; skipping $JOB_NAME job." + continue ;; + *) echo "!! Error during package update; aborting." + exit 1 ;; + esac + else + echo "%% Rebuilding package(s)" + [ "${AUTOSPEC_ARGS/--changelog}" = "${AUTOSPEC_ARGS}" ] && + AUTOSPEC_ARGS="$AUTOSPEC_ARGS --changelog \"automatic rebuild by autodist\"" + launch_pkgs_loop rebuild "$AUTOSPEC_ARGS" || { + case $SEVERITY in + 0) ;; + 1) echo "%! Error during package update for rebuild; skipping $JOB_NAME job." + continue ;; + *) echo "!! Error during package update for rebuild; aborting." + exit 1 ;; + esac + } + fi + fi + else + ## skip package in job if up to date + #for j in ${JOB_PKGS[*]}; do + # REPVER=`grep "^$j " $SRCPKGLIST | gawk '{ print $2 }'` + # version_find_bigger $TRVER $REPVER + # [ $? -eq 1 ] && NEED_REBUILD=1 + # done + echo "%% Updating to version ${JOB_VER:1}" + # WARNING: JOB_VER must be passed to launch_pkgs_loop as the first string in the second parameter + [ "${AUTOSPEC_ARGS/--changelog}" = "${AUTOSPEC_ARGS}" ] && + AUTOSPEC_ARGS="$AUTOSPEC_ARGS --changelog \"automatic update to ${JOB_VER:1} by autodist\"" + launch_pkgs_loop update "${JOB_VER:1} $AUTOSPEC_ARGS $SEND_FORCE \ + --define gnomever=$GNOME_VER" || { + if [ ! "$rebuild_packages" ]; then + case $SEVERITY in + 0) ;; + 1) echo "%! Error during update; skipping $JOB_NAME job." + continue ;; + *) echo "!! Error during update; aborting." + exit 1 ;; + esac + else + [ "${AUTOSPEC_ARGS/--changelog}" = "${AUTOSPEC_ARGS}" ] && + AUTOSPEC_ARGS="$AUTOSPEC_ARGS --changelog \"automatic rebuild by autodist\"" + launch_pkgs_loop rebuild "$AUTOSPEC_ARGS" || { + case $SEVERITY in + 0) ;; + 1) echo "%! Error during package update for rebuild; skipping $JOB_NAME job." + continue ;; + *) echo "!! Error during package update for rebuild; aborting." + exit 1 ;; + esac + } + fi + } + fi + fi + + if [ "$do_build" ]; then + LOGDIR=$LOGBASEDIR/build + LOGFILE=$LOGDIR/last + echo "%% Starting BUILD operation @ `LANG=C date`" + echo "%% "`log_date`" Starting BUILD operation" > $LOGFILE + launch_job_loop build "$AUTOSPEC_ARGS $SEND_FORCE_BUILD $SEND_SERVER_CMD" || { + case $SEVERITY in + 0) ;; + 1) echo "%! Error during build; skipping $JOB_NAME job." + continue ;; + *) echo "!! Error during build; aborting." + exit 1 ;; + esac + } + fi + + if [ "$do_install" ]; then + LOGDIR=$LOGBASEDIR/install + LOGFILE=$LOGDIR/last + > $LOGFILE + echo "%% Starting INSTALL operation @ `LANG=C date`" + echo "%% "`log_date`" Starting INSTALL operation" > $LOGFILE + launch_job_loop install "$AUTOSPEC_ARGS" || { + case $SEVERITY in + 0) ;; + 1) echo "%! Error during installation; skipping $JOB_NAME job." + continue ;; + *) echo "!! Error during installation; aborting." + exit 1 ;; + esac + } + fi + + if [ "$do_send" ]; then + LOGDIR=$LOGBASEDIR/send + LOGFILE=$LOGDIR/last + > $LOGFILE + echo "%% Starting SEND operation @ `LANG=C date`" + echo "%% "`log_date`" Starting SEND operation" > $LOGFILE + launch_job_loop send "$AUTOSPEC_ARGS --nosrpm $SEND_SERVER_CMD" || { + case $SEVERITY in + 0) ;; + 1) echo "%! Error sending packages; skipping $JOB_NAME job." + continue ;; + *) echo "!! Error sending packages; aborting." + exit 1 ;; + esac + } + echo "== sending source rpms" + launch_pkgs_loop send "$AUTOSPEC_ARGS --norpm $SEND_SERVER_CMD" + if [ $? -gt 0 ]; then + case $SEVERITY in + 0) ;; + 1) echo "%! Error sending sources; skipping $JOB_NAME job." + continue ;; + *) echo "!! Error sending sources; aborting." + exit 1 ;; + esac + else + # archive patches + if [ "$do_autobuild" ]; then + [ -e $AUTOUPDATEDIR/spec-patches-update/$JOB_NAME.spec.patch ] && \ + mv $AUTOUPDATEDIR/spec-patches-update/$JOB_NAME.spec.patch \ + $AUTOUPDATEDIR/spec-patches-update/old/${JOB_NAME}.spec.${DATE_NOW}.patch + [ -e $AUTOUPDATEDIR/spec-patches-build/$JOB_NAME.spec.patch ] && \ + mv $AUTOUPDATEDIR/spec-patches-build/${JOB_NAME}.spec.${DATE_NOW}.patch \ + $AUTOUPDATEDIR/spec-patches-build/old/${JOB_NAME}.spec.${DATE_NOW}.patch + fi + fi + fi + # if we are here the job was completed; remove manual entry, if any, and add to successlist + [ "$do_autobuild" ] && { + sed -i "/^$JOB_NAME .*/d" $AUTOUPDATEDIR/*.in + echo "$JOB_NAME $DATE_NOW" >> $SUCCESSLISTDIR/auto.success + } +done +[ "$do_autobuild" = "1" ] && rm -f $PIDFILE +echo "%% All jobs done @ `LANG=C date`" diff --git a/autodist-tool b/autodist-tool new file mode 100755 index 0000000..d191119 --- /dev/null +++ b/autodist-tool @@ -0,0 +1,157 @@ +#!/bin/bash +# +# autodist-tool +# Copyright (c) 2008-2010 by Silvan Calarco +# +. /etc/autodist/config +me=(${0##*/} $VERSION "Tue Oct 28 2008") + +DATE_NOW=`date +%s` +RPMDIR=/usr/src/RPM/ +AUTOUPDATEDIR=/var/ftp/pub/openmamba/$AUTODIST_REPOSITORY/autoupdate/ +BUILDDEPSFILE=/var/ftp/pub/openmamba/distromatic/$AUTODIST_REPOSITORY/builddeps-i586 +SOURCESDIR=$AUTOUPDATEDIR/sources/ +SRCPKGLIST=/var/ftp/pub/openmamba/$AUTODIST_REPOSITORY/srcpkglist +SUCCESSLISTDIR=$AUTOUPDATEDIR +SKIPPEDLISTDIR=$AUTOUPDATEDIR +DISTDBFILE=/etc/autodist/distdb + +#eval `autospec -q --eval="srpms_dir"` +#eval `autospec -q --eval="rpms_dir"` +eval `autospec -q --eval="spec_dir"` +#eval `autospec -q --eval="source_dir"` +#eval `autospec -q --eval="tmppath_dir"` + +function usage() { + echo "\ +${me[0]} ${me[1]} +"$"Copyright (C) 2008 Silvan Calarco "" +"$"Released under the terms of the GNU GPL v3 license" + echo " + +"$"Usage"": + $me makepatch package [build|update|remove] + $me schedule job_regexp + $me unschedule job_regexp + $me skip job_regexp +" + +} + +[ $# -gt 0 ] || { usage ; exit 1; } + +unset OPERATION COMMAND PKG + +for ((i=1; i<=$#; i++)); do + case ${!i} in + -h|--help) usage; exit 1 ;; + *) if [ ! "$COMMAND" ]; then + COMMAND=${!i} + elif [ ! "$JOB" ]; then + JOB=${!i} + else + OPERATION=${!i} + fi + ;; + esac +done + +[ "${JOB/*\#}" != "${JOB}" ] && { + JOBVER="+${JOB/*\#}" + JOB="${JOB/\#*}" +} || JOBVER="+0" + +if [ "$COMMAND" = "makepatch" ]; then + [ "$JOB" ] || { + echo "Error: package non specified." + exit 1 + } + + if [ ! "$OPERATION" ]; then + [ -e $AUTOUPDATEDIR/spec-patches-update/$JOB.spec.patch ] && { + echo "== update patch ==" + cat $AUTOUPDATEDIR/spec-patches-update/$JOB.spec.patch + } + [ -e $AUTOUPDATEDIR/spec-patches-build/$JOB.spec.patch ] && { + echo "== build patch ==" + cat $AUTOUPDATEDIR/spec-patches-build/$JOB.spec.patch + } + exit 0 + elif [ "$OPERATION" = "remove" ]; then + echo -n "== Removing patches for $JOB package" + rm -f $AUTOUPDATEDIR/spec-patches-update/$JOB.spec.patch + rm -f $AUTOUPDATEDIR/spec-patches-build/$JOB.spec.patch + echo + exit 0 + fi + +echo diff $spec_dir/.$JOB.spec.autodist.pre$OPERATION $spec_dir/$JOB.spec > \ + $AUTOUPDATEDIR/spec-patches-$OPERATION/$JOB.spec.patch + + diff $spec_dir/.$JOB.spec.autodist.pre$OPERATION $spec_dir/$JOB.spec > \ + $AUTOUPDATEDIR/spec-patches-$OPERATION/$JOB.spec.patch + RET=$? + + if [ $RET -eq 1 ]; then + echo "Created $OPERATION patch for $JOB:" + cat $AUTOUPDATEDIR/spec-patches-$OPERATION/$JOB.spec.patch + exit 0 + elif [ $RET -eq 0 ]; then + echo "Info: files are identical." + rm $AUTOUPDATEDIR/spec-patches-$OPERATION/$JOB.spec.patch + exit 0 + else + echo "Error: diff returned $RET while creating the patch." + exit 1 + fi +elif [ "$COMMAND" = "schedule" ]; then + [ "$JOB" ] || { + echo "Scheduled jobs:" + cat $AUTOUPDATEDIR/manual.in + exit 0 + } +# cat $BUILDDEPSFILE | sort -k2 -n | +# while read line; do +# set -- $line +# if [ "`echo \" $1 \" | grep \" $JOB \"`" ]; then + if [ "`grep \"^$JOB \" $SRCPKGLIST`" -o "`grep \"^$JOB=(\" $DISTDBFILE`" ]; then + echo "Job $JOB scheduled for automatic update or rebuild" + sed -i "/^$JOB .*/d" $AUTOUPDATEDIR/manual.in + echo "$JOB $JOBVER 0" >> $AUTOUPDATEDIR/manual.in || exit 1 + else + echo "Unknown job $JOB." + fi +# done +elif [ "$COMMAND" = "unschedule" ]; then + [ "$JOB" ] || { + echo "Scheduled jobs:" + cat $AUTOUPDATEDIR/manual.in + exit 0 + } +# cat $AUTOUPDATEDIR/manual.in | sort -k2 -n | +# while read line; do +# set -- $line +# if [ "`echo \" $1 \" | grep \" $JOB \"`" ]; then + if [ "`grep \"^$JOB \" $AUTOUPDATEDIR/manual.in`" ]; then + sed -i "/^$JOB .*/d" $AUTOUPDATEDIR/manual.in + echo "Job $JOB removed from schedule" + fi +# done +elif [ "$COMMAND" = "skip" ]; then + [ "$JOB" ] || { + echo "Error: package non specified." + exit 1 + } + SKIPPEDLINE=`awk '{ print $1" "$2 }' $SKIPPEDLISTDIR/*.skip | grep -m1 "^$JOB "` + if [ "$SKIPPEDLINE" ]; then + sed -i "/^$PKGNAME /d" $SKIPPEDLISTDIR/*.skip + fi + if [ "`grep \"^$JOB \" $SRCPKGLIST`" -o "`grep \"^$JOB=(\" $DISTDBFILE`" ]; then + echo "$JOB $DATE_NOW 101" >> $SKIPPEDLISTDIR/auto.skip + echo "Job $JOB skipped from automatic builds" + else + echo "Unknown job $JOB." + fi +else + echo "Error: invalid command $COMMAND" +fi diff --git a/autoport b/autoport new file mode 100755 index 0000000..ee0510e --- /dev/null +++ b/autoport @@ -0,0 +1,475 @@ +#!/bin/bash +# autoport -- batch cross-build tool based on autodist +# Copyright (C) 2011 by Silvan Calarco +# +# Released under the terms of the GNU GPL release 3 license +# +VERSION=0.8.5 +BASE_ARCH=i586 +BASE_REPOSITORY=devel +PORT_REPOSITORY=devel + +. /etc/autodist/config + +me=(${0##*/} $VERSION "Sat Mar 20 2011") + +function usage() { + echo "\ +${me[0]} ${me[1]} +"$"Copyright (C) 2010 Silvan Calarco "" +"$"Released under the terms of the GNU GPL v3 license" + echo " +"$"Batch port and cross-build tool based on autodist."" + +"$"Usage"": + $me [-a][-f][-x arch1[,arch2],..][-r repository][-d release_repository]{--fix|job ...} + + -a "$"Automatic mode (use cache) + -b "$"Batch port all packages in port repository to sync with base repository + -f "$"Force operations + -np "$"Don't prepare packages + -nr "$"Don't recurse build + --fix "$"Fix .la files for cross linking and exit + -r "$"Work on given repository (default: $PORT_REPOSITORY) + -d "$"Release packages to given repository (default: $PORT_REPOSITORY) + -x "$"Operate in cross build mode + -h "$"Show this help and exit + -v "$"More verbose output + + arch "$"Target architecture + job "$"Job specification for autodist"" +" + +} + +# get_pkg_buildinfo - uses distromatic generated build file for +# getting information on the repository +# +# $1: distromatic files base url for repository +# $2: architecture +# $3: pkg name +function get_pkg_buildinfo() { + + local pkg i a local_arch local_distromatic + + [ $1 ] && local_distromatic=$1 || exit 1 + [ $2 ] && local_arch=$2 || exit 1 + [ $3 ] && pkg=$3 + + if [ ! "$pkg" ]; then + [ -e $local_distromatic/builds-${local_arch}.sh ] && . $local_distromatic/builds-${local_arch}.sh + return 0 + fi + + pkg_archs=(); + for a in ${archs[*]}; do + pkg_header=(); + DISTROMATIC_BUILD_FILE=$local_distromatic/builds-$a.sh + [ -e $DISTROMATIC_BUILD_FILE ] && . $DISTROMATIC_BUILD_FILE + [ ${pkg_header[0]} ] && pkg_archs=(${pkg_archs[*]} $a) + done + + pkg_header=(); + pkg_builds=(); + pkg_obsoletes=(); + pkg_list=(); + + DISTROMATIC_BUILD_FILE=$local_distromatic/builds-${local_arch}.sh + [ -e $DISTROMATIC_BUILD_FILE ] && . $DISTROMATIC_BUILD_FILE + +# { +# echo "Error: missing distromatic generated file $DISTROMATIC_BUILD_FILE; aborting." +# return; +# } +# . $DISTROMATIC_BUILD_FILE + + for i in ${pkg_list[*]}; do + if [ "$i" == "${pkg_header[0]}" ]; then + pkg_name=${pkg_header[0]}; + # Note: pkg_arch reported in builds file is just last arch source was + # built for, so we use repository arch instead + pkg_arch=${pkg_header[1]}; + [ "$pkg_arch" = "noarch" ] || pkg_arch=${local_arch} + pkg_version=${pkg_header[2]}; + pkg_release=${pkg_header[3]}; + pkg_group=${pkg_header[4]}; + pkg_license=${pkg_header[5]}; + pkg_size=${pkg_header[6]}; + pkg_buildtime=${pkg_header[7]}; + pkg_altrep=${pkg_header[8]}; + pkg_repository=${pkg_header[9]}; + return 0 + fi + done + + unset pkg_name pkg_arch pkg_version pkg_release \ + pkg_group pkg_license pkg_size pkg_buildtime pkg_altrep pkg_repository + + return 1 +} + +function write_last_file() { + [ "$AUTO_MODE" == "1" ] && LASTFILE=$DATADIR/last || LASTFILE=$DATADIR/lastmanual + cat > $LASTFILE << _EOF +JOB_CANTPREPARE=(${JOB_CANTPREPARE[*]}) +JOB_MISSINGREQ=(${JOB_MISSINGREQ[*]}) +JOB_SENT=(${JOB_SENT[*]}) +JOB_CANTINSTAL=(${JOB_CANTINSTALL[*]}) +JOB_COMPLETED=(${JOB_COMPLETED[*]}) +JOB_FAILED=(${JOB_FAILED[*]}) +_EOF +} + +function find_requirements() { + [ "$1" ] || return 1 + local tf=`mktemp` || { + echo "Error: cannot create tempfile" + return 1 + } + local tf1=`mktemp` + local OUTFILE=$1 + + if [ "`grep " is needed by " $OUTFILE`" ]; then + grep " is needed by " $OUTFILE | awk '{ print $1 }' | sort -u > $tf1 + elif [ "`grep " matches no packages" $OUTFILE`" ]; then + grep " matches no packages" $OUTFILE | awk '{ print $2 }' | tr -d \' | sort -u > $tf1 + elif [ "`grep " no package provides " $OUTFILE`" ]; then + grep " no package provides " $OUTFILE | sed "s|.* no package provides ||" | sort -u > $tf1 + fi + + [ `stat -c %s $tf1` -gt 0 ] && { + echo -n " | missing requirements: " + > $tf + cat $tf1 | while read line; do + REQ=`grep "^$line:" $DATADIR/$PORT_REPOSITORY/sources-$BASE_ARCH | awk '{ print $2 }'` + [ "$REQ" ] && \ + echo "${REQ/_}" >> $tf || \ + echo -n "$line(unresolved) " + done + > $tf1 + cat $tf | sort -u 2>/dev/null | while read line; do + if [ "`echo " ${JOB[*]} ${JOB_MISSINGREQ[*]} ${JOB_CANTINSTALL[*]} " | grep " $line "`" ]; then + echo -n "($line) " + else + echo -n "$line " + echo -n "$line " >> $tf1 + fi + done + JOB_MISSINGREQ=(${JOB_MISSINGREQ[*]} `cat $tf1`) + echo + } + rm -f $tf $tf1 + return 0 +} + +[ $# -gt 0 ] || { usage ; exit 1; } + +BUILD_ARCH=`uname -i` + +case $BUILD_ARCH in + i386|i486|i686) BUILD_ARCH=i586 ;; + arm*) BUILD_ARCH=arm ;; +esac + +TARGET_ARCHS=$BUILD_ARCH +JOB_CMDLINE=() +CROSS_MODE= + +for ((i=1; i<=$#; i++)); do + case ${!i} in + -a) AUTO_MODE=1 ;; + -b) BATCH_MODE=1 ;; + -f) FORCE_MODE=1 ;; + -v) VERBOSE_MODE=1 ;; + -np) DONT_PREPARE=1 ;; + -nr) DONT_RECURSE=1 ;; + --fix) FIX_MODE=1 ;; + -r) shift + PORT_REPOSITORY="${!i}" + ;; + -d) shift + DEST_REPOSITORY="${!i}" + ;; + -x) shift + TARGET_ARCHS="`echo ${!i} | tr , ' '`" + CROSS_MODE=1 + ;; + -h|--help) + usage + exit 0 + ;; + *) JOB_CMDLINE=(${JOB_CMDLINE[*]} ${!i}) + ;; + esac +done + +[ "$DEST_REPOSITORY" ] || DEST_REPOSITORY=$PORT_REPOSITORY + +for TARGET_ARCH in ${TARGET_ARCHS}; do + + [ "$BASE_ARCH" = "$TARGET_ARCH" -a "$PORT_REPOSITRY" = "$DEST_REPOSITORY" ] && { + echo "Error: base and target arch ($BASE_ARCH) are the same as well as port and release repositories ($PORT_REPOSITORY); skipping." + continue + } + + archs=($BASE_ARCH $TARGET_ARCH) + JOBS_SKIPPED=() + JOBS_CANTPREPARE=() + JOBS_CANTINSTALL=() + JOB_MISSINGREQ=() + JOB_COMPLETED=() + JOB_FAILED=() + + DATADIR=$HOME/.autoport + DATAARCHDIR=$DATADIR/$TARGET_ARCH + DISTROMATIC_BASE_URL=${REPS_BASE_URL}/distromatic/ + BASE_REPOSITORY_DISTROMATIC_URL=${DISTROMATIC_BASE_URL}$BASE_REPOSITORY + PORT_REPOSITORY_DISTROMATIC_URL=${DISTROMATIC_BASE_URL}$PORT_REPOSITORY + + [ "$AUTO_MODE" -a -e $DATAARCHDIR/last ] && . $DATAARCHDIR/last + JOB=(${JOB_CMDLINE[*]} ${JOB_MISSINGREQ[*]} ${JOB_FAILED[*]}) + [ "$FIX_MODE" -o "$BATCH_MODE" -o "${JOB[*]}" ] || { usage ; exit 1; } + + [ -d $DATAARCHDIR ] || mkdir -p $DATAARCHDIR + [ -d $DATADIR/$BASE_REPOSITORY ] || mkdir -p $DATADIR/$BASE_REPOSITORY + [ -d $DATADIR/$PORT_REPOSITORY ] || mkdir -p $DATADIR/$PORT_REPOSITORY + + logfile=$DATAARCHDIR/log + [ -e $logfile ] && mv -f $logfile $DATAARCHDIR/loglast + > $logfile + + BUILD_PLATFORM=`rpm --target $TARGET_ARCH --eval %{_build}` + BUILD_CPU=`echo $BUILD_PLATFORM | cut -d- -f1` + TARGET_PLATFORM=`rpm --target $TARGET_ARCH --eval %{_target_platform}` + TARGET_CPU=`echo $TARGET_PLATFORM | cut -d- -f1` + SPECDIR=`rpm --eval %{_specdir}` + + echo "Build platform is $BUILD_PLATFORM" + echo "Target platform is $TARGET_PLATFORM" + echo "Port repository is $PORT_REPOSITORY" + echo "Release repository is $DEST_REPOSITORY" + + curl -s $PORT_REPOSITORY_DISTROMATIC_URL/sources-$BASE_ARCH -o $DATADIR/$PORT_REPOSITORY/sources-$BASE_ARCH || + echo "Warning: unable to fetch $PORT_REPOSITORY_DISTROMATIC_URL/sources-$BASE_ARCH" + curl -s $PORT_REPOSITORY_DISTROMATIC_URL/sources-$TARGET_CPU -o $DATADIR/$PORT_REPOSITORY/sources-$TARGET_CPU || + echo "Warning: unable to fetch $PORT_REPOSITORY_DISTROMATIC_URL/sources-$TARGET_CPU" + curl -s $PORT_REPOSITORY_DISTROMATIC_URL/builds-$BASE_ARCH.sh -o $DATADIR/$PORT_REPOSITORY/builds-$BASE_ARCH.sh || + echo "Error: unable to fetch $PORT_REPOSITORY_DISTROMATIC_URL/builds-$BASE_ARCH.sh" + curl -s $PORT_REPOSITORY_DISTROMATIC_URL/builds-$TARGET_ARCH.sh -o $DATADIR/$PORT_REPOSITORY/builds-$TARGET_ARCH.sh || + echo "Error: unable to fetch $PORT_REPOSITORY_DISTROMATIC_URL/builds-$TARGET_ARCH.sh" + + if [ "$BATCH_MODE" ]; then + [ "${JOB[*]}" ] && { + echo "Error: no jobs allowed in batch mode; aborting." + exit 1 + } + curl -s $BASE_REPOSITORY_DISTROMATIC_URL/builds-$BASE_ARCH.sh -o $DATADIR/$BASE_REPOSITORY/builds-$BASE_ARCH.sh || + echo "Error: unable to fetch $BASE_REPOSITORY_DISTROMATIC_URL/builds-$BASE_ARCH.sh" + curl -s $BASE_REPOSITORY_DISTROMATIC_URL/builds-$TARGET_ARCH.sh -o $DATADIR/$BASE_REPOSITORY/builds-$TARGET_ARCH.sh || + echo "Error: unable to fetch $BASE_REPOSITORY_DISTROMATIC_URL/builds-$TARGET_ARCH.sh" + get_pkg_buildinfo $DATADIR/$PORT_REPOSITORY $BASE_ARCH + port_pkg_list=${pkg_list[*]} + for p in ${port_pkg_list}; do + get_pkg_buildinfo $DATADIR/$PORT_REPOSITORY $TARGET_ARCH $p || get_pkg_buildinfo $DATADIR/$BASE_REPOSITORY $TARGET_ARCH $p + if [ "$pkg_name" ]; then + base_pkg_ver=$pkg_version + + get_pkg_buildinfo $DATADIR/$PORT_REPOSITORY $BASE_ARCH $p + [ "$pkg_name" ] || { + echo "Error: internal error, should never be here; aborting." + exit 1 + } + port_pkg_ver=$pkg_version + + get_pkg_buildinfo $DATADIR/$PORT_REPOSITORY $TARGET_ARCH $p + if [ "$pkg_name" ]; then + if [ "$pkg_version" != "$port_pkg_ver" ]; then + echo "Package $pkg_name#${port_pkg_ver}($TARGET_ARCH) differs from $pkg_name#${pkg_version}($BASE_ARCH); port needed." + JOB=(${JOB[*]} $p) + else + echo "Package $pkg_name#${port_pkg_ver}($TARGET_ARCH) is up to date." + fi + else + echo "$p#${port_pkg_ver}($BASE_ARCH) is in port repository but $p#${base_pkg_ver}($TARGET_ARCH) is in base repository; port needed." + JOB=(${JOB[*]} $p) + fi + fi + done + fi + + step=0 + tmpfile=`mktemp` + tmpfile1=`mktemp` + + [ -e $DATAARCHDIR/sentjobs ] || > $DATAARCHDIR/sentjobs + find $DATAARCHDIR/sentjobs -cmin 120 && { + > $DATAARCHDIR/sentjobs + } + + [ -e $DATAARCHDIR/preparedjobs ] || > $DATAARCHDIR/preparedjobs + find $DATAARCHDIR/preparedjobs -ctime 1 && { + > $DATAARCHDIR/preparedjobs + } + + sudo autoport-fix-environment $TARGET_ARCH + + [ "$FIX_MODE" ] && exit 0 + + [ "$FORCE_MODE" ] && FORCE_FLAG="--force" + + while [ "${JOB[*]}" ]; do + step=`expr $step + 1` + [ "$BATCH_MODE" -a $step -gt $AUTOPORT_MAX_STEPS ] && { + echo "Maximum steps count reached for batch mode; exiting. See $logfile for details." + break + } + echo "==========" + echo "Step $step" + echo "Scheduled jobs: ${JOB[*]}" + echo + JOB_MISSINGREQ_OLD=(${JOB_MISSINGREQ[*]}) + JOB_MISSINGREQ=() + JOB_MAYBEINSTALLED_NEW=() + JOB_FAILED_OLD=(${JOB_FAILED[*]}) + JOB_FAILED=() + for JOB_NUM in `seq 1 ${#JOB[*]}`; do + JOB_CURRENT=${JOB[$JOB_NUM-1]} + if [ "`grep "^${JOB_CURRENT}$" /etc/autodist/unstage 2>/dev/null`" -o \ + "`grep "^${JOB_CURRENT}$" /etc/autodist/unstage.${TARGET_ARCH} 2>/dev/null`" ]; then + echo -n "$JOB_CURRENT: " + STAGEOPTS= + else + echo -n "$JOB_CURRENT(staging): " + STAGEOPTS="$AUTOPORT_STAGEVARS" + fi + if [ "$CROSS_MODE" -a "${JOB_CURRENT:0:5}" == "perl-" ]; then + echo " (SKIPPED) [unable to cross-build perl modules]" + JOB_SKIPPED=(${JOB_SKIPPED[*]} $JOB_CURRENT) + continue + fi + [ "`grep ^$JOB_CURRENT\$ $DATAARCHDIR/sentjobs`" -a ! "$FORCE_MODE" ] && { + echo " (SKIPPED) [already sent]" + JOB_SKIPPED=(${JOB_SKIPPED[*]} $JOB_CURRENT) + continue + } + if [ "${JOB_MAYBEINSTALLED_NEW[*]}" = "" -a \ + "${JOB_MISSINGREQ_OLD[*]}" != "" -a \ + "`echo "( ${JOB_FAILED_OLD[*]} )"| grep " $JOB_CURRENT "`" ]; then + echo " (FAILED) [nothing new since previous attempt]" + JOB_FAILED=(${JOB_FAILED[*]} $JOB_CURRENT) + continue + fi + [ ! -e ${SPECDIR}/${JOB_CURRENT}.spec ] && DONT_PREPARE_THIS= || DONT_PREPARE_THIS="$DONT_PREPARE" + [ ! "$DONT_PREPARE_THIS" -a ! "`grep ^$JOB_CURRENT\$ $DATAARCHDIR/preparedjobs`" ] && { + echo -n "prepare" + [ "$VERBOSE_MODE" ] && echo " +%% COMMAND: LANG=C autodist -p ${JOB_CURRENT} --server $PORT_REPOSITORY --repository $PORT_REPOSITORY --severity 2 -- $STAGEOPTS" + LANG=C autodist -p ${JOB_CURRENT} --server $PORT_REPOSITORY --repository $PORT_REPOSITORY --severity 2 -- $STAGEOPTS &>>$logfile + [ $? -gt 0 ] && { + JOB_CANTPREPARE=(${JOB_CANTPREPARE[*]} $JOB_CURRENT) + echo "(FAILED) " + continue + } || { + echo $JOB_CURRENT >> $DATAARCHDIR/preparedjobs + echo -n "(OK) " + } + if [ "$PORT_REPOSITORY" != "$DEST_REPOSITORY" ]; then + echo -n "update" + [ "$VERBOSE_MODE" ] && echo " +%% COMMAND: LANG=C autodist -u -r ${JOB_CURRENT} --severity 2 -- $STAGEOPTS --changelog \"automatic port from $PORT_REPOSITORY\"" + LANG=C autodist -u -r ${JOB_CURRENT} --severity 2 -- $STAGEOPTS --changelog \"automatic port from $PORT_REPOSITORY\" &>>$logfile + [ $? -gt 0 ] && { + echo "(FAILED) " + continue + } || { + echo -n "(OK) " + } + fi + } + echo -n "port" + get_pkg_buildinfo $DATADIR/$PORT_REPOSITORY $TARGET_ARCH ${JOB_CURRENT} || \ + get_pkg_buildinfo $DATADIR/$PORT_REPOSITORY $BASE_ARCH ${JOB_CURRENT} || \ + get_pkg_buildinfo $DATADIR/$BASE_REPOSITORY $TARGET_ARCH ${JOB_CURRENT} || \ + get_pkg_buildinfo $DATADIR/$BASE_REPOSITORY $BASE_ARCH ${JOB_CURRENT} + [ "$pkg_repository" ] || { + echo "(FAILED) [can't get repository information for this package]" + continue + } + [ "$PORT_REPOSITORY" != "$DEST_REPOSITORY" ] && pkg_repository="$DEST_REPOSITORY" + [ ! "$DONT_PREPARE_THIS" -a "$PORT_REPOSITORY" = "$DEST_REPOSITORY" ] && NOSRPM_OPTS="--nosrpm" || NOSRPM_OPTS="--force" + LANG=C autodist -b -s ${JOB_CURRENT} --arch $TARGET_ARCH --server $pkg_repository --repository $PORT_REPOSITORY --severity 2 $FORCE_FLAG -- $STAGEOPTS $NOSRPM_OPTS &>$tmpfile + [ $? -gt 0 ] && { + if [ "$VERBOSE_MODE" ]; then + echo + echo "Failed output:" + echo "==============" + cat $tmpfile + echo "==============" + echo + fi + cat $tmpfile >> $logfile + JOB_FAILED=(${JOB_FAILED[*]} $JOB_CURRENT) + echo "(FAILED)" + JOB_LOG=`grep "^?= See " $tmpfile | awk '{ print $3 }'` + [ "$JOB_LOG" ] || JOB_LOG=$tmpfile + find_requirements $JOB_LOG + continue + } || { + cat $tmpfile >> $logfile + JOB_SENT=(${JOB_SENT[*]} $JOB_CURRENT) + echo $JOB_CURRENT >> $DATAARCHDIR/sentjobs + echo -n "(OK) " + } + echo -n "install" + LANG=C autodist -i ${JOB_CURRENT} --arch $TARGET_ARCH --force --severity 2 -- $STAGEOPTS &>>$tmpfile + # --server $DEST_REPOSITORY --repository $PORT_REPOSITORY + [ $? -gt 0 ] && { + if [ "$VERBOSE_MODE" ]; then + echo + echo "Failed output:" + echo "==============" + cat $tmpfile + echo "==============" + echo + fi + cat $tmpfile >> $logfile + JOB_CANTINSTALL=(${JOB_CANTINSTALL[*]} $JOB_CURRENT) + echo $JOB_CURRENT >> $DATAARCHDIR/checkinstalljobs + echo "(FAILED)" + # sometimes script fails but package is installed; run fix_la_files anyway + sudo autoport-fix-environment $TARGET_ARCH + + JOB_MAYBEINSTALLED_NEW=(${JOB_MAYBEINSTALLED_NEW[*]} $JOB_CURRENT) + JOB_LOG=`grep "^?= See " $tmpfile | awk '{ print $3 }'` + [ "$JOB_LOG" ] || JOB_LOG=$tmpfile + find_requirements $JOB_LOG + continue + } || { + cat $tmpfile >> $logfile + sudo autoport-fix-environment $TARGET_ARCH + JOB_MAYBEINSTALLED_NEW=(${JOB_MAYBEINSTALLED_NEW[*]} $JOB_CURRENT) + JOB_COMPLETED=(${JOB_COMPLETED[*]} $JOB_CURRENT) + echo -n "(OK)" + } + echo + done + echo "Skipped jobs: ${JOB_SKIPPED[*]}" + echo "Unpreparable jobs: ${JOB_CANTPREPARE[*]}" + echo "Missing requirements: ${JOB_MISSINGREQ[*]}" + echo "Completed jobs: ${JOB_COMPLETED[*]}" + echo "Installation error for: ${JOB_CANTINSTALL[*]}" + echo "Failed jobs: ${JOB_FAILED[*]}" + write_last_file + + [ "${JOB[*]}" == "${JOB_FAILED[*]}" -a "${JOB_MISSINGREQ[*]}" == "" ] && { + echo "Loop detected. Finishing. See $logfile for details." + rm -f $tmpfile $tmpfile1 + exit 1 + } + [ "$DONT_RECURSE" ] && break + JOB=(${JOB_MISSINGREQ[*]} ${JOB_FAILED[*]}) + done + rm -f $tmpfile $tmpfile1 +done +echo "All jobs completed. See $logfile for details." +exit 0 diff --git a/autoport-fix-environment b/autoport-fix-environment new file mode 100755 index 0000000..d90ccbc --- /dev/null +++ b/autoport-fix-environment @@ -0,0 +1,88 @@ +#!/bin/bash +# autoport-fix-environment -- fixes libtool (*.la) library paths; runs with suid permissions +# Copyright (C) 2010 by Silvan Calarco +# +# Released under the terms of the GNU GPL release 3 license +# +VERSION=0.8.3 + +me=(${0##*/} $VERSION "Wed Aug 11 2010") + +function usage() { + echo "\ +${me[0]} ${me[1]} +"$"Copyright (C) 2010 Silvan Calarco "" +"$"Released under the terms of the GNU GPL v3 license" + echo " +"$"Fixes libtool (*.la) library paths."" + +"$"Usage"": + $me [arch] + + arch "$"Specify target architecture (default: $BUILD_ARCH)"" +" + +} + +function fix_la_files() { + for _lib in lib lib64; do + [ "`ls /usr/${_lib}/*.la 2>/dev/null`" ] && { + sed -i "s|libdir='/usr/$TARGET_PLATFORM/${_lib}'|libdir='/usr/${_lib}'|g" /usr/${_lib}/*.la + sed -i "s|libdir='/$TARGET_PLATFORM/${_lib}'|libdir='/usr/${_lib}'|g" /usr/${_lib}/*.la + sed -i "s|/usr/$TARGET_PLATFORM/${_lib}|/usr/${_lib}|g" /usr/${_lib}/*.la + sed -i "s|[:space:]/usr/$TARGET_PLATFORM/${_lib}|[:space:]/usr/${_lib}/lib|g" /usr/${_lib}/*.la + } + done +} + +function fix_la_files_cross() { + for _lib in lib lib64; do + [ "`ls /usr/$TARGET_PLATFORM/${_lib}/*.la 2>/dev/null`" ] && { + sed -i "s|libdir='/usr/${_lib}'|libdir='/usr/$TARGET_PLATFORM/${_lib}'|g" /usr/$TARGET_PLATFORM/${_lib}/*.la + sed -i "s|libdir='/${_lib}'|libdir='/usr/$TARGET_PLATFORM/${_lib}'|g" /usr/$TARGET_PLATFORM/${_lib}/*.la + sed -i "s|/usr/${_lib}|/usr/$TARGET_PLATFORM/${_lib}|g" /usr/$TARGET_PLATFORM/${_lib}/*.la + sed -i "s|[:space:]/lib/${_lib}|[:space:]/usr/$TARGET_PLATFORM/${_lib}/lib|g" /usr/$TARGET_PLATFORM/${_lib}/*.la + } + done +} + +BUILD_ARCH=`uname -i` + +case $BUILD_ARCH in + i386|i486|i686) BUILD_ARCH=i586 ;; + arm*) BUILD_ARCH=arm ;; +esac + +for ((i=1; i<=$#; i++)); do + case ${!i} in + -h|--help) usage; exit 1 ;; + -*) echo "Error: invalid option '${!i}'" + usage + exit 1 + ;; + *) if [ "$TARGET_ARCH" ]; then + echo "Error: unexpected option '${!i}'" + usage + exit 1 + fi + TARGET_ARCH=${!i} + ;; + esac +done + +[ "$TARGET_ARCH" ] || TARGET_ARCH=$BUILD_ARCH + +BUILD_PLATFORM=`rpm --target $TARGET_ARCH --eval %{_build}` +BUILD_CPU=`echo $BUILD_PLATFORM | cut -d- -f1` +TARGET_PLATFORM=`rpm --target $TARGET_ARCH --eval %{_target_platform}` +TARGET_CPU=`echo $TARGET_PLATFORM | cut -d- -f1` + +#echo "Build platform is $BUILD_PLATFORM" +#echo "Target platform is $TARGET_PLATFORM" + +if [ "$TARGET_PLATFORM" != "$BUILD_PLATFORM" ]; then + fix_la_files_cross +else + fix_la_files +fi +exit 0 diff --git a/autospec-conf b/autospec-conf new file mode 100644 index 0000000..ccb08c7 --- /dev/null +++ b/autospec-conf @@ -0,0 +1,91 @@ +# [configuration file for `autospec'] + +DISTRO="openmamba" +VENDOR="openmamba" + +curl_opts_netlink="--connect-timeout 15 --retry 3 --limit-rate 400k -Y 1 -C -s" + +packager_fullname="Automatic Build System" +packager_email="autodist@mambasoft.it" + +ftp_rw_server_num_default=0 +colorize=0 +format_description_width=0 + +# Directories used by the rpm tool to read and save files to +srpms_dir="/var/autodist/RPM/SRPMS" +rpms_dir="/var/autodist/RPM/RPMS" +spec_dir="/var/autodist/RPM/SPECS" +source_dir="/var/autodist/RPM/SOURCES" +build_dir="/var/autodist/RPM/BUILD" +tmppath_dir="/var/tmp/autodist" + +ftp_alias[0]="devel" +ftpurl_ro_rpms[0]="ftp://ftp.openmamba.org/pub/openmamba/devel/RPMS.@arch@" +ftpurl_ro_srpms[0]="ftp://ftp.openmamba.org/pub/openmamba/devel/SRPMS.base" +ftp_rw_server[0]="ftp://ftp.openmamba.org" +ftp_rw_port[0]= +ftp_rw_passive_mode[0]=on +ftp_rw_user[0]= +ftp_rw_passwd[0]= +ftp_rw_rpms_dir[0]="/RPMS.@arch@" +ftp_rw_srpms_dir[0]="/SRPMS.base" +arch_list[0]="i586 ppc arm x86_64" +arch_noarch_upload[0]="${arch_list[0]}" +ftpdir_rw_old[0]="/old" + +ftp_alias[1]="devel-games" +ftpurl_ro_rpms[1]="ftp://ftp.openmamba.org/pub/openmamba/devel-games/RPMS.@arch@" +ftpurl_ro_srpms[1]="ftp://ftp.openmamba.org/pub/openmamba/devel-games/SRPMS.base" +ftp_rw_server[1]="ftp://ftp.openmamba.org" +ftp_rw_port[1]= +ftp_rw_passive_mode[1]=on +ftp_rw_user[1]= +ftp_rw_passwd[1]= +ftp_rw_rpms_dir[1]="/RPMS.@arch@" +ftp_rw_srpms_dir[1]="/SRPMS.base" +arch_list[1]="i586" +arch_noarch_upload[1]="${arch_list[1]}" +ftpdir_rw_old[1]="/old" + +ftp_alias[2]="devel-makedist" +ftpurl_ro_rpms[2]="ftp://ftp.openmamba.org/pub/openmamba/devel-makedist/RPMS.@arch@" +ftpurl_ro_srpms[2]="ftp://ftp.openmamba.org/pub/openmamba/devel-makedist/SRPMS.base" +ftp_rw_server[2]="ftp://ftp.openmamba.org" +ftp_rw_port[2]= +ftp_rw_passive_mode[2]=on +ftp_rw_user[2]= +ftp_rw_passwd[2]= +ftp_rw_rpms_dir[2]="/RPMS.@arch@" +ftp_rw_srpms_dir[2]="/SRPMS.base" +arch_list[2]="i586" +arch_noarch_upload[2]="${arch_list[2]}" +ftpdir_rw_old[2]="/old" + +ftp_alias[3]="devel-autodist" +ftpurl_ro_rpms[3]="ftp://ftp.openmamba.org/pub/openmamba/devel-autodist/RPMS.@arch@" +ftpurl_ro_srpms[3]="ftp://ftp.openmamba.org/pub/openmamba/devel-autodist/SRPMS.base" +ftp_rw_server[3]="ftp://ftp.openmamba.org" +ftp_rw_port[3]= +ftp_rw_passive_mode[3]=on +ftp_rw_user[3]= +ftp_rw_passwd[3]= +ftp_rw_rpms_dir[3]="/RPMS.@arch@" +ftp_rw_srpms_dir[3]="/SRPMS.base" +arch_list[3]="i586" +arch_noarch_upload[3]="${arch_list[3]}" +ftpdir_rw_old[3]="/old" + +ftp_alias[4]="devel-future" +ftpurl_ro_rpms[4]="ftp://ftp.openmamba.org/pub/openmamba/devel-future/RPMS.@arch@" +ftpurl_ro_srpms[4]="ftp://ftp.openmamba.org/pub/openmamba/devel-future/SRPMS.base" +ftp_rw_server[4]="ftp://ftp.openmamba.org" +ftp_rw_port[4]= +ftp_rw_passive_mode[4]=on +ftp_rw_user[4]= +ftp_rw_passwd[4]= +ftp_rw_rpms_dir[4]="/RPMS.@arch@" +ftp_rw_srpms_dir[4]="/SRPMS.base" +arch_list[4]="i586" +arch_noarch_upload[4]="${arch_list[4]}" +ftpdir_rw_old[4]="/old" diff --git a/etc/autodist/blacklist b/etc/autodist/blacklist new file mode 100644 index 0000000..f48a456 --- /dev/null +++ b/etc/autodist/blacklist @@ -0,0 +1,16 @@ +filesystem +cross-environment +openmamba-sound-theme +desktop-base-openmamba +autodist +kernel27 +rpm +apt +soundfont-2rock9 +livecd-tools +makedist +makedist-openmamba +postplug +grub-theme-openmamba +kdevelop +lxde diff --git a/etc/autodist/config b/etc/autodist/config new file mode 100644 index 0000000..fffb0f4 --- /dev/null +++ b/etc/autodist/config @@ -0,0 +1,16 @@ +# Global configuration file for autodist +# +REPS_BASE_URL=http://www.openmamba.org/pub/openmamba +LOCAL_REPS_BASE_DIR=/var/ftp/pub/openmamba +SEND_SERVER=devel-autodist +GNOME_VER=2.32.0 +AUTOBUILD_MAXNUM=150 +AUTOBUILD_DATEFROM=20060601 +AUTOBUILD_SKIP_DAYS=7 +AUTOBUILD_SUCCESS_DAYS=3 +AUTODIST_REPOSITORY=devel-autodist +AUTODIST_DELAYED_REPOSITORY=devel-future +AUTODIST_REPOSITORIES=(devel devel-games devel-makedist devel-kernel devel-xorg devel-kde4 devel-autodist) +AUTOPORT_STAGEVARS="--define stage1=1" +AUTOPORT_MAX_STEPS=15 +#RPMDIR=/usr/src/RPM diff --git a/etc/autodist/distdb b/etc/autodist/distdb new file mode 100644 index 0000000..a00fa99 --- /dev/null +++ b/etc/autodist/distdb @@ -0,0 +1,108 @@ +# openmamba autodist build jobs database - architecture independent +# +# Copyright (c) 2006-2010 by Silvan Calarco +# Released under the terms of the GNU GPL version 3 license +# + +xorg_drv_video=( +xorg-drv-video,xorg-drv-video-ati,xorg-drv-video-fbdev,xorg-drv-video-geode,xorg-drv-video-i128,xorg-drv-video-intel,xorg-drv-video-mga,xorg-drv-video-nv,xorg-drv-video-openchrome,xorg-drv-video-r128,xorg-drv-video-radeonhd,xorg-drv-video-sis,xorg-drv-video-dummy,xorg-drv-video-siliconmotion,xorg-drv-video-savage,xorg-drv-video-newport +) + +xorg_drv_input=( +xorg-drv-input,xorg-drv-input-aiptek,xorg-drv-input-calcomp,xorg-drv-input-citron,xorg-drv-input-digitaledge,xorg-drv-input-dmc,xorg-drv-input-dynapro,xorg-drv-input-elo2300,xorg-drv-input-elographics,xorg-drv-input-evdev,xorg-drv-input-fpit,xorg-drv-input-hyperpen,xorg-drv-input-jamstudio,xorg-drv-input-joystick,xorg-drv-input-keyboard,xorg-drv-input-magellan,xorg-drv-input-magictouch,xorg-drv-input-microtouch,xorg-drv-input-mouse,xorg-drv-input-mutouch,xorg-drv-input-palmax,xorg-drv-input-penmount,xorg-drv-input-spaceorb,xorg-drv-input-summa,xorg-drv-input-synaptics,xorg-drv-input-tek4957,xorg-drv-input-ur98,xorg-drv-input-vmmouse,xorg-drv-input-void +) + +abiword=( +abiword,abiword-docs +%build_and_install +1 +) + +compiz=( +compiz-core,libcompizconfig,python-compizconfig,compizconfig-backend-kconfig4,compiz-fusion-plugins-main,compiz-fusion-plugins-extra +%build_and_install +1 +) +# compiz-bcop,compizconfig-backend-kconfig,compizconfig-settings-manager,compizconfig-simple-settings-manager,emerald + +#curl=( +#curl +#%build_and_install +#1 +#) + +evolution=( +libevolution-data-server,evolution +%build_and_install +1 +) +#,evolution-exchange + +#ekiga=( +#libpt,libopal,ekiga +#%build_and_install +#1 +#) + +#gobby=( +#obby,gobby +#%build_and_install +#1 +#) + +kde3=( +kdelibs,kdebase,kdeadmin,kdeutils,kdenetwork,kdeaccessibility,kdepim,kdegames,kdegraphics,kdemultimedia,kdeaddons,kdenetwork,kdesdk,kdetoys,kdebindings,kdewebdev,kdeedu,kdeartwork,kde-i18n +%build_and_install +1 +) + +kde4=( +kdelibs,kdepimlibs,oxygen-icons,kdebase-runtime,kdebase-workspace,kdebase4,kdeadmin4,kdegraphics,kdemultimedia4,kdenetwork4,kdeartwork4,kdegames4,kdetoys4,kdeaccessibility4,kdeedu4,kdesdk4,kdebindings4,kdeutils,kdeplasma-addons,kde-l10n +%build_and_install +1 +) +#kdepim4,kdepim-runtime, + +alsa=( +libalsa,libalsa-plugins,alsa-utils,alsa-driver,alsa-tools +%build_and_install +1 +) + +xfce=( +libxfce4util,xfconf,libxfcegui4,libxfce4ui,xfce-utils,xfce4-appfinder,xfce4-panel,xfce4-session,xfdesktop,xfwm4 +%build_and_install +1 +) +#xfce4-mixer,xfprint,orage,xfwm4-themes,libxfce4menu + +FlightGear=( +libSimGear,FlightGear +%build_and_install +1 +) + +valknut=( +libdc,valknut +%build_and_install +1 +) + +# use for major release update (e.g. 2.24 -> 2.26) +gnome=( +libgnome,libsoup,libgweather,librsvg,libwnck,libgdl,gnome-desktop,python-gnome-desktop,libeel,gnome-icon-theme,gnome-menus,libgnome-panel,anjuta,zenity,metacity,nautilus,brasero,cheese,evince,gconf-editor,gedit,gedit-plugins +%build_and_install +1 +) + +fwbuilder=( +libfwbuilder,fwbuilder +%build_and_install +1 +) + +koffice=( +koffice,koffice-i18n +%build_and_install +1 +) diff --git a/etc/autodist/distdb.arm b/etc/autodist/distdb.arm new file mode 100644 index 0000000..7a4c461 --- /dev/null +++ b/etc/autodist/distdb.arm @@ -0,0 +1,59 @@ +# openmamba autodist build jobs database +# +# Copyright (c) 2006-2010 by Silvan Calarco +# Released under the terms of the GNU GPL version 3 license +# + +binutils=( +binutils +cross_target_cpu +arm +) + +glibc=( +glibc +cross_target_cpu,bigendian,softfloat,KERNEL_TARGET,KERNEL_VER,build_doc,build_profile,build_selinux +arm,-,-,mamba-arm,2.6.35,0,0,0 +) + +gcc=( +gcc +cross_target_cpu +arm +) + +kernel=( +kernel +target,KERNEL_TARGET +arm,mamba-arm +) + +pam=( +pam +bootstrap +1 +) + +rpm=( +rpm +bootstrap +1 +) + +klibc=( +klibc +KERNEL_VER +2.6.33mamba-arm +) + +emacs=( +emacs +bootstrap +1 +) + +gcc=( +gcc +disable_jack,disable_gjdoc,disable_java +1,1,1 +) diff --git a/etc/autodist/distdb.d/embedded.db b/etc/autodist/distdb.d/embedded.db new file mode 100644 index 0000000..c799737 --- /dev/null +++ b/etc/autodist/distdb.d/embedded.db @@ -0,0 +1,78 @@ +# openmamba autodist build jobs database +# +# Copyright (c) 2006-2008 by Silvan Calarco +# Released under the terms of the GNU GPL version 3 license +# + +kernel_embedded_all=( +kernel-embedded +target,KERNEL_TARGET,KERNEL_PLATFORM +i586,geode,hurricane +arm,pxa2xx,logicpd_pxa270 +arm,pxa2xx,intel_dbpxa250 +) + +u_boot_all=( +u-boot +target,TARGET_BOARD +i586,- +arm,pxa255_idp +arm,mainstone_rr +ppc,icecube_5200 +) + +cross_environment_uclibc=( +cross-environment +cross_target_cpu,cross_target_system,autodist_crossonly +arm,uclibc,1 +) + +buildroot_legacy=( +buildroot_legacy +target,cross_target_cpu +arm,arm +) +#i586,i586 + +cross_environment_uclibc=( +cross-environment +cross_target_cpu,cross_target_system,autodist_crossonly +arm,uclibc,1 +) + +glibc_stage2_arm=( +glibc +cross_target_cpu,stage2,bigendian,softfloat +arm,1,-,- +arm,1,1,- +arm,1,-,1 +arm,1,1,1 +) + +glibc_arm_embedded=( +glibc +cross_target_cpu,bigendian,softfloat +arm,-,- +arm,1,- +arm,-,1 +arm,1,1 +) + +kaffe_arm=( +kaffe +target,__cc,_build,_host,_target_platform +arm,arm-linux-uclibc-gcc,i586-openmamba-linux-gnu,arm-linux-uclibc,arm-linux-uclibc +) + +libzzip_arm=( +libzzip +target,__cc,_build,_host,_target_platform +arm,arm-linux-uclibc-gcc,i586-openmamba-linux-gnu,arm-linux-uclibc,arm-linux-uclibc +) + +libxml2_arm=( +libxml2 +target,__cc,_build,_host,_target_platform +arm,arm-linux-uclibc-gcc,i586-openmamba-linux-gnu,arm-openmamba-linux-gnu,arm-linux-uclibc +) + diff --git a/etc/autodist/distdb.d/openmamba-website.db b/etc/autodist/distdb.d/openmamba-website.db new file mode 100644 index 0000000..b1d9c50 --- /dev/null +++ b/etc/autodist/distdb.d/openmamba-website.db @@ -0,0 +1,24 @@ +# openmamba autodist build jobs database +# +# Copyright (c) 2006-2008 by Silvan Calarco +# Released under the terms of the GNU GPL version 3 license +# + +openmamba_bbpress=( +bbpress +installdir,sitename,adminmail +%serverdir/../forum.openmamba.org,openmamba,info@openmamba.org +) + +openmamba_mantis=( +mantis +installdir,sitename,adminmail +%serverdir/../bugs.openmamba.org,openmamba,info@openmamba.org +) + +openmamba_mediawiki=( +mediawiki +installdir,sitename,lang +%serverdir/../wiki.openmamba.org/it,openmamba,it +%serverdir/../wiki.openmamba.org/en,openmamba,en +) diff --git a/etc/autodist/distdb.i586 b/etc/autodist/distdb.i586 new file mode 100644 index 0000000..c61e3d6 --- /dev/null +++ b/etc/autodist/distdb.i586 @@ -0,0 +1,290 @@ +# openmamba autodist build jobs database for i586 platform +# +# Copyright (c) 2006-2010 by Silvan Calarco +# Released under the terms of the GNU GPL version 3 license +# + +# XTC 1 (Cross Toolchain) +cross_environment=( +cross-environment +cross_target_cpu,autodist_crossonly,_target_platform +i586,1,i586-openmamba-linux-gnu +arm,1,arm-openmamba-linux-gnueabi +ppc,1,ppc-openmamba-linux-gnu +x86_64,1,x86_64-openmamba-linux-gnu +) + +# +# XTC 2 +# +# build native binutils (gcc needed, so it's not a stage1 build) +# and cross platform binutils +# +binutils=( +binutils +cross_target_cpu,_target_platform +x86_64,x86_64-openmamba-linux-gnu +i586,i586-openmamba-linux-gnu +arm,arm-openmamba-linux-gnueabi +ppc,ppc-openmamba-linux-gnu +) + +# +# XTC 3 +# +# glibc stage1: build headers only +glibc_stage1=( +glibc +cross_target_cpu,stage1,_target_platform,KERNEL_TARGET,KERNEL_VER +i586,1,i586-openmamba-linux-gnu,mamba,- +arm,1,arm-openmamba-linux-gnueabi,mamba-arm,2.6.33 +ppc,1,ppc-openmamba-linux-gnu,mamba-ppc,2.6.33 +x86_64,1,x86_64-openmamba-linux-gnu,mamba-x86_64,- +) + +# +# XTC 4 +# +gcc_stage1=( +gcc +cross_target_cpu,stage1,_target_platform +arm,1,arm-openmamba-linux-gnueabi +i586,1,i586-openmamba-linux-gnu +ppc,1,ppc-openmamba-linux-gnu +x86_64,1,x86_64-openmamba-linux-gnu +) + +# +# XTC 5 +# +glibc_stage2=( +glibc +cross_target_cpu,stage2,bigendian,softfloat,_target_platform,KERNEL_TARGET,KERNEL_VER +arm,1,-,-,arm-openmamba-linux-gnueabi,mamba-arm,2.6.33 +i586,1,-,-,i586-openmamba-linux-gnu,mamba,- +ppc,1,-,-,ppc-openmamba-linux-gnu,mamba,- +x86_64,1,-,-,x86_64-openmamba-linux-gnu,mamba-x86_64,- +) + +# +# XTC 6 +# +gcc=( +gcc +cross_target_cpu,_target_platform,disable_java +i586,i586-openmamba-linux-gnu,- +arm,arm-openmamba-linux-gnueabi,1 +x86_64,x86_64-openmamba-linux-gnu,1 +ppc,ppc-openmamba-linux-gnu,1 +) + +# +# XTC 7 +# +glibc=( +glibc +cross_target_cpu,_target_platform,bigendian,softfloat,KERNEL_TARGET,KERNEL_VER +i586,i586-openmamba-linux-gnu,-,-,mamba,2.6.35 +x86_64,x86_64-openmamba-linux-gnu,-,-,mamba-x86_64,2.6.33 +arm,arm-openmamba-linux-gnueabi,-,-,mamba-arm,2.6.35 +ppc,ppc-openmamba-linux-gnu,-,-,mamba-ppc,2.6.33 +) + +gcc_uclibc=( +gcc +cross_target_cpu,_target_platform,bigendian,softfloat,KERNEL_TARGET,KERNEL_VER +arm,arm-linux-uclibc,-,-,mamba-arm,2.6.33 +) + +dietlibc=( +dietlibc +cross_target_cpu +i586 +arm +) + +gcc34=( +gcc34 +cross_target_cpu +i586 +ppc +) + +klibc=( +klibc +cross_target_cpu,_target_platform,KERNEL_VER +-,-,- +ppc,ppc-openmamba-linux-gnu,2.6.33mamba-ppc +x86_64,x86_64-openmamba-linux-gnu,2.6.33mamba-x86_64 +arm,arm-openmamba-linux-gnueabi,2.6.33mamba-arm +) + +glibc_arm=( +glibc +cross_target_cpu,bigendian,softfloat,KERNEL_TARGET,KERNEL_VER +arm,-,-,mamba-arm,- +) + + +kernel=( +kernel +target,KERNEL_TARGET +i586,mamba +i586,mamba-64GB +) +#ppc,mamba +#x86_64,mamba + +kernel_extramodules=( +kernel-extramodules +target,KERNEL_TARGET +i586,mamba +i586,mamba-64GB +) + +kernel_packages_old=( +hsfmodem,slmodem,compat-wireless,alsa-driver,ati-driver,lirc,ndiswrapper,NVIDIA,NVIDIA_71xx,NVIDIA_96xx,NVIDIA_173xx,VirtualBox,broadcom-sta,atheros-81,drbd,rtl8192se +target,KERNEL_TARGET,KERNEL_VER +i586,mamba,2.6.35 +i586,mamba-64GB,2.6.35 +) + +kernel_packages=( +hsfmodem,slmodem,compat-wireless,alsa-driver,ati-driver,lirc,ndiswrapper,NVIDIA,NVIDIA_71xx,NVIDIA_96xx,NVIDIA_173xx,VirtualBox,broadcom-sta,stk11xx,cm2020,rtl8192se +target,KERNEL_TARGET,KERNEL_VER +i586,mamba,- +i586,mamba-64GB,- +) + +kernel_packages_new=( +hsfmodem,slmodem,compat-wireless,alsa-driver,ati-driver,lirc,ndiswrapper,NVIDIA,NVIDIA_71xx,NVIDIA_96xx,NVIDIA_173xx,VirtualBox,broadcom-sta,stk11xx,cm2020,rtl8192se +target,KERNEL_TARGET,KERNEL_VER +i586,mamba,2.6.37 +i586,mamba-64GB,2.6.37 +) + +#ppc,mamba +#x86_64,mamba + +NVIDIA_all=( +NVIDIA,NVIDIA_71xx,NVIDIA_96xx,NVIDIA_173xx +target,KERNEL_TARGET,KERNEL_VER +i586,mamba,- +i586,mamba-64GB,- +) + +alsa_driver=( +alsa-driver +target,KERNEL_TARGET +i586,mamba +i586,mamba-64GB +) + +ati_driver=( +ati-driver +target,KERNEL_TARGET +i586,mamba +i586,mamba-64GB +) + +broadcom_sta=( +broadcom-sta +target,KERNEL_TARGET +i586,mamba +i586,mamba-64GB +) + +kernel_wireless_backport=( +kernel-wireless-backport +target,KERNEL_TARGET +i586,mamba +i586,mamba-64GB +) + +lirc=( +lirc +target,KERNEL_TARGET +i586,mamba +i586,mamba-64GB +) + +ndiswrapper=( +ndiswrapper +target,KERNEL_TARGET +i586,mamba +i586,mamba-64GB +) + +NVIDIA=( +NVIDIA +target,KERNEL_TARGET +i586,mamba +i586,mamba-64GB +) + +VirtualBox=( +VirtualBox +target,KERNEL_TARGET +i586,mamba +i586,mamba-64GB +) + +broadcom_sta=( +broadcom-sta +target,KERNEL_TARGET +i586,mamba +i586,mamba-64GB +) + +atheros_81=( +atheros-sta +target,KERNEL_TARGET +i586,mamba +i586,mamba-64GB +) + +drbd=( +drbd +target,KERNEL_TARGET +i586,mamba +i586,mamba-64GB +) + +# +# ppc cross toolchain +# +binutils_ppc=( +binutils +cross_target_cpu,_target_platform +ppc,ppc-openmamba-linux-gnu +) + +glibc_ppc_stage1=( +glibc +cross_target_cpu,stage1,_target_platform,KERNEL_TARGET,KERNEL_VER +ppc,1,ppc-openmamba-linux-gnu,mamba,- +) + +gcc_ppc_stage1=( +gcc +cross_target_cpu,stage1,_target_platform +ppc,1,ppc-openmamba-linux-gnu +) + +glibc_ppc_stage2=( +glibc +cross_target_cpu,stage2,bigendian,softfloat,_target_platform,KERNEL_TARGET,KERNEL_VER +ppc,1,-,-,ppc-openmamba-linux-gnu,mamba-ppc,2.6.33 +) + +gcc_ppc=( +gcc +cross_target_cpu,_target_platform +ppc,ppc-openmamba-linux-gnu +) + +glibc_ppc=( +glibc +cross_target_cpu,_target_platform,bigendian,softfloat,KERNEL_TARGET,KERNEL_VER +ppc,ppc-openmamba-linux-gnu,-,-,mamba-ppc,2.6.33 +) diff --git a/etc/autodist/distdb.ppc b/etc/autodist/distdb.ppc new file mode 100644 index 0000000..9550e00 --- /dev/null +++ b/etc/autodist/distdb.ppc @@ -0,0 +1,267 @@ +# openmamba autodist build jobs database +# +# Copyright (c) 2006-2010 by Silvan Calarco +# Released under the terms of the GNU GPL version 3 license +# + +# XTC 1 (Cross Toolchain) +cross_environment=( +cross-environment +cross_target_cpu,autodist_crossonly,_target_platform +x86_64,1,x86_64-openmamba-linux-gnu +i586,1,i586-openmamba-linux-gnu +arm,1,arm-openmamba-linux-gnueabi +ppc,1,ppc-openmamba-linux-gnu +) + +# +# XTC 2 +# +# build native binutils (gcc needed, so it's not a stage1 build) +# and cross platform binutils +# +binutils=( +binutils +cross_target_cpu,_target_platform +x86_64,x86_64-openmamba-linux-gnu +i586,i586-openmamba-linux-gnu +arm,arm-openmamba-linux-gnueabi +ppc,ppc-openmamba-linux-gnu +) + +# +# XTC 3 +# +# glibc stage1: build headers only +glibc_stage1=( +glibc +cross_target_cpu,stage1,_target_platform,KERNEL_TARGET,KERNEL_VER +x86_64,1,x86_64-openmamba-linux-gnu,mamba-x86_64,- +arm,1,arm-openmamba-linux-gnueabi,mamba-arm,2.6.33 +i586,1,i586-openmamba-linux-gnu,mamba,- +ppc,1,ppc-openmamba-linux-gnu,mamba,- +) + +# +# XTC 4 +# +gcc_stage1=( +gcc +cross_target_cpu,stage1,_target_platform +x86_64,1,x86_64-openmamba-linux-gnu +arm,1,arm-openmamba-linux-gnueabi +i586,1,i586-openmamba-linux-gnu +ppc,1,ppc-openmamba-linux-gnu +) + +# +# XTC 5 +# +glibc_stage2=( +glibc +cross_target_cpu,stage2,bigendian,softfloat,_target_platform,KERNEL_TARGET,KERNEL_VER +x86_64,1,-,-,x86_64-openmamba-linux-gnu,mamba-x86_64,- +arm,1,-,-,arm-openmamba-linux-gnueabi,mamba-arm,2.6.33 +i586,1,-,-,i586-openmamba-linux-gnu,mamba,- +ppc,1,-,-,ppc-openmamba-linux-gnu,mamba,- +) + +# +# XTC 6 +# +gcc=( +gcc +cross_target_cpu,_target_platform +x86_64,x86_64-openmamba-linux-gnu +arm,arm-openmamba-linux-gnueabi +i586,i586-openmamba-linux-gnu +ppc,ppc-openmamba-linux-gnu +) + +# +# XTC 7 +# +glibc=( +glibc +cross_target_cpu,_target_platform,bigendian,softfloat,KERNEL_TARGET,KERNEL_VER +ppc,ppc-openmamba-linux-gnu,-,-,mamba-ppc,2.6.33 +x86_64,x86_64-openmamba-linux-gnu,-,-,mamba-x86_64,- +i586,i586-openmamba-linux-gnu,-,-,mamba,- +arm,arm-openmamba-linux-gnueabi,-,-,mamba-arm,2.6.33 +) + +gcc_uclibc=( +gcc +cross_target_cpu,_target_platform,bigendian,softfloat,KERNEL_TARGET,KERNEL_VER +arm,arm-linux-uclibc,-,-,mamba-arm,2.6.33 +) + +dietlibc=( +dietlibc +cross_target_cpu +ppc +x86_64 +i586 +arm +) + +gcc34=( +gcc34 +cross_target_cpu +ppc +x86_64 +i586 +ppc +) + +#klibc=( +#klibc +#cross_target_cpu,_target_platform,KERNEL_VER +#-,-,- +#ppc,ppc-openmamba-linux-gnueabi,2.6.33mamba-ppc +#) + +kernel=( +kernel +target,KERNEL_TARGET +ppc,mamba-ppc +) + +kernel_new=( +kernel +target,KERNEL_TARGET,KERNEL_VER +ppc,mamba-ppc,2.6.33 +) + +kernel_extra=( +kernel-extramodules +target,KERNEL_TARGET +ppc,mamba-ppc +) + +kernel_packages=( +hsfmodem,compat-wireless,ati-driver,NVIDIA,NVIDIA_71xx,NVIDIA_96xx,NVIDIA_173xx,broadcom-sta +target,KERNEL_TARGET,KERNEL_VER +ppc,mamba-ppc,- +) +# slmodem, alsa-driver, lirc,VirtualBox, ndiswrapper, alsa-driver + +kernel_packages_new=( +hsfmodem,compat-wireless,ati-driver,NVIDIA,NVIDIA_71xx,NVIDIA_96xx,NVIDIA_173xx,broadcom-sta +target,KERNEL_TARGET,KERNEL_VER +ppc,mamba-ppc,2.6.33 +) + +NVIDIA_all=( +NVIDIA,NVIDIA_71xx,NVIDIA_96xx,NVIDIA_173xx +target,KERNEL_TARGET,KERNEL_VER +ppc,mamba-ppc +) + +alsa_driver=( +alsa-driver +target,KERNEL_TARGET +ppc,mamba-ppc +) + +ati_driver=( +ati-driver +target,KERNEL_TARGET +ppc,mamba-ppc +) + +broadcom_sta=( +broadcom-sta +target,KERNEL_TARGET +ppc,mamba-ppc +) + +kernel_extramodules=( +kernel-extramodules +target,KERNEL_TARGET +ppc,mamba-ppc +) + +kernel_nongpl=( +kernel-nongpl +target,KERNEL_TARGET +ppc,mamba-ppc +) + +kernel_wireless_backport=( +kernel-wireless-backport +target,KERNEL_TARGET +ppc,mamba-ppc +) + +lirc=( +lirc +target,KERNEL_TARGET +ppc,mamba-ppc +) + +ndiswrapper=( +ndiswrapper +target,KERNEL_TARGET +ppc,mamba-ppc +) + +NVIDIA=( +NVIDIA +target,KERNEL_TARGET +ppc,mamba-ppc +) + +VirtualBox=( +VirtualBox +target,KERNEL_TARGET +ppc,mamba-ppc +) + +glibc=( +glibc +cross_target_cpu,bigendian,softfloat,KERNEL_TARGET,KERNEL_VER +ppc,-,-,mamba-ppc,2.6.33 +) + +gcc=( +gcc +cross_target_cpu +ppc +) + +binutils=( +binutils +cross_target_cpu +ppc +) + +pam=( +pam +bootstrap +1 +) + +rpm=( +rpm +bootstrap +1 +) + +klibc=( +klibc +KERNEL_VER +2.6.33mamba-ppc +) + +emacs=( +emacs +bootstrap +1 +) + +gcc=( +gcc +disable_jack,disable_java,disable_gjdoc +1,1,1 +) diff --git a/etc/autodist/distdb.x86_64 b/etc/autodist/distdb.x86_64 new file mode 100644 index 0000000..254c36c --- /dev/null +++ b/etc/autodist/distdb.x86_64 @@ -0,0 +1,271 @@ +# openmamba autodist build jobs database +# +# Copyright (c) 2006-2010 by Silvan Calarco +# Released under the terms of the GNU GPL version 3 license +# + +# XTC 1 (Cross Toolchain) +cross_environment=( +cross-environment +cross_target_cpu,autodist_crossonly,_target_platform +x86_64,1,x86_64-openmamba-linux-gnu +i586,1,i586-openmamba-linux-gnu +arm,1,arm-openmamba-linux-gnueabi +ppc,1,ppc-openmamba-linux-gnu +) + +# +# XTC 2 +# +# build native binutils (gcc needed, so it's not a stage1 build) +# and cross platform binutils +# +binutils=( +binutils +cross_target_cpu,_target_platform +x86_64,x86_64-openmamba-linux-gnu +i586,i586-openmamba-linux-gnu +arm,arm-openmamba-linux-gnueabi +ppc,ppc-openmamba-linux-gnu +) + +# +# XTC 3 +# +# glibc stage1: build headers only +glibc_stage1=( +glibc +cross_target_cpu,stage1,_target_platform,KERNEL_TARGET,KERNEL_VER +x86_64,1,x86_64-openmamba-linux-gnu,mamba-x86_64,- +arm,1,arm-openmamba-linux-gnueabi,mamba-arm,2.6.33 +i586,1,i586-openmamba-linux-gnu,mamba,- +ppc,1,ppc-openmamba-linux-gnu,mamba,- +) + +# +# XTC 4 +# +gcc_stage1=( +gcc +cross_target_cpu,stage1,_target_platform +x86_64,1,x86_64-openmamba-linux-gnu +arm,1,arm-openmamba-linux-gnueabi +i586,1,i586-openmamba-linux-gnu +ppc,1,ppc-openmamba-linux-gnu +) + +# +# XTC 5 +# +glibc_stage2=( +glibc +cross_target_cpu,stage2,bigendian,softfloat,_target_platform,KERNEL_TARGET,KERNEL_VER +x86_64,1,-,-,x86_64-openmamba-linux-gnu,mamba-x86_64,- +arm,1,-,-,arm-openmamba-linux-gnueabi,mamba-arm,2.6.33 +i586,1,-,-,i586-openmamba-linux-gnu,mamba,- +ppc,1,-,-,ppc-openmamba-linux-gnu,mamba,- +) + +# +# XTC 6 +# +gcc=( +gcc +cross_target_cpu,_target_platform +x86_64,x86_64-openmamba-linux-gnu +arm,arm-openmamba-linux-gnueabi +i586,i586-openmamba-linux-gnu +ppc,ppc-openmamba-linux-gnu +) + +# +# XTC 7 +# +glibc=( +glibc +cross_target_cpu,_target_platform,bigendian,softfloat,KERNEL_TARGET,KERNEL_VER +x86_64,x86_64-openmamba-linux-gnu,-,-,mamba-x86_64,- +i586,i586-openmamba-linux-gnu,-,-,mamba,- +arm,arm-openmamba-linux-gnueabi,-,-,mamba-arm,2.6.33 +) + +gcc_uclibc=( +gcc +cross_target_cpu,_target_platform,bigendian,softfloat,KERNEL_TARGET,KERNEL_VER +arm,arm-linux-uclibc,-,-,mamba-arm,2.6.33 +) + +dietlibc=( +dietlibc +cross_target_cpu +x86_64 +i586 +arm +) + +gcc34=( +gcc34 +cross_target_cpu +x86_64 +i586 +ppc +) + +kernel=( +kernel +target,KERNEL_TARGET +x86_64,mamba-x86_64 +) +#x86_64,mamba-xen + +kernel_extra=( +kernel-extramodules +target,KERNEL_TARGET +x86_64,mamba-x86_64 +) +#x86_64,mamba-xen + +kernel_packages=( +hsfmodem,compat-wireless,ati-driver,NVIDIA,NVIDIA_71xx,NVIDIA_96xx,NVIDIA_173xx,broadcom-sta +target,KERNEL_TARGET,KERNEL_VER +x86_64,mamba-x86_64,- +) +# slmodem, alsa-driver, lirc,VirtualBox, ndiswrapper, alsa-driver + +kernel_packages_new=( +hsfmodem,compat-wireless,ati-driver,NVIDIA,NVIDIA_71xx,NVIDIA_96xx,NVIDIA_173xx,broadcom-sta +target,KERNEL_TARGET,KERNEL_VER +x86_64,mamba-x86_64,2.6.33 +) + +kernelxen_packages=( +alsa-driver,hsfmodem,compat-wireless,ati-driver,ndiswrapper,broadcom-sta +target,KERNEL_TARGET,KERNEL_VER +x86_64,mamba-xen,- +) + +NVIDIA_all=( +NVIDIA,NVIDIA_71xx,NVIDIA_96xx,NVIDIA_173xx +target,KERNEL_TARGET,KERNEL_VER +x86_64,mamba-x86_64 +) +#x86_64,mamba-xen + +alsa_driver=( +alsa-driver +target,KERNEL_TARGET +x86_64,mamba-x86_64 +x86_64,mamba-xen +) + +ati_driver=( +ati-driver +target,KERNEL_TARGET +x86_64,mamba-x86_64 +x86_64,mamba-xen +) + +broadcom_sta=( +broadcom-sta +target,KERNEL_TARGET +x86_64,mamba-x86_64 +x86_64,mamba-xen +) + +kernel_extramodules=( +kernel-extramodules +target,KERNEL_TARGET +x86_64,mamba-x86_64 +x86_64,mamba-xen +) + +kernel_nongpl=( +kernel-nongpl +target,KERNEL_TARGET +x86_64,mamba-x86_64 +x86_64,mamba-xen +) + +kernel_wireless_backport=( +kernel-wireless-backport +target,KERNEL_TARGET +x86_64,mamba-x86_64 +x86_64,mamba-xen +) + +broadcom_sta=( +broadcom-sta +target,KERNEL_TARGET +x86_64,mamba-x86_64 +x86_64,mamba-xen +) + +lirc=( +lirc +target,KERNEL_TARGET +x86_64,mamba-x86_64 +x86_64,mamba-xen +) + +ndiswrapper=( +ndiswrapper +target,KERNEL_TARGET +x86_64,mamba-x86_64 +x86_64,mamba-xen +) + +NVIDIA=( +NVIDIA +target,KERNEL_TARGET +x86_64,mamba-x86_64 +) +#x86_64,mamba-xen + +VirtualBox=( +VirtualBox +target,KERNEL_TARGET +x86_64,mamba-x86_64 +x86_64,mamba-xen +) + +glibc=( +glibc +cross_target_cpu,bigendian,softfloat,KERNEL_TARGET,KERNEL_VER +x86_64,-,-,mamba-x86_64,- +) + +gcc=( +gcc +cross_target_cpu +x86_64 +) + +binutils=( +binutils +cross_target_cpu +x86_64 +) + +pam=( +pam +bootstrap +1 +) + +rpm=( +rpm +bootstrap +1 +) + +emacs=( +emacs +bootstrap +1 +) + +gcc=( +gcc +disable_jack,disable_gjdoc,disable_java +1,1,1 +) diff --git a/etc/autodist/legacy b/etc/autodist/legacy new file mode 100644 index 0000000..a5fab93 --- /dev/null +++ b/etc/autodist/legacy @@ -0,0 +1,75 @@ +kdebase +kdewebdev +grub +libsqlite2 +libglade1 +openssl097 +gnupg +kannel +ftp +nrg2iso +ddrescue +db42 +gcc34 +ftpsync +libglib1 +gcc33 +libxml +libtool1 +openldap22 +python24 +postgresql7 +PyQt +libcares1 +libraw13941 +net-snmp5 +libmtp7 +gambas +libgda2 +libmusicbrainz2 +libpng2 +libXaw8 +icu38 +mysql5 +libreadline5 +libxcb-xlib +autoconf2.13 +python +libflac11 +libdc1394_control +automake1.10 +libusb0 +xorg-drv-input +libeigen +libgtk1 +java-junit3 +lm_sensors2 +kernel-extramodules +kernel-nongpl-nvidia +kernel-nongpl-fglrx +kernel-nongpl +automake1.6 +libjpeg6b +kernel-nongpl-fglrx +kernel-nongpl-nvidia +db47 +arts +kdegraphics +synaptic +libjpeg7 +kdevelop +libgda +objectweb-asm1 +objectweb-asm2 +apache-tomcat5 +java-junit381 +jakarta-commons-lang24 +openssl098 +libpng12 +java-servletapi4 +tcltk84 +make381 +lilo +rpm516 +ffmpeg052 +rpm5 diff --git a/etc/autodist/scripts/update-specfile b/etc/autodist/scripts/update-specfile new file mode 100755 index 0000000..c58de17 --- /dev/null +++ b/etc/autodist/scripts/update-specfile @@ -0,0 +1,27 @@ +# Autodist script for updating specfiles +# +# Copyright (c) 2007-2009 by Silvan Calarco +# Released with the same license as autodist +# + +[ "$1" ] || { + echo "Error: update-specfile: specfile not given; aborting." + exit 1 +} + +[ -e $1 ] || { + echo "Error: update-specfile: file $1 does not exist; aborting." + exit 1 +} + +sed -i "s|^Vendor:.*|Vendor: openmamba|" $1 +sed -i "s|^Distribution:.*|Distribution: openmamba|" $1 +sed -i "s|silvan\.calarco@qilinux\.it|silvan.calarco@mambasoft.it|" $1 +sed -i "/BuildRequires:[[:space:]]*libffmpeg-devel/d" $1 +sed -i "s|\(BuildRequires:[[:space:]]*\)libmysql-devel|\1libmysql5-devel|" $1 +sed -i "s|\(BuildRequires:[[:space:]]*\)libdb42-devel|\1libdb47-devel|" $1 +sed -i "s|\(BuildRequires:[[:space:]]*\)firefox-devel|\1xulrunner-devel|" $1 +sed -i "s|^PreReq:[[:space:]]*/sbin/install-info|Requires(post):%{__install_info}|" $1 +sed -i "s|^PreReq:[[:space:]]*%{__install_info}|Requires(post):%{__install_info}|" $1 +sed -i "s|^PreReq:[[:space:]]*|Requires(pre): |" $1 +exit 0 diff --git a/etc/autodist/unstage b/etc/autodist/unstage new file mode 100644 index 0000000..90584dd --- /dev/null +++ b/etc/autodist/unstage @@ -0,0 +1 @@ +gcc diff --git a/etc/autodist/unstage.arm b/etc/autodist/unstage.arm new file mode 100644 index 0000000..4200eb6 --- /dev/null +++ b/etc/autodist/unstage.arm @@ -0,0 +1,11 @@ +libatk +libgtk +libpango +tcltk +dbus +libgsf +python +glib +libnfsidmap +ghostscript + diff --git a/etc/autodist/unstage.i586 b/etc/autodist/unstage.i586 new file mode 100644 index 0000000..e69de29 diff --git a/etc/autodist/unstage.ppc b/etc/autodist/unstage.ppc new file mode 100644 index 0000000..e69de29 diff --git a/etc/autodist/unstage.x86_64 b/etc/autodist/unstage.x86_64 new file mode 100644 index 0000000..e69de29 diff --git a/etc/autodist/versions b/etc/autodist/versions new file mode 100644 index 0000000..eaa9c72 --- /dev/null +++ b/etc/autodist/versions @@ -0,0 +1,3 @@ +cinepaint 0.22 +ftp 0.17 +tar 1.20 diff --git a/etc/cron.daily/40-openmamba-autodist-cleanold b/etc/cron.daily/40-openmamba-autodist-cleanold new file mode 100755 index 0000000..7ea85f2 --- /dev/null +++ b/etc/cron.daily/40-openmamba-autodist-cleanold @@ -0,0 +1,7 @@ +#!/bin/bash +find /var/autodist/RPM/RPMS/i586/ -maxdepth 1 -ctime +25 -exec rm -rf {} \; +find /var/autodist/RPM/RPMS/noarch/ -maxdepth 1 -ctime +25 -exec rm -rf {} \; +find /var/autodist/RPM/BUILD/ -maxdepth 1 -ctime +25 -exec rm -rf {} \; +find /var/autodist/RPM/SOURCES/ -maxdepth 1 -ctime +120 -exec rm -rf {} \; +find /var/autodist/RPM/SRPMS/ -maxdepth 1 -ctime +90 -exec rm -rf {} \; +find /var/tmp/autodist/ -maxdepth 1 -ctime +25 -exec rm -rf {} \; diff --git a/etc/cron.hourly/65-openmamba-autobuild-autoport b/etc/cron.hourly/65-openmamba-autobuild-autoport new file mode 100755 index 0000000..8e857c0 --- /dev/null +++ b/etc/cron.hourly/65-openmamba-autobuild-autoport @@ -0,0 +1,72 @@ +#!/bin/bash +# +# openmamba-autobuild-autodist daily cron script +# (c) 2008-2011 by Silvan Calarco +# +#. /etc/sysconfig/openmamba-central +. /etc/sysconfig/autoport + +[ "$AUTOPORT_ENABLE" = "1" -o "$AUTOPORT_ENABLE" = "true" ] || exit 0 + +ME=`basename $0` +[ "$$" == "`pidof -x $ME`" ] || { + echo "Warning: script already running; exiting." + exit 0 +} + +PIDFILE=/var/run/autodist/autodist.pid +HOUR=`date +%H` + +function pid_check() { + + [ -e $PIDFILE ] && PIDCHECK=`cat $PIDFILE` + + [ "$PIDCHECK" -a -e /proc/$PIDCHECK ] && { + echo "Error: an autodist process is already running; exiting for safety." + exit 0 + + } +} + +for r in $PORT_REPOSITORIES; do + echo "Autoport start at `date`" > /var/autodist/log/autoport-$r.log + echo "========================" >> /var/autodist/log/autoport-$r.log +done + +for a in $CHROOT_ARCHS; do + # sudo mount -o bind /proc /var/autoport/$a/proc + echo "Updating packages in $a emulation environment" + LANG=C /usr/sbin/chroot /var/autoport/$a smart update + LANG=C /usr/sbin/chroot /var/autoport/$a smart upgrade -y + for r in $PORT_REPOSITORIES; do + echo "Working on $r($a) in emulation mode" >> $local_ftp/$r/autoport.log + /usr/sbin/chroot /var/autoport/$a su -l sdk -c "autoport -b -r $r" >> $local_ftp/$r/autoport.log + cat /var/autoport/arm/home/sdk/.autoport/$a/log >> $local_ftp/$r/autoport.log + echo >> $local_ftp/$r/autoport.log + done +done + +for a in $NATIVE_ARCHS; do + echo "Updating packages in $a native environment" + LANG=C smart update + LANG=C smart upgrade -y + for r in $PORT_REPOSITORIES; do + echo "Working on $r($a) in native mode" >> /var/autodist/log/autoport-$r.log + su -l autodist -c "autoport -b -r $r" >> /var/autodist/log/autoport-$r.log + cat /var/autoport/arm/home/sdk/.autoport/$a/log >> $local_ftp/$r/autoport.log + echo >> /var/autodist/log/autoport-$r.log + done +done + +for r in $PORT_REPOSITORIES; do + for a in $CROSS_ARCHS; do + echo "Working on $r($a) in cross-platform mode" >> $local_ftp/$r/autoport.log + su -l autodist -c "autoport -b -x $a -r $r" >> $local_ftp/$r/autoport.log + cat /var/autodist/.autoport/$a/log >> $local_ftp/$r/autoport.log + echo >> $local_ftp/$r/autoport.log + done +done + +for r in $PORT_REPOSITORIES; do + cp /var/autodist/log/autoport-$r.log /var/autodist/log/autoport-$r-last.log +done diff --git a/etc/sudoers.d/autoport b/etc/sudoers.d/autoport new file mode 100755 index 0000000..0b88162 --- /dev/null +++ b/etc/sudoers.d/autoport @@ -0,0 +1 @@ +%packager ALL = NOPASSWD: /usr/bin/autoport-fix-environment diff --git a/etc/sysconfig/autoport b/etc/sysconfig/autoport new file mode 100644 index 0000000..27c6ab7 --- /dev/null +++ b/etc/sysconfig/autoport @@ -0,0 +1,8 @@ +# +# autoport global configuration +# +AUTOPORT_ENABLE=0 +CHROOT_ARCHS= +CROSS_ARCHS= +NATIVE_ARCHS=arm +PORT_REPOSITORIES="devel-makedist"