spectacle-0.25/AUTHORS0000644002342000234200000000016112502671637012672 0ustar rzrrzrAnas Nashif (anas.nashif@intel.com) Jian-feng Ding (jian-feng.ding@intel.com) Marko Saukko (sage@merproject.org) spectacle-0.25/COPYING0000644002342000234200000004311412502671637012662 0ustar rzrrzr GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) 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 this service 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 make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. 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. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), 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 distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the 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 a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE 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. 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 convey 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 2 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, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision 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, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This 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. spectacle-0.25/Makefile0000644002342000234200000000211212502671637013260 0ustar rzrrzrPYTHON ?= python VERSION = $(shell cat VERSION) TAGVER = $(shell cat VERSION | sed -e "s/\([0-9\.]*\).*/\1/") ifeq ($(VERSION), $(TAGVER)) TAG = $(TAGVER) else TAG = "HEAD" endif ifndef PREFIX PREFIX = "/usr" endif all: tmpls $(PYTHON) setup.py build tmpls: cd spectacle/spec; $(MAKE) cd spectacle/dsc; $(MAKE) tag: git tag $(VERSION) dist-bz2: git archive --format=tar --prefix=spectacle-$(VERSION)/ $(TAG) | \ bzip2 > spectacle-$(VERSION).tar.bz2 dist-gz: git archive --format=tar --prefix=spectacle-$(VERSION)/ $(TAG) | \ gzip > spectacle-$(VERSION).tar.gz doc: markdown README.md > README.html test: cd tests/; $(PYTHON) alltest.py install: all install-data $(PYTHON) setup.py install --root=${DESTDIR} --prefix=${PREFIX} develop: all install-data $(PYTHON) setup.py develop install-data: install -d ${DESTDIR}/usr/share/spectacle/ install -m 644 data/*csv ${DESTDIR}/usr/share/spectacle/ install -m 644 data/GROUPS ${DESTDIR}/usr/share/spectacle/ clean: rm -rf build/ rm -f README.html cd spectacle/spec; $(MAKE) clean cd spectacle/dsc; $(MAKE) clean spectacle-0.25/README.md0000644002342000234200000003206112502671637013105 0ustar rzrrzr# Spectacle Tutorial ## Introduction Spectacle is the toolset for packaging maintenance of MeeGo, including the tool to generate spec files from metadata file in YAML format, and tools to convert spec files or spec-builder's ini files to YAML format. For spectacle managed packages, all generic packaging information will be stored in the YAML file, and it also allows maintaining customizations in the spec file directly with special enclosure tags. Three separated tools will be installed: * specify: the tool to generate or to update spec file, based on YAML * ini2spectacle: the tool to convert spec-builder .ini to YAML and new spec file * spec2spectacle: the tool to convert original spec to YAML and new spec file ## Installation ### Instruction Several methods available for spectacle installation: * rpm/deb packages for several supported Linux distributions From [MeeGo Repos](http://repo.meego.com/tools/repo/), repo urls can be found for: * MeeGo * Fedora 10,11,12 * openSUSE(s) * xUbuntu 8.10/9.04/9.10 * Debian 5.0 * Download the latest source package, and install it by ``make install`` (Only running ``setup.py install`` is not enough!) The latest code in git tree can be accessed at: [git tree](git://gitorious.org/meego-developer-tools/spectacle.git) ### Requirements * python 2.x, above 2.5 * PyYAML, the python module for YAML parsing * cheetah, one popular templating system for python * In many linux distributions, the package may be named as python-cheetah. ## Usage ### specify Usage: specify [options] [yaml-path] Options: --version show program's version number and exit -h, --help show this help message and exit -o OUTFILE_PATH, --output=OUTFILE_PATH Path of output spec file -s, --skip-scm Skip to check upstream SCM when specified in YAML -N, --not-download Do not try to download newer source files -n, --non-interactive Non interactive running, to use default answers ### ini2spectacle Usage: ini2spectacle [options] [ini-path] Options: --version show program's version number and exit -h, --help show this help message and exit -o OUTFILE_PATH, --output=OUTFILE_PATH Path of output yaml file -f, --include-files To store files list in YAML file ### spec2spectacle Usage: spec2spectacle [options] [spec-path] Options: --version show program's version number and exit -h, --help show this help message and exit -o OUTFILE_PATH, --output=OUTFILE_PATH Path of output yaml file -r, --replace-macros To replace self-defined macros in spec file --no-builder-parsing Do NOT try to parse build/install scripts -f, --include-files To store files list in YAML file ## Syntax of spectacle YAML The syntax of YAML can be refered here: Two example spectacle YAML files are placed to examples/ directory in source code: * xfce4-session.yaml, a real world sample with most of the elements * general.yaml, a fake spectacle contains all the available elements, with comments All available directives for spectacle are listed as the following: * Name: **string** * Summary: **string** * Version: **string**, version string * Release: **string** * Epoch: **string** * Group: **string** * License: **string** * URL: **string** * SCM: **string**, URL to git tree * Archive: **string**, format for output of SCM tarball, e.g., gzip, bzip2, xz * BuildArch: **string** * ExclusiveArch: **string** * Prefix: **string** * LocaleName: **string** * LocaleOptions: **string** * Description: **text** * Sources: **list** of **string** * SourcePrefix: **string**, specify the prefix path in source package * ExtraSources: **list** of **string** * SetupOptions: **string**, the options string for %setup * Patches: **list** of **string**, all patches need to be in 'p1' level * Requires: **list** of **string** * RequiresPre: **list** of **string** * RequiresPreUn: **list** of **string** * RequiresPost: **list** of **string** * RequiresPostUn: **list** of **string** * PkgBR: **list** of **string**, packages required in building, or BuildRequires * PkgConfigBR: **list** of **string**, pkg-config requires in building * Provides: **list** of **string** * Conflicts: **list** of **string** * Obsoletes: **list** of **string** * BuildConflicts: **list** of **string** * Macros: **list* of **string** * Macros2: **list* of **string** * Configure: **string**, valid values: **autogen**, **configure**, **reconfigure**, **none** **If not specified, the default value "configure" will be used** * ConfigOptions: **list**, extra options for ``Configure`` * Builder: **string**, valid values: **make**, **single-make**, **python**, **perl**, **qmake**, **none** **If not specified, the deault value "make" will be used. If do not want a automatic builder, please use "none".** * QMakeOptions: **list**, extra options for **qmake** ``Builder`` * Files: **list** of **string**, content of ``%files`` for small packages * FilesInput: **string**, extra input source for %files * NoFiles: **boolean**, if to be set as True, means no %files section for this package and it cause no rpm generated * RunFdupes: **string**, path under %buildroot to run ``%fdupes`` macro in %install * RpmLintIgnore: **list**, list of skip items for ``rpmlint`` * Check: **boolean**, whether need ``%check`` section in spec * SupportOtherDistros: **boolean**, whether need to check for other distros (besides MeeGo) * UseAsNeeded: **boolean**, whether export LD\_AS\_NEEDED=1 environ variable before building * NoAutoReq: **boolean**, whether add 'AutoReq: 0' to spec * NoAutoProv: **boolean**, whether add 'AutoProv: 0' to spec * NoSetup: **boolean**, whether to skip using ``%setup`` in ``%prep`` * NoAutoLocale: **boolean**, whether to use ``%find_lang`` to search locale data when found 'intltool' in PkgBR * NoDesktop: **boolean**, whether to install the desktop files in package * UpdateDesktopDB: **boolean**, whether to run 'update-desktop-database' to flush cache when package (un)installation * NoIconCache: **boolean**, whether to run 'gtk-update-icon-cache' if icon files found in package * AutoDepend: **boolean**, for subpackages only, whether to add Require to main package automatically * AsWholeName: **boolean**, for subpackages only, whether to use **Name** as the whole package name * AutoSubPackages: **list** of **string**, mainly for '-devel' * SubPackages: **list** of **dict**, the **dict** item is the lower level directives for sub packages: * Name * Summary * Description * Group * etc. **CAUTION**: The following cases of value string have special meaning in YAML syntax: * string with leading **``%``** charactor * string with leading **``*``** charactor * string contains **``:``** charactor and one or more spaces/tabs after **``:``** * string end with **``:``** charactor **Then these string values need to be quoted by ``'``(single-quote) or ``"`` (double-quote), and the choice of quote char should not conflict with the value string self.** ## Mandatory and valid keywords for all packages ### Mandatory keywords The following keywords are mandatory for main package: * Name * Summary * Description * Version * Group * License The following keywords are mandatory for sub-package: * Name * Summary * Description * Group ### Valid keywords for sub-packages For sub-packages, only a subset of keywords can be specified: * Name * Summary * Description * Group * License * Version * Release * Epoch * URL * BuildArch * Files * Prefix * Requires * RequiresPre * RequiresPreUn * RequiresPost * RequiresPostUn * Provides * Conflicts * Obsoletes * NoAutoReq * NoAutoProv * NoAutoReqProv * NoIconCache * FilesInput ### Keywords only for sub-packages The following keywords are only valid for sub-packages: * AsWholeName * AutoDepend ## Namespace support for multi-architecture in several keywords For the following spectacle YAML keywords: * Requires * PkgBR * PkgConfigBR * Patches * ConfigOptions * QMakeOptions If one of the items need to be architecture specified, we can add arch prefix to it. The supported prefix and the corresponding architectures as the followings: * ``ix86:`` - x86 platform * ``arm:`` - generic arm platform * ``armv5:`` - armv5 platform, will expand to "armv5el armv5tel armv5tejl" * ``armv7:`` - armv7 platform, will expand to "armv7el armv7tel armv7l armv7hl armv7nhl" Here's some samples: Requires: - arm:pkg-need-in-arm-image - ix86:pkg-need-in-x86-image - normal-pkg ConfigOptions: - arm:--arm-specific-opt - ix86:--ix86-specific-opt - --common-opt ## Customizations in spec Generated spec files by specify will have many placeholders for customizations, such as: # >> build pre # << build pre You can add any custom code between the markers, next time when you run ``specify``, the text between the markers will be kept as is, all other sections relying on the meta data from the YAML file will be changed depending on the values in the YAML file. The following placeholders in spec can be customized: * Private Macros, used in this package's spec With placeholder: # >> macros # << macros * Private Macros2, used in this package's spec # >> macros2 # << macros2 **NOTE**: The placeholder lines will NOT generated in spec by default. If you need customized macros2, it need be added manually before %pre section of the .spec file, and only once. * Extra setup scripts in the last of ``%prep`` With placeholder: # >> setup # << setup * Pre-Build, scripts before package building With placeholder: # >> build pre # << build pre * Post-Build, scripts after package building With placeholder: # >> build post # << build post * Pre-Install, scripts before package installation With placeholder: # >> install pre # << install pre * Post-Install, scripts after package installation With placeholder: # >> install post # << install post * Files, files list in packaged rpm With placeholder: # >> files [[-p] sub-package] # << files [[-p] sub-package] **NOTE**: "sub-packge" stands for the name of sub-package, and it is optional. If no sub-package name specified, it means the files of **main** package. **NOTE**: If the file list is simple enough, you can use YAML *Files* keyword instead to record it. * Scripts for %check section With placeholder: # >> check # << check **NOTE**: Only if YAML boolean *Check* is specifed as ``yes``, %check with placeholder lines will be generated in .spec. * Scriptlets for %pre section With placeholder: # >> pre # << pre **NOTE**: The placeholder lines will NOT generated in spec by default. If you need customized %pre scripts, it need be added manually, and only once. * Scriptlets for %preun section With placeholder: # >> preun # << preun **NOTE**: The placeholder lines will NOT generated in spec by default. If you need customized %preun scripts, it need be added manually, and only once. * Scriptlets for %post section With placeholder: # >> post # << post **NOTE**: The placeholder lines will NOT generated in spec by default. If you need customized %post scripts, it need be added manually, and only once. * Scriptlets for %postun section With placeholder: # >> postun # << postun **NOTE**: The placeholder lines will NOT generated in spec by default. If you need customized %postun scripts, it need be added manually, and only once. ## Internal Implementation Spectacle uses cheetah templates to generate the spec file, based the metadata from YAML file. But the end users need not tackle it. ## Tips * If to upgrade the pkg to a newer version, you can just edit the version string in spectacle YAML file, and when you run ``specify``, it will download the needed files for you automatically. * For packages with locale data, *LocaleName* is needed. If package maintainers cannot confirm whether there are locale files, they can just do not use *LocaleName* at first, and whenever "unpackaged files" rpm packaging errors encountered, it means *LocaleName* should be added. And please do not use it for packages without locale data to keep them clean, though it will not block the building and packaging. * When using spec2spectacle/ini2spectacle to generate spectacle, the following problems should be checked: * Remove duplicate Requires(include pre/post/preun/postun) which were added automatically based on the analysis of file list. * Review and clean up the reserved scripts in "build|install pre|post" sections in new generated spec file. * User can use "series.conf" file to specify multiple patches under package directory. The "series.conf" can be used by ``quilt`` and the content can be updated to spec automatically when running ``specify``. spectacle-0.25/TODO0000644002342000234200000000015512502671637012315 0ustar rzrrzrTopic - Integrate Arjan's autospectacle: https://meego.gitorious.org/meego-developer-tools/autospectacle spectacle-0.25/VERSION0000644002342000234200000000000412502671637012666 0ustar rzrrzr0.25spectacle-0.25/data/GROUPS0000644002342000234200000000414712502671637013505 0ustar rzrrzrAmusements/Games Amusements/Graphics Applications/Archiving Applications/Communications Applications/Databases Applications/Editors Applications/Emulators Applications/Engineering Applications/File Applications/Internet Applications/Multimedia Applications/Productivity Applications/Publishing Applications/System Applications/Text Development/Debuggers Development/Languages Development/Libraries Development/System Development/Tools Documentation System/Boot System/Console System/I18n/Chinese System/I18n/Japanese System/I18n/Korean System/Packages System/Base System/Daemons System/Kernel System/Libraries System/Shells System/X11 System/X11/Fonts System/X11/Icons System/GUI/XFCE System/GUI/Other System/GUI/GNOME Communications/Cellular Adaptation Communications/Cellular Framework Communications/Telephony and IM Communications/Bluetooth Communications/Connectivity Adaptation Communications/ConnMan Data Management/Content Framework Development Platform/Platform SDK Essentials/Base Essentials Graphics/Font Management Graphics/Display and Graphics Adaptation Graphics/Input Adaptation Graphics/Open GL ES Graphics/X11 Kernel/Linux Kernel Location/Location Framework Location/Location Adaptation Multimedia/Audio Adaptation Multimedia/Camera Adaptation Multimedia/Gstreamer Multimedia/Imaging and Video Adaptation Multimedia/Imaging Codecs Multimedia/PulseAudio Multimedia/Sharing Multimedia/UPnP Personal Information Management/Backup Framework Personal Information Management/Calendar Engine Personal Information Management/Contacts Engine Personal Information Management/Email Engine Personal Information Management/Synchronization Framework Qt/Qt Qt/Qt Mobility Qt/Qt WebKit Security/Accounts Security/Certificate Manager Security/Integrity Protection Framework Security/Access Control Framework Security/Single Sign-On Security/SW Distribution Security Security/Security Adaptation Software Management/Package Manager System/Context Framework System/NGF System/Resource Policy System/Sensor Adaptation System/Sensor Framework System/Startup Services System/System Control System/Device Mode Adaptation System/Vibra and Haptics Adaptation spectacle-0.25/data/pkgconfig-provides.csv0000644002342000234200000010756512502671637017070 0ustar rzrrzrConsoleKit-devel,pkgconfig(ck-connector) GConf-dbus-devel,pkgconfig(gconf-2.0) ImageMagick-c++-devel,pkgconfig(ImageMagick++) ImageMagick-c++-devel,pkgconfig(Magick++) ImageMagick-devel,pkgconfig(ImageMagick) ImageMagick-devel,pkgconfig(MagickCore) ImageMagick-devel,pkgconfig(MagickWand) ImageMagick-devel,pkgconfig(Wand) ORBit2-devel,pkgconfig(ORBit-2.0) ORBit2-devel,pkgconfig(ORBit-CosNaming-2.0) ORBit2-devel,pkgconfig(ORBit-idl-2.0) ORBit2-devel,pkgconfig(ORBit-imodule-2.0) OpenCV-devel,pkgconfig(opencv) OpenEXR-devel,pkgconfig(OpenEXR) PackageKit-glib-devel,pkgconfig(packagekit-glib2) PackageKit-qt-devel,pkgconfig(packagekit-qt) SDL-devel,pkgconfig(sdl) SDL_Pango-devel,pkgconfig(SDL_Pango) SDL_gfx-devel,pkgconfig(SDL_gfx) SDL_image-devel,pkgconfig(SDL_image) SDL_mixer-devel,pkgconfig(SDL_mixer) WebKit-gtk-devel,pkgconfig(webkit-1.0) WiMAX-Network-Service-devel,pkgconfig(libiWmxSdk-0) aiksaurus-devel,pkgconfig(aiksaurus-1.0) aiksaurus-devel,pkgconfig(gaiksaurus-1.0) alsa-lib-devel,pkgconfig(alsa) anerley-devel,pkgconfig(anerley) anjuta-devel,pkgconfig(libanjuta-1.0) anthy-devel,pkgconfig(anthy) apr-devel,pkgconfig(apr-1) apr-util-devel,pkgconfig(apr-util-1) art-sharp2,pkgconfig(art-sharp-2.0) aspell-devel,pkgconfig(aspell) at-spi-devel,pkgconfig(cspi-1.0) at-spi-devel,pkgconfig(libloginhelper-1.0) at-spi-devel,pkgconfig(libspi-1.0) atk-devel,pkgconfig(atk) attica-devel,pkgconfig(libattica) audiofile-devel,pkgconfig(audiofile) augeas-devel,pkgconfig(augeas) autogen-devel,pkgconfig(autoopts) autotrace-devel,pkgconfig(autotrace) avahi-compat-howl-devel,pkgconfig(avahi-compat-howl) avahi-compat-howl-devel,pkgconfig(howl) avahi-compat-libdns_sd-devel,pkgconfig(avahi-compat-libdns_sd) avahi-compat-libdns_sd-devel,pkgconfig(libdns_sd) avahi-devel,pkgconfig(avahi-client) avahi-devel,pkgconfig(avahi-core) avahi-glib-devel,pkgconfig(avahi-glib) avahi-gobject-devel,pkgconfig(avahi-gobject) avahi-ui-devel,pkgconfig(avahi-ui) babl-devel,pkgconfig(babl) banshee-1-devel,pkgconfig(banshee-1-collection-indexer) banshee-1-devel,pkgconfig(banshee-1-core) banshee-1-devel,pkgconfig(banshee-1-hyena) banshee-1-devel,pkgconfig(banshee-1-hyena-data-sqlite) banshee-1-devel,pkgconfig(banshee-1-hyena-gui) banshee-1-devel,pkgconfig(banshee-1-lastfm) banshee-1-devel,pkgconfig(banshee-1-lastfm-gui) banshee-1-devel,pkgconfig(banshee-1-mono-media) banshee-1-devel,pkgconfig(banshee-1-musicbrainz) banshee-1-devel,pkgconfig(banshee-1-nowplaying) banshee-1-devel,pkgconfig(banshee-1-services) banshee-1-devel,pkgconfig(banshee-1-thickclient) bickley-devel,pkgconfig(bickley-0.4) bind-devel,pkgconfig(libbind) bisho-devel,pkgconfig(bisho) bluez-libs-devel,pkgconfig(bluez) bognor-regis-devel,pkgconfig(bognor-regis-0.6) brasero-devel,pkgconfig(libbrasero-burn) brasero-devel,pkgconfig(libbrasero-media) bugle-devel,pkgconfig(bugle) buteo-sync-plugins-devel,pkgconfig(syncmlcommon) buteo-syncfw-devel,pkgconfig(synccommon) buteo-syncfw-devel,pkgconfig(syncfwclient) buteo-syncfw-devel,pkgconfig(syncpluginmgr) buteo-syncfw-devel,pkgconfig(syncprofile) buteo-syncml-devel,pkgconfig(meegosyncml) c-ares-devel,pkgconfig(libcares) cairo-devel,pkgconfig(cairo) cairo-devel,pkgconfig(cairo-fc) cairo-devel,pkgconfig(cairo-ft) cairo-devel,pkgconfig(cairo-gl) cairo-devel,pkgconfig(cairo-glx) cairo-devel,pkgconfig(cairo-gobject) cairo-devel,pkgconfig(cairo-pdf) cairo-devel,pkgconfig(cairo-png) cairo-devel,pkgconfig(cairo-ps) cairo-devel,pkgconfig(cairo-svg) cairo-devel,pkgconfig(cairo-xlib) cairo-devel,pkgconfig(cairo-xlib-xrender) cairomm-devel,pkgconfig(cairomm-1.0) cairomm-devel,pkgconfig(cairomm-ft-1.0) cairomm-devel,pkgconfig(cairomm-pdf-1.0) cairomm-devel,pkgconfig(cairomm-png-1.0) cairomm-devel,pkgconfig(cairomm-ps-1.0) cairomm-devel,pkgconfig(cairomm-svg-1.0) cairomm-devel,pkgconfig(cairomm-xlib-1.0) check-devel,pkgconfig(check) cheese-devel,pkgconfig(cheese-gtk) clean-device-devel,pkgconfig(clean-device) clutter-box2d-devel,pkgconfig(clutter-box2d-0.10) clutter-devel,pkgconfig(cally-1.0) clutter-devel,pkgconfig(clutter-1.0) clutter-devel,pkgconfig(clutter-glx-1.0) clutter-devel,pkgconfig(clutter-x11-1.0) clutter-devel,pkgconfig(cogl-1.0) clutter-devel,pkgconfig(cogl-gl-1.0) clutter-gesture-devel,pkgconfig(clutter-gesture) clutter-gst-devel,pkgconfig(clutter-gst-1.0) clutter-gtk-devel,pkgconfig(clutter-gtk-0.12) clutter-imcontext-devel,pkgconfig(clutter-imcontext-0.1) compat-telepathy-qt4-devel,pkgconfig(TelepathyQt4) compat-telepathy-qt4-farsight-devel,pkgconfig(TelepathyQt4Farsight) connman-devel,pkgconfig(connman) contactsd-devel,pkgconfig(contactsd-1.0) contextkit-devel,pkgconfig(contextprovider-1.0) contextkit-devel,pkgconfig(contextsubscriber-1.0) cppunit-devel,pkgconfig(cppunit) cryptsetup-luks-devel,pkgconfig(libcryptsetup) ctdb-devel,pkgconfig(ctdb) dbus-devel,pkgconfig(dbus-1) dbus-glib-devel,pkgconfig(dbus-glib-1) dbus-python-devel,pkgconfig(dbus-python) devhelp-devel,pkgconfig(libdevhelp-1.0) device-mapper-devel,pkgconfig(devmapper) djvulibre-devel,pkgconfig(ddjvuapi) dotconf-devel,pkgconfig(dotconf) e2fsprogs-devel,pkgconfig(e2p) e2fsprogs-devel,pkgconfig(ext2fs) ecryptfs-utils-devel,pkgconfig(libecryptfs) eggdbus-devel,pkgconfig(eggdbus-1) enchant-devel,pkgconfig(enchant) eog-devel,pkgconfig(eog) esound-devel,pkgconfig(esound) evince-devel,pkgconfig(evince-document-2.30) evince-devel,pkgconfig(evince-view-2.30) evolution-data-server-devel,pkgconfig(camel-1.2) evolution-data-server-devel,pkgconfig(camel-provider-1.2) evolution-data-server-devel,pkgconfig(evolution-data-server-1.2) evolution-data-server-devel,pkgconfig(libebackend-1.2) evolution-data-server-devel,pkgconfig(libebook-1.2) evolution-data-server-devel,pkgconfig(libecal-1.2) evolution-data-server-devel,pkgconfig(libedata-book-1.2) evolution-data-server-devel,pkgconfig(libedata-cal-1.2) evolution-data-server-devel,pkgconfig(libedataserver-1.2) evolution-data-server-devel,pkgconfig(libedataserverui-1.2) evolution-data-server-devel,pkgconfig(libegroupwise-1.2) evolution-devel,pkgconfig(evolution-calendar) evolution-devel,pkgconfig(evolution-mail) evolution-devel,pkgconfig(evolution-plugin) evolution-devel,pkgconfig(evolution-shell) exempi-devel,pkgconfig(exempi-2.0) exiv2-devel,pkgconfig(exiv2) farsight2-devel,pkgconfig(farsight2-0.10) fennec-qt-devel,pkgconfig(libxul) fennec-qt-devel,pkgconfig(libxul-embedding) fennec-qt-devel,pkgconfig(mozilla-gtkmozembed) fennec-qt-devel,pkgconfig(mozilla-gtkmozembed-embedding) fennec-qt-devel,pkgconfig(mozilla-js) fennec-qt-devel,pkgconfig(mozilla-plugin) finch-devel,pkgconfig(finch) finch-devel,pkgconfig(gnt) flac-devel,pkgconfig(flac) flac-devel,pkgconfig(flac++) fontconfig-devel,pkgconfig(fontconfig) fontforge-devel,pkgconfig(fontforge) freetype-devel,pkgconfig(freetype2) fribidi-devel,pkgconfig(fribidi) fuse-devel,pkgconfig(fuse) gamin-devel,pkgconfig(gamin) gammu-devel,pkgconfig(gammu) gammu-devel,pkgconfig(gammu-smsd) garage-client-services-devel,pkgconfig(garage-client-services) gc-devel,pkgconfig(bdw-gc) gconf-sharp2,pkgconfig(gconf-sharp-2.0) gconf-sharp2,pkgconfig(gconf-sharp-peditors-2.0) gd-devel,pkgconfig(gdlib) gedit-devel,pkgconfig(gedit-2.20) gegl-devel,pkgconfig(gegl) geoclue-devel,pkgconfig(geoclue) gimp-devel,pkgconfig(gimp-2.0) gimp-devel,pkgconfig(gimpthumb-2.0) gimp-devel,pkgconfig(gimpui-2.0) glade-sharp2,pkgconfig(glade-sharp-2.0) glade3-libgladeui-devel,pkgconfig(gladeui-1.0) glew-devel,pkgconfig(glew) glib-sharp2,pkgconfig(glib-sharp-2.0) glib2-devel,pkgconfig(gio-2.0) glib2-devel,pkgconfig(gio-unix-2.0) glib2-devel,pkgconfig(glib-2.0) glib2-devel,pkgconfig(gmodule-2.0) glib2-devel,pkgconfig(gmodule-export-2.0) glib2-devel,pkgconfig(gmodule-no-export-2.0) glib2-devel,pkgconfig(gobject-2.0) glib2-devel,pkgconfig(gthread-2.0) glibmm-devel,pkgconfig(giomm-2.4) glibmm-devel,pkgconfig(glibmm-2.4) gmime-devel,pkgconfig(gmime-2.4) gnet2-devel,pkgconfig(gnet-2.0) gnome-bluetooth-libs-devel,pkgconfig(gnome-bluetooth-1.0) gnome-control-center-netbook-devel,pkgconfig(gnome-keybindings) gnome-control-center-netbook-devel,pkgconfig(gnome-window-settings-2.0) gnome-control-center-netbook-devel,pkgconfig(libgnome-control-center-extension) gnome-desktop-devel,pkgconfig(gnome-desktop-2.0) gnome-disk-utility-devel,pkgconfig(gdu) gnome-disk-utility-ui-devel,pkgconfig(gdu-gtk) gnome-doc-utils-stylesheets,pkgconfig(gnome-doc-utils) gnome-doc-utils-stylesheets,pkgconfig(xml2po) gnome-icon-theme,pkgconfig(gnome-icon-theme) gnome-keyring-devel,pkgconfig(gcr-0) gnome-keyring-devel,pkgconfig(gp11-0) gnome-media-devel,pkgconfig(gnome-media-profiles) gnome-menus-devel,pkgconfig(libgnome-menu) gnome-mime-data,pkgconfig(gnome-mime-data-2.0) gnome-panel-devel,pkgconfig(libpanelapplet-2.0) gnome-python2-desktop,pkgconfig(gnome-python-desktop-2.0) gnome-python2-devel,pkgconfig(gnome-python-2.0) gnome-screensaver,pkgconfig(gnome-screensaver) gnome-settings-daemon-devel,pkgconfig(gnome-settings-daemon) gnome-sharp2,pkgconfig(gnome-sharp-2.0) gnome-utils-devel,pkgconfig(gdict-1.0) gnome-vfs-sharp2,pkgconfig(gnome-vfs-sharp-2.0) gnome-vfs2-devel,pkgconfig(gnome-vfs-2.0) gnome-vfs2-devel,pkgconfig(gnome-vfs-module-2.0) gnumeric-devel,pkgconfig(libspreadsheet-1.10) gnutls-devel,pkgconfig(gnutls) goffice-devel,pkgconfig(libgoffice-0.8) google-gadgets-devel,pkgconfig(libggadget-1.0) google-gadgets-devel,pkgconfig(libggadget-dbus-1.0) google-gadgets-devel,pkgconfig(libggadget-gtk-1.0) google-gadgets-devel,pkgconfig(libggadget-js-1.0) google-gadgets-devel,pkgconfig(libggadget-npapi-1.0) google-gadgets-devel,pkgconfig(libggadget-xdg-1.0) gpsd-devel,pkgconfig(libgps) gpsd-devel,pkgconfig(libgpsd) graphviz-devel,pkgconfig(libcdt) graphviz-devel,pkgconfig(libcgraph) graphviz-devel,pkgconfig(libgraph) graphviz-devel,pkgconfig(libgvc) graphviz-devel,pkgconfig(libgvpr) graphviz-devel,pkgconfig(libpathplan) graphviz-devel,pkgconfig(libxdot) grilo-devel,pkgconfig(grilo-0.1) grilo-devel,pkgconfig(grilo-net-0.1) gsl-devel,pkgconfig(gsl) gssdp-devel,pkgconfig(gssdp-1.0) gst-plugins-bad-free-devel,pkgconfig(gstreamer-plugins-bad-free-0.10) gst-plugins-base-devel,pkgconfig(gstreamer-app-0.10) gst-plugins-base-devel,pkgconfig(gstreamer-audio-0.10) gst-plugins-base-devel,pkgconfig(gstreamer-cdda-0.10) gst-plugins-base-devel,pkgconfig(gstreamer-fft-0.10) gst-plugins-base-devel,pkgconfig(gstreamer-floatcast-0.10) gst-plugins-base-devel,pkgconfig(gstreamer-interfaces-0.10) gst-plugins-base-devel,pkgconfig(gstreamer-netbuffer-0.10) gst-plugins-base-devel,pkgconfig(gstreamer-pbutils-0.10) gst-plugins-base-devel,pkgconfig(gstreamer-plugins-base-0.10) gst-plugins-base-devel,pkgconfig(gstreamer-riff-0.10) gst-plugins-base-devel,pkgconfig(gstreamer-rtp-0.10) gst-plugins-base-devel,pkgconfig(gstreamer-rtsp-0.10) gst-plugins-base-devel,pkgconfig(gstreamer-sdp-0.10) gst-plugins-base-devel,pkgconfig(gstreamer-tag-0.10) gst-plugins-base-devel,pkgconfig(gstreamer-video-0.10) gst-plugins-camera-devel,pkgconfig(gstreamer-nokia-videosrc-0.10) gst-v4l2-camsrc-devel,pkgconfig(gstreamer-atomisphal-0.10) gst-v4l2-camsrc-devel,pkgconfig(gstreamer-mfld-videosrc-0.10) gst-vabuffer-devel,pkgconfig(gst-vabuffer) gstreamer-devel,pkgconfig(gstreamer-0.10) gstreamer-devel,pkgconfig(gstreamer-base-0.10) gstreamer-devel,pkgconfig(gstreamer-check-0.10) gstreamer-devel,pkgconfig(gstreamer-controller-0.10) gstreamer-devel,pkgconfig(gstreamer-dataprotocol-0.10) gstreamer-devel,pkgconfig(gstreamer-net-0.10) gstreamer-editing-services-devel,pkgconfig(gst-editing-services-0.10) gstreamer-python-devel,pkgconfig(gst-python-0.10) gtk-doc,pkgconfig(gtk-doc) gtk-sharp2,pkgconfig(gtk-dotnet-2.0) gtk-sharp2,pkgconfig(gtk-sharp-2.0) gtk-sharp2-gapi,pkgconfig(gapi-2.0) gtk2-devel,pkgconfig(gail) gtk2-devel,pkgconfig(gdk-2.0) gtk2-devel,pkgconfig(gdk-pixbuf-2.0) gtk2-devel,pkgconfig(gdk-pixbuf-xlib-2.0) gtk2-devel,pkgconfig(gdk-x11-2.0) gtk2-devel,pkgconfig(gtk+-2.0) gtk2-devel,pkgconfig(gtk+-unix-print-2.0) gtk2-devel,pkgconfig(gtk+-x11-2.0) gtk2-engines-devel,pkgconfig(gtk-engines-2) gtkglext-devel,pkgconfig(gdkglext-1.0) gtkglext-devel,pkgconfig(gdkglext-x11-1.0) gtkglext-devel,pkgconfig(gtkglext-1.0) gtkglext-devel,pkgconfig(gtkglext-x11-1.0) gtkhtml3-devel,pkgconfig(gtkhtml-editor) gtkhtml3-devel,pkgconfig(libgtkhtml-3.14) gtkmathview-devel,pkgconfig(gtkmathview-custom-reader) gtkmathview-devel,pkgconfig(gtkmathview-libxml2) gtkmathview-devel,pkgconfig(gtkmathview-libxml2-reader) gtkmathview-devel,pkgconfig(mathview-backend-gtk) gtkmathview-devel,pkgconfig(mathview-backend-ps) gtkmathview-devel,pkgconfig(mathview-backend-svg) gtkmathview-devel,pkgconfig(mathview-core) gtkmathview-devel,pkgconfig(mathview-frontend-custom-reader) gtkmathview-devel,pkgconfig(mathview-frontend-libxml2) gtkmathview-devel,pkgconfig(mathview-frontend-libxml2-reader) gtkmm-devel,pkgconfig(atkmm-1.6) gtkmm-devel,pkgconfig(gdkmm-2.4) gtkmm-devel,pkgconfig(gtkmm-2.4) gtksourceview2-devel,pkgconfig(gtksourceview-2.0) gtkspell-devel,pkgconfig(gtkspell-2.0) guile-devel,pkgconfig(guile-1.8) gupnp-av-devel,pkgconfig(gupnp-av-1.0) gupnp-devel,pkgconfig(gupnp-1.0) gupnp-dlna-devel,pkgconfig(gupnp-dlna-1.0) gupnp-igd-devel,pkgconfig(gupnp-igd-1.0) gupnp-ui-devel,pkgconfig(gupnp-ui-1.0) gupnp-vala,pkgconfig(gupnp-vala-1.0) gwenhywfar-devel,pkgconfig(gwenhywfar) gypsy-devel,pkgconfig(gypsy) hunspell-devel,pkgconfig(hunspell) icon-naming-utils,pkgconfig(icon-naming-utils) ilmbase-devel,pkgconfig(IlmBase) iptables-devel,pkgconfig(libiptc) iptables-devel,pkgconfig(xtables) iso-codes-devel,pkgconfig(iso-codes) jana-devel,pkgconfig(libjana) jana-devel,pkgconfig(libjana-ecal) jana-devel,pkgconfig(libjana-gtk) json-c-devel,pkgconfig(json) json-glib-devel,pkgconfig(json-glib-1.0) kcalcore-devel,pkgconfig(libkcalcoren) lcms-devel,pkgconfig(lcms) libCI-devel,pkgconfig(libci) libICE-devel,pkgconfig(ice) libIDL-devel,pkgconfig(libIDL-2.0) libSM-devel,pkgconfig(sm) libX11-devel,pkgconfig(x11) libX11-devel,pkgconfig(x11-xcb) libXScrnSaver-devel,pkgconfig(xscrnsaver) libXTrap-devel,pkgconfig(xtrap) libXau-devel,pkgconfig(xau) libXaw-compat,pkgconfig(xaw6) libXaw-devel,pkgconfig(xaw7) libXcomposite-devel,pkgconfig(xcomposite) libXcursor-devel,pkgconfig(xcursor) libXdamage-devel,pkgconfig(xdamage) libXdmcp-devel,pkgconfig(xdmcp) libXevie-devel,pkgconfig(xevie) libXext-devel,pkgconfig(xext) libXfixes-devel,pkgconfig(xfixes) libXfont-devel,pkgconfig(xfont) libXfontcache-devel,pkgconfig(xfontcache) libXft-devel,pkgconfig(xft) libXi-devel,pkgconfig(xi) libXinerama-devel,pkgconfig(xinerama) libXmu-devel,pkgconfig(xmu) libXmu-devel,pkgconfig(xmuu) libXpm-devel,pkgconfig(xpm) libXrandr-devel,pkgconfig(xrandr) libXrender-devel,pkgconfig(xrender) libXres-devel,pkgconfig(xres) libXt-devel,pkgconfig(xt) libXtst-devel,pkgconfig(xtst) libXv-devel,pkgconfig(xv) libXvMC-devel,pkgconfig(xvmc) libXxf86dga-devel,pkgconfig(xxf86dga) libXxf86misc-devel,pkgconfig(xxf86misc) libXxf86vm-devel,pkgconfig(xxf86vm) libabiword-devel,pkgconfig(abiword-2.8) libaccounts-glib-devel,pkgconfig(libaccounts-glib) libaccounts-qt-devel,pkgconfig(accounts-qt) libaccounts-ui-devel,pkgconfig(AccountPlugin) libao-devel,pkgconfig(ao) libarchive-devel,pkgconfig(libarchive) libart_lgpl-devel,pkgconfig(libart-2.0) libasyncns-devel,pkgconfig(libasyncns) libatasmart-devel,pkgconfig(libatasmart) libblkid-devel,pkgconfig(blkid) libbonobo-devel,pkgconfig(bonobo-activation-2.0) libbonobo-devel,pkgconfig(libbonobo-2.0) libbonoboui-devel,pkgconfig(libbonoboui-2.0) libburn-devel,pkgconfig(libburn-1) libcanberra-devel,pkgconfig(libcanberra) libcanberra-devel,pkgconfig(libcanberra-gtk) libcap-ng-devel,pkgconfig(libcap-ng) libchamplain-devel,pkgconfig(champlain-0.8) libchamplain-devel,pkgconfig(champlain-gtk-0.8) libchamplain-gtk-devel,pkgconfig(champlain-gtk-0.8) libchewing-devel,pkgconfig(chewing) libcmtspeech-ifx-devel,pkgconfig(libcmtspeech-ifx) libcom_err-devel,pkgconfig(com_err) libcommhistory-devel,pkgconfig(commhistory) libcontentaction-devel,pkgconfig(contentaction-0.1) libcqpid-devel,pkgconfig(libcqpid) libcroco-devel,pkgconfig(libcroco-0.6) libcurl-devel,pkgconfig(libcurl) libdaemon-devel,pkgconfig(libdaemon) libdbus-c++-devel,pkgconfig(dbus-c++-1) libdbus-qeventloop-devel,pkgconfig(libdbus-qeventloop1) libdiscid-devel,pkgconfig(libdiscid) libdmx-devel,pkgconfig(dmx) libdres-devel,pkgconfig(libdres) libdrm-devel,pkgconfig(libdrm) libdrm-devel,pkgconfig(libdrm_intel) libdrm-devel,pkgconfig(libdrm_radeon) libdrm-devel,pkgconfig(libkms) libdsme-devel,pkgconfig(dsme) libdsme-devel,pkgconfig(dsme_dbus_if) libdsme-devel,pkgconfig(thermalmanager_dbus_if) libeap0-devel,pkgconfig(libeap0) libedit-devel,pkgconfig(libedit) libeigen2-devel,pkgconfig(eigen2) libenca-devel,pkgconfig(enca) libexif-devel,pkgconfig(libexif) libfakekey-devel,pkgconfig(libfakekey) libffi-devel,pkgconfig(libffi) libfontenc-devel,pkgconfig(fontenc) libfprint-devel,pkgconfig(libfprint) libgail-gnome-devel,pkgconfig(libgail-gnome) libgcrypt-devel,pkgconfig(libgcrypt) libgcrypt-devel,pkgconfig(libgpg-error) libgda-devel,pkgconfig(libgda-4.0) libgda-devel,pkgconfig(libgda-bdb-4.0) libgda-devel,pkgconfig(libgda-report-4.0) libgda-devel,pkgconfig(libgda-xslt-4.0) libgda-sqlite-devel,pkgconfig(libgda-sqlite-4.0) libgdata-devel,pkgconfig(libgdata) libgdbus-devel,pkgconfig(gdbus) libgdiplus0-devel,pkgconfig(libgdiplus) libgdl-devel,pkgconfig(gdl-1.0) libgee-devel,pkgconfig(gee-1.0) libggz-devel,pkgconfig(libggz) libglade2-devel,pkgconfig(libglade-2.0) libglademm-devel,pkgconfig(libglademm-2.4) libgnome-devel,pkgconfig(libgnome-2.0) libgnome-keyring-devel,pkgconfig(gnome-keyring-1) libgnomecanvas-devel,pkgconfig(libgnomecanvas-2.0) libgnomecups-devel,pkgconfig(libgnomecups-1.0) libgnomekbd-devel,pkgconfig(libgnomekbd) libgnomekbd-devel,pkgconfig(libgnomekbdui) libgnomeprint22-devel,pkgconfig(libgnomeprint-2.2) libgnomeprintui22-devel,pkgconfig(libgnomeprintui-2.2) libgnomeui-devel,pkgconfig(libgnomeui-2.0) libgphoto2-devel,pkgconfig(libgphoto2) libgphoto2-devel,pkgconfig(libgphoto2_port) libgsf-devel,pkgconfig(libgsf-1) libgtop2-devel,pkgconfig(libgtop-2.0) libgudev1-devel,pkgconfig(gudev-1.0) libgweather-devel,pkgconfig(gweather) libhangul-devel,pkgconfig(libhangul) libical-devel,pkgconfig(libical) libicu-devel,pkgconfig(icu-i18n) libicu-devel,pkgconfig(icu-io) libicu-devel,pkgconfig(icu-le) libicu-devel,pkgconfig(icu-lx) libicu-devel,pkgconfig(icu-uc) libid3tag-devel,pkgconfig(id3tag) libidn-devel,pkgconfig(libidn) libiphb-devel,pkgconfig(libiphb) libiptcdata-devel,pkgconfig(libiptcdata) libisofs-devel,pkgconfig(libisofs-1) libjingle-devel,pkgconfig(jinglebase-0.3) libjingle-devel,pkgconfig(jinglep2p-0.3) libmatchbox-devel,pkgconfig(libmb) libmdatauri-devel,pkgconfig(mdatauri) libmeegochat-devel,pkgconfig(libmeegochat) libmeegocontrolpanel-devel,pkgconfig(duicontrolpanel) libmeegocontrolpanel-devel,pkgconfig(meegotouch-controlpanel) libmeegotouch-devel,pkgconfig(meegotouch) libmeegotouch-devel,pkgconfig(meegotouch-boostable) libmeegotouch-devel,pkgconfig(meegotouchcore) libmeegotouch-devel,pkgconfig(meegotouchsettings) libmtp-devel,pkgconfig(libmtp) libngf-devel,pkgconfig(libngf0) libnice-devel,pkgconfig(nice) libnl-devel,pkgconfig(libnl-1) libnotify-devel,pkgconfig(libnotify) libofono-qt-devel,pkgconfig(ofono-qt) libofx-devel,pkgconfig(libofx) libogg-devel,pkgconfig(ogg) liboil-devel,pkgconfig(liboil-0.3) libopenraw-devel,pkgconfig(libopenraw-1.0) libopenraw-gnome-devel,pkgconfig(libopenraw-gnome-1.0) libopensync-devel,pkgconfig(opensync-1.0) libpciaccess-devel,pkgconfig(pciaccess) libphonon-devel,pkgconfig(phonon) libpng-devel,pkgconfig(libpng) libpng-devel,pkgconfig(libpng12) libprolog-devel,pkgconfig(libprolog) libpthread-stubs,pkgconfig(pthread-stubs) libpublishwidgets-devel,pkgconfig(publish-widgets) libpurple-devel,pkgconfig(purple) libqt-devel,pkgconfig(QtCLucene) libqt-devel,pkgconfig(QtCore) libqt-devel,pkgconfig(QtDBus) libqt-devel,pkgconfig(QtDeclarative) libqt-devel,pkgconfig(QtDesigner) libqt-devel,pkgconfig(QtDesignerComponents) libqt-devel,pkgconfig(QtGui) libqt-devel,pkgconfig(QtHelp) libqt-devel,pkgconfig(QtNetwork) libqt-devel,pkgconfig(QtScript) libqt-devel,pkgconfig(QtScriptTools) libqt-devel,pkgconfig(QtSql) libqt-devel,pkgconfig(QtSvg) libqt-devel,pkgconfig(QtTest) libqt-devel,pkgconfig(QtUiTools) libqt-devel,pkgconfig(QtXml) libqt-devel,pkgconfig(QtXmlPatterns) libqtopengl-devel,pkgconfig(QtMeeGoGraphicsSystemHelper) libqtopengl-devel,pkgconfig(QtOpenGL) libqtsparql-devel,pkgconfig(QtSparql) libqtsparql-tracker-extensions-devel,pkgconfig(QtSparqlTrackerExtensions) libqttracker-devel,pkgconfig(qttracker) libqtwebkit-devel,pkgconfig(QtWebKit) libquill-devel,pkgconfig(quill) libquillmetadata-devel,pkgconfig(quillmetadata) librapi2-devel,pkgconfig(librapi2) libresource-devel,pkgconfig(libresource0) libresource-devel,pkgconfig(libresource0-glib) libresourceqt-devel,pkgconfig(libresourceqt1) librsvg2-devel,pkgconfig(librsvg-2.0) libsamplerate-devel,pkgconfig(samplerate) libsexy-devel,pkgconfig(libsexy) libshare-ui-devel,pkgconfig(share-ui-plugin) libshare-ui-devel,pkgconfig(share-widgets) libsigc++-devel,pkgconfig(sigc++-2.0) libsignon-devel,pkgconfig(SignOnExtension) libsignon-devel,pkgconfig(libsignon-qt) libsignon-devel,pkgconfig(signon-plugins) libsignon-devel,pkgconfig(signon-plugins-common) libsignon-devel,pkgconfig(signon-saslplugin) libsignon-devel,pkgconfig(signond) libsignon-glib-devel,pkgconfig(libsignon-glib) libsignoncrypto-qt-devel,pkgconfig(libsignoncrypto-qt) libsilc-devel,pkgconfig(silc) libsilc-devel,pkgconfig(silcclient) libsmbclient-devel,pkgconfig(smbclient) libsmbclient-devel,pkgconfig(smbsharemodes) libsmbios-devel,pkgconfig(libsmbios_c) libsndfile-devel,pkgconfig(sndfile) libsocialweb-devel,pkgconfig(libsocialweb-client) libsocialweb-devel,pkgconfig(libsocialweb-keyfob) libsocialweb-devel,pkgconfig(libsocialweb-keystore) libsocialweb-devel,pkgconfig(libsocialweb-module) libsocialweb-qt-devel,pkgconfig(libsocialweb-qt) libsoup-devel,pkgconfig(libsoup-2.4) libsoup-devel,pkgconfig(libsoup-gnome-2.4) libspectre-devel,pkgconfig(libspectre) libss-devel,pkgconfig(ss) libsynce-devel,pkgconfig(libsynce) libsyncml-devel,pkgconfig(libsyncml-1.0) libtalloc-devel,pkgconfig(talloc) libtasn1-devel,pkgconfig(libtasn1) libtdb-compat-devel,pkgconfig(tdb-compat) libtdb-devel,pkgconfig(tdb) libtelepathy-devel,pkgconfig(libtelepathy) libthai-devel,pkgconfig(libthai) libtheora-devel,pkgconfig(theora) libtheora-devel,pkgconfig(theoradec) libtheora-devel,pkgconfig(theoraenc) libtrace-devel,pkgconfig(libsimple-trace) libudev-devel,pkgconfig(libudev) libudev-devel,pkgconfig(udev) libusb-devel,pkgconfig(libusb) libusb1-devel,pkgconfig(libusb-1.0) libuser-devel,pkgconfig(libuser) libuuid-devel,pkgconfig(uuid) libv4l-devel,pkgconfig(libv4l1) libv4l-devel,pkgconfig(libv4l2) libv4l-devel,pkgconfig(libv4lconvert) libva-devel,pkgconfig(libva) libva-devel,pkgconfig(libva-egl) libva-devel,pkgconfig(libva-glx) libva-devel,pkgconfig(libva-tpi) libva-devel,pkgconfig(libva-x11) libvisual-devel,pkgconfig(libvisual-0.4) libvorbis-devel,pkgconfig(vorbis) libvorbis-devel,pkgconfig(vorbisenc) libvorbis-devel,pkgconfig(vorbisfile) libwbxml2-devel,pkgconfig(libwbxml2) libwebupload-devel,pkgconfig(libwebupload) libwmf-devel,pkgconfig(libwmf) libwnck-devel,pkgconfig(libwnck-1.0) libwpd-devel,pkgconfig(libwpd-0.8) libwpd-devel,pkgconfig(libwpd-stream-0.8) libwpg-devel,pkgconfig(libwpg-0.1) libwpg-devel,pkgconfig(libwpg-stream-0.1) libwps-devel,pkgconfig(libwps-0.1) libwps-devel,pkgconfig(libwps-stream-0.1) libwsbm-devel,pkgconfig(libwsbm) libxcb-devel,pkgconfig(xcb) libxcb-devel,pkgconfig(xcb-composite) libxcb-devel,pkgconfig(xcb-damage) libxcb-devel,pkgconfig(xcb-dpms) libxcb-devel,pkgconfig(xcb-dri2) libxcb-devel,pkgconfig(xcb-glx) libxcb-devel,pkgconfig(xcb-randr) libxcb-devel,pkgconfig(xcb-record) libxcb-devel,pkgconfig(xcb-render) libxcb-devel,pkgconfig(xcb-res) libxcb-devel,pkgconfig(xcb-screensaver) libxcb-devel,pkgconfig(xcb-shape) libxcb-devel,pkgconfig(xcb-shm) libxcb-devel,pkgconfig(xcb-sync) libxcb-devel,pkgconfig(xcb-xevie) libxcb-devel,pkgconfig(xcb-xf86dri) libxcb-devel,pkgconfig(xcb-xfixes) libxcb-devel,pkgconfig(xcb-xinerama) libxcb-devel,pkgconfig(xcb-xprint) libxcb-devel,pkgconfig(xcb-xtest) libxcb-devel,pkgconfig(xcb-xv) libxcb-devel,pkgconfig(xcb-xvmc) libxkbfile-devel,pkgconfig(xkbfile) libxklavier-devel,pkgconfig(libxklavier) libxml2-devel,pkgconfig(libxml-2.0) libxslt-devel,pkgconfig(libexslt) libxslt-devel,pkgconfig(libxslt) libzip-devel,pkgconfig(libzip) libzypp-devel,pkgconfig(libzypp) link-grammar-devel,pkgconfig(link-grammar) loudmouth-devel,pkgconfig(loudmouth-1.0) lua-devel,pkgconfig(lua) m17n-db-devel,pkgconfig(m17n-db) m17n-lib-devel,pkgconfig(m17n-core) m17n-lib-devel,pkgconfig(m17n-flt) m17n-lib-devel,pkgconfig(m17n-shell) marmazon-devel,pkgconfig(marmazon) matchbox-panel-devel,pkgconfig(matchbox-panel) mce-headers,pkgconfig(mce) meego-panel-myzone-devel,pkgconfig(penge) meego-panel-status-devel,pkgconfig(meego-panel-status) meegotouch-applauncherd-devel,pkgconfig(meegotouch-boostable) meegotouch-applauncherd-devel,pkgconfig(qdeclarative-boostable) meegotouch-applauncherd-devel,pkgconfig(qt-boostable) meegotouch-feedback-devel,pkgconfig(meegotouch-feedback) meegotouch-feedbackreactionmaps-devel,pkgconfig(meegotouch-feedbackreactionmaps) meegotouch-inputmethodengine-devel,pkgconfig(MeegoImEngine) meegotouch-inputmethodframework-devel,pkgconfig(MeegoImFramework) meegotouchcp-bluetooth-libmeegobluetooth-devel,pkgconfig(meegobluetooth) meegotouchcp-connman-libconnman-qt-devel,pkgconfig(connman-qt) mesa-dri-drivers-devel,pkgconfig(dri) mesa-libEGL-devel,pkgconfig(egl) mesa-libGL-devel,pkgconfig(gl) mesa-libGLESv1-devel,pkgconfig(glesv1_cm) mesa-libGLESv2-devel,pkgconfig(glesv2) mesa-libGLU-devel,pkgconfig(glu) mesa-libOSMesa-devel,pkgconfig(osmesa) mesa-libOpenVG-devel,pkgconfig(vg) min,pkgconfig(min) min-devel,pkgconfig(min-dev) minizip-devel,pkgconfig(minizip) mkcal-devel,pkgconfig(libmkcal) mm-common,pkgconfig(mm-common-libstdc++) mobile-broadband-provider-info,pkgconfig(mobile-broadband-provider-info) mono-addins,pkgconfig(mono-addins) mono-addins,pkgconfig(mono-addins-gui) mono-addins,pkgconfig(mono-addins-setup) mono-devel,pkgconfig(cecil) mono-devel,pkgconfig(dotnet) mono-devel,pkgconfig(dotnet35) mono-devel,pkgconfig(mono) mono-devel,pkgconfig(mono-cairo) mono-devel,pkgconfig(mono-lineeditor) mono-devel,pkgconfig(mono-options) mono-nunit,pkgconfig(mono-nunit) mono-wcf,pkgconfig(wcf) mono-web,pkgconfig(mono.web) mono-web,pkgconfig(system.web.extensions.design_1.0) mono-web,pkgconfig(system.web.extensions_1.0) mono-web,pkgconfig(system.web.mvc) mono-zeroconf-devel,pkgconfig(mono-zeroconf) monodoc-core,pkgconfig(monodoc) mssf-certman-devel,pkgconfig(mssf-certman) mssf-crypto-devel,pkgconfig(mssf-crypto) mtdev-devel,pkgconfig(mtdev) mutter-devel,pkgconfig(libmutter-private) mutter-devel,pkgconfig(mutter-plugins) mutter-netbook-devel,pkgconfig(meego-panel) mx-devel,pkgconfig(mx-1.0) mx-devel,pkgconfig(mx-gtk-1.0) nautilus-devel,pkgconfig(libnautilus-extension) nautilus-python-devel,pkgconfig(nautilus-python) ncurses-devel,pkgconfig(form) ncurses-devel,pkgconfig(formw) ncurses-devel,pkgconfig(menu) ncurses-devel,pkgconfig(menuw) ncurses-devel,pkgconfig(ncurses) ncurses-devel,pkgconfig(ncursesw) ncurses-devel,pkgconfig(panel) ncurses-devel,pkgconfig(panelw) ncurses-devel,pkgconfig(tic) ncurses-devel,pkgconfig(tinfo) ndesk-dbus,pkgconfig(ndesk-dbus-1.0) ndesk-dbus-glib-devel,pkgconfig(ndesk-dbus-glib-1.0) neon-devel,pkgconfig(neon) newt-devel,pkgconfig(libnewt) ngfd-plugin-dev,pkgconfig(ngf-plugin) notify-python,pkgconfig(notify-python) notify-sharp,pkgconfig(notify-sharp) nspr-devel,pkgconfig(nspr) nss-devel,pkgconfig(nss) ofono-devel,pkgconfig(ofono) ohm-devel,pkgconfig(libohmfact) ohm-devel,pkgconfig(libohmplugin) ohm-devel,pkgconfig(ohm) opal-devel,pkgconfig(opal) openobex-devel,pkgconfig(openobex) openssl-devel,pkgconfig(libcrypto) openssl-devel,pkgconfig(libssl) openssl-devel,pkgconfig(openssl) orc-devel,pkgconfig(orc-0.4) ots-devel,pkgconfig(libots-1) pacrunner-devel,pkgconfig(libproxy-1.0) pakchois-devel,pkgconfig(pakchois) pango-devel,pkgconfig(pango) pango-devel,pkgconfig(pangocairo) pango-devel,pkgconfig(pangoft2) pango-devel,pkgconfig(pangox) pango-devel,pkgconfig(pangoxft) pangomm-devel,pkgconfig(pangomm-1.4) parted-devel,pkgconfig(libparted) pciutils-devel,pkgconfig(libpci) pcre-devel,pkgconfig(libpcre) pcre-devel,pkgconfig(libpcrecpp) pcre-devel,pkgconfig(libpcreposix) pidgin-devel,pkgconfig(pidgin) pixman-devel,pkgconfig(pixman-1) pkcs11-helper-devel,pkgconfig(libpkcs11-helper-1) pm-utils-devel,pkgconfig(pm-utils) pocketsphinx-devel,pkgconfig(pocketsphinx) polkit-devel,pkgconfig(polkit-agent-1) polkit-devel,pkgconfig(polkit-backend-1) polkit-devel,pkgconfig(polkit-gobject-1) polkit-gnome-devel,pkgconfig(polkit-gtk-1) poppler-devel,pkgconfig(poppler) poppler-devel,pkgconfig(poppler-splash) poppler-glib-devel,pkgconfig(poppler-cairo) poppler-glib-devel,pkgconfig(poppler-glib) poppler-qt-devel,pkgconfig(poppler-qt4) popt-devel,pkgconfig(popt) ptlib-devel,pkgconfig(ptlib) pulseaudio-devel,pkgconfig(libpulse) pulseaudio-devel,pkgconfig(libpulse-mainloop-glib) pulseaudio-devel,pkgconfig(libpulse-simple) pulseaudio-devel,pkgconfig(pulsecore) pycairo-devel,pkgconfig(pycairo) pyclutter-devel,pkgconfig(pyclutter-1.0) pyclutter-gtk-devel,pkgconfig(pyclutter-gtk-0.10) pygobject2-devel,pkgconfig(pygobject-2.0) pygtk2-devel,pkgconfig(pygtk-2.0) pygtkglext-devel,pkgconfig(pygtkglext-1.0) pygtksourceview-devel,pkgconfig(pygtksourceview-2.0) pyorbit-devel,pkgconfig(pyorbit-2) qca2-devel,pkgconfig(qca2) qjson-devel,pkgconfig(QJson) qmf-devel,pkgconfig(qmfclient) qmf-devel,pkgconfig(qmfmessageserver) qmsystem-devel,pkgconfig(qmsystem2) qpid-cpp-client-devel,pkgconfig(qpid) qt-mobility-devel,pkgconfig(QtConnectivity) qt-mobility-devel,pkgconfig(QtContacts) qt-mobility-devel,pkgconfig(QtFeedback) qt-mobility-devel,pkgconfig(QtGallery) qt-mobility-devel,pkgconfig(QtLocation) qt-mobility-devel,pkgconfig(QtMessaging) qt-mobility-devel,pkgconfig(QtMultimediaKit) qt-mobility-devel,pkgconfig(QtOrganizer) qt-mobility-devel,pkgconfig(QtPublishSubscribe) qt-mobility-devel,pkgconfig(QtSensors) qt-mobility-devel,pkgconfig(QtServiceFramework) qt-mobility-devel,pkgconfig(QtSystemInfo) qt-mobility-devel,pkgconfig(QtVersit) qt-mobility-devel,pkgconfig(QtVersitOrganizer) qt-obex-ftp-library-devel,pkgconfig(obexftp) qtgstreamer-devel,pkgconfig(QtGLib-2.0) qtgstreamer-devel,pkgconfig(QtGStreamer-0.10) qtgstreamer-devel,pkgconfig(QtGStreamerUi-0.10) qtgstreamer-devel,pkgconfig(QtGStreamerUtils-0.10) quillimagefilter-devel,pkgconfig(quillimagefilter) rarian-devel,pkgconfig(rarian) rest-devel,pkgconfig(rest-0.7) rest-devel,pkgconfig(rest-extras-0.7) rhythmbox-devel,pkgconfig(rhythmbox) rpm-devel,pkgconfig(rpm) rygel-devel,pkgconfig(rygel-1.0) samba-common,pkgconfig(netapi) samba-winbind-devel,pkgconfig(wbclient) sane-backends-devel,pkgconfig(sane-backends) scim-devel,pkgconfig(scim) scim-devel,pkgconfig(scim-gtkutils) scim-devel,pkgconfig(scim-x11utils) sensorfw-devel,pkgconfig(sensord) shared-mime-info,pkgconfig(shared-mime-info) signon-digest-devel,pkgconfig(signon-digestplugin) signon-oauth2-devel,pkgconfig(signon-oauth2plugin) slang-devel,pkgconfig(slang) sofia-sip-devel,pkgconfig(sofia-sip-ua) sofia-sip-glib-devel,pkgconfig(sofia-sip-ua-glib) soundtouch-devel,pkgconfig(libSoundTouch) soundtouch-devel,pkgconfig(soundtouch-1.0) soundtouch-devel,pkgconfig(soundtouch-1.4) speex-devel,pkgconfig(speex) speex-devel,pkgconfig(speexdsp) sphinxbase-devel,pkgconfig(sphinxbase) sqlite-devel,pkgconfig(sqlite3) startup-notification-devel,pkgconfig(libstartup-notification-1.0) swi-prolog-devel,pkgconfig(swi-prolog) syncevolution-devel,pkgconfig(syncevolution) syncevolution-devel,pkgconfig(synthesis) syncevolution-devel,pkgconfig(synthesis-sdk) syncevolution-gtk-devel,pkgconfig(syncevo-dbus) taglib-devel,pkgconfig(taglib) taglib-devel,pkgconfig(taglib_c) taglib-sharp-devel,pkgconfig(taglib-sharp) telepathy-farsight-devel,pkgconfig(telepathy-farsight) telepathy-glib-devel,pkgconfig(telepathy-glib) telepathy-logger-devel,pkgconfig(telepathy-logger-0.1) telepathy-mission-control-devel,pkgconfig(libmcclient) telepathy-mission-control-devel,pkgconfig(mission-control) telepathy-mission-control-devel,pkgconfig(mission-control-plugins) telepathy-qt4-devel,pkgconfig(TelepathyQt4) telepathy-qt4-farsight-devel,pkgconfig(TelepathyQt4Farsight) timed-devel,pkgconfig(timed) timed-devel,pkgconfig(timed-voland) totem-pl-parser-devel,pkgconfig(totem-plparser) totem-pl-parser-devel,pkgconfig(totem-plparser-mini) tracker-devel,pkgconfig(tracker-client-0.9) tracker-devel,pkgconfig(tracker-extract-0.9) tracker-devel,pkgconfig(tracker-miner-0.9) tracker-devel,pkgconfig(tracker-sparql-0.9) transfer-ui-devel,pkgconfig(libtuiclient) tumbler-devel,pkgconfig(tumbler-1) twitter-glib-devel,pkgconfig(twitter-glib-1.0) udisks-devel,pkgconfig(udisks) unique-devel,pkgconfig(unique-1.0) upower-devel,pkgconfig(devkit-power-gobject) upower-devel,pkgconfig(upower-glib) usbutils,pkgconfig(usbutils) usbutils-devel,pkgconfig(usbutils) uuid-devel,pkgconfig(ossp-uuid) vala-devel,pkgconfig(libvala-0.12) valgrind-devel,pkgconfig(valgrind) vamp-plugin-sdk-devel,pkgconfig(vamp) vamp-plugin-sdk-devel,pkgconfig(vamp-hostsdk) vamp-plugin-sdk-devel,pkgconfig(vamp-sdk) vte-devel,pkgconfig(pyvte) vte-devel,pkgconfig(vte) wimax-tools-devel,pkgconfig(libwimaxll-0) wimax-tools-devel,pkgconfig(libwimaxll-i2400m-0) wimax-tools-devel,pkgconfig(wimaxll-cmd-0) wv-devel,pkgconfig(wv-1.0) xcb-proto,pkgconfig(xcb-proto) xcb-util-devel,pkgconfig(xcb-atom) xcb-util-devel,pkgconfig(xcb-aux) xcb-util-devel,pkgconfig(xcb-event) xcb-util-devel,pkgconfig(xcb-icccm) xcb-util-devel,pkgconfig(xcb-image) xcb-util-devel,pkgconfig(xcb-keysyms) xcb-util-devel,pkgconfig(xcb-property) xcb-util-devel,pkgconfig(xcb-renderutil) xcb-util-devel,pkgconfig(xcb-reply) xmlrpc-c-devel,pkgconfig(xmlrpc) xmlrpc-c-devel,pkgconfig(xmlrpc++) xmlrpc-c-devel,pkgconfig(xmlrpc_abyss) xmlrpc-c-devel,pkgconfig(xmlrpc_client) xmlrpc-c-devel,pkgconfig(xmlrpc_client++) xmlrpc-c-devel,pkgconfig(xmlrpc_cpp) xmlrpc-c-devel,pkgconfig(xmlrpc_packetsocket) xmlrpc-c-devel,pkgconfig(xmlrpc_server) xmlrpc-c-devel,pkgconfig(xmlrpc_server++) xmlrpc-c-devel,pkgconfig(xmlrpc_server_abyss) xmlrpc-c-devel,pkgconfig(xmlrpc_server_abyss++) xmlrpc-c-devel,pkgconfig(xmlrpc_server_cgi) xmlrpc-c-devel,pkgconfig(xmlrpc_server_cgi++) xmlrpc-c-devel,pkgconfig(xmlrpc_server_pstream++) xmlrpc-c-devel,pkgconfig(xmlrpc_util) xorg-x11-drv-evdev-devel,pkgconfig(xorg-evdev) xorg-x11-drv-joystick-devel,pkgconfig(xorg-joystick) xorg-x11-drv-synaptics-devel,pkgconfig(xorg-synaptics) xorg-x11-drv-wacom-devel,pkgconfig(xorg-wacom) xorg-x11-font-utils,pkgconfig(fontutil) xorg-x11-proto-bigreqsproto,pkgconfig(bigreqsproto) xorg-x11-proto-compositeproto,pkgconfig(compositeproto) xorg-x11-proto-damageproto,pkgconfig(damageproto) xorg-x11-proto-dmxproto,pkgconfig(dmxproto) xorg-x11-proto-dri2proto,pkgconfig(dri2proto) xorg-x11-proto-evieext,pkgconfig(evieproto) xorg-x11-proto-fixesproto,pkgconfig(fixesproto) xorg-x11-proto-fontcacheproto,pkgconfig(fontcacheproto) xorg-x11-proto-fontsproto,pkgconfig(fontsproto) xorg-x11-proto-glproto,pkgconfig(glproto) xorg-x11-proto-inputproto,pkgconfig(inputproto) xorg-x11-proto-kbproto,pkgconfig(kbproto) xorg-x11-proto-randrproto,pkgconfig(randrproto) xorg-x11-proto-recordproto,pkgconfig(recordproto) xorg-x11-proto-renderproto,pkgconfig(renderproto) xorg-x11-proto-resourceproto,pkgconfig(resourceproto) xorg-x11-proto-scrnsaverproto,pkgconfig(scrnsaverproto) xorg-x11-proto-trapproto,pkgconfig(trapproto) xorg-x11-proto-videoproto,pkgconfig(videoproto) xorg-x11-proto-xcmiscproto,pkgconfig(xcmiscproto) xorg-x11-proto-xextproto,pkgconfig(xextproto) xorg-x11-proto-xf86bigfontproto,pkgconfig(xf86bigfontproto) xorg-x11-proto-xf86dgaproto,pkgconfig(xf86dgaproto) xorg-x11-proto-xf86driproto,pkgconfig(xf86driproto) xorg-x11-proto-xf86miscproto,pkgconfig(xf86miscproto) xorg-x11-proto-xf86rushproto,pkgconfig(xf86rushproto) xorg-x11-proto-xf86vidmodeproto,pkgconfig(xf86vidmodeproto) xorg-x11-proto-xineramaproto,pkgconfig(xineramaproto) xorg-x11-proto-xproto,pkgconfig(xproto) xorg-x11-proto-xproxymanagementprotocol,pkgconfig(xproxymngproto) xorg-x11-server-devel,pkgconfig(xorg-server) xorg-x11-util-macros,pkgconfig(xorg-macros) xorg-x11-xbitmaps,pkgconfig(xbitmaps) xorg-x11-xtrans-devel,pkgconfig(xtrans) xz-devel,pkgconfig(liblzma) zlib-devel,pkgconfig(zlib) zvbi-devel,pkgconfig(zvbi-0.2) pvr-bin-devel,pkgconfig(egl) pvr-bin-devel,pkgconfig(glesv1_cm) pvr-bin-devel,pkgconfig(glesv2) pvr-bin-devel,pkgconfig(vg) spectacle-0.25/examples/xfce4-session.yaml0000644002342000234200000000216112502671637017020 0ustar rzrrzrName: xfce4-session Summary: Xfce session manager Version: 4.6.1 Release: 1 Group: System/Desktop License: GPLv2+ URL: http://www.xfce.org/ Description: | xfce4-session is the session manager for the Xfce desktop environment. Patches: - xfce4-session-4.4.2-hide-tips.patch - xfce4-session-4.5.99.1-splash.patch - xfce4-session-logout.patch Sources: - http://www.xfce.org/archive/xfce-%{version}/src/xfce4-session-%{version}.tar.bz2 - xfce4-autostart-editor.png Requires: - libxfcegui4 >= %{version} - xorg-x11-server-utils PkgConfigBR: - libwnck-1.0 - xt - dbus-1 - libstartup-notification-1.0 - libglade-2.0 - libxfcegui4-1.0 PkgBR: - gettext - intltool - imake - xorg-x11-server-utils - GConf2-devel Configure: configure ConfigOptions: - --enable-gnome - --enable-final LocaleName: xfce4-session AutoSubPackages: - devel SubPackages: - Name: engines Group: System/Desktop Summary: Additional engines for xfce4-session Description: | Additional splash screen engines for the Xfce Session Manager. spectacle-0.25/setup.py0000644002342000234200000000266312502671637013345 0ustar rzrrzr#!/usr/bin/env python import os, sys from distutils.core import setup try: import setuptools # enable "setup.py develop", optional except ImportError: pass if 'install' in sys.argv and \ 'MAKEFLAGS' not in os.environ and \ 'RPM_BUILD_ROOT' not in os.environ: repl = raw_input('WARNING: Please use `make install` for installation, continue(y/N)? ') if repl != 'y': sys.exit(1) # For debian based systems, '--install-layout=deb' is needed after 2.6 if sys.version_info[:2] <= (2, 5) and '--install-layout=deb' in sys.argv: del sys.argv[sys.argv.index('--install-layout=deb')] version_path = 'VERSION' try: # first line should be the version number version = open(version_path).readline().strip() ver_file = open('spectacle/__version__.py', 'w') ver_file.write("VERSION = \"%s\"\n" % version) ver_file.close() except IOError: print 'WARNING: Cannot write version number file' setup(name='spectacle', version = version, description='Spectacle', author='Anas Nashif, Jian-feng Ding', author_email='anas.nashif@intel.com, jian-feng.ding@intel.com', url='https://meego.gitorious.org/meego-developer-tools/spectacle', scripts=['tools/specify', 'tools/ini2spectacle', 'tools/spec2spectacle', 'tools/deb2spectacle'], packages=['spectacle', 'spectacle.spec', 'spectacle.dsc'], package_data={'spectacle': ['data/*.csv', 'data/GROUPS']}, ) spectacle-0.25/spectacle/__init__.py0000644002342000234200000000003012502671637015671 0ustar rzrrzr# modules for spectacle spectacle-0.25/spectacle/convertor.py0000644002342000234200000001370012502671637016163 0ustar rzrrzr#!/usr/bin/python -tt # vim: ai ts=4 sts=4 et sw=4 # Copyright (c) 2009 Intel Corporation # # 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; version 2 of the License # # 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, write to the Free Software Foundation, Inc., 59 # Temple Place - Suite 330, Boston, MA 02111-1307, USA. import sys # internal module import logger ORDER_ENTRIES = ['Name', 'AsWholeName', 'Summary', 'Version', 'Release', 'Epoch', 'Group', 'License', 'URL', 'SCM', 'Sources', 'ExtraSources', 'Patches', 'Description', '', 'Requires', 'RequiresPre', 'RequiresPreUn', 'RequiresPost', 'RequiresPostUn', 'PkgBR', 'PkgConfigBR', 'Provides', 'Obsoletes', 'Conflicts', 'Configure', 'ConfigOptions', 'Builder', 'BuildArch', 'ExclusiveArch', 'LocaleName', 'LocaleOptions', 'Files', 'Check', 'SupportOtherDistros', 'UseAsNeeded', 'NoAutoReq', 'NoAutoProv', 'NoAutoReqProv', ] class Convertor(object): """ Class for generic operations: * Translate field names between different format * Transfer non-order dict to ordered list of (key, val) pairs Derived sub-classes should update cv_table, the dictionary for translation, for specific input format. """ cv_table = {} # un-ordered ones will be append the ordered ones in random order # 'Files', 'SubPackages' will the last two def __init__(self, cv_table = {}): self.cv_table.update(cv_table) def _translate_keys(self, dict): # translate AutoReq/AutoProv to spectacle boolean keys autoreq = autoprov = None if 'AutoReq' in dict: autoreq = dict['AutoReq'] del dict['AutoReq'] if 'AutoProv' in dict: autoprov = dict['AutoProv'] del dict['AutoProv'] if 'AutoReqProv' in dict: if dict['AutoReqProv'] == '0': autoreq = autoprov = '0' del dict['AutoReqProv'] if autoreq == '0' and autoprov == '0': dict['NoAutoReqProv'] = 'yes' elif autoreq == '0': dict['NoAutoReq'] = 'yes' elif autoprov == '0': dict['NoAutoProv'] = 'yes' # else: ignore def _replace_keys(self, dict): for k,v in self.cv_table.iteritems(): if k in dict: dict[v] = dict[k] del dict[k] def _remove_duplicate(self, dict): # check duplicate default configopts dup = '--disable-static' if 'ConfigOptions' in dict and dup in dict['ConfigOptions']: dict['ConfigOptions'].remove(dup) if not dict['ConfigOptions']: del dict['ConfigOptions'] # check duplicate requires for base package if "SubPackages" in dict: if 'Epoch' in dict: autodep = "%{name} = %{epoch}:%{version}-%{release}" else: autodep = "%{name} = %{version}-%{release}" for sp in dict["SubPackages"]: if 'Requires' in sp and autodep in sp['Requires']: sp['Requires'].remove(autodep) if not sp['Requires']: del sp['Requires'] # check duplicate '%defattr' for files list if 'extra' in dict and 'Files' in dict['extra']: try: dict['extra']['Files'].remove('%defattr(-,root,root,-)') except ValueError: pass def convert(self, dict, need_break = True): self._replace_keys(dict) self._translate_keys(dict) self._remove_duplicate(dict) items = [] for entry in ORDER_ENTRIES: if not entry: # empty string means a blank line for break if need_break: items.append(('', '')) continue if entry in dict: items.append((entry, dict[entry])) del dict[entry] subpkgs = [] try: subpkgs_list = dict['SubPackages'] del dict['SubPackages'] for sub_items in subpkgs_list: subpkgs.append(self.convert(sub_items, False)) except: pass if 'extra' in dict: extra = dict['extra'] del dict['extra'] else: extra = {} for k, v in dict.iteritems(): logger.warning('un-ordered entry: %s' % k) items.append((k, v)) if extra: try: # clean up empty lines in %files files = [s.strip() for s in extra['Files'] if s.strip()] if files: extra['Files'] = files else: del extra['Files'] except KeyError: pass if extra: # check it again items.append(('extra', extra)) if subpkgs: items.append(('SubPackages', subpkgs)) return items spectacle-0.25/spectacle/deb822.py0000644002342000234200000011600112502671637015126 0ustar rzrrzr# vim: fileencoding=utf-8 # Based on the code in git://git.debian.org/git/pkg-python-debian/python-debian.git # with a few modifications to simplify the module dependencies. # A python interface for various rfc822-like formatted files used by Debian # (.changes, .dsc, Packages, Sources, etc) # # Copyright (C) 2005-2006 dann frazier # Copyright (C) 2006-2010 John Wright # Copyright (C) 2006 Adeodato Simó # Copyright (C) 2008 Stefano Zacchiroli # # 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 2 # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. try: import apt_pkg # This module uses apt_pkg only for its TagFile interface. apt_pkg.TagFile _have_apt_pkg = True except (ImportError, AttributeError): _have_apt_pkg = False import new import re import string import sys import warnings import StringIO import UserDict def function_deprecated_by(func): """ Return a function that warns it is deprecated by another function. Returns a new function that warns it is deprecated by function ``func``, then acts as a pass-through wrapper for ``func``. """ func_name = func.__name__ warn_msg = "Use %(func_name)s instead" % vars() def deprecated_func(*args, **kwargs): warnings.warn(warn_msg, DeprecationWarning, stacklevel=2) return func(*args, **kwargs) return deprecated_func class TagSectionWrapper(object, UserDict.DictMixin): """Wrap a TagSection object, using its find_raw method to get field values This allows us to pick which whitespace to strip off the beginning and end of the data, so we don't lose leading newlines. """ def __init__(self, section): self.__section = section def keys(self): return self.__section.keys() def __getitem__(self, key): s = self.__section.find_raw(key) if s is None: raise KeyError(key) # Get just the stuff after the first ':' # Could use s.partition if we only supported python >= 2.5 data = s[s.find(':')+1:] # Get rid of spaces and tabs after the ':', but not newlines, and strip # off any newline at the end of the data. return data.lstrip(' \t').rstrip('\n') class OrderedSet(object): """A set-like object that preserves order when iterating over it We use this to keep track of keys in Deb822Dict, because it's much faster to look up if a key is in a set than in a list. """ def __init__(self, iterable=[]): self.__set = set() self.__order = [] for item in iterable: self.add(item) def add(self, item): if item not in self: # set.add will raise TypeError if something's unhashable, so we # don't have to handle that ourselves self.__set.add(item) self.__order.append(item) def remove(self, item): # set.remove will raise KeyError, so we don't need to handle that # ourselves self.__set.remove(item) self.__order.remove(item) def __iter__(self): # Return an iterator of items in the order they were added return iter(self.__order) def __contains__(self, item): # This is what makes OrderedSet faster than using a list to keep track # of keys. Lookup in a set is O(1) instead of O(n) for a list. return item in self.__set ### list-like methods append = add def extend(self, iterable): for item in iterable: self.add(item) ### class Deb822Dict(object, UserDict.DictMixin): # Subclassing UserDict.DictMixin because we're overriding so much dict # functionality that subclassing dict requires overriding many more than # the four methods that DictMixin requires. """A dictionary-like object suitable for storing RFC822-like data. Deb822Dict behaves like a normal dict, except: - key lookup is case-insensitive - key order is preserved - if initialized with a _parsed parameter, it will pull values from that dictionary-like object as needed (rather than making a copy). The _parsed dict is expected to be able to handle case-insensitive keys. If _parsed is not None, an optional _fields parameter specifies which keys in the _parsed dictionary are exposed. """ # See the end of the file for the definition of _strI def __init__(self, _dict=None, _parsed=None, _fields=None, encoding="utf-8"): self.__dict = {} self.__keys = OrderedSet() self.__parsed = None self.encoding = encoding if _dict is not None: # _dict may be a dict or a list of two-sized tuples if hasattr(_dict, 'items'): items = _dict.items() else: items = list(_dict) try: for k, v in items: self[k] = v except ValueError: this = len(self.__keys) len_ = len(items[this]) raise ValueError('dictionary update sequence element #%d has ' 'length %d; 2 is required' % (this, len_)) if _parsed is not None: self.__parsed = _parsed if _fields is None: self.__keys.extend([ _strI(k) for k in self.__parsed.keys() ]) else: self.__keys.extend([ _strI(f) for f in _fields if self.__parsed.has_key(f) ]) ### BEGIN DictMixin methods def __setitem__(self, key, value): key = _strI(key) self.__keys.add(key) self.__dict[key] = value def __getitem__(self, key): key = _strI(key) try: value = self.__dict[key] except KeyError: if self.__parsed is not None and key in self.__keys: value = self.__parsed[key] else: raise if isinstance(value, str): # Always return unicode objects instead of strings try: value = value.decode(self.encoding) except UnicodeDecodeError, e: # Evidently, the value wasn't encoded with the encoding the # user specified. warnings.warn('decoding from %s failed; attempting to detect ' 'the true encoding' % self.encoding, UnicodeWarning) raise e return value def __delitem__(self, key): key = _strI(key) self.__keys.remove(key) try: del self.__dict[key] except KeyError: # If we got this far, the key was in self.__keys, so it must have # only been in the self.__parsed dict. pass def has_key(self, key): key = _strI(key) return key in self.__keys def keys(self): return [str(key) for key in self.__keys] ### END DictMixin methods def __repr__(self): return '{%s}' % ', '.join(['%r: %r' % (k, v) for k, v in self.items()]) def __eq__(self, other): mykeys = self.keys(); mykeys.sort() otherkeys = other.keys(); otherkeys.sort() if not mykeys == otherkeys: return False for key in mykeys: if self[key] != other[key]: return False # If we got here, everything matched return True def copy(self): # Use self.__class__ so this works as expected for subclasses copy = self.__class__(self) return copy # TODO implement __str__() and make dump() use that? class Deb822(Deb822Dict): def __init__(self, sequence=None, fields=None, _parsed=None, encoding="utf-8"): """Create a new Deb822 instance. :param sequence: a string, or any any object that returns a line of input each time, normally a file(). Alternately, sequence can be a dict that contains the initial key-value pairs. :param fields: if given, it is interpreted as a list of fields that should be parsed (the rest will be discarded). :param _parsed: internal parameter. :param encoding: When parsing strings, interpret them in this encoding. (All values are given back as unicode objects, so an encoding is necessary in order to properly interpret the strings.) """ if hasattr(sequence, 'items'): _dict = sequence sequence = None else: _dict = None Deb822Dict.__init__(self, _dict=_dict, _parsed=_parsed, _fields=fields, encoding=encoding) if sequence is not None: try: self._internal_parser(sequence, fields) except EOFError: pass self.gpg_info = None def iter_paragraphs(cls, sequence, fields=None, use_apt_pkg=True, shared_storage=False, encoding="utf-8"): """Generator that yields a Deb822 object for each paragraph in sequence. :param sequence: same as in __init__. :param fields: likewise. :param use_apt_pkg: if sequence is a file(), apt_pkg will be used if available to parse the file, since it's much much faster. Set this parameter to False to disable using apt_pkg. :param shared_storage: not used, here for historical reasons. Deb822 objects never use shared storage anymore. :param encoding: Interpret the paragraphs in this encoding. (All values are given back as unicode objects, so an encoding is necessary in order to properly interpret the strings.) """ if _have_apt_pkg and use_apt_pkg and isinstance(sequence, file): parser = apt_pkg.TagFile(sequence) for section in parser: yield cls(fields=fields, _parsed=TagSectionWrapper(section), encoding=encoding) else: iterable = iter(sequence) x = cls(iterable, fields, encoding=encoding) while len(x) != 0: yield x x = cls(iterable, fields, encoding=encoding) iter_paragraphs = classmethod(iter_paragraphs) ### def _internal_parser(self, sequence, fields=None): single = re.compile("^(?P\S+)\s*:\s*(?P\S.*?)\s*$") multi = re.compile("^(?P\S+)\s*:\s*$") multidata = re.compile("^\s(?P.+?)\s*$") wanted_field = lambda f: fields is None or f in fields if isinstance(sequence, basestring): sequence = sequence.splitlines() curkey = None content = "" for line in self.gpg_stripped_paragraph(sequence): m = single.match(line) if m: if curkey: self[curkey] = content if not wanted_field(m.group('key')): curkey = None continue curkey = m.group('key') content = m.group('data') continue m = multi.match(line) if m: if curkey: self[curkey] = content if not wanted_field(m.group('key')): curkey = None continue curkey = m.group('key') content = "" continue m = multidata.match(line) if m: content += '\n' + line # XXX not m.group('data')? continue if curkey: self[curkey] = content def __str__(self): return self.dump() def __unicode__(self): return self.dump() # __repr__ is handled by Deb822Dict def get_as_string(self, key): """Return the self[key] as a string (or unicode) The default implementation just returns unicode(self[key]); however, this can be overridden in subclasses (e.g. _multivalued) that can take special values. """ return unicode(self[key]) def dump(self, fd=None, encoding=None): """Dump the the contents in the original format If fd is None, return a unicode object. If fd is not None, attempt to encode the output to the encoding the object was initialized with, or the value of the encoding argument if it is not None. This will raise UnicodeEncodeError if the encoding can't support all the characters in the Deb822Dict values. """ if fd is None: fd = StringIO.StringIO() return_string = True else: return_string = False if encoding is None: # Use the encoding we've been using to decode strings with if none # was explicitly specified encoding = self.encoding for key in self.iterkeys(): value = self.get_as_string(key) if not value or value[0] == '\n': # Avoid trailing whitespace after "Field:" if it's on its own # line or the value is empty # XXX Uh, really print value if value == '\n'? entry = '%s:%s\n' % (key, value) else: entry = '%s: %s\n' % (key, value) if not return_string: fd.write(entry.encode(encoding)) else: fd.write(entry) if return_string: return fd.getvalue() ### def is_single_line(self, s): if s.count("\n"): return False else: return True isSingleLine = function_deprecated_by(is_single_line) def is_multi_line(self, s): return not self.is_single_line(s) isMultiLine = function_deprecated_by(is_multi_line) def _merge_fields(self, s1, s2): if not s2: return s1 if not s1: return s2 if self.is_single_line(s1) and self.is_single_line(s2): ## some fields are delimited by a single space, others ## a comma followed by a space. this heuristic assumes ## that there are multiple items in one of the string fields ## so that we can pick up on the delimiter being used delim = ' ' if (s1 + s2).count(', '): delim = ', ' L = (s1 + delim + s2).split(delim) L.sort() prev = merged = L[0] for item in L[1:]: ## skip duplicate entries if item == prev: continue merged = merged + delim + item prev = item return merged if self.is_multi_line(s1) and self.is_multi_line(s2): for item in s2.splitlines(True): if item not in s1.splitlines(True): s1 = s1 + "\n" + item return s1 raise ValueError _mergeFields = function_deprecated_by(_merge_fields) def merge_fields(self, key, d1, d2=None): ## this method can work in two ways - abstract that away if d2 == None: x1 = self x2 = d1 else: x1 = d1 x2 = d2 ## we only have to do work if both objects contain our key ## otherwise, we just take the one that does, or raise an ## exception if neither does if key in x1 and key in x2: merged = self._mergeFields(x1[key], x2[key]) elif key in x1: merged = x1[key] elif key in x2: merged = x2[key] else: raise KeyError ## back to the two different ways - if this method was called ## upon an object, update that object in place. ## return nothing in this case, to make the author notice a ## problem if she assumes the object itself will not be modified if d2 == None: self[key] = merged return None return merged mergeFields = function_deprecated_by(merge_fields) def split_gpg_and_payload(sequence): """Return a (gpg_pre, payload, gpg_post) tuple Each element of the returned tuple is a list of lines (with trailing whitespace stripped). """ gpg_pre_lines = [] lines = [] gpg_post_lines = [] state = 'SAFE' gpgre = re.compile(r'^-----(?PBEGIN|END) PGP (?P[^-]+)-----$') blank_line = re.compile('^$') first_line = True for line in sequence: line = line.strip('\r\n') # skip initial blank lines, if any if first_line: if blank_line.match(line): continue else: first_line = False m = gpgre.match(line) if not m: if state == 'SAFE': if not blank_line.match(line): lines.append(line) else: if not gpg_pre_lines: # There's no gpg signature, so we should stop at # this blank line break elif state == 'SIGNED MESSAGE': if blank_line.match(line): state = 'SAFE' else: gpg_pre_lines.append(line) elif state == 'SIGNATURE': gpg_post_lines.append(line) else: if m.group('action') == 'BEGIN': state = m.group('what') elif m.group('action') == 'END': gpg_post_lines.append(line) break if not blank_line.match(line): if not lines: gpg_pre_lines.append(line) else: gpg_post_lines.append(line) if len(lines): return (gpg_pre_lines, lines, gpg_post_lines) else: raise EOFError('only blank lines found in input') split_gpg_and_payload = staticmethod(split_gpg_and_payload) def gpg_stripped_paragraph(cls, sequence): return cls.split_gpg_and_payload(sequence)[1] gpg_stripped_paragraph = classmethod(gpg_stripped_paragraph) def get_gpg_info(self): """Return a GpgInfo object with GPG signature information This method will raise ValueError if the signature is not available (e.g. the original text cannot be found)""" # raw_text is saved (as a string) only for Changes and Dsc (see # _gpg_multivalued.__init__) which is small compared to Packages or # Sources which contain no signature if not hasattr(self, 'raw_text'): raise ValueError, "original text cannot be found" if self.gpg_info is None: self.gpg_info = GpgInfo.from_sequence(self.raw_text) return self.gpg_info ### # XXX check what happens if input contains more that one signature class GpgInfo(dict): """A wrapper around gnupg parsable output obtained via --status-fd This class is really a dictionary containing parsed output from gnupg plus some methods to make sense of the data. Keys are keywords and values are arguments suitably splitted. See /usr/share/doc/gnupg/DETAILS.gz""" # keys with format "key keyid uid" uidkeys = ('GOODSIG', 'EXPSIG', 'EXPKEYSIG', 'REVKEYSIG', 'BADSIG') def valid(self): """Is the signature valid?""" return self.has_key('GOODSIG') or self.has_key('VALIDSIG') # XXX implement as a property? # XXX handle utf-8 %-encoding def uid(self): """Return the primary ID of the signee key, None is not available""" pass @staticmethod def from_output(out, err=None): """Create a new GpgInfo object from gpg(v) --status-fd output (out) and optionally collect stderr as well (err). Both out and err can be lines in newline-terminated sequence or regular strings.""" n = GpgInfo() if isinstance(out, basestring): out = out.split('\n') if isinstance(err, basestring): err = err.split('\n') n.out = out n.err = err header = '[GNUPG:] ' for l in out: if not l.startswith(header): continue l = l[len(header):] l = l.strip('\n') # str.partition() would be better, 2.5 only though s = l.find(' ') key = l[:s] if key in GpgInfo.uidkeys: # value is "keyid UID", don't split UID value = l[s+1:].split(' ', 1) else: value = l[s+1:].split(' ') n[key] = value return n # XXX how to handle sequences of lines? file() returns \n-terminated @staticmethod def from_sequence(sequence, keyrings=['/usr/share/keyrings/debian-keyring.gpg'], executable=["/usr/bin/gpgv"]): """Create a new GpgInfo object from the given sequence. Sequence is a sequence of lines or a string executable is a list of args for subprocess.Popen, the first element being the gpg executable""" # XXX check for gpg as well and use --verify accordingly? args = executable #args.extend(["--status-fd", "1", "--no-default-keyring"]) args.extend(["--status-fd", "1"]) import os [args.extend(["--keyring", k]) for k in keyrings if os.path.isfile(k) and os.access(k, os.R_OK)] if "--keyring" not in args: raise IOError, "cannot access any of the given keyrings" import subprocess p = subprocess.Popen(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) # XXX what to do with exit code? if isinstance(sequence, basestring): (out, err) = p.communicate(sequence) else: (out, err) = p.communicate("\n".join(sequence)) return GpgInfo.from_output(out, err) @staticmethod def from_file(target, *args): """Create a new GpgInfo object from the given file, calls from_sequence(file(target), *args)""" return from_sequence(file(target), *args) ### class PkgRelation(object): """Inter-package relationships Structured representation of the relationships of a package to another, i.e. of what can appear in a Deb882 field like Depends, Recommends, Suggests, ... (see Debian Policy 7.1). """ # XXX *NOT* a real dependency parser, and that is not even a goal here, we # just parse as much as we need to split the various parts composing a # dependency, checking their correctness wrt policy is out of scope __dep_RE = re.compile( \ r'^\s*(?P[a-zA-Z0-9.+\-]{2,})(\s*\(\s*(?P[>=<]+)\s*(?P[0-9a-zA-Z:\-+~.]+)\s*\))?(\s*\[(?P[\s!\w\-]+)\])?\s*$') __comma_sep_RE = re.compile(r'\s*,\s*') __pipe_sep_RE = re.compile(r'\s*\|\s*') __blank_sep_RE = re.compile(r'\s*') @classmethod def parse_relations(cls, raw): """Parse a package relationship string (i.e. the value of a field like Depends, Recommends, Build-Depends ...) """ def parse_archs(raw): # assumption: no space beween '!' and architecture name archs = [] for arch in cls.__blank_sep_RE.split(raw.strip()): if len(arch) and arch[0] == '!': archs.append((False, arch[1:])) else: archs.append((True, arch)) return archs def parse_rel(raw): match = cls.__dep_RE.match(raw) if match: parts = match.groupdict() d = { 'name': parts['name'] } if not (parts['relop'] is None or parts['version'] is None): d['version'] = (parts['relop'], parts['version']) else: d['version'] = None if parts['archs'] is None: d['arch'] = None else: d['arch'] = parse_archs(parts['archs']) return d else: print >> sys.stderr, \ 'deb822.py: WARNING: cannot parse package' \ ' relationship "%s", returning it raw' % raw return { 'name': raw, 'version': None, 'arch': None } tl_deps = cls.__comma_sep_RE.split(raw.strip()) # top-level deps cnf = map(cls.__pipe_sep_RE.split, tl_deps) return map(lambda or_deps: map(parse_rel, or_deps), cnf) @staticmethod def str(rels): """Format to string structured inter-package relationships Perform the inverse operation of parse_relations, returning a string suitable to be written in a package stanza. """ def pp_arch(arch_spec): (excl, arch) = arch_spec if excl: return arch else: return '!' + arch def pp_atomic_dep(dep): s = dep['name'] if dep.has_key('version') and dep['version'] is not None: s += ' (%s %s)' % dep['version'] if dep.has_key('arch') and dep['arch'] is not None: s += ' [%s]' % string.join(map(pp_arch, dep['arch'])) return s pp_or_dep = lambda deps: string.join(map(pp_atomic_dep, deps), ' | ') return string.join(map(pp_or_dep, rels), ', ') class _lowercase_dict(dict): """Dictionary wrapper which lowercase keys upon lookup.""" def __getitem__(self, key): return dict.__getitem__(self, key.lower()) class _PkgRelationMixin(object): """Package relationship mixin Inheriting from this mixin you can extend a Deb882 object with attributes letting you access inter-package relationship in a structured way, rather than as strings. For example, while you can usually use pkg['depends'] to obtain the Depends string of package pkg, mixing in with this class you gain pkg.depends to access Depends as a Pkgrel instance To use, subclass _PkgRelationMixin from a class with a _relationship_fields attribute. It should be a list of field names for which structured access is desired; for each of them a method wild be added to the inherited class. The method name will be the lowercase version of field name; '-' will be mangled as '_'. The method would return relationships in the same format of the PkgRelation' relations property. See Packages and Sources as examples. """ def __init__(self, *args, **kwargs): self.__relations = _lowercase_dict({}) self.__parsed_relations = False for name in self._relationship_fields: # To avoid reimplementing Deb822 key lookup logic we use a really # simple dict subclass which just lowercase keys upon lookup. Since # dictionary building happens only here, we ensure that all keys # are in fact lowercase. # With this trick we enable users to use the same key (i.e. field # name) of Deb822 objects on the dictionary returned by the # relations property. keyname = name.lower() if self.has_key(name): self.__relations[keyname] = None # lazy value # all lazy values will be expanded before setting # __parsed_relations to True else: self.__relations[keyname] = [] @property def relations(self): """Return a dictionary of inter-package relationships among the current and other packages. Dictionary keys depend on the package kind. Binary packages have keys like 'depends', 'recommends', ... while source packages have keys like 'build-depends', 'build-depends-indep' and so on. See the Debian policy for the comprehensive field list. Dictionary values are package relationships returned as lists of lists of dictionaries (see below for some examples). The encoding of package relationships is as follows: - the top-level lists corresponds to the comma-separated list of Deb822, their components form a conjuction, i.e. they have to be AND-ed together - the inner lists corresponds to the pipe-separated list of Deb822, their components form a disjunction, i.e. they have to be OR-ed together - member of the inner lists are dictionaries with the following keys: - name: package (or virtual package) name - version: A pair if the relationship is versioned, None otherwise. operator is one of "<<", "<=", "=", ">=", ">>"; version is the given version as a string. - arch: A list of pairs if the relationship is architecture specific, None otherwise. Polarity is a boolean (false if the architecture is negated with "!", true otherwise), architecture the Debian archtiecture name as a string. Examples: "emacs | emacsen, make, debianutils (>= 1.7)" becomes [ [ {'name': 'emacs'}, {'name': 'emacsen'} ], [ {'name': 'make'} ], [ {'name': 'debianutils', 'version': ('>=', '1.7')} ] ] "tcl8.4-dev, procps [!hurd-i386]" becomes [ [ {'name': 'tcl8.4-dev'} ], [ {'name': 'procps', 'arch': (false, 'hurd-i386')} ] ] """ if not self.__parsed_relations: lazy_rels = filter(lambda n: self.__relations[n] is None, self.__relations.keys()) for n in lazy_rels: self.__relations[n] = PkgRelation.parse_relations(self[n]) self.__parsed_relations = True return self.__relations class _multivalued(Deb822): """A class with (R/W) support for multivalued fields. To use, create a subclass with a _multivalued_fields attribute. It should be a dictionary with *lower-case* keys, with lists of human-readable identifiers of the fields as the values. Please see Dsc, Changes, and PdiffIndex as examples. """ def __init__(self, *args, **kwargs): Deb822.__init__(self, *args, **kwargs) for field, fields in self._multivalued_fields.items(): try: contents = self[field] except KeyError: continue if self.is_multi_line(contents): self[field] = [] updater_method = self[field].append else: self[field] = Deb822Dict() updater_method = self[field].update for line in filter(None, contents.splitlines()): updater_method(Deb822Dict(zip(fields, line.split()))) def get_as_string(self, key): keyl = key.lower() if keyl in self._multivalued_fields: fd = StringIO.StringIO() if hasattr(self[key], 'keys'): # single-line array = [ self[key] ] else: # multi-line fd.write("\n") array = self[key] order = self._multivalued_fields[keyl] try: field_lengths = self._fixed_field_lengths except AttributeError: field_lengths = {} for item in array: for x in order: raw_value = str(item[x]) try: length = field_lengths[keyl][x] except KeyError: value = raw_value else: value = (length - len(raw_value)) * " " + raw_value fd.write(" %s" % value) fd.write("\n") return fd.getvalue().rstrip("\n") else: return Deb822.get_as_string(self, key) ### class _gpg_multivalued(_multivalued): """A _multivalued class that can support gpg signed objects This class's feature is that it stores the raw text before parsing so that gpg can verify the signature. Use it just like you would use the _multivalued class. This class only stores raw text if it is given a raw string, or if it detects a gpg signature when given a file or sequence of lines (see Deb822.split_gpg_and_payload for details). """ def __init__(self, *args, **kwargs): try: sequence = args[0] except IndexError: sequence = kwargs.get("sequence", None) if sequence is not None: if isinstance(sequence, basestring): self.raw_text = sequence elif hasattr(sequence, "items"): # sequence is actually a dict(-like) object, so we don't have # the raw text. pass else: try: gpg_pre_lines, lines, gpg_post_lines = \ self.split_gpg_and_payload(sequence) except EOFError: # Empty input gpg_pre_lines = lines = gpg_post_lines = [] if gpg_pre_lines and gpg_post_lines: raw_text = StringIO.StringIO() raw_text.write("\n".join(gpg_pre_lines)) raw_text.write("\n\n") raw_text.write("\n".join(lines)) raw_text.write("\n\n") raw_text.write("\n".join(gpg_post_lines)) self.raw_text = raw_text.getvalue() try: args = list(args) args[0] = lines except IndexError: kwargs["sequence"] = lines _multivalued.__init__(self, *args, **kwargs) class Dsc(_gpg_multivalued): _multivalued_fields = { "files": [ "md5sum", "size", "name" ], "checksums-sha1": ["sha1", "size", "name"], "checksums-sha256": ["sha256", "size", "name"], } class Changes(_gpg_multivalued): _multivalued_fields = { "files": [ "md5sum", "size", "section", "priority", "name" ], "checksums-sha1": ["sha1", "size", "name"], "checksums-sha256": ["sha256", "size", "name"], } def get_pool_path(self): """Return the path in the pool where the files would be installed""" # This is based on the section listed for the first file. While # it is possible, I think, for a package to provide files in multiple # sections, I haven't seen it in practice. In any case, this should # probably detect such a situation and complain, or return a list... s = self['files'][0]['section'] try: section, subsection = s.split('/') except ValueError: # main is implicit section = 'main' if self['source'].startswith('lib'): subdir = self['source'][:4] else: subdir = self['source'][0] return 'pool/%s/%s/%s' % (section, subdir, self['source']) class PdiffIndex(_multivalued): _multivalued_fields = { "sha1-current": [ "SHA1", "size" ], "sha1-history": [ "SHA1", "size", "date" ], "sha1-patches": [ "SHA1", "size", "date" ], } @property def _fixed_field_lengths(self): fixed_field_lengths = {} for key in self._multivalued_fields: if hasattr(self[key], 'keys'): # Not multi-line -- don't need to compute the field length for # this one continue length = self._get_size_field_length(key) fixed_field_lengths[key] = {"size": length} return fixed_field_lengths def _get_size_field_length(self, key): lengths = [len(str(item['size'])) for item in self[key]] return max(lengths) class Release(_multivalued): """Represents a Release file Set the size_field_behavior attribute to "dak" to make the size field length only as long as the longest actual value. The default, "apt-ftparchive" makes the field 16 characters long regardless. """ # FIXME: Add support for detecting the behavior of the input, if # constructed from actual 822 text. _multivalued_fields = { "md5sum": [ "md5sum", "size", "name" ], "sha1": [ "sha1", "size", "name" ], "sha256": [ "sha256", "size", "name" ], } __size_field_behavior = "apt-ftparchive" def set_size_field_behavior(self, value): if value not in ["apt-ftparchive", "dak"]: raise ValueError("size_field_behavior must be either " "'apt-ftparchive' or 'dak'") else: self.__size_field_behavior = value size_field_behavior = property(lambda self: self.__size_field_behavior, set_size_field_behavior) @property def _fixed_field_lengths(self): fixed_field_lengths = {} for key in self._multivalued_fields: length = self._get_size_field_length(key) fixed_field_lengths[key] = {"size": length} return fixed_field_lengths def _get_size_field_length(self, key): if self.size_field_behavior == "apt-ftparchive": return 16 elif self.size_field_behavior == "dak": lengths = [len(str(item['size'])) for item in self[key]] return max(lengths) class Sources(Dsc, _PkgRelationMixin): """Represent an APT source package list""" _relationship_fields = [ 'build-depends', 'build-depends-indep', 'build-conflicts', 'build-conflicts-indep', 'binary' ] def __init__(self, *args, **kwargs): Dsc.__init__(self, *args, **kwargs) _PkgRelationMixin.__init__(self, *args, **kwargs) class Packages(Deb822, _PkgRelationMixin): """Represent an APT binary package list""" _relationship_fields = [ 'depends', 'pre-depends', 'recommends', 'suggests', 'breaks', 'conflicts', 'provides', 'replaces', 'enhances' ] def __init__(self, *args, **kwargs): Deb822.__init__(self, *args, **kwargs) _PkgRelationMixin.__init__(self, *args, **kwargs) ### class _CaseInsensitiveString(str): """Case insensitive string. """ def __new__(cls, str_): s = str.__new__(cls, str_) s.str_lower = str_.lower() s.str_lower_hash = hash(s.str_lower) return s def __hash__(self): return self.str_lower_hash def __eq__(self, other): return self.str_lower == other.lower() def lower(self): return self.str_lower _strI = _CaseInsensitiveString spectacle-0.25/spectacle/dsc/Makefile0000644002342000234200000000065012502671637016001 0ustar rzrrzr# ex: set tabstop=4 noexpandtab: PYTHON=python CHEETAH=cheetah TEMPLATES=$(wildcard *.tmpl) TEMPLATE_MODS=$(patsubst %.tmpl,%.py,$(TEMPLATES)) .SECONDARY: $(TEMPLATE_MODS) all: $(TEMPLATE_MODS) %.py: %.tmpl $(CHEETAH) compile --settings='useStackFrames=False' $< cp $@ __init__.py clean: rm -f $(TEMPLATE_MODS) rm -f $(addsuffix .bak,$(TEMPLATE_MODS)) rm -f *.xsd *.wsdl rm -f *.pyc *.pyo rm -f *.py rm -f *.bak spectacle-0.25/spectacle/dsc/dsc.tmpl0000644002342000234200000000123112502671637016004 0ustar rzrrzr# ############################################## # Do not Edit! Generated by: # spec-builder version 0.13 # ############################################### Format: 1.0 Source: ${metadata.Name} Architecture: any Version: ${metadata.Version} Homepage: ${metadata.URL} Standards-Version: 3.8.0 Maintainer: packagers@moblin.org ## BuildRequires #if $metadata.has_key("BuildRequires") #for $brtype in $metadata.BuildRequires #if $brtype == "PkgConfig" #for $br in $metadata.BuildRequires.PkgConfig Build-Depends: $br #end for #end if #if $brtype == "Pkg" #for $br in $metadata.BuildRequires.Pkg Build-Depends: $br #end for #end if #end for #end if spectacle-0.25/spectacle/dumper.py0000644002342000234200000001461312502671637015442 0ustar rzrrzr#!/usr/bin/python -tt # vim: ai ts=4 sts=4 et sw=4 # Copyright (c) 2009 Intel Corporation # # 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; version 2 of the License # # 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, write to the Free Software Foundation, Inc., 59 # Temple Place - Suite 330, Boston, MA 02111-1307, USA. import sys TAB = ' ' # 4space, instead of Tab class SpectacleDumper(object): """ Dumper medium data to output format. Supported output format: yaml, json The format of medium data of spectacle, as input for dumping: data = [ (key1, val1), # atom value ('', ''), # for blank line (key2, [val21, val22, val23]), # list of values (key3, [ # special for 'SubPackages' [ # items for subpkg (key31, val31), (key32, val32), ... ], [ ... ], ]), (key4, { # special for 'extra' 'key41': 'value41' ... }) ] """ spec_extra_keys = { # key -> ( nkey, nsubkey) # ^^ None means to use 'Files': ('files', None), 'macros': ('macros', None), 'setup': ('setup', None), 'PostMakeInstallExtras': ('install', 'post'), 'PreMakeInstallExtras': ('install', 'pre'), 'PostMakeExtras': ('build', 'post'), 'PreMakeExtras': ('build', 'pre'), } def __init__(self, format = 'yaml', opath = None): self.format = format self.opath = opath self.spec_extra = {} def _esc_value(self, val): # ESC for leading '%', for yaml syntax if val.startswith('%') or \ val.startswith('*') or \ ": " in val or \ ":\t" in val or \ val.endswith(':'): if '"' in val: quote_char = '\'' else: quote_char = '\"' return quote_char + val + quote_char else: return val def _dump_yaml(self, data, fp, indent = '', cur_pkg = 'main'): if indent: cur_indent = indent + '- ' else: cur_indent = indent first_line = True for key, value in data: if not first_line and indent: cur_indent = indent + ' ' if not key: # empty key means blank line for break fp.write("\n") continue if key == 'extra': for extra_key, extra_val in value.iteritems(): if not extra_val: continue try: nkey = self.spec_extra_keys[extra_key][0] nsubkey = self.spec_extra_keys[extra_key][1] if not nsubkey: nsubkey = cur_pkg except KeyError: nkey = extra_key nsubkey = cur_pkg if not isinstance(extra_val, list): extra_val = [extra_val] if nkey not in self.spec_extra: self.spec_extra[nkey] = {} self.spec_extra[nkey][nsubkey] = extra_val continue if isinstance(value, list): fp.write(cur_indent + "%s:\n" % (key)) for item in value: if isinstance(item, list): # only 'SubPackges' will reach here # cur_pkg will be the 1st pair ('Name', subpkg) self._dump_yaml(item, fp, cur_indent + TAB, cur_pkg = item[0][1]) fp.write("\n") else: fp.write(cur_indent + TAB + "- %s\n" % (self._esc_value(item))) elif isinstance(value, bool): if value: fp.write(cur_indent + "%s: yes\n" % (key)) else: fp.write(cur_indent + "%s: no\n" % (key)) else: lines_to_write = value.splitlines() if len(lines_to_write) == 1: try: fp.write(cur_indent + "%s: %s\n" % (key, self._esc_value(value))) except UnicodeEncodeError: fp.write(cur_indent + "%s: %s\n" % (key, self._esc_value(value).encode('utf8'))) elif len(lines_to_write) == 0: # not exist until now fp.write(cur_indent + "%s:\n" % (key)) else: fp.write(cur_indent + "%s: |\n" % key) for line in lines_to_write: fp.write(cur_indent + TAB + "%s\n" % line) first_line = False def _update_spec(self): import specify return specify.generate_rpm(self.opath, True, self.spec_extra) [0] def dump(self, data, format = None): if not format: format = self.format fp = sys.stdout if self.opath: try: fp = file(self.opath, 'w') except IOError: logger.warning('Cannot open file %s for writing' % self.opath) # print out pass try: if format == 'yaml': self._dump_yaml(data, fp) else: logger.error('Unsupported spectacle data dump format: %s' %format) finally: fp.close() if self.spec_extra and self.opath: return self._update_spec() return None spectacle-0.25/spectacle/logger.py0000644002342000234200000000517212502671637015425 0ustar rzrrzr#!/usr/bin/python -tt # vim: ai ts=4 sts=4 et sw=4 # Copyright (c) 2009 Intel Corporation # # 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; version 2 of the License # # 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, write to the Free Software Foundation, Inc., 59 # Temple Place - Suite 330, Boston, MA 02111-1307, USA. import os,sys import re __ALL__ = ['set_mode', 'info', 'warning', 'error', 'ask'] # COLORs in ANSI INFO_COLOR = 32 # green WARN_COLOR = 33 # yellow ERR_COLOR = 31 # red ASK_COLOR = 34 # blue PREFIX_RE = re.compile('^<(.*?)>\s*(.*)') INTERACTIVE = True def _color_print(head, color, msg = None, stream = sys.stdout): if os.getenv('ANSI_COLORS_DISABLED') is None: head = '\033[%dm%s:\033[0m' %(color, head) if msg: stream.write('%s %s\n' % (head, msg)) else: stream.write('%s ' % head) def _color_perror(head, color, msg): _color_print(head, color, msg, sys.stderr) def _split_msg(head, msg): m = PREFIX_RE.match(msg) if m: head += ' <%s>' % m.group(1) msg = m.group(2) return head, msg def set_mode(interactive): global INTERACTIVE if interactive: INTERACTIVE = True else: INTERACTIVE = False def info(msg): head, msg = _split_msg('Info', msg) _color_perror(head, INFO_COLOR, msg) def warning(msg): head, msg = _split_msg('Warning', msg) _color_perror(head, WARN_COLOR, msg) def error(msg): head, msg = _split_msg('Error', msg) _color_perror(head, ERR_COLOR, msg) sys.exit(1) def ask(msg, default=True): _color_print('Q', ASK_COLOR, '') try: if default: msg += '(Y/n) ' else: msg += '(y/N) ' if INTERACTIVE: repl = raw_input(msg) if repl.lower() == 'y': return True elif repl.lower() == 'n': return False else: return default else: sys.stdout.write('%s ' % msg) if default: sys.stdout.write('Y\n') else: sys.stdout.write('N\n') return default except KeyboardInterrupt: sys.stdout.write('\n') sys.exit(2) spectacle-0.25/spectacle/spec/Makefile0000644002342000234200000000065012502671637016162 0ustar rzrrzr# ex: set tabstop=4 noexpandtab: PYTHON=python CHEETAH=cheetah TEMPLATES=$(wildcard *.tmpl) TEMPLATE_MODS=$(patsubst %.tmpl,%.py,$(TEMPLATES)) .SECONDARY: $(TEMPLATE_MODS) all: $(TEMPLATE_MODS) %.py: %.tmpl $(CHEETAH) compile --settings='useStackFrames=False' $< cp $@ __init__.py clean: rm -f $(TEMPLATE_MODS) rm -f $(addsuffix .bak,$(TEMPLATE_MODS)) rm -f *.xsd *.wsdl rm -f *.pyc *.pyo rm -f *.py rm -f *.bak spectacle-0.25/spectacle/spec/spec.tmpl0000644002342000234200000005642712502671637016367 0ustar rzrrzr# ############################################## # Do NOT Edit the Auto-generated Part! # Generated by: spectacle version ${metadata.MyVersion} # ############################################## Name: ${metadata.Name} ## ## Pre-defined const and functions #set $str_newline = '\n' #def arch_line($value, $pre='', $post='') #set $rarch, $arch, $value = $arch_split($value) #if $arch %ifarch $arch #end if ${pre}${value}${post}#slurp #if $arch %endif#slurp #end if #end def ################### ## Macros # >> macros #if $extra.content.has_key("macros") and $extra.content.macros.has_key("main") $str_newline.join($extra.content.macros.main) #end if # << macros #if $extra.HasStatic %define keepstatic 1 #set $cfgstatic = "" #else #set $cfgstatic = "--disable-static" #end if #if $metadata.has_key("Macros") #for $macro_key,$macro_value in $metadata.Macros.items() %define $macro_key $macro_value #end for #end if #if $metadata.has_key('Builder') #set $Builder = $metadata.Builder #else ## default #set $Builder = 'make' #end if #if $Builder == 'python' #if $metadata.has_key("BuildArch") and $metadata.BuildArch == 'noarch' %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} #else %{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} #end if #end if Summary: ${metadata.Summary} Version: ${metadata.Version} Release: ${metadata.Release} #if $metadata.has_key("Epoch") Epoch: ${metadata.Epoch} #set $auto_depend = "%{epoch}:%{version}-%{release}" #else #set $auto_depend = "%{version}-%{release}" #end if Group: ${metadata.Group} License: ${metadata.License} #if $metadata.has_key("ExclusiveArch") ExclusiveArch: ${metadata.ExclusiveArch} #end if #if $metadata.has_key("BuildArch") BuildArch: ${metadata.BuildArch} #end if #if $metadata.has_key("Prefix") Prefix: ${metadata.Prefix} #end if #if $metadata.has_key("URL") URL: ${metadata.URL} #end if ## Sources #if $metadata.has_key("Sources") #set $idx = 0 #for $source in $metadata.Sources Source${idx}: $source #set $idx = $idx + 1 #end for #end if Source100: ${metadata.Name}.yaml #if $metadata.has_key("RpmLintIgnore") Source101: ${metadata.Name}-rpmlintrc #end if ## Patches #if $metadata.has_key("Patches") #set $idx = 0 #for $patch in $metadata.Patches $arch_line($patch, "Patch%d: "%$idx) #set $idx = $idx + 1 #end for ## each patch #end if #if 'NoAutoReq' in $metadata AutoReq: 0 #end if #if 'NoAutoReqProv' in $metadata AutoReqProv: 0 #end if ## Requires #if $Builder == 'perl' Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo \$version)) #end if #if $metadata.has_key("Requires") #for $req in $metadata.Requires $arch_line($req, 'Requires: ') #end for ## each req #end if #if $metadata.has_key("RequiresPre") #for $req in $metadata.RequiresPre Requires(pre): $req #end for #end if #if $metadata.has_key("RequiresPreUn") #for $req in $metadata.RequiresPreUn Requires(preun): $req #end for #end if #if $metadata.has_key("RequiresPost") #for $req in $metadata.RequiresPost Requires(post): $req #end for #end if #if $metadata.has_key("RequiresPostUn") #for $req in $metadata.RequiresPostUn Requires(postun): $req #end for #end if ## BuildRequires #if $metadata.has_key("PkgConfigBR") #for $br in $metadata.PkgConfigBR #set $br_comps = $br.split() #if $len($br_comps) > 1 $arch_line($br_comps[0], "BuildRequires: pkgconfig(", ")%s" % $br[$len($br_comps[0]):]) #else $arch_line($br, "BuildRequires: pkgconfig(", ")") #end if #end for ## each br #end if #if $metadata.has_key("PkgBR") #for $br in $metadata.PkgBR $arch_line($br, "BuildRequires: ") #end for ## each br #end if ## BuildConflicts #if $metadata.has_key("BuildConflicts") #for $bcfl in $metadata.BuildConflicts BuildConflicts: $bcfl #end for #end if #if $metadata.has_key("RunFdupes") BuildRequires: fdupes #end if #if $Builder == 'cmake' BuildRequires: cmake #end if #if 'NoAutoProv' in $metadata AutoProv: 0 #end if ## Provides #if $metadata.has_key("Provides") #for $prd in $metadata.Provides Provides: $prd #end for #end if ## Conflicts #if $metadata.has_key("Conflicts") #for $cfl in $metadata.Conflicts Conflicts: $cfl #end for #end if ## Obsoletes #if $metadata.has_key("Obsoletes") #for $obs in $metadata.Obsoletes Obsoletes: $obs #end for #end if #if 'SupportOtherDistros' in $metadata BuildRoot: %{_tmppath}/%{name}-%{version}-build #end if %description #if $metadata.has_key("Description") ${metadata.Description} #else Description: %{summary} #end if #if $metadata.has_key("SubPackages") #for $sp in $metadata.SubPackages #set $sub_extra = $extra.subpkgs[$sp.Name] #if $sp.has_key("AsWholeName") %package -n $sp.Name #else %package $sp.Name #end if Summary: $sp.Summary #if $sp.has_key("License") License: $sp.License #end if #if $sp.has_key("Group") Group: $sp.Group #else Group: ${metadata.Group} #end if #if $sp.has_key("Version") Version: $sp.Version #end if #if $sp.has_key("Release") Release: $sp.Release #end if #if $sp.has_key("Epoch") Epoch: $sp.Epoch #end if #if $sp.has_key("URL") URL: $sp.URL #end if #if $sp.has_key("BuildArch") BuildArch: $sp.BuildArch #end if #if $sp.has_key("Prefix") Prefix: $sp.Prefix #end if #if 'NoAutoReq' in $sp AutoReq: 0 #end if #if 'NoAutoProv' in $sp AutoProv: 0 #end if #if 'NoAutoReqProv' in $sp AutoReqProv: 0 #end if #if $sp.has_key("AutoDepend") and not $metadata.has_key("NoFiles") Requires: %{name} = $auto_depend #end if #if $sp.has_key("Requires") #for $req in $sp.Requires $arch_line($req, "Requires: ") #end for ## each req #end if #if $sp.has_key("RequiresPre") #for $req in $sp.RequiresPre Requires(pre): $req #end for #end if #if $sp.has_key("RequiresPreUn") #for $req in $sp.RequiresPreUn Requires(preun): $req #end for #end if #if $sp.has_key("RequiresPost") #for $req in $sp.RequiresPost Requires(post): $req #end for #end if #if $sp.has_key("RequiresPostUn") #for $req in $sp.RequiresPostUn Requires(postun): $req #end for #end if ## Provides #if $sp.has_key("Provides") #for $prd in $sp.Provides Provides: $prd #end for #end if ## Conflicts #if $sp.has_key("Conflicts") #for $cfl in $sp.Conflicts Conflicts: $cfl #end for #end if ## Obsoletes #if $sp.has_key("Obsoletes") #for $obs in $sp.Obsoletes Obsoletes: $obs #end for #end if ## BR #if $sp.has_key("PkgBR") #for $br in $sp.PkgBR $arch_line($br, "BuildRequires: ") #end for ## each br #end if ## PkgConfigBR #if $sp.has_key("PkgConfigBR") #for $br in $sp.PkgConfigBR #set $br_comps = $br.split() #if $len($br_comps) > 1 $arch_line($br_comps[0], "BuildRequires: pkgconfig(", ")%s" % $br[$len($br_comps[0]):]) #else $arch_line($br, "BuildRequires: pkgconfig(", ")") #end if #end for ## each br #end if ## BuildConflicts #if $sp.has_key("BuildConflicts") #for $bcfl in $sp.BuildConflicts BuildConflicts: $bcfl #end for #end if #if $sp.has_key("AsWholeName") %description -n $sp.Name #else %description $sp.Name #end if #if $sp.has_key('Description') $sp.Description #else Description: %{summary} #end if #end for #end if ################### ## Macros2 #if $metadata.has_key("Macros2") or $extra.content.has_key("macros2") #if $extra.content.has_key("macros2") and $extra.content.macros2.has_key("main") and $extra.content.macros2.main # >> macros2 $str_newline.join($extra.content.macros2.main) # << macros2 #end if #if $metadata.has_key("Macros2") #for $macro_key,$macro_value in $metadata.Macros2.items() %define $macro_key $macro_value #end for #end if #end if ############################ prep scripts %prep #if $metadata.has_key("Sources") #if $metadata.has_key("NoSetup") # No setup #else if $metadata.has_key("SetupOptions") %setup $metadata.SetupOptions #else %setup -q -n $metadata.SourcePrefix #end if #end if ## has Sources ## Applying patches #if $metadata.has_key("Patches") #set $idx = 0 #for $patch in $metadata.Patches #if "PatchCmts" in $metadata $metadata.PatchCmts[$idx] #end if #if 'PatchOpts' in $metadata $arch_line($patch, "# ", "\n%%patch%d %s"%($idx, $metadata.PatchOpts[$idx])) #else $arch_line($patch, "# ", "\n%%patch%d -p1"%$idx) #end if #set $idx = $idx + 1 #end for ## each patch #end if # >> setup #if $extra.content.has_key("setup") and $extra.content.setup.has_key("main") $str_newline.join($extra.content.setup.main) #end if # << setup ############################ build scripts %build #if not $metadata.has_key('UseAsNeeded') unset LD_AS_NEEDED #end if # >> build pre #if $extra.content.has_key("build") and $extra.content.build.has_key("pre") $str_newline.join($extra.content.build.pre) #end if # << build pre ############################ #if $Builder == 'python' CFLAGS="\$RPM_OPT_FLAGS" %{__python} setup.py build #else if $Builder == 'qmake' #set $Configure = 'none' #if 'SupportOtherDistros' in $metadata %if 0%{?moblin_version} %qmake #slurp #if 'QMakeOptions' in $metadata \ #else #end if %else qmake -makefile -nocache \ "QMAKE_CFLAGS_RELEASE=\${CFLAGS:-%optflags}" \ "QMAKE_CFLAGS_DEBUG=\${CFLAGS:-%optflags}" \ "QMAKE_CXXFLAGS_RELEASE=\${CXXFLAGS:-%optflags}" \ "QMAKE_CXXFLAGS_DEBUG=\${CXXFLAGS:-%optflags}" \ QMAKE_STRIP=: \ PREFIX=%{_prefix} #slurp #if 'QMakeOptions' in $metadata \ #else #end if %endif #else %qmake #slurp #if 'QMakeOptions' in $metadata \ #else #end if #end if #if 'QMakeOptions' in $metadata #set $length = len($metadata.QMakeOptions) #set $idx = 1 #for $opt in $metadata.QMakeOptions #if $idx == $length $arch_line($opt, " ") #else $arch_line($opt, " ", " \\") #end if #set $idx = $idx + 1 #end for #end if ## QMakeOptions make %{?jobs:-j%jobs} #else if $Builder == 'perl' if test -f Makefile.PL; then %{__perl} Makefile.PL INSTALLDIRS=vendor make %{?jobs:-j%jobs} else %{__perl} Build.PL --installdirs vendor ./Build fi #else ####### #if $metadata.has_key('Configure') #set $Configure = $metadata.Configure ####### #else ## default #if $Builder == 'cmake' #set $Configure = 'cmake' #else #set $Configure = 'configure' #end if #end if ####### #if $Configure == 'autogen' %autogen $cfgstatic %configure $cfgstatic#slurp #else if $Configure == 'cmake' %cmake . #slurp #else if $Configure == 'configure' %configure $cfgstatic#slurp #else if $Configure == 'reconfigure' %reconfigure $cfgstatic#slurp #end if ## any other values fall thru to 'noconfigure' #if ( $Configure != 'noconfigure' or $Configure != 'none' ) and $metadata.has_key("ConfigOptions") \ #set $length = len($metadata.ConfigOptions) #set $idx = 1 #for $opt in $metadata.ConfigOptions ## checking arch namespace prefix #if $idx == $length $arch_line($opt, " ") #else $arch_line($opt, " ", " \\") #end if #set $idx = $idx + 1 #end for #end if ## ConfigOptions #if $Builder == 'make' or $Builder == 'cmake' make %{?jobs:-j%jobs} #else if $Builder == 'single-make' make #else if $Builder != 'no-make' and $Builder != 'none' and $Builder != 'no-builder' $Builder #end if #end if ## Builder == python ############################ # >> build post #if $extra.content.has_key("build") and $extra.content.build.has_key("post") $str_newline.join($extra.content.build.post) #end if # << build post ############################ installation scripts %install #if 'SupportOtherDistros' in $metadata rm -rf \$RPM_BUILD_ROOT #else rm -rf %{buildroot} #end if # >> install pre #if $extra.content.has_key("install") and $extra.content.install.has_key("pre") $str_newline.join($extra.content.install.pre) #end if # << install pre #if $Builder == 'python' #if 'SupportOtherDistros' in $metadata %if 0%{?suse_version} %{__python} setup.py install --root=\$RPM_BUILD_ROOT --prefix=%{_prefix} %else %{__python} setup.py install --root=\$RPM_BUILD_ROOT -O1 %endif #else %{__python} setup.py install --root=%{buildroot} -O1 #end if #else if $Builder == 'perl' if test -f Makefile.PL; then make pure_install PERL_INSTALL_ROOT=%{buildroot} else ./Build install --installdirs vendor fi find %{buildroot} -type f -name .packlist -exec rm -f {} ';' find %{buildroot} -depth -type d -exec rmdir {} 2>/dev/null ';' find %{buildroot} -type f -name '*.bs' -empty -exec rm -f {} ';' %{_fixperms} %{buildroot}/* #else if $Builder == 'qmake' #if 'SupportOtherDistros' in $metadata %if 0%{?moblin_version} %qmake_install %else %makeinstall %endif #else %qmake_install #end if #else if $Builder == 'make' or $Builder == 'single-make' or $Builder == 'cmake' #if 'SupportOtherDistros' in $metadata %if 0%{?moblin_version} %make_install %else %makeinstall %endif #else %make_install #end if ## SupportOtherDistros #end if ## of Builder == 'make' ... #if $metadata.has_key("ExtraInstall") $metadata.ExtraInstall #end if # >> install post #if $extra.content.has_key("install") and $extra.content.install.has_key("post") $str_newline.join($extra.content.install.post) #end if # << install post #if $extra.Desktop desktop-file-install --delete-original \ --dir %{buildroot}%{_datadir}/applications \ %{buildroot}%{_datadir}/applications/*.desktop #end if #if $metadata.has_key("LocaleName") #if $metadata.has_key("LocaleOptions") #set $localeopt_str = $metadata["LocaleOptions"] %find_lang ${metadata.LocaleName} $localeopt_str #else %find_lang ${metadata.LocaleName} #end if #end if ############################ run fdupes #if $metadata.has_key("RunFdupes") #for $fditem in $metadata.RunFdupes %fdupes %{buildroot}/$fditem #end for #end if ############################ optional check scripts #if $metadata.has_key("Check") %check # >> check #if $extra.content.has_key("check") $str_newline.join($extra.content.check.main) #else #if $Builder == 'perl' if test -f Makefile.PL; then make test else ./Build test fi #else make check #end if #end if # << check #end if ############################ Pre #set $has_extra_pre = $extra.content.has_key("pre") and $extra.content.pre.has_key("main") #if $extra.Schema or $has_extra_pre %pre ## -Schema #if $extra.Schema if [ "$1" -gt 1 ]; then #for $schema in $extra.Schemas export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` gconftool-2 --makefile-uninstall-rule \ $schema \ > /dev/null || : #end for fi #end if ## -Extra pre #if $has_extra_pre # >> pre $str_newline.join($extra.content.pre.main) # << pre #end if #end if ############################ PreUn #set $has_extra_preun = $extra.content.has_key("preun") and $extra.content.preun.has_key("main") #if $extra.Schema or $extra.SystemdService or $has_extra_preun %preun ## -Schema #if $extra.Schema if [ "$1" -eq 0 ]; then #for $schema in $extra.Schemas export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` gconftool-2 --makefile-uninstall-rule \ $schema \ > /dev/null || : #end for fi #end if ## -SystemdService (systemd) #if $extra.SystemdService if [ "$1" -eq 0 ]; then #for $srv in $extra.SystemdServices systemctl stop $srv #end for fi #end if ## -Extra preun #if $has_extra_preun # >> preun $str_newline.join($extra.content.preun.main) # << preun #end if #end if ############################ Post #set $has_extra_post = $extra.content.has_key("post") and $extra.content.post.has_key("main") and $extra.content.post.main #if $extra.Lib or $extra.Info or $extra.Schema or $extra.Icon or $extra.DesktopDB or $extra.SystemdService or $has_extra_post #set $only_Lib = not ($extra.Info or $extra.Schema or $extra.Icon or $extra.DesktopDB or $extra.SystemdService or $has_extra_post) #if $only_Lib %post -p /sbin/ldconfig #else %post #end if ## -Lib #if $extra.Lib and not $only_Lib /sbin/ldconfig #end if ## -Schema #if $extra.Schema #for $schema in $extra.Schemas export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` gconftool-2 --makefile-install-rule \ $schema > /dev/null || : #end for #end if ## -Info #if $extra.Info #for $inf in $extra.Infos %install_info --info-dir=%_infodir $inf #end for #end if ## -Icon #if $extra.Icon /bin/touch --no-create %{_datadir}/icons/hicolor || : %{_bindir}/gtk-update-icon-cache \ --quiet %{_datadir}/icons/hicolor 2> /dev/null|| : #end if ## -DesktopDB #if $extra.DesktopDB update-desktop-database %{_datadir}/applications &> /dev/null || : #end if ## -SystemdService (systemd) #if $extra.SystemdService systemctl daemon-reload #for $srv in $extra.SystemdServices systemctl reload-or-try-restart $srv #end for #end if ## -Extra Post Script #if $has_extra_post # >> post $str_newline.join($extra.content.post.main) # << post #end if #end if ## need post ############################ PostUn #set $has_extra_postun = $extra.content.has_key("postun") and $extra.content.postun.has_key("main") and $extra.content.postun.main #if $extra.Lib or $extra.Info or $extra.Icon or $extra.DesktopDB or $extra.SystemdService or $has_extra_postun #set $only_Lib = not ($extra.Info or $extra.Icon or $extra.DesktopDB or $extra.SystemdService or $has_extra_postun) #if $only_Lib %postun -p /sbin/ldconfig #else %postun #end if #if $extra.Lib and not $only_Lib /sbin/ldconfig #end if ## -Info #if $extra.Info if [ $1 = 0 ] ;then #for $inf in $extra.Infos %install_info_delete --info-dir=%{_infodir} $inf #end for fi #end if ## -Icon #if $extra.Icon /bin/touch --no-create %{_datadir}/icons/hicolor || : %{_bindir}/gtk-update-icon-cache \ --quiet %{_datadir}/icons/hicolor 2> /dev/null|| : #end if ## -DesktopDB #if $extra.DesktopDB update-desktop-database %{_datadir}/applications &> /dev/null || : #end if ## -SystemdService (systemd) #if $extra.SystemdService systemctl daemon-reload #end if ## -Extra Postun Script #if $has_extra_postun # >> postun $str_newline.join($extra.content.postun.main) # << postun #end if #end if ## need postun ######################################## ## Pre/Preun/Post/Postun for SubPackages #if $metadata.has_key("SubPackages") #for $sp in $metadata.SubPackages #if $sp.has_key("AsWholeName") #set $pkg_name = "-n " + $sp.Name #else #set $pkg_name = $sp.Name #end if #set $sub_extra = $extra.subpkgs[$sp.Name] ####################### ## Pre for SubPackages #set $has_extra_pre = $extra.content.has_key("pre") and $extra.content.pre.has_key($sp.Name) #if $sub_extra.Schema or $has_extra_pre %pre $pkg_name ## -Schema #if $sub_extra.Schema if [ "$1" -gt 1 ]; then #for $schema in $sub_extra.Schemas export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` gconftool-2 --makefile-uninstall-rule \ $schema \ > /dev/null || : #end for fi #end if ## -Extra pre #if $has_extra_pre # >> pre $sp.Name $str_newline.join($extra.content.pre[$sp.Name]) # << pre $sp.Name #end if #end if ####################### ## Preun for SubPackages #set $has_extra_preun = $extra.content.has_key("preun") and $extra.content.preun.has_key($sp.Name) #if $sub_extra.Schema or $sub_extra.SystemdService or $has_extra_preun %preun $pkg_name ## -Schema #if $sub_extra.Schema if [ "$1" -eq 0 ]; then #for $schema in $sub_extra.Schemas export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` gconftool-2 --makefile-uninstall-rule \ $schema \ > /dev/null || : #end for fi #end if ## -SystemdService (systemd) #if $sub_extra.SystemdService if [ "$1" -eq 0 ]; then #for $srv in $sub_extra.SystemdServices systemctl stop $srv #end for fi #end if ## -Extra preun #if $has_extra_preun # >> preun $sp.Name $str_newline.join($extra.content.preun[$sp.Name]) # << preun $sp.Name #end if #end if ####################### ## Post for SubPackages #set $has_extra_post = $extra.content.has_key("post") and $extra.content.post.has_key($sp.Name) and $extra.content.post[$sp.Name] #if $sub_extra.Lib or $sub_extra.Info or $sub_extra.Icon or $sub_extra.Schema or $sub_extra.DesktopDB or $sub_extra.SystemdService or $has_extra_post #set $only_Lib = not ($sub_extra.Info or $sub_extra.Icon or $sub_extra.Schema or $sub_extra.DesktopDB or $sub_extra.SystemdService or $has_extra_post) #if $only_Lib %post $pkg_name -p /sbin/ldconfig #else %post $pkg_name #end if ## -Lib #if $sub_extra.Lib and not $only_Lib /sbin/ldconfig #end if ## -Schema #if $sub_extra.Schema #for $schema in $sub_extra.Schemas export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` gconftool-2 --makefile-install-rule \ $schema > /dev/null || : #end for #end if ## -Info #if $sub_extra.Info #for $inf in $sub_extra.Infos %install_info --info-dir=%_infodir $inf #end for #end if ## Info ## -Icon #if $sub_extra.Icon /bin/touch --no-create %{_datadir}/icons/hicolor || : %{_bindir}/gtk-update-icon-cache \ --quiet %{_datadir}/icons/hicolor 2> /dev/null|| : #end if ## -DesktopDB #if $sub_extra.DesktopDB update-desktop-database %{_datadir}/applications &> /dev/null || : #end if ## -SystemdService (systemd) #if $sub_extra.SystemdService systemctl daemon-reload #for $srv in $sub_extra.SystemdServices systemctl reload-or-try-restart $srv #end for #end if ## -Extra Post Script #if $has_extra_post # >> post $sp.Name $str_newline.join($extra.content.post[$sp.Name]) # << post $sp.Name #end if #end if ## need post ####################### ## PostUn for SubPackages #set $has_extra_postun = $extra.content.has_key("postun") and $extra.content.postun.has_key($sp.Name) and $extra.content.postun[$sp.Name] #if $sub_extra.Lib or $sub_extra.Info or $sub_extra.Icon or $sub_extra.DesktopDB or $sub_extra.SystemdService or $has_extra_postun #set $only_Lib = not ($sub_extra.Info or $sub_extra.Icon or $sub_extra.DesktopDB or $sub_extra.SystemdService or $has_extra_postun) #if $only_Lib %postun $pkg_name -p /sbin/ldconfig #else %postun $pkg_name #end if #if $sub_extra.Lib and not $only_Lib /sbin/ldconfig #end if #if $sub_extra.Info if [ $1 = 0 ] ;then #for $inf in $sub_extra.Infos %install_info_delete --info-dir=%{_infodir} $inf #end for fi #end if ## Info ## -Icon #if $sub_extra.Icon /bin/touch --no-create %{_datadir}/icons/hicolor || : %{_bindir}/gtk-update-icon-cache \ --quiet %{_datadir}/icons/hicolor 2> /dev/null|| : #end if ## -DesktopDB #if $sub_extra.DesktopDB update-desktop-database %{_datadir}/applications &> /dev/null || : #end if ## -SystemdService (systemd) #if $sub_extra.SystemdService systemctl daemon-reload #end if ## -Extra Postun Script #if $has_extra_postun # >> postun $sp.Name $str_newline.join($extra.content.postun[$sp.Name]) # << postun $sp.Name #end if #end if ## need postun #end for ## per subpackage #end if ## has subpackages #if not $metadata.has_key("NoFiles") #if (not $metadata.has_key('LocaleFilesPkgName') or $metadata.LocaleFilesPkgName == $metadata.Name) and $metadata.has_key("LocaleName") %files -f ${metadata.LocaleName}.lang #else if $metadata.has_key('FilesInput') %files -f $metadata.FilesInput #else %files #end if %defattr(-,root,root,-) ## TODO to be cleanup #if $metadata.has_key("Documents") #for $doc in $metadata.Documents %doc $doc #end for #end if #if "Files" in $metadata: #for $f in $metadata.Files $arch_line($f) #end for #end if # >> files #if $extra.content.has_key("files") and $extra.content.files.has_key("main") $str_newline.join($extra.content.files.main) #end if # << files #end if ## not NoFiles ## files for subpkgs #if $metadata.has_key("SubPackages") #for $sp in $metadata.SubPackages #if $sp.has_key("AsWholeName") #set $pkg_name = "-n " + $sp.Name #else #set $pkg_name = $sp.Name #end if #if $metadata.has_key("LocaleName") and $metadata.has_key('LocaleFilesPkgName') and $metadata.LocaleFilesPkgName == $pkg_name %files $pkg_name -f ${metadata.LocaleName}.lang #else if $sp.has_key('FilesInput') %files $pkg_name -f $sp.FilesInput #else %files $pkg_name #end if %defattr(-,root,root,-) ## TODO to be cleanup #if $sp.has_key("Documents") #for $doc in $sp.Documents %doc $doc #end for #end if #if "Files" in $sp: #for $f in $sp.Files $arch_line($f) #end for #end if # >> files $sp.Name #if $extra.content.has_key("files") and $extra.content.files.has_key($sp.Name) $str_newline.join($extra.content.files[$sp.Name]) #end if # << files $sp.Name #end for #end if spectacle-0.25/spectacle/specify.py0000644002342000234200000021272512502671637015614 0ustar rzrrzr#!/usr/bin/python -tt # vim: ai ts=4 sts=4 et sw=4 # Copyright (c) 2009 Intel Corporation # # 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; version 2 of the License # # 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, write to the Free Software Foundation, Inc., 59 # Temple Place - Suite 330, Boston, MA 02111-1307, USA. import os, sys import re import tempfile import shutil import copy import datetime import csv import tarfile # third-party modules import yaml # internal modules import __version__ import spec import logger from vercmp import FairVersion as _V USER_CONFIG = '~/.spectacle/spectacle.conf' # Path for series file that contains patches (and comment lines #) SERIES_PATH = 'series.conf' # Mandatory keys for main package MAND_KEYS = ('Name', 'Summary', 'Description', 'Version', 'Group', 'License', ) # Mandatory keys for subpackage SUB_MAND_KEYS = ('Name', 'Summary', 'Description', 'Group', ) # boolean keys with the default 'False' value BOOLNO_KEYS = ('Check', 'SupportOtherDistros', 'NoAutoReq', 'NoAutoProv', 'NoAutoReqProv', 'NoSetup', 'NoAutoLocale', 'AsWholeName', 'NoFiles', 'NoDesktop', 'UpdateDesktopDB', 'NoIconCache', 'NoSystemdService', ) # boolean keys with the default 'True' value BOOLYES_KEYS = ('UseAsNeeded', 'AutoDepend', ) # All boolean keys BOOL_KEYS = BOOLNO_KEYS + BOOLYES_KEYS # Keys expected to have list type value. LIST_KEYS = ('Sources', 'ExtraSources', 'Patches', 'ConfigOptions', 'QMakeOptions', 'Requires', 'RequiresPre', 'RequiresPreUn', 'RequiresPost', 'RequiresPostUn', 'PkgBR', 'PkgConfigBR', 'Provides', 'Conflicts', 'BuildConflicts', 'Obsoletes', 'AutoSubPackages', 'Files', 'Documents', 'RunFdupes', 'RpmLintIgnore', 'Macros', 'Macros2', ) # Keys expected to have string value. STR_KEYS = ('Name', 'Summary', 'Description', 'Version', 'Release', 'Epoch', 'Group', 'License', 'URL', # "Source Code Management". In this context URL to git repository. 'SCM', # Type of archive that is done when SCM is used. 'Archive', 'BuildArch', 'ExclusiveArch', 'SourcePrefix', 'Configure', 'Builder', 'SetupOptions', 'LocaleName', 'LocaleOptions', # Defines the package name where the *.lang file is added. 'LocaleFilesPkgName', 'FilesInput', 'PostScripts', 'Prefix', ) # Keys that are only available for subpackages SUBONLY_KEYS = ('AsWholeName', 'AutoDepend', ) # Key that are warned about moving to main package # if found from subpackages. SUBWARN_KEYS = ('PkgBR', 'PkgConfigBR', 'BuildConflicts', ) # Keys available for subpackages. SUBAVAIL_KEYS = ('Name', 'Summary', 'Description', 'Group', 'License', 'Files', 'Prefix', 'Requires', 'RequiresPre', 'RequiresPreUn', 'RequiresPost', 'RequiresPostUn', 'Provides', 'Conflicts', 'Obsoletes', 'NoAutoReq', 'NoAutoProv', 'NoAutoReqProv', 'NoIconCache', 'FilesInput', # Very rare keys in sub packages 'Version', 'Release', 'Epoch', 'URL', 'BuildArch', ) # Deprecated keys that are not used anymore and # should be removed from .yaml DROP_KEYS = ('PostScripts', 'Documents', ) # Renamed keys. RENAMED_KEYS = {'NeedCheckSection': 'Check', 'NoLocale': 'NoAutoLocale', } # Common typos in keys TYPO_KEYS = {'BuildRequires': 'PkgBR or PkgConfigBR', 'Url': 'URL', } # Keys that may have archictecture qualifier in front of them. ARCHED_KEYS = ('Requires', 'PkgBR', 'PkgConfigBR', 'Patches', 'ConfigOptions', 'QMakeOptions', 'Files', ) # Available architecture qualifiers ARCHS = {'ix86': '%{ix86}', 'arm': '%{arm}', 'armv5': 'armv5el armv5tel armv5tejl', 'armv7': 'armv7el armv7tel armv7l armv7hl armv7nhl', } # Different options for "Configure" yaml key. CONFIGURES = ('configure', 'reconfigure', 'autogen', 'cmake', 'none') # Different options for "Builder" yaml key. BUILDERS = ('make', 'single-make', 'python', 'perl', 'qmake', 'cmake', 'none') # Paths that should be replaced with macros when seen in %files. # NOTE: Order of this list matters! PATHMACROS = (('/usr/bin', '%{_bindir}'), ('/usr/sbin', '%{_sbindir}'), ('/usr/lib', '%{_libdir}'), ('/usr/libexec', '%{_libexecdir}'), ('/usr/include', '%{_includedir}'), ('/usr/share/info', '%{_infodir}'), ('/usr/share/man', '%{_mandir}'), ('/usr/share', '%{_datadir}'), ('/usr', '%{_prefix}'), ('/etc/rc.d/init.d', '%{_initddir}'), ('/etc/init.d', '%{_initddir}'), ('/etc', '%{_sysconfdir}'), ('/var/lib', '%{_sharedstatedir}'), ('/var', '%{_localstatedir}'), ) # Function to read config file to parser def read_config_file(configfile,config_parser = None): from ConfigParser import SafeConfigParser configfile = os.path.expanduser(configfile) if not os.path.exists(configfile): return None if not config_parser: config_parser = SafeConfigParser() config_parser.read(configfile) return config_parser # Function to get values from config def get_config(configs, gettype, key, section = 'Main'): if not configs: return None if not configs.has_section(section): return None if not configs.has_option(section, key): return None if gettype == "boolean": return configs.getboolean(section,key) else: return configs.get(section,key) # global helper functions def arch_split(value): m = re.match('^(\w+):([^:]+)', value) if m: arch = m.group(1) left = m.group(2) if arch in ARCHS: return arch, ARCHS[arch], left else: return arch, arch, left else: return '', '', value class GitAccess(): def __init__(self, path): self.path = path def _gettags(self): tags = {} try: fh = os.popen('git ls-remote --tags "%s" 2>/dev/null' % self.path) prefix = 'refs/tags/' for line in fh: line = line.strip() node, tag = line.split(None, 1) if not tag.startswith(prefix): continue tagx = tag[len(prefix):len(tag)] tags[tagx] = node except KeyboardInterrupt: sys.exit(2) return tags def get_toptag(self): vers = [_V(tag) for tag in self._gettags()] # Need to filter ^{} entries out # http://stackoverflow.com/questions/5346060/git-tag-why-this-duplicate-tag-in-remotes filtered_vers = [item for item in vers if not str(item).endswith("^{}")] if filtered_vers: filtered_vers.sort() return str(filtered_vers[-1]) return None class RPMWriter(): """ The following keys will be generated on the fly based on values from YAML, and transfered to tmpl: MyVersion: version of spectacle ExtraInstall: extra install script for 'ExtraSources' """ extra_per_pkg = { 'Desktop': False, 'DesktopDB': False, 'Schema': False, 'Schemas': [], 'Lib': False, 'HasStatic': False, 'Icon': False, 'Service': False, 'SystemdService': False, 'SystemdServices': [], 'Info': False, 'Infos': [], } # Templates for AutoSubPackages key asp_templates = { 'devel': { 'Name': "devel", 'Description': "Development files for %{name}.", 'Summary': "Development files for %{name}", 'Group': "Development/Libraries", 'AutoDepend': "True", }, 'docs': { 'Name': "docs", 'Description': "Documentation files for %{name}.", 'Summary': "Documentation files for %{name}", 'Group': "Development/Libraries", 'AutoDepend': "True", }, 'lang': { 'Name': "lang", 'Description': "Translation files for %{name}.", 'Summary': "Translation files for %{name}", 'Group': "Development/Libraries", 'AutoDepend': "True", }, # Used when package doesn't match any of the above. 'unknown': { 'Name': "unknown", 'Description': "Files for %{name}.", 'Summary': "Files for %{name}", 'Group': "Development/Libraries", 'AutoDepend': "True", }, } def __init__(self, yaml_fpath, spec_fpath=None, clean_old=False, download_new=True, skip_scm=False): self.yaml_fpath = yaml_fpath now = datetime.datetime.now() self.metadata = {'MyVersion': __version__.VERSION, 'Date': now.strftime("%Y-%m-%d")} self.pkg = None self.version = None self.release = None self.specfile = spec_fpath self.packages = {} self.clean_old = clean_old self.download_new = download_new self.skip_scm = skip_scm self.uiwidget = None # default as gtk2 if Qt not detected # initialize extra info for spec self.extra = { 'subpkgs': {}, 'content': {} } # update extra info for main package self.extra.update(copy.deepcopy(self.extra_per_pkg)) # record filelist from 'ExtraSources' directive self.extras_filelist = [] try: self.stream = file(yaml_fpath, 'r') except IOError: logger.error('Cannot read file: %s' % yaml_fpath) self.configs = read_config_file(USER_CONFIG) def dump(self): # debugging import pprint pprint.pprint(yaml.dump(yaml.load(self.stream))) def _check_dup_files(self, files): # try to remove duplicate '%defattr' in files list dup1 = '%defattr(-,root,root,-)' dup2 = '%defattr(-,root,root)' found_dup = dup1 if dup1 in files else dup2 if dup2 in files else None if found_dup: logger.warning('found duplicate "%s" in file list, removed!' % found_dup) files.remove(found_dup) def _check_dup_ldconfig(self, pkgname = None): if not pkgname: pkgname = 'main' if not self.extra['Lib']: return else: if not self.extra['subpkgs'][pkgname]['Lib']: return dup1 = '/sbin/ldconfig' dup2 = 'ldconfig' for sec in ('post', 'postun'): try: extra = self.extra['content'][sec][pkgname] except KeyError: continue found_dup = dup1 if dup1 in extra else dup2 if dup2 in extra else None if found_dup: extra.remove(found_dup) logger.warning('Found duplicate "%s" calling in "%%%s" of %s package, removed!' % (found_dup, sec, pkgname)) def _check_dup_scriptlets(self, pkgname = None): if not pkgname: pkgname = 'main' extra = self.extra else: extra = self.extra['subpkgs'][pkgname] if extra['Desktop']: re_idstr = re.compile('^desktop-file-install\s+') try: lines = extra['content']['install']['pre'] + \ extra['content']['install']['post'] except KeyError: pass else: for line in lines: if re_idstr.match(line): logger.warning('Found possible duplicate "desktop-file-install" script in post install') break if extra['DesktopDB']: re_idstr = re.compile('^update-desktop-database\s+') for sec in ('post', 'postun'): try: lines = self.extra['content'][sec][pkgname] except KeyError: continue for line in lines: if re_idstr.match(line): logger.warning('Found possible duplicate "update-desktop-database" script in %%%s of %s package'%(sec, pkgname)) break if extra['Info']: re_idstr = re.compile('^%install_info') for sec in ('post', 'postun'): try: lines = self.extra['content'][sec][pkgname] except KeyError: continue for line in lines: if re_idstr.match(line): logger.warning('Found possible duplicate "%%install_info..." script in %%%s of %s package'%(sec, pkgname)) break if extra['Icon']: re_idstr = re.compile('^/bin/touch\s+.*%{_datadir}/icons/hicolor.*') re_idstr2 = re.compile('gtk-update-icon-cache\s+') for sec in ('post', 'postun'): try: lines = self.extra['content'][sec][pkgname] except KeyError: continue for line in lines: if re_idstr.match(line): logger.warning('Found possible duplicate script to touch icons in %%%s of %s package'%(sec, pkgname)) elif re_idstr2.search(line): logger.warning('Found possible duplicate "gtk-update-icon-cache" script in %%%s of %s package'%(sec, pkgname)) if extra['Schema']: re_idstr = re.compile('gconftool-2\s+') for sec in ('post', 'pre', 'preun'): try: lines = self.extra['content'][sec][pkgname] except KeyError: continue for line in lines: if re_idstr.search(line): logger.warning('Found possible duplicate "gconftool-2" script in %%%s of %s package'%(sec, pkgname)) break def sanity_check(self): def _check_empty_keys(metadata): """ return the empty keys """ keys = [] for key in metadata.keys(): if metadata[key] is None: keys.append(key) del metadata[key] return keys def _check_mandatory_keys(metadata, subpkg = False): """ return [] if all mandatory keys found, otherwise return the lost keys """ if subpkg: mkeys = list(SUB_MAND_KEYS) else: mkeys = list(MAND_KEYS) for key in metadata: if key in mkeys: mkeys.remove(key) if not mkeys: break return mkeys def _check_invalid_keys(metadata, subpkg = None): """ return list of invalid keys """ if not subpkg: # main package all_keys = list(LIST_KEYS + STR_KEYS + BOOL_KEYS + ('Date', 'MyVersion')) all_keys += RENAMED_KEYS.keys() all_keys.append('SubPackages') for key in SUBONLY_KEYS: all_keys.remove(key) else: # sub package all_keys = list(SUBAVAIL_KEYS + SUBWARN_KEYS + SUBONLY_KEYS) keys = [] for key in metadata: if key not in all_keys: keys.append(key) # whether the invalid keys are common typo for key in keys[:]: if key in TYPO_KEYS: logger.warning('"%s" might be a typo of %s, please fix it' %(key,TYPO_KEYS[key])) keys.remove(key) return keys def _check_subwarn_keys(metadata, subpkg): for key in SUBWARN_KEYS: if key in metadata: logger.warning('"%s" found in sub-pkg: %s, please consider to move it to main package' %(key, subpkg)) def _check_key_group(metadata): if metadata.has_key("Group"): warn = True try: for line in open("/usr/share/spectacle/GROUPS"): if metadata['Group'] in line: warn = False break except IOError: logger.error('Cannot open "/usr/share/spectacle/GROUPS", maybe the package was not installed correctly.') if warn: logger.warning('Group \'%s\' is not in the list of approved groups. See /usr/share/spectacle/GROUPS for the complete list.' % (metadata['Group'])) def _check_key_license(metadata): # warning for gplv3 gpl3_re = re.compile('L?GPL\s*v3', re.I) if metadata.has_key("License"): if gpl3_re.search(metadata['License']): logger.warning('GPLv3 related license might be unacceptable.') def _check_key_epoch(metadata): if 'Epoch' in metadata: logger.warning('Please consider to remove "Epoch"') def _check_pkgconfig(): try: pkgcfg = csv.reader(open('/usr/share/spectacle/pkgconfig-provides.csv'), delimiter=',') except IOError: logger.error('Cannot open "/usr/share/spectacle/pkgconfig-provides.csv", maybe the package was not installed correctly.') for row in pkgcfg: pc = re.search('pkgconfig\(([^)]+)\)', row[1]) m = pc.group(1) if self.packages.has_key(row[0]): ll = self.packages[row[0]] ll.append(m) self.packages[row[0]] = ll else: self.packages[row[0]] = [m] def _check_key_desc(metadata): """ sub-routine for 'description' checking """ if metadata['Description'] == '%{summary}' or \ metadata['Description'] == metadata['Summary']: return False return True def _check_listkey(metadata, key): """ sub-routine for LIST typed keys checking and will remove all empty and None values """ if key in metadata and not isinstance(metadata[key], list): return False if key not in metadata: return True try: while True: metadata[key].remove(None) except ValueError: pass try: while True: metadata[key].remove('') except ValueError: return True def _check_strkey(metadata, key): """ sub-routine for STR typed keys checking """ if key in metadata and not isinstance(metadata[key], str) and not isinstance(metadata[key], unicode): return False return True def _check_boolkey(metadata, key): """ sub-routine for boolean typed keys checking """ if key in metadata and not isinstance(metadata[key], bool): return False return True def _check_arched_keys(metadata): """ sub-routine for ARCH namespace available keys """ def _check_arch(key, item): if isinstance(item, dict): logger.warning('For arch prefixed %s value "%s", please do NOT leave extra spaces after ":", skipped!' % \ (key, ':'.join(map(str, item.popitem())))) return False arch = arch_split(item)[0] if arch and arch not in ARCHS: logger.warning('unsupport arch namespace: %s in key %s' % (arch, key)) return True for key in ARCHED_KEYS: if key in metadata: if key in STR_KEYS: if not _check_arch(key, metadata[key]): del metadata[key] elif key in LIST_KEYS: for item in metadata[key]: if not _check_arch(key, item): metadata[key].remove(item) if not metadata[key]: del metadata[key] def _check_key_localename(metadata): """ sub-routine for 'LocaleName' checking """ if 'LocaleOptions' in metadata and 'LocaleName' not in metadata: return False return True def _check_dropped_keys(metadata): for key in DROP_KEYS: if key in metadata: logger.warning('Deprecated key: %s found, please use other valid keys' % key) def _check_renamed_keys(metadata): for key in RENAMED_KEYS: if key in metadata: metadata[RENAMED_KEYS[key]] = metadata[key] del metadata[key] logger.warning('Renamed key: %s found, please use %s instead' % (key, RENAMED_KEYS[key])) def _check_key_setups(metadata): if 'NoSetup' in metadata: if 'SetupOptions' in metadata: logger.warning('"SetupOptions" will have NO effect when "NoSetup" specified in YAML') if 'SourcePrefix' in metadata: logger.warning('"SourcePrefix" will have NO effect when "NoSetup" specified in YAML') else: if 'SetupOptions' in metadata and 'SourcePrefix' in metadata: logger.warning('"SourcePrefix" will have NO effect when "SetupOptions" specified in YAML') def _check_key_nofiles(metadata): if 'Files' in metadata: logger.error('both "NoFiles" and "Files" exist in YAML file, please fix it') for req in ('Requires', 'RequiresPre', 'RequiresPreUn', 'RequiresPost', 'RequiresPostUn', 'Provides', 'Conflicts', 'BuildConflicts', 'Obsoletes'): if req in metadata and metadata[req]: logger.warning('"NoFiles" exists, key %s has no effect any more' % req) def _check_key_configure(metadata): cfg = metadata['Configure'] if cfg not in CONFIGURES: logger.warning('"%s" is not a valid choice of Configure(%s)' % (cfg, '/'.join(CONFIGURES))) def _check_key_builder(metadata): builder = metadata['Builder'] if builder not in BUILDERS: logger.warning('"%s" is not a valid choice of Builder(%s)' % (builder, '/'.join(BUILDERS))) # checking invalid 'Configure' for special builder if builder in ('python', 'perl', 'qmake', 'cmake') and \ 'Configure' in metadata and metadata['Configure'] != 'none': logger.warning('"%s" need no "Configure" setting which will be ignored' % builder) # checking for empty keys keys = _check_empty_keys(self.metadata) if keys: logger.warning('Please remove empty keys in main package: %s' % ', '.join(keys)) if "SubPackages" in self.metadata: for sp in self.metadata["SubPackages"]: keys = _check_empty_keys(sp) if keys: logger.warning('Please remove empty keys in %s subpackage: %s' % (sp['Name'], ', '.join(keys))) # checking for mandatory keys keys = _check_mandatory_keys(self.metadata) if keys: logger.error('Missing mandatory keys for main package: %s' % ', '.join(keys)) if "SubPackages" in self.metadata: for sp in self.metadata["SubPackages"]: keys = _check_mandatory_keys(sp, True) if keys: if 'Name' in keys: logger.error('Missing mandatory keys for sub-pkg: Name') else: logger.error('Missing mandatory keys for sub-pkg "%s": %s' % (sp['Name'], ', '.join(keys))) # checking for unexpected keys keys = _check_invalid_keys(self.metadata) if keys: logger.warning('Unexpected keys found: %s' % ', '.join(keys)) if "SubPackages" in self.metadata: for sp in self.metadata["SubPackages"]: keys = _check_invalid_keys(sp, sp['Name']) if keys: logger.warning('Unexpected keys for sub-pkg %s found: %s' % (sp['Name'], ', '.join(keys))) # checking for questionable sub-package keys if "SubPackages" in self.metadata and 'NoFiles' not in self.metadata: for sp in self.metadata["SubPackages"]: keys = _check_subwarn_keys(sp, sp['Name']) # checking for deprecated keys _check_dropped_keys(self.metadata) # checking for renamed keys _check_renamed_keys(self.metadata) ######### Type checkings ########## # checking for LIST expected keys for key in LIST_KEYS: if not _check_listkey(self.metadata, key): logger.warning('the value of "%s" in main package is expected as list typed' % key) self.metadata[key] = [self.metadata[key]] if "SubPackages" in self.metadata: for sp in self.metadata["SubPackages"]: if not _check_listkey(sp, key): logger.warning('the value of "%s" in "%s" sub-package is expected as list typed' % (key, sp['Name'])) sp[key] = [sp[key]] # checking for STR expected keys for key in STR_KEYS: if not _check_strkey(self.metadata, key): logger.warning('the value of "%s" in main package is expected as string typed' % key) if isinstance(self.metadata[key], list): self.metadata[key] = ' '.join(self.metadata[key]) else: del self.metadata[key] if "SubPackages" in self.metadata: for sp in self.metadata["SubPackages"]: if not _check_strkey(sp, key): logger.warning('the value of "%s" in "%s" sub-package is expected as string typed' % (key, sp['Name'])) if isinstance(sp[key], list): sp[key] = ' '.join(sp[key]) else: del sp[key] # checking for BOOL expected keys for key in BOOL_KEYS: if not _check_boolkey(self.metadata, key): logger.warning('the value of "%s" in main package is expected as bool typed, dropped!' % key) # just drop it del self.metadata[key] if "SubPackages" in self.metadata: for sp in self.metadata["SubPackages"]: if not _check_boolkey(sp, key): logger.warning('the value of "%s" in "%s" sub-package is expected as bool typed, dropped!' % (key, sp['Name'])) del sp[key] ######### checkings for special keys ########## # checking for arch namespace enabled keys _check_arched_keys(self.metadata) if "SubPackages" in self.metadata: for sp in self.metadata["SubPackages"]: _check_arched_keys(sp) # checking for proposal pkgconfig requires if self.metadata.has_key("PkgBR"): _check_pkgconfig() pcbr = [] br = [] for p in self.metadata['PkgBR']: px = p.split()[0] for arch in ARCHS: prefix = arch + ':' if px.startswith(prefix): px = px[len(prefix):] pl = self.packages if pl.has_key(px): if len(pl[px]) == 1: pcbr.append(pl[px][0]) else: br.append(p) logger.warning("""Please use one of the followings: - %s in PkgConfigBR instead of %s in PkgBR""" %('\n - '.join(pl[px]), px)) else: br.append(p) if len(pcbr) > 0: if self.metadata.has_key('PkgConfigBR'): pcbr.extend(self.metadata['PkgConfigBR']) logger.info("""Proposal (multiple values skipped, please insert them manually): PkgConfigBR: - %s PkgBR: - %s """ %('\n - '.join(pcbr), '\n - '.join(br))) _check_key_epoch(self.metadata) # checking for meego valid groups _check_key_group(self.metadata) if "SubPackages" in self.metadata: for sp in self.metadata["SubPackages"]: _check_key_group(sp) # checking for meego invalid licenses _check_key_license(self.metadata) if "SubPackages" in self.metadata: for sp in self.metadata["SubPackages"]: _check_key_license(sp) # checking for validation of 'Description' if not _check_key_desc(self.metadata): logger.error('main package has no qualified "Description" tag\n\ \t"Description" cannot be "%{summary}" or equal to the value of "Summary"') if "SubPackages" in self.metadata: for sp in self.metadata["SubPackages"]: if not _check_key_desc(sp): logger.error('sub-pkg: "%s" has no qualified "Description" tag\n\ \t"Description" cannot be "%%{summary}" or equal to the value of "Summary"' % sp['Name']) # checking for validation of 'LocaleName' and 'LocaleOptions' if not _check_key_localename(self.metadata): self.metadata['LocaleName'] = "%{name}" logger.warning('lost "LocaleName" keyword, use "%{name}" as default') # checking for validation of 'NoSetup', 'SetupOptions' and 'SourcePrefix' _check_key_setups(self.metadata) # checking for validation of 'NoFiles' if 'NoFiles' in self.metadata: _check_key_nofiles(self.metadata) # checking duplicate 'Files' items if 'Files' in self.metadata: self._check_dup_files(self.metadata['Files']) if "SubPackages" in self.metadata: for sp in self.metadata["SubPackages"]: if 'Files' in sp: self._check_dup_files(sp['Files']) # checking for validation of 'Configure and Builder' if 'Configure' in self.metadata: _check_key_configure(self.metadata) if 'Builder' in self.metadata: _check_key_builder(self.metadata) def _get_scm_latest_release(self): if "Archive" in self.metadata: archive = self.metadata['Archive'] if archive not in ('bzip2', 'gzip', 'xz'): archive = 'bzip2' else: archive = 'bzip2' if archive == 'bzip2': appendix = 'bz2' elif archive == 'xz': appendix = 'xz' else: appendix = 'gz' scm_url = self.metadata['SCM'] scm = GitAccess(scm_url) logger.info("Getting tags from SCM...") top = scm.get_toptag() if not top or top == self.version: # no need to fetch from SCM return logger.warning('Version in YAML shoud be updated according SCM tags') self.version = top self.metadata['Version'] = self.version pwd = os.getcwd() if os.path.exists("%s/%s-%s.tar.%s" %(pwd, self.pkg, self.version, appendix )): logger.info("Archive already exists, will not creating a new one") else: logger.info("Creating archive %s/%s-%s.tar.%s ..." % (pwd, self.pkg, self.version, appendix)) tmp = tempfile.mkdtemp() os.chdir(tmp) os.system('git clone %s' % scm_url) os.chdir( "%s/%s" %(tmp, self.pkg)) os.system(' git archive --format=tar --prefix=%s-%s/ %s | %s > %s/%s-%s.tar.%s' \ % (self.pkg, self.version, self.version, archive, pwd, self.pkg, self.version, appendix )) shutil.rmtree(tmp) os.chdir(pwd) def _download_sources(self): pkg = self.pkg rev = self.version sources = self.metadata['Sources'] for s in sources: if s.startswith('http://') or s.startswith('https://') or s.startswith('ftp://'): target = s.replace('%{name}', pkg) target = target.replace('%{version}', rev) f_name = os.path.basename(target) if os.path.isdir(f_name): logger.warning('Source file \'%s\' can not be downloaded, because directory with same name already exists.' % (f_name)) elif not os.path.isfile(f_name): answer = logger.ask('Need to download source package: %s ?' % f_name) if not answer: break logger.info('Downloading latest source package from: %s' % target) import glob import urlgrabber from urlgrabber.progress import text_progress_meter try: urlgrabber.urlgrab(target, f_name, progress_obj = text_progress_meter()) except urlgrabber.grabber.URLGrabError, e: if e.errno == 14: # HTTPError logger.warning('Invalid source URL \'%s\'' % (target)) # In error case the file most probably would not be valid, # thus we remove the invalid file. os.remove(f_name) else: raise e except KeyboardInterrupt: logger.info('Downloading is interrupted by ^C') else: # After download, asking to remove the possible old tarballs target = s.replace('%{name}', pkg) target = target.replace('%{version}', '*') globname = os.path.basename(target) for f in glob.glob(globname): if f == f_name: continue answer = logger.ask('Possible old source: %s, to delete it?' % f) if not answer: break try: os.remove(f) logger.info('%s Deleted!' % f) except OSError: logger.warning('Cannot delete %s' % f) def _analyze_source(self): def pc_files(members): for tarinfo in members: f = os.path.split(tarinfo.name)[1] xx = f.split(".pc.") if len(xx) > 1 and xx[1] == "in": extractfile buf = tarinfo.tobuf() tarball = None for uri in self.metadata['Sources']: fpath = os.path.basename(uri) fpath = fpath.replace('%{name}', self.pkg) fpath = fpath.replace('%{version}', self.version) if os.path.exists(fpath) and os.path.getsize(fpath): try: if tarfile.is_tarfile(fpath): tarball = fpath break except: logger.warning('Corrupt tarball %s found!' % fpath) pass prefix = None if tarball: tf = tarfile.open(tarball, 'r:*') for member in tf.getmembers(): if member.type == tarfile.DIRTYPE: prefix = member.name.rstrip('/') break #analyze_path = tempfile.mkdtemp(dir=os.getcwd(), prefix=".spectacle_") #tf.extractll(path=analyze_path, members=pc_files(tf)) for member in tf.getmembers(): f = os.path.split(member.name)[1] xx = f.split(".pc.") if len(xx) > 1 and xx[1] == "in": pc = tf.extractfile(member) # TODO tf.close() # confirm 'SourcePrefix' is valid if 'SourcePrefix' not in self.metadata and 'NoSetup' not in self.metadata: # setting the default value firstly self.metadata['SourcePrefix'] = '%{name}-%{version}' if not prefix or prefix == '.': # guess prefix from filename if tarball: if '.tar.' in tarball: prefix = os.path.basename(tarball).split('.tar.')[0] else: # strip the ext name prefix = os.path.splitext(tarball)[0] if prefix and prefix != '%s-%s' % (self.pkg, self.version): prefix = prefix.replace(self.pkg, '%{name}') prefix = prefix.replace(self.version, '%{version}') self.metadata['SourcePrefix'] = prefix def _parse_series(self): patches = [] comments = [] comment = '' for line in file(SERIES_PATH): if not line.strip(): continue if line.startswith('#'): comment += line else: line = line.strip() patches.append(line) comments.append(comment.rstrip()) comment = '' return patches, comments def _cleanup_boolkeys(self, items): """ clean up all boolean type keys, use the exists status to present bool value """ # for keys with default value FALSE for bopt in BOOLNO_KEYS: if bopt in items and not items[bopt]: del items[bopt] # for keys with default value TRUE for bopt in BOOLYES_KEYS: if bopt in items and not items[bopt]: del items[bopt] else: items[bopt] = True def _gen_auto_requires(self, metadata, extra, pkg_name = 'main'): auto_requires = { 'Lib': {'RequiresPost': ['/sbin/ldconfig'], 'RequiresPostUn': ['/sbin/ldconfig'], }, 'Icon': {'RequiresPost': ['/bin/touch', '%{_bindir}/gtk-update-icon-cache'], }, # BuildRequires doesn't support paths, thus this is mentioned as package. 'Desktop': {'PkgBR': ['desktop-file-utils'], }, 'DesktopDB': {'RequiresPost': ['%{_bindir}/update-desktop-database'], 'RequiresPostUn': ['%{_bindir}/update-desktop-database'], }, 'Info': {'RequiresPost': ['/sbin/install-info'], 'RequiresPostUn': ['/sbin/install-info'], }, 'Service': {'RequiresPost': ['/sbin/service', '/sbin/chkconfig'], 'RequiresPostUn': ['/sbin/service', '/sbin/chkconfig'], }, 'SystemdService': {'RequiresPost': ['systemd'], 'RequiresPreUn': ['systemd'], 'RequiresPostUn': ['systemd'], 'Requires': ['systemd'], }, 'Schema': {'RequiresPost': ['%{_bindir}/gconftool-2'], 'RequiresPreUn': ['%{_bindir}/gconftool-2'], 'RequiresPre': ['%{_bindir}/gconftool-2'], }, } for key,reqs in auto_requires.iteritems(): if extra[key]: for req,items in reqs.iteritems(): if req in metadata: for i in items: # e.g. GConf2 >= 0.14 yaml_reqs = map(lambda s: s.split()[0], metadata[req]) if i in yaml_reqs: if i in metadata[req]: logger.warning('duplicate item: %s for %s in package %s' % (i,req,pkg_name)) # else do nothing else: metadata[req].append(i) else: metadata[req] = items def parse(self): # customized int/float constructor for Loader of in PyYAML # to regard all numbers as plain string def _no_number(self, node): return str(self.construct_scalar(node)) yaml.Loader.add_constructor(u'tag:yaml.org,2002:int', _no_number) yaml.Loader.add_constructor(u'tag:yaml.org,2002:float', _no_number) # loading data from YAML try: self.metadata.update(yaml.load(self.stream)) except yaml.scanner.ScannerError, e: logger.error('syntax error found in yaml: %s' % str(e)) except yaml.parser.ParserError, e: logger.error('syntax error found in yaml: %s' % str(e)) except ValueError: logger.error('Please check if the input file is in YAML format') except TypeError: # empty can lead here logger.error('Empty yaml file: %s' % self.yaml_fpath) # verifying the sanity self.sanity_check() # for convenience self.pkg = self.metadata['Name'] self.version = self.metadata['Version'] try: self.release = self.metadata['Release'] except KeyError: logger.warning('"Release" not specified, use "1" as the default value') self.release = self.metadata['Release'] = '1' if not self.specfile: self.specfile = "%s.spec" % self.pkg self.newspec = True if "RpmLintIgnore" in self.metadata: rpmlintrc = "%s-rpmlintrc" %self.metadata['Name'] rpmlint = "from Config import *\n" for lint in self.metadata['RpmLintIgnore']: rpmlint = rpmlint + "addFilter(\"%s\")\n" %lint file = open(rpmlintrc, "w") file.write(rpmlint) file.close() # handling 'ExtraSources', extra separated files which need to be install # specific paths if "ExtraSources" in self.metadata: # confirm 'Sources' valid if 'Sources' not in self.metadata: self.metadata['Sources'] = [] extra_srcs = [] extra_install = '' count = len(self.metadata['Sources']) for extra_src in self.metadata['ExtraSources']: try: file, path = map(str.strip, extra_src.split(';')) except: file = extra_src.strip() path = '' self.extras_filelist.append(os.path.join(path, file)) extra_srcs.append(file) if path: extra_install += "mkdir -p %%{buildroot}%s\n" % (path) extra_install += "cp -a %%{SOURCE%s} %%{buildroot}%s\n" % (count, path) count = count + 1 self.metadata['Sources'].extend(extra_srcs) self.metadata['ExtraInstall'] = extra_install if self.download_new: if not self.skip_scm: # update to SCM latest release if "SCM" in self.metadata: self._get_scm_latest_release() # if no srcpkg with yaml.version exists in cwd, trying to download if 'Sources' in self.metadata: self._download_sources() if "Macros" in self.metadata: macros_parsed = {} for macro in self.metadata['Macros']: try: macro_name, macro_value = map(str.strip, macro.split(';')) except: logger.error('Invalid Macros entry "%s", should be "name;value"' % macro) macros_parsed[macro_name] = macro_value self.metadata['Macros'] = macros_parsed if "Macros2" in self.metadata: macros_parsed = {} for macro in self.metadata['Macros2']: try: macro_name, macro_value = map(str.strip, macro.split(';')) except: logger.error('Invalid Macros2 entry "%s", should be "name;value"' % macro) macros_parsed[macro_name] = macro_value self.metadata['Macros2'] = macros_parsed # handle patches with extra options if "Patches" in self.metadata: patches = self.metadata['Patches'] self.metadata['Patches'] = [] self.metadata['PatchOpts'] = [] for patch in patches: if isinstance(patch, str): self.metadata['Patches'].append(patch) self.metadata['PatchOpts'].append('-p1') elif isinstance(patch, dict): self.metadata['Patches'].append(patch.keys()[0]) self.metadata['PatchOpts'].append(patch.values()[0]) elif isinstance(patch, list): self.metadata['Patches'].append(patch[0]) self.metadata['PatchOpts'].append(' '.join(patch[1:])) # detect 'series.conf' in current dir if os.path.exists(SERIES_PATH): if "Patches" in self.metadata: logger.warning('Both "Patches" tag in yaml and series.conf exists, please use only one.') else: self.metadata['Patches'], self.metadata['PatchCmts'] = self._parse_series() if 'Sources' in self.metadata: self._analyze_source() # clean up all boolean type keys, use the exists status to present bool value self._cleanup_boolkeys(self.metadata) if "SubPackages" in self.metadata: for sp in self.metadata["SubPackages"]: self._cleanup_boolkeys(sp) # check duplicate default configopts dup = '--disable-static' if 'ConfigOptions' in self.metadata and dup in self.metadata['ConfigOptions']: logger.warning('found duplicate configure options: "%s", please remove it' % dup) self.metadata['ConfigOptions'].remove(dup) if not self.metadata['ConfigOptions']: del self.metadata['ConfigOptions'] # check duplicate requires for base package if "SubPackages" in self.metadata: if 'Epoch' in self.metadata: autodep = "%{name} = %{epoch}:%{version}-%{release}" else: autodep = "%{name} = %{version}-%{release}" for sp in self.metadata["SubPackages"]: if 'Requires' in sp and autodep in sp['Requires'] and 'AutoDepend' in sp: logger.warning('found duplicate Requires for %s in sub-pkg:%s, please remove it' %(autodep, sp['Name'])) sp['Requires'].remove(autodep) if not sp['Requires']: del sp['Requires'] # initialize extra flags for subpkgs if "SubPackages" in self.metadata: for sp in self.metadata["SubPackages"]: self.extra['subpkgs'][sp['Name']] = copy.deepcopy(self.extra_per_pkg) if "AutoSubPackages" in self.metadata: if not self.metadata.has_key('SubPackages'): self.metadata['SubPackages'] = [] for asp in self.metadata["AutoSubPackages"]: self.extra['subpkgs'][asp] = copy.deepcopy(self.extra_per_pkg) if self.asp_templates.has_key(asp): self.metadata['SubPackages'].append(self.asp_templates[asp]) # By default if the LocaleFilesPkgName isn't defined and we have # lang subpackage the .lang file is assigned to lang package. if asp == "lang" and not self.metadata.has_key('LocaleFilesPkgName'): self.metadata['LocaleFilesPkgName'] = asp else: unknown_asp_tmp = self.asp_templates['unknown'] unknown_asp_tmp['Name'] = asp self.metadata['SubPackages'].append(unknown_asp_tmp) # detect the using UI widget, QT or Gtk2 all_pkgbr = [] if 'PkgBR' in self.metadata: all_pkgbr += self.metadata['PkgBR'] if 'PkgConfigBR' in self.metadata: all_pkgbr += self.metadata['PkgConfigBR'] for br in all_pkgbr: if br.startswith('Qt'): self.uiwidget = 'Qt' if 'LocaleName' not in self.metadata and 'NoAutoLocale' not in self.metadata: # If LocaleName or NoAutoLocale isn't set lets search if there is 'intltool' build requirement # and set LocaleName to Name. if self.metadata.has_key("PkgBR"): for br in self.metadata['PkgBR']: if br == 'intltool': self.metadata['LocaleName'] = self.metadata['Name'] break """ NOTE we need NOT to do the following checking: * whether auto-added Requires(include pre/post/preun/postun) duplicated They should be checked by users manually. """ def _lookup_pkgmeta(self, pkgname): if pkgname == 'main': return self.metadata try: for sp in self.metadata['SubPackages']: if sp['Name'] == pkgname: return sp except KeyError: # Not a available subpackage for 'pkgname' return {} # not found return {} def parse_files(self, files): py_path_check = False if 'Builder' in self.metadata and self.metadata['Builder'] == 'python': py_path_check = True if 'BuildArch' in self.metadata and self.metadata['BuildArch'] == 'noarch': py_path = '%{python_sitelib}' else: py_path = '%{python_sitearch}' for pkg_name,v in files.iteritems(): pkg_meta = self._lookup_pkgmeta(pkg_name) if pkg_name == 'main': pkg_extra = self.extra else: pkg_extra = self.extra['subpkgs'][pkg_name] for l in v: # check and warn improper file path for prefix, macro in PATHMACROS: if l.startswith(prefix): logger.warning('for %%files line: "%s"\n' % (l,) +\ '\tplease use %s to replace the leading path %s' % (macro, prefix)) break if re.match('\s*%exclude\s.*', l): pass # not match anyting excluded files elif re.match('.*\.info\..*', l) or re.match('.*(usr/share/info|%{_infodir}).*info\..*$', l): p1 = re.compile('^%doc\s+(.*)') l1 = p1.sub(r'\1', l) pkg_extra['Infos'].append(l1) pkg_extra['Info'] = True elif re.match('.*(usr/share|%{_datadir})/applications/.*\.desktop$', l): if 'NoDesktop' not in self.metadata: # any pkg (main and every sub-pkg) will affect global settings self.extra['Desktop'] = True elif re.match('.*(/etc|%{_sysconfdir})/rc.d/init.d/.*', l) or \ re.match('.*(/etc|%{_sysconfdir})/init.d/.*', l) or \ re.match('.*%{_initddir}/.*', l) or \ re.match('.*%{_initrddir}/.*', l): # legacy init scripts pkg_extra['Service'] = True elif re.match('^/(lib|%{_lib})/systemd/system/[^/*]*.service$', l): # new service for systemd if 'NoSystemdService' not in self.metadata: pkg_extra['SystemdService'] = True service = l.split('systemd/system/')[-1] if service not in pkg_extra['SystemdServices']: pkg_extra['SystemdServices'].append(service) elif re.match('.*(%{_libdir}|%{_lib}|/lib|/usr/lib)/[^/]*[.*?]+so([.*?]+.*$|$)', l) or \ re.match('.*(/ld.so.conf.d/).*', l): if pkg_name != 'devel' and not pkg_name.endswith('-devel'): # 'devel' sub pkgs should not set Lib flags pkg_extra['Lib'] = True elif re.match('.*(%{_libdir}|%{_lib}).*', l) and re.match('.*\.a$', l): # if *.a found, set 'HasStatic' flag for MAIN pkg self.extra['HasStatic'] = True elif re.match('.*\.schema.*', l): comp = l.split() if len(comp) > 1: l = comp[1] pkg_extra['Schema'] = True pkg_extra['Schemas'].append(l) elif re.match('.*\/icons\/.*', l): if 'NoIconCache' in pkg_meta and pkg_meta['NoIconCache'] == True: # using "NoIconCache" to avoid cache explicitly continue if self.uiwidget and self.uiwidget == 'Qt': # disable icon files handling for Qt based app continue pkg_extra['Icon'] = True # special checking for python packages if py_path_check: if '%{python_sitelib}' in l or '%{python_sitearch}' in l: if py_path not in l: logger.error('please use %s in %%files to specify module installation path' % py_path) # check whether need to update desktop database if 'UpdateDesktopDB' in self.metadata: self.extra['DesktopDB'] = True if self.extra['Desktop'] != True: logger.warning('"UpdateDesktopDB" specified but found no desktop files') def parse_existing(self, spec_fpath): sin = re.compile("^# >> ([^\s]+)\s*(.*)") sout = re.compile("^# << ([^\s]+)\s*(.*)") version = None # temp vars recording = [] record = False files = {} install = {} build = {} macros = {} # macros added after Name: field in .spec macros2 = {} # macros added before %prep section in .spec setup = {} pre = {} preun = {} post = {} postun = {} check = {} # extra headers line_num = 0 for i in file(spec_fpath): line_num += 1 i = i.strip() if line_num < 4: if line_num == 3: m = re.match("^#.*spectacle version (\S+)$", i) if m: version = m.group(1) spec_ver = _V(version) cur_ver = _V(__version__.VERSION) if cur_ver < spec_ver: logger.warning('!!! Current spectacle version is lower than the one used for this package previously') default_answer = False if self.configs: old_spectacle_ok = get_config(self.configs,'boolean','old_spectacle_ok') if old_spectacle_ok is not None: default_answer = old_spectacle_ok answer = logger.ask('Please upgrade your spectacle, continue?', default_answer) if not answer: sys.exit(1) else: answer = logger.ask('Existing spec file was not generated by spectacle, continue?', False) if not answer: sys.exit(1) matchin = sin.match(i) matchout = sout.match(i) if matchin: if record: logger.error('%s:%d "%s %s" placeholder starting without ending previous %s:%d "%s %s"' % (spec_fpath, line_num, matchin.group(1), matchin.group(2), spec_fpath, start_line_num, ingroup1, ingroup2) ) record = True recording = [] ingroup1 = matchin.group(1) ingroup2 = matchin.group(2) start_line_num = line_num continue if matchout: if not record: logger.error('%s:%d "%s %s" placeholder ending whithout starting' % (spec_fpath, line_num, matchout.group(1), matchout.group(2))) record = False if matchout.group(1) != ingroup1 or matchout.group(2) != ingroup2 : logger.error('%s:%d "%s %s" placeholder ending not match starting %s:%d "%s %s"' % (spec_fpath, line_num, matchout.group(1), matchout.group(2),spec_fpath, start_line_num, ingroup1, ingroup2)) if not recording: continue # empty if matchout.group(2) and matchout.group(1) in ["files", "post","postun", "pre", "preun"]: if not matchout.group(2) in self.extra['subpkgs']: logger.error('In %s:%d %s section for lost sub-package: %s. Please fix it and try again.' % (spec_fpath, line_num, matchout.group(1), matchout.group(2))) if matchout.group(1) == "files": if matchout.group(2): if matchout.group(2) in files: logger.error('%s:%d two files %s section.' % (spec_fpath, line_num,matchout.group(2))) files[matchout.group(2)] = recording else: if 'main' in files: logger.error('%s:%d two files section.' % (spec_fpath, line_num)) files['main'] = recording elif matchout.group(1) == "post": if matchout.group(2): if matchout.group(2) in post: logger.error('%s:%d two post %s section.' % (spec_fpath, line_num,matchout.group(2))) post[matchout.group(2)] = recording else: if 'main' in post: logger.error('%s:%d two post section.' % (spec_fpath, line_num)) post['main'] = recording elif matchout.group(1) == "postun": if matchout.group(2): if matchout.group(2) in postun: logger.error('%s:%d two postun %s section.' % (spec_fpath, line_num,matchout.group(2))) postun[matchout.group(2)] = recording else: if 'main' in postun: logger.error('%s:%d two postun section.' % (spec_fpath, line_num)) postun['main'] = recording elif matchout.group(1) == "pre": if matchout.group(2): if matchout.group(2) in pre: logger.error('%s:%d two pre %s section.' % (spec_fpath, line_num,matchout.group(2))) pre[matchout.group(2)] = recording else: if 'main' in pre: logger.error('%s:%d two pre section.' % (spec_fpath, line_num)) pre['main'] = recording elif matchout.group(1) == "preun": if matchout.group(2): if matchout.group(2) in preun: logger.error('%s:%d two preun %s section.' % (spec_fpath, line_num,matchout.group(2))) preun[matchout.group(2)] = recording else: if 'main' in preun: logger.error('%s:%d two preun section.' % (spec_fpath, line_num)) preun['main'] = recording elif matchout.group(1) == "install": if matchout.group(2) in install: logger.error('%s:%d two install %s section.' % (spec_fpath, line_num,matchout.group(2))) install[matchout.group(2)] = recording elif matchout.group(1) == "build": if 'main' in build: logger.error('%s:%d two build section.' % (spec_fpath, line_num)) build[matchout.group(2)] = recording elif matchout.group(1) == "macros": if 'main' in macros: logger.error('%s:%d two macros section.' % (spec_fpath, line_num)) macros['main'] = recording elif matchout.group(1) == "macros2": if 'main' in macros2: logger.error('%s:%d two macros2 section.' % (spec_fpath, line_num)) macros2['main'] = recording elif matchout.group(1) == "setup": if 'main' in setup: logger.error('%s:%d two setup section.' % (spec_fpath, line_num)) setup['main'] = recording elif matchout.group(1) == "check" or \ matchout.group(1) == "check_scriptlets": #TODO, remove it whenever cleanup if 'main' in check: logger.error('%s:%d two check section.' % (spec_fpath, line_num)) check['main'] = recording else: logger.error('%s:%d unknown section.' % (spec_fpath, line_num)) if record: recording.append(i) if record: logger.error('%s:%d "%s %s" placeholder starting without ending' % (spec_fpath, start_line_num, ingroup1, ingroup2)) content= { "files" : files, "install": install, "build" : build, } if macros: content["macros"] = macros if macros2: content["macros2"] = macros2 if setup: content["setup"] = setup if post: content["post"] = post if postun: content["postun"] = postun if pre: content["pre"] = pre if preun: content["preun"] = preun if check and 'Check' in self.metadata: content["check"] = check # checking whether both 'Files' key and inline files exists if files: files_yaml = False if 'Files' in self.metadata and self.metadata['Files']: files_yaml = True elif 'SubPackages' in self.metadata: for spkg in self.metadata['SubPackages']: if 'Files' in spkg: files_yaml = True break if files_yaml: logger.warning('both "Files" keyword and inline %file content in spec present') # try to remove duplicate '%defattr' in files list for key in content['files']: self._check_dup_files(content['files'][key]) # checking duplicate 'rm -rf %{buildroot}' re_cleanup = re.compile('^(?:rm|\%\{__rm\})\W+-rf\W+(?:\$RPM_BUILD_ROOT|\%\{buildroot\})/?$') if 'install' in content and 'post' in content['install']: if re_cleanup.match(content['install']['post'][0]): logger.warning('duplicate buildroot cleanup found in the first line of install_post, remove it') return content def process(self, extra_content): """ Read in old spec and record all customized stuff, And auto-detect extra infos from %files list """ # backup old spec file if needed if os.path.exists(self.specfile): if self.clean_old: # backup original file backdir = 'spec.backup' try: os.mkdir(backdir) except: pass bak_spec_fpath = os.path.join(backdir, self.specfile) if os.path.exists(bak_spec_fpath): answer = logger.ask('%s will be overwritten by the backup, continue?' % bak_spec_fpath) if not answer: sys.exit(1) logger.info('Old spec file is saved as "%s"' % bak_spec_fpath) os.rename(self.specfile, bak_spec_fpath) else: self.newspec = False specfile = self.specfile if not self.newspec: self.extra['content'] = self.parse_existing(specfile) if extra_content: self.extra['content'].update(extra_content) if 'files' in self.extra['content']: files = copy.deepcopy(self.extra['content']['files']) else: files = {} if 'Files' in self.metadata: if 'main' in files: files['main'] += self.metadata['Files'] else: files['main'] = self.metadata['Files'] if "SubPackages" in self.metadata: for sp in self.metadata["SubPackages"]: if 'Files' in sp: if sp['Name'] in files: files[sp['Name']] += sp['Files'] else: files[sp['Name']] = sp['Files'] self.parse_files(files) # adding automatic requires according %files self._gen_auto_requires(self.metadata, self.extra) if "SubPackages" in self.metadata: for sp in self.metadata["SubPackages"]: self._gen_auto_requires(sp, self.extra['subpkgs'][sp['Name']], sp['Name']) # check duplicate 'ldconfig' in %post/%postun # actually, all auto generated scripts in %post like sections should be checked # for duplicate issue, but it's not nice to do that according current design. # But for 'ldconfig', there're too many issues with it, the following code # is just a workaround to fix them. self._check_dup_ldconfig() if "SubPackages" in self.metadata: for sp in self.metadata["SubPackages"]: self._check_dup_ldconfig(sp['Name']) # check duplicate other auto-scriptlets in %post/%postun self._check_dup_scriptlets() if "SubPackages" in self.metadata: for sp in self.metadata["SubPackages"]: self._check_dup_scriptlets(sp['Name']) spec_content = spec.spec(searchList=[{ 'metadata': self.metadata, 'extra': self.extra, 'arch_split': arch_split }]).respond() file = open(specfile, "w") file.write(spec_content.encode('utf-8')) file.close() def generate_rpm(yaml_fpath, clean_old = False, extra_content = None, spec_fpath=None, download_new=True, skip_scm=False): rpm_writer = RPMWriter(yaml_fpath, spec_fpath, clean_old, download_new, skip_scm) rpm_writer.parse() rpm_writer.process(extra_content) return rpm_writer.specfile, rpm_writer.newspec spectacle-0.25/spectacle/spectacle.conf.tmpl0000644002342000234200000000030312502671637017350 0ustar rzrrzr[Main] # If this is set to True the default behaviour will change # so that files will be overridden even if the spectacle # currently used is older. # # Default: no # old_spectacle_ok = no spectacle-0.25/spectacle/vercmp.py0000644002342000234200000000744412502671637015446 0ustar rzrrzr#!/usr/bin/python -tt # vim: ai ts=4 sts=4 et sw=4 # Copyright (c) 2009 Intel Corporation # # 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; version 2 of the License # # 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, write to the Free Software Foundation, Inc., 59 # Temple Place - Suite 330, Boston, MA 02111-1307, USA. import re import string from types import StringType import distutils.version class FairVersion(distutils.version.LooseVersion): """ Version schemes based on LooseVersion in distutils.version, but with more comparison rules to meet the expect result. For instance, the 'git', 'rc', 'svn', 'beta' alphabetic components means "pre-release" tags, and other additional non-numberic identifiers means "post-release" tags. In the version comparison of the versions with extra tags, this rule will be applied: "pre-release" version < release version < "post-release" version e.g.: 1.1.0git < 1.1.0 < 1.1.1 < 1.1.1-meego It can hardly cover all the special cases, but if the version string can follow the packaging guideline of MeeGo, this class is useful enough. """ pre_tags = ('git', 'svn', 'cvs', 'alpha', 'a', 'beta', 'b', 'rc') def parse (self, vstring): self.vstring = vstring components = filter(lambda x: x and x != '.', self.component_re.split(vstring)) numbers = [] extras = [] for part in components: if not extras: try: numbers.append(int(part)) except ValueError: extras.append(part) else: extras.append(part) self.version = numbers self.extra_tags = extras def __repr__ (self): return "FairVersion ('%s')" % str(self) def __cmp__ (self, other): if isinstance(other, StringType): other = FairVersion(other) res = cmp(self.version, other.version) if res == 0: # need to consider the extra tags in if not self.extra_tags and not other.extra_tags: return 0 self_pre = None self_post = None oth_pre = None oth_post = None if self.extra_tags: if self.extra_tags[0] in self.pre_tags: self_pre = True else: self_post = True if other.extra_tags: if other.extra_tags[0] in self.pre_tags: oth_pre = True else: oth_post = True if (self_pre and oth_pre) or (self_post and oth_post): return cmp(self.extra_tags, other.extra_tags) elif self_pre and not oth_pre: return -1 elif oth_post: return -1 elif oth_pre or self_post: return 1 # must not reach here!! raise ValueError() else: return res if __name__ == '__main__': # test cases import pprint vers = ['1.1.0', '1.1', '1.0', '1.1git', '1.1-meego', '1.1.0git', '1.1.0meego1', '1.1.0meego2', '1.1.0.1', '1.1.1'] fvers = [FairVersion(v) for v in vers] fvers.sort() pprint.pprint(fvers) spectacle-0.25/tests/alltest.py0000755002342000234200000000175612502671637015024 0ustar rzrrzr#!/usr/bin/python -tt # vim: ai ts=4 sts=4 et sw=4 # Copyright (c) 2009 Intel Corporation # # 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; version 2 of the License # # 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, write to the Free Software Foundation, Inc., 59 # Temple Place - Suite 330, Boston, MA 02111-1307, USA. import unittest import test_specify def main(): suite = unittest.TestSuite(( test_specify.suite(), )) unittest.TextTestRunner(verbosity=2).run(suite) if __name__ == '__main__': main() spectacle-0.25/tests/cleanup.sh0000755002342000234200000000017412502671637014756 0ustar rzrrzr#!/bin/sh find . -name '*.pyc' -exec rm -f {} \; 2>/dev/null find . -name tmp-files -type d -exec rm -rf {} \; 2>/dev/null spectacle-0.25/tests/fixcase.sh0000755002342000234200000000154212502671637014751 0ustar rzrrzr#!/bin/sh if [ $# -lt 1 ]; then echo 'Usage fixcase.sh ' exit 1 fi CaseName=$1 cd test-${CaseName} || exit 0 cp ../base/testpkg.yaml . specify -N -n -o output.spec testpkg.yaml 1>output.1.o 2>output.2.o mv output.spec output.orig.spec patch < input.p specify -N -n -o output.spec testpkg.yaml 1>output.1 2>output.2 if [ -f output.spec ]; then diff -upN output.orig.spec output.spec > output.p if [ $? != 0 ]; then echo 'Output diff:' cat output.p else rm -f output.p fi else rm -f output.p touch output.no fi diff -upN output.1.o output.1 > output.1p if [ $? != 0 ]; then echo 'Stdout diff:' cat output.1p else rm -f output.1p fi diff -upN output.2.o output.2 > output.2p if [ $? != 0 ]; then echo 'Stderr diff:' cat output.2p else rm -f output.2p fi mkdir -p tmp-files mv -f *.yaml *.spec *.[12o] tmp-files spectacle-0.25/tests/gencase.sh0000755002342000234200000000170212502671637014732 0ustar rzrrzr#!/bin/sh if [ $# -lt 1 ]; then echo 'Usage gencase.sh ' exit 1 fi CaseName=$1 mkdir test-${CaseName} cd test-${CaseName} cp ../base/testpkg.yaml . specify -N -n -o output.spec testpkg.yaml 1>output.1.o 2>output.2.o vi testpkg.yaml diff -upN ../base/testpkg.yaml testpkg.yaml > input.p mv output.spec output.orig.spec specify -N -n -o output.spec testpkg.yaml 1>output.1 2>output.2 echo 'Input diff:' cat input.p if [ -f output.spec ]; then diff -upN output.orig.spec output.spec > output.p if [ $? != 0 ]; then echo 'Output diff:' cat output.p else rm -f output.p fi else rm -f output.p touch output.no fi diff -upN output.1.o output.1 > output.1p if [ $? != 0 ]; then echo 'Stdout diff:' cat output.1p else rm -f output.1p fi diff -upN output.2.o output.2 > output.2p if [ $? != 0 ]; then echo 'Stderr diff:' cat output.2p else rm -f output.2p fi mkdir tmp-files mv -f *.yaml *.spec *.[12o] tmp-files spectacle-0.25/tests/specify_cases/base/testpkg.yaml0000644002342000234200000000116012502671637021063 0ustar rzrrzrName: testpkg Summary: Sample package for spectacle testings Version: 1.0 Release: 1 Group: System/Base License: BSD URL: http://www.testpkg.org/ Sources: - http://www.testpkg.org/testpkg-%{version}.tar.gz Description: | Sample package for spectacle testings, which will be used as the base of all testings. In this YAML file, only basic keywords specified, plus with one sub package "devel". Configure: none Builder: none SubPackages: - Name: devel Summary: Development files for %{name} Group: Development/Libraries Description: This package contains development files for %{name}. spectacle-0.25/tests/specify_cases/test-NonASCII_string/input.p0000644002342000234200000000060712502671637022777 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-15 12:26:52.000000000 +0800 +++ testpkg.yaml 2010-07-23 11:14:51.021468437 +0800 @@ -11,6 +11,7 @@ Description: | Sample package for spectacle testings, which will be used as the base of all testings. In this YAML file, only basic keywords specified, plus with one sub package "devel". + Author: ä¸å»ºå³° Configure: none Builder: none spectacle-0.25/tests/specify_cases/test-NonASCII_string/output.p0000644002342000234200000000054012502671637023174 0ustar rzrrzr--- output.orig.spec 2010-07-23 11:13:30.382083701 +0800 +++ output.spec 2010-07-23 11:14:51.172407798 +0800 @@ -20,6 +20,7 @@ Source100: testpkg.yaml Sample package for spectacle testings, which will be used as the base of all testings. In this YAML file, only basic keywords specified, plus with one sub package "devel". +Author: ä¸å»ºå³° spectacle-0.25/tests/specify_cases/test-autolocale_intltool/input.p0000644002342000234200000000036012502671637024156 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-15 12:26:52.000000000 +0800 +++ testpkg.yaml 2010-03-18 16:07:06.000000000 +0800 @@ -14,6 +14,8 @@ Description: | Configure: none Builder: none +PkgBR: + - intltool SubPackages: - Name: devel spectacle-0.25/tests/specify_cases/test-autolocale_intltool/output.p0000644002342000234200000000075512502671637024367 0ustar rzrrzr--- output.orig.spec 2012-02-24 13:40:31.580141904 +0200 +++ output.spec 2012-02-24 13:40:31.755145845 +0200 @@ -16,6 +16,7 @@ License: BSD URL: http://www.testpkg.org/ Source0: http://www.testpkg.org/testpkg-%{version}.tar.gz Source100: testpkg.yaml +BuildRequires: intltool %description @@ -57,8 +58,9 @@ rm -rf %{buildroot} # >> install post # << install post +%find_lang testpkg -%files +%files -f testpkg.lang %defattr(-,root,root,-) # >> files # << files spectacle-0.25/tests/specify_cases/test-builder_cmake/input.p0000644002342000234200000000054112502671637022671 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-15 12:26:52.000000000 +0800 +++ testpkg.yaml 2010-07-23 11:16:29.493919869 +0800 @@ -12,8 +12,7 @@ Description: | the base of all testings. In this YAML file, only basic keywords specified, plus with one sub package "devel". -Configure: none -Builder: none +Builder: cmake SubPackages: - Name: devel spectacle-0.25/tests/specify_cases/test-builder_cmake/output.p0000644002342000234200000000127712502671637023101 0ustar rzrrzr--- output.orig.spec 2012-05-29 18:36:31.785887769 +0300 +++ output.spec 2012-05-29 18:36:32.393890788 +0300 @@ -16,6 +16,7 @@ License: BSD URL: http://www.testpkg.org/ Source0: http://www.testpkg.org/testpkg-%{version}.tar.gz Source100: testpkg.yaml +BuildRequires: cmake %description Sample package for spectacle testings, which will be used as @@ -42,7 +43,8 @@ This package contains development files # >> build pre # << build pre - +%cmake . +make %{?jobs:-j%jobs} # >> build post # << build post @@ -51,6 +53,7 @@ This package contains development files rm -rf %{buildroot} # >> install pre # << install pre +%make_install # >> install post # << install post spectacle-0.25/tests/specify_cases/test-builder_default/input.p0000644002342000234200000000041312502671637023233 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-09 17:48:35.000000000 +0800 +++ testpkg.yaml 2010-03-11 23:37:30.000000000 +0800 @@ -13,7 +13,6 @@ Description: | specified, plus with one sub package "devel". Configure: none -Builder: none SubPackages: - Name: devel spectacle-0.25/tests/specify_cases/test-builder_default/output.p0000644002342000234200000000064212502671637023440 0ustar rzrrzr--- output.orig.spec 2010-06-21 16:39:53.000000000 +0800 +++ output.spec 2010-06-21 16:39:53.000000000 +0800 @@ -43,6 +43,7 @@ This package contains development files # << build pre +make %{?jobs:-j%jobs} # >> build post # << build post @@ -50,6 +51,7 @@ This package contains development files rm -rf %{buildroot} # >> install pre # << install pre +%make_install # >> install post # << install post spectacle-0.25/tests/specify_cases/test-builder_perl/input.p0000644002342000234200000000043212502671637022552 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-09 17:48:35.000000000 +0800 +++ testpkg.yaml 2010-03-11 23:39:12.000000000 +0800 @@ -13,7 +13,7 @@ Description: | specified, plus with one sub package "devel". Configure: none -Builder: none +Builder: perl SubPackages: - Name: devel spectacle-0.25/tests/specify_cases/test-builder_perl/output.p0000644002342000234200000000230712502671637022756 0ustar rzrrzr--- output.orig.spec 2010-03-17 21:15:02.000000000 +0800 +++ output.spec 2010-03-17 21:15:02.000000000 +0800 @@ -14,6 +14,7 @@ License: BSD URL: http://www.testpkg.org/ Source0: http://www.testpkg.org/testpkg-%{version}.tar.gz Source100: testpkg.yaml +Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) %description Sample package for spectacle testings, which will be used as @@ -41,7 +42,13 @@ This package contains development files # >> build pre # << build pre - +if test -f Makefile.PL; then +%{__perl} Makefile.PL INSTALLDIRS=vendor +make %{?jobs:-j%jobs} +else +%{__perl} Build.PL --installdirs vendor +./Build +fi # >> build post # << build post @@ -49,6 +56,15 @@ This package contains development files rm -rf %{buildroot} # >> install pre # << install pre +if test -f Makefile.PL; then +make pure_install PERL_INSTALL_ROOT=%{buildroot} +else +./Build install --installdirs vendor +fi +find %{buildroot} -type f -name .packlist -exec rm -f {} ';' +find %{buildroot} -depth -type d -exec rmdir {} 2>/dev/null ';' +find %{buildroot} -type f -name '*.bs' -empty -exec rm -f {} ';' +%{_fixperms} %{buildroot}/* # >> install post # << install post spectacle-0.25/tests/specify_cases/test-builder_python/input.p0000644002342000234200000000043412502671637023133 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-09 17:48:35.000000000 +0800 +++ testpkg.yaml 2010-03-11 23:39:01.000000000 +0800 @@ -13,7 +13,7 @@ Description: | specified, plus with one sub package "devel". Configure: none -Builder: none +Builder: python SubPackages: - Name: devel spectacle-0.25/tests/specify_cases/test-builder_python/output.p0000644002342000234200000000142412502671637023334 0ustar rzrrzr--- output.orig.spec 2012-02-24 13:22:54.127297702 +0200 +++ output.spec 2012-02-24 13:22:54.296301532 +0200 @@ -8,6 +8,7 @@ Name: testpkg # >> macros # << macros +%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} Summary: Sample package for spectacle testings Version: 1.0 Release: 1 @@ -43,7 +44,7 @@ This package contains development files # >> build pre # << build pre - +CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build # >> build post # << build post @@ -51,6 +52,7 @@ This package contains development files rm -rf %{buildroot} # >> install pre # << install pre +%{__python} setup.py install --root=%{buildroot} -O1 # >> install post # << install post spectacle-0.25/tests/specify_cases/test-builder_qmake/input.p0000644002342000234200000000043312502671637022707 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-09 17:48:35.000000000 +0800 +++ testpkg.yaml 2010-03-10 23:59:17.000000000 +0800 @@ -13,7 +13,7 @@ Description: | specified, plus with one sub package "devel". Configure: none -Builder: none +Builder: qmake SubPackages: - Name: devel spectacle-0.25/tests/specify_cases/test-builder_qmake/output.p0000644002342000234200000000067212502671637023115 0ustar rzrrzr--- output.orig.spec 2010-09-17 10:54:29.816399316 +0800 +++ output.spec 2010-09-17 10:54:32.033206436 +0800 @@ -42,7 +42,9 @@ This package contains development files # >> build pre # << build pre +%qmake +make %{?jobs:-j%jobs} # >> build post # << build post @@ -50,6 +52,7 @@ This package contains development files rm -rf %{buildroot} # >> install pre # << install pre +%qmake_install # >> install post # << install post spectacle-0.25/tests/specify_cases/test-builder_qmake_multidistros/input.p0000644002342000234200000000057312502671637025536 0ustar rzrrzr--- ../base/testpkg.yaml 2010-09-07 11:40:02.000000000 +0800 +++ testpkg.yaml 2010-09-14 16:16:34.549150340 +0800 @@ -12,8 +12,8 @@ Description: | the base of all testings. In this YAML file, only basic keywords specified, plus with one sub package "devel". -Configure: none -Builder: none +Builder: qmake +SupportOtherDistros: yes SubPackages: - Name: devel spectacle-0.25/tests/specify_cases/test-builder_qmake_multidistros/output.p0000644002342000234200000000176512502671637025743 0ustar rzrrzr--- output.orig.spec 2012-02-24 13:44:49.778954613 +0200 +++ output.spec 2012-02-24 13:44:49.947958417 +0200 @@ -16,6 +16,7 @@ License: BSD URL: http://www.testpkg.org/ Source0: http://www.testpkg.org/testpkg-%{version}.tar.gz Source100: testpkg.yaml +BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -44,15 +45,32 @@ This package contains development files # >> build pre # << build pre +%if 0%{?moblin_version} +%qmake +%else +qmake -makefile -nocache \ + "QMAKE_CFLAGS_RELEASE=${CFLAGS:-%optflags}" \ + "QMAKE_CFLAGS_DEBUG=${CFLAGS:-%optflags}" \ + "QMAKE_CXXFLAGS_RELEASE=${CXXFLAGS:-%optflags}" \ + "QMAKE_CXXFLAGS_DEBUG=${CXXFLAGS:-%optflags}" \ + QMAKE_STRIP=: \ + PREFIX=%{_prefix} +%endif +make %{?jobs:-j%jobs} # >> build post # << build post %install -rm -rf %{buildroot} +rm -rf $RPM_BUILD_ROOT # >> install pre # << install pre +%if 0%{?moblin_version} +%qmake_install +%else +%makeinstall +%endif # >> install post # << install post spectacle-0.25/tests/specify_cases/test-builder_single_make/input.p0000644002342000234200000000057512502671637024076 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-09 17:48:35.000000000 +0800 +++ testpkg.yaml 2010-03-11 23:38:36.000000000 +0800 @@ -12,8 +12,8 @@ Description: | the base of all testings. In this YAML file, only basic keywords specified, plus with one sub package "devel". -Configure: none -Builder: none +Configure: configure +Builder: single-make SubPackages: - Name: devel spectacle-0.25/tests/specify_cases/test-builder_single_make/output.p0000644002342000234200000000067612502671637024301 0ustar rzrrzr--- output.orig.spec 2010-06-21 16:42:01.000000000 +0800 +++ output.spec 2010-06-21 16:42:01.000000000 +0800 @@ -42,7 +42,8 @@ This package contains development files # >> build pre # << build pre - +%configure --disable-static +make # >> build post # << build post @@ -50,6 +51,7 @@ This package contains development files rm -rf %{buildroot} # >> install pre # << install pre +%make_install # >> install post # << install post spectacle-0.25/tests/specify_cases/test-builder_without_configure/input.p0000644002342000234200000000043212502671637025354 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-09 17:48:35.000000000 +0800 +++ testpkg.yaml 2010-03-11 23:37:57.000000000 +0800 @@ -13,7 +13,7 @@ Description: | specified, plus with one sub package "devel". Configure: none -Builder: none +Builder: make SubPackages: - Name: devel spectacle-0.25/tests/specify_cases/test-builder_without_configure/output.p0000644002342000234200000000064212502671637025560 0ustar rzrrzr--- output.orig.spec 2010-06-21 16:40:59.000000000 +0800 +++ output.spec 2010-06-21 16:40:59.000000000 +0800 @@ -43,6 +43,7 @@ This package contains development files # << build pre +make %{?jobs:-j%jobs} # >> build post # << build post @@ -50,6 +51,7 @@ This package contains development files rm -rf %{buildroot} # >> install pre # << install pre +%make_install # >> install post # << install post spectacle-0.25/tests/specify_cases/test-checking_dropped_keys/input.p0000644002342000234200000000044612502671637024432 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-15 12:26:52.000000000 +0800 +++ testpkg.yaml 2010-03-15 15:47:50.000000000 +0800 @@ -14,6 +14,11 @@ Description: | Configure: none Builder: none +Documents: + - README + - DOC +PostScripts: | + # scripts in %post SubPackages: - Name: devel spectacle-0.25/tests/specify_cases/test-checking_dropped_keys/output.2p0000644002342000234200000000056412502671637024716 0ustar rzrrzr--- output.2.o 2012-07-02 15:35:02.519573626 +0300 +++ output.2 2012-07-02 15:35:02.629573629 +0300 @@ -1 +1,3 @@ +Warning: Deprecated key: PostScripts found, please use other valid keys +Warning: Deprecated key: Documents found, please use other valid keys Warning: NEW spec file created: output.spec, maybe customized spec content is needed! spectacle-0.25/tests/specify_cases/test-checking_dropped_keys/output.p0000644002342000234200000000034712502671637024633 0ustar rzrrzr--- output.orig.spec 2012-07-02 15:35:02.519573626 +0300 +++ output.spec 2012-07-02 15:35:02.629573629 +0300 @@ -58,6 +58,8 @@ rm -rf %{buildroot} %files %defattr(-,root,root,-) +%doc README +%doc DOC # >> files # << files spectacle-0.25/tests/specify_cases/test-checking_empty_keys/input.p0000644002342000234200000000065512502671637024135 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-15 12:26:52.000000000 +0800 +++ testpkg.yaml 2010-03-17 21:34:05.000000000 +0800 @@ -4,7 +4,7 @@ Version: 1.0 Release: 1 Group: System/Base License: BSD -URL: http://www.testpkg.org/ +URL: Sources: - http://www.testpkg.org/testpkg-%{version}.tar.gz Description: | @@ -14,6 +14,9 @@ Description: | Configure: none Builder: none +Patches: +Check: + SubPackages: - Name: devel spectacle-0.25/tests/specify_cases/test-checking_empty_keys/output.2p0000644002342000234200000000044312502671637024413 0ustar rzrrzr--- output.2.o 2012-07-02 15:35:02.751573632 +0300 +++ output.2 2012-07-02 15:35:02.869573635 +0300 @@ -1 +1,2 @@ +Warning: Please remove empty keys in main package: Patches, URL, Check Warning: NEW spec file created: output.spec, maybe customized spec content is needed! spectacle-0.25/tests/specify_cases/test-checking_empty_keys/output.p0000644002342000234200000000050712502671637024332 0ustar rzrrzr--- output.orig.spec 2012-07-02 15:35:02.751573632 +0300 +++ output.spec 2012-07-02 15:35:02.869573635 +0300 @@ -13,7 +13,6 @@ Version: 1.0 Release: 1 Group: System/Base License: BSD -URL: http://www.testpkg.org/ Source0: http://www.testpkg.org/testpkg-%{version}.tar.gz Source100: testpkg.yaml spectacle-0.25/tests/specify_cases/test-checking_ignored_configure/input.p0000644002342000234200000000057012502671637025430 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-15 12:26:52.000000000 +0800 +++ testpkg.yaml 2010-07-23 11:18:54.291407470 +0800 @@ -12,8 +12,8 @@ Description: | the base of all testings. In this YAML file, only basic keywords specified, plus with one sub package "devel". -Configure: none -Builder: none +Configure: configure +Builder: python SubPackages: - Name: devel spectacle-0.25/tests/specify_cases/test-checking_ignored_configure/output.2p0000644002342000234200000000044012502671637025707 0ustar rzrrzr--- output.2.o 2012-07-02 15:35:02.996573639 +0300 +++ output.2 2012-07-02 15:35:03.108573642 +0300 @@ -1 +1,2 @@ +Warning: "python" need no "Configure" setting which will be ignored Warning: NEW spec file created: output.spec, maybe customized spec content is needed! spectacle-0.25/tests/specify_cases/test-checking_ignored_configure/output.p0000644002342000234200000000142212502671637025626 0ustar rzrrzr--- output.orig.spec 2012-07-02 15:35:02.996573639 +0300 +++ output.spec 2012-07-02 15:35:03.108573642 +0300 @@ -8,6 +8,7 @@ Name: testpkg # >> macros # << macros +%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} Summary: Sample package for spectacle testings Version: 1.0 Release: 1 @@ -42,7 +43,7 @@ This package contains development files # >> build pre # << build pre - +CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build # >> build post # << build post @@ -51,6 +52,7 @@ This package contains development files rm -rf %{buildroot} # >> install pre # << install pre +%{__python} setup.py install --root=%{buildroot} -O1 # >> install post # << install post spectacle-0.25/tests/specify_cases/test-checking_invalid_archnamespace/input.p0000644002342000234200000000066612502671637026246 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-15 12:26:52.000000000 +0800 +++ testpkg.yaml 2010-03-30 17:18:27.000000000 +0800 @@ -11,6 +11,11 @@ Description: | Sample package for spectacle testings, which will be used as the base of all testings. In this YAML file, only basic keywords specified, plus with one sub package "devel". +Requires: + - ppc:ppc-pkg + +PkgBR: + - sparc:sparc-pkg-devel Configure: none Builder: none spectacle-0.25/tests/specify_cases/test-checking_invalid_archnamespace/output.2p0000644002342000234200000000052312502671637026521 0ustar rzrrzr--- output.2.o 2012-07-02 15:35:03.231573645 +0300 +++ output.2 2012-07-02 15:35:03.346573648 +0300 @@ -1 +1,3 @@ +Warning: unsupport arch namespace: ppc in key Requires +Warning: unsupport arch namespace: sparc in key PkgBR Warning: NEW spec file created: output.spec, maybe customized spec content is needed! spectacle-0.25/tests/specify_cases/test-checking_invalid_archnamespace/output.p0000644002342000234200000000067512502671637026447 0ustar rzrrzr--- output.orig.spec 2012-07-02 15:35:03.231573645 +0300 +++ output.spec 2012-07-02 15:35:03.346573648 +0300 @@ -16,6 +16,12 @@ License: BSD URL: http://www.testpkg.org/ Source0: http://www.testpkg.org/testpkg-%{version}.tar.gz Source100: testpkg.yaml +%ifarch ppc +Requires: ppc-pkg +%endif +%ifarch sparc +BuildRequires: sparc-pkg-devel +%endif %description Sample package for spectacle testings, which will be used as spectacle-0.25/tests/specify_cases/test-checking_invalid_cfgr_builder/input.p0000644002342000234200000000055712502671637026102 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-15 12:26:52.000000000 +0800 +++ testpkg.yaml 2010-07-07 09:41:50.525421578 +0800 @@ -12,8 +12,8 @@ Description: | the base of all testings. In this YAML file, only basic keywords specified, plus with one sub package "devel". -Configure: none -Builder: none +Configure: abc +Builder: xyz SubPackages: - Name: devel spectacle-0.25/tests/specify_cases/test-checking_invalid_cfgr_builder/output.2p0000644002342000234200000000064112502671637026357 0ustar rzrrzr--- output.2.o 2012-07-02 15:35:03.467573651 +0300 +++ output.2 2012-07-02 15:35:03.577573654 +0300 @@ -1 +1,3 @@ +Warning: "abc" is not a valid choice of Configure(configure/reconfigure/autogen/cmake/none) +Warning: "xyz" is not a valid choice of Builder(make/single-make/python/perl/qmake/cmake/none) Warning: NEW spec file created: output.spec, maybe customized spec content is needed! spectacle-0.25/tests/specify_cases/test-checking_invalid_cfgr_builder/output.p0000644002342000234200000000034412502671637026275 0ustar rzrrzr--- output.orig.spec 2012-07-02 15:35:03.467573651 +0300 +++ output.spec 2012-07-02 15:35:03.577573654 +0300 @@ -43,6 +43,7 @@ This package contains development files # << build pre +xyz # >> build post # << build post spectacle-0.25/tests/specify_cases/test-checking_invalid_keys/input.p0000644002342000234200000000047612502671637024426 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-09 17:48:35.000000000 +0800 +++ testpkg.yaml 2010-03-10 23:53:29.000000000 +0800 @@ -5,6 +5,7 @@ Release: 1 Group: System/Base License: BSD URL: http://www.testpkg.org/ +xURL: http://www.testpkg.org/ Sources: - http://www.testpkg.org/testpkg-%{version}.tar.gz Description: | spectacle-0.25/tests/specify_cases/test-checking_invalid_keys/output.2p0000644002342000234200000000040112502671637024675 0ustar rzrrzr--- output.2.o 2012-07-02 15:35:03.701573658 +0300 +++ output.2 2012-07-02 15:35:03.812573661 +0300 @@ -1 +1,2 @@ +Warning: Unexpected keys found: xURL Warning: NEW spec file created: output.spec, maybe customized spec content is needed! spectacle-0.25/tests/specify_cases/test-checking_mandatory_keys/input.p0000644002342000234200000000037512502671637024774 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-09 17:48:35.000000000 +0800 +++ testpkg.yaml 2010-03-10 23:55:04.000000000 +0800 @@ -1,6 +1,5 @@ Name: testpkg Summary: Sample package for spectacle testings -Version: 1.0 Release: 1 Group: System/Base License: BSD spectacle-0.25/tests/specify_cases/test-checking_mandatory_keys/output.2p0000644002342000234200000000042212502671637025250 0ustar rzrrzr--- output.2.o 2012-07-02 15:35:03.934573664 +0300 +++ output.2 2012-07-02 15:35:04.043573667 +0300 @@ -1 +1 @@ -Warning: NEW spec file created: output.spec, maybe customized spec content is needed! +Error: Missing mandatory keys for main package: Version spectacle-0.25/tests/specify_cases/test-checking_mandatory_keys/output.no0000644002342000234200000000000012502671637025333 0ustar rzrrzrspectacle-0.25/tests/specify_cases/test-checking_missing_description/input.p0000644002342000234200000000125412502671637026014 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-09 17:48:35.000000000 +0800 +++ testpkg.yaml 2010-03-14 17:33:38.000000000 +0800 @@ -7,11 +7,6 @@ License: BSD URL: http://www.testpkg.org/ Sources: - http://www.testpkg.org/testpkg-%{version}.tar.gz -Description: | - Sample package for spectacle testings, which will be used as - the base of all testings. In this YAML file, only basic keywords - specified, plus with one sub package "devel". - Configure: none Builder: none @@ -19,4 +14,3 @@ SubPackages: - Name: devel Summary: Development files for %{name} Group: Development/Libraries - Description: This package contains development files for %{name}. spectacle-0.25/tests/specify_cases/test-checking_missing_description/output.2p0000644002342000234200000000042612502671637026277 0ustar rzrrzr--- output.2.o 2012-07-02 15:35:04.170573670 +0300 +++ output.2 2012-07-02 15:35:04.280573673 +0300 @@ -1 +1 @@ -Warning: NEW spec file created: output.spec, maybe customized spec content is needed! +Error: Missing mandatory keys for main package: Description spectacle-0.25/tests/specify_cases/test-checking_missing_description/output.no0000644002342000234200000000000012502671637026356 0ustar rzrrzrspectacle-0.25/tests/specify_cases/test-checking_nosetup/input.p0000644002342000234200000000055512502671637023440 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-15 12:26:52.000000000 +0800 +++ testpkg.yaml 2010-03-31 17:19:48.000000000 +0800 @@ -12,6 +12,10 @@ Description: | the base of all testings. In this YAML file, only basic keywords specified, plus with one sub package "devel". +NoSetup: yes +SetupOptions: -q -n xyz +SourcePrefix: xyz + Configure: none Builder: none spectacle-0.25/tests/specify_cases/test-checking_nosetup/output.2p0000644002342000234200000000060012502671637023712 0ustar rzrrzr--- output.2.o 2012-07-02 15:35:04.406573677 +0300 +++ output.2 2012-07-02 15:35:04.517573680 +0300 @@ -1 +1,3 @@ +Warning: "SetupOptions" will have NO effect when "NoSetup" specified in YAML +Warning: "SourcePrefix" will have NO effect when "NoSetup" specified in YAML Warning: NEW spec file created: output.spec, maybe customized spec content is needed! spectacle-0.25/tests/specify_cases/test-checking_nosetup/output.p0000644002342000234200000000037112502671637023635 0ustar rzrrzr--- output.orig.spec 2012-07-02 15:35:04.406573677 +0300 +++ output.spec 2012-07-02 15:35:04.517573680 +0300 @@ -33,7 +33,7 @@ This package contains development files %prep -%setup -q -n %{name}-%{version} +# No setup # >> setup # << setup spectacle-0.25/tests/specify_cases/test-checking_pathmacro_proposals/input.p0000644002342000234200000000054212502671637026017 0ustar rzrrzr--- ../base/testpkg.yaml 2010-09-07 11:40:02.000000000 +0800 +++ testpkg.yaml 2011-06-20 17:06:35.749534033 +0800 @@ -15,6 +15,12 @@ Description: | Configure: none Builder: none +Files: + - /usr/bin/abc + - /usr/share/info/info.gz + - /usr/share/testpkg/api + + SubPackages: - Name: devel Summary: Development files for %{name} spectacle-0.25/tests/specify_cases/test-checking_pathmacro_proposals/output.2p0000644002342000234200000000110212502671637026273 0ustar rzrrzr--- output.2.o 2012-07-02 15:35:04.642573683 +0300 +++ output.2 2012-07-02 15:35:04.758573686 +0300 @@ -1 +1,7 @@ +Warning: for %files line: "/usr/bin/abc" + please use %{_bindir} to replace the leading path /usr/bin +Warning: for %files line: "/usr/share/info/info.gz" + please use %{_infodir} to replace the leading path /usr/share/info +Warning: for %files line: "/usr/share/testpkg/api" + please use %{_datadir} to replace the leading path /usr/share Warning: NEW spec file created: output.spec, maybe customized spec content is needed! spectacle-0.25/tests/specify_cases/test-checking_pathmacro_proposals/output.p0000644002342000234200000000141212502671637026215 0ustar rzrrzr--- output.orig.spec 2012-07-02 15:35:04.642573683 +0300 +++ output.spec 2012-07-02 15:35:04.758573686 +0300 @@ -16,6 +16,8 @@ License: BSD URL: http://www.testpkg.org/ Source0: http://www.testpkg.org/testpkg-%{version}.tar.gz Source100: testpkg.yaml +Requires(post): /sbin/install-info +Requires(postun): /sbin/install-info %description Sample package for spectacle testings, which will be used as @@ -56,8 +58,19 @@ rm -rf %{buildroot} # << install post +%post +%install_info --info-dir=%_infodir /usr/share/info/info.gz + +%postun +if [ $1 = 0 ] ;then +%install_info_delete --info-dir=%{_infodir} /usr/share/info/info.gz +fi + %files %defattr(-,root,root,-) +/usr/bin/abc +/usr/share/info/info.gz +/usr/share/testpkg/api # >> files # << files spectacle-0.25/tests/specify_cases/test-checking_pkgconfigbr_proposals/input.p0000644002342000234200000000051412502671637026333 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-09 17:48:35.000000000 +0800 +++ testpkg.yaml 2010-03-14 15:02:15.000000000 +0800 @@ -12,6 +12,8 @@ Description: | the base of all testings. In this YAML file, only basic keywords specified, plus with one sub package "devel". +PkgBR: + - libX11-devel Configure: none Builder: none spectacle-0.25/tests/specify_cases/test-checking_pkgconfigbr_proposals/output.2p0000644002342000234200000000055112502671637026617 0ustar rzrrzr--- output.2.o 2012-07-02 15:35:04.880573689 +0300 +++ output.2 2012-07-02 15:35:04.996573692 +0300 @@ -1 +1,5 @@ +Warning: Please use one of the followings: + - x11 + - x11-xcb + in PkgConfigBR instead of libX11-devel in PkgBR Warning: NEW spec file created: output.spec, maybe customized spec content is needed! spectacle-0.25/tests/specify_cases/test-checking_pkgconfigbr_proposals/output.p0000644002342000234200000000057012502671637026536 0ustar rzrrzr--- output.orig.spec 2012-07-02 15:35:04.880573689 +0300 +++ output.spec 2012-07-02 15:35:04.996573692 +0300 @@ -16,6 +16,7 @@ License: BSD URL: http://www.testpkg.org/ Source0: http://www.testpkg.org/testpkg-%{version}.tar.gz Source100: testpkg.yaml +BuildRequires: libX11-devel %description Sample package for spectacle testings, which will be used as spectacle-0.25/tests/specify_cases/test-checking_problem_groups/input.p0000644002342000234200000000047412502671637025002 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-09 17:48:35.000000000 +0800 +++ testpkg.yaml 2010-03-11 23:35:25.000000000 +0800 @@ -2,7 +2,7 @@ Name: testpkg Summary: Sample package for spectacle testings Version: 1.0 Release: 1 -Group: System/Base +Group: System XYZ/Base License: BSD URL: http://www.testpkg.org/ Sources: spectacle-0.25/tests/specify_cases/test-checking_problem_groups/output.2p0000644002342000234200000000053312502671637025261 0ustar rzrrzr--- output.2.o 2012-07-02 15:35:05.123573696 +0300 +++ output.2 2012-07-02 15:35:05.233573699 +0300 @@ -1 +1,2 @@ +Warning: Group 'System XYZ/Base' is not in the list of approved groups. See /usr/share/spectacle/GROUPS for the complete list. Warning: NEW spec file created: output.spec, maybe customized spec content is needed! spectacle-0.25/tests/specify_cases/test-checking_problem_groups/output.p0000644002342000234200000000062012502671637025174 0ustar rzrrzr--- output.orig.spec 2012-07-02 15:35:05.123573696 +0300 +++ output.spec 2012-07-02 15:35:05.233573699 +0300 @@ -11,7 +11,7 @@ Name: testpkg Summary: Sample package for spectacle testings Version: 1.0 Release: 1 -Group: System/Base +Group: System XYZ/Base License: BSD URL: http://www.testpkg.org/ Source0: http://www.testpkg.org/testpkg-%{version}.tar.gz spectacle-0.25/tests/specify_cases/test-checking_renamed_keys/input.p0000644002342000234200000000035712502671637024411 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-09 17:48:35.000000000 +0800 +++ testpkg.yaml 2010-03-14 23:12:48.000000000 +0800 @@ -14,6 +14,7 @@ Description: | Configure: none Builder: none +NeedCheckSection: yes SubPackages: - Name: devel spectacle-0.25/tests/specify_cases/test-checking_renamed_keys/output.2p0000644002342000234200000000044312502671637024670 0ustar rzrrzr--- output.2.o 2012-07-02 15:35:05.353573702 +0300 +++ output.2 2012-07-02 15:35:05.465573705 +0300 @@ -1 +1,2 @@ +Warning: Renamed key: NeedCheckSection found, please use Check instead Warning: NEW spec file created: output.spec, maybe customized spec content is needed! spectacle-0.25/tests/specify_cases/test-checking_renamed_keys/output.p0000644002342000234200000000040612502671637024605 0ustar rzrrzr--- output.orig.spec 2012-07-02 15:35:05.353573702 +0300 +++ output.spec 2012-07-02 15:35:05.465573705 +0300 @@ -56,6 +56,11 @@ rm -rf %{buildroot} # << install post +%check +# >> check +make check +# << check + %files %defattr(-,root,root,-) # >> files spectacle-0.25/tests/specify_cases/test-checking_setupoptions/input.p0000644002342000234200000000053612502671637024516 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-15 12:26:52.000000000 +0800 +++ testpkg.yaml 2010-03-31 17:20:07.000000000 +0800 @@ -12,6 +12,9 @@ Description: | the base of all testings. In this YAML file, only basic keywords specified, plus with one sub package "devel". +SetupOptions: -q -n xyz +SourcePrefix: xyz + Configure: none Builder: none spectacle-0.25/tests/specify_cases/test-checking_setupoptions/output.2p0000644002342000234200000000045612502671637025002 0ustar rzrrzr--- output.2.o 2012-07-02 15:35:05.586573708 +0300 +++ output.2 2012-07-02 15:35:05.698573711 +0300 @@ -1 +1,2 @@ +Warning: "SourcePrefix" will have NO effect when "SetupOptions" specified in YAML Warning: NEW spec file created: output.spec, maybe customized spec content is needed! spectacle-0.25/tests/specify_cases/test-checking_setupoptions/output.p0000644002342000234200000000037712502671637024722 0ustar rzrrzr--- output.orig.spec 2012-07-02 15:35:05.586573708 +0300 +++ output.spec 2012-07-02 15:35:05.698573711 +0300 @@ -33,7 +33,7 @@ This package contains development files %prep -%setup -q -n %{name}-%{version} +%setup -q -n xyz # >> setup # << setup spectacle-0.25/tests/specify_cases/test-checking_typo_pkgbr/input.p0000644002342000234200000000044112502671637024115 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-15 12:26:52.000000000 +0800 +++ testpkg.yaml 2010-07-23 11:20:04.151422059 +0800 @@ -15,6 +15,9 @@ Description: | Configure: none Builder: none +BuildRequires: + - abc + SubPackages: - Name: devel Summary: Development files for %{name} spectacle-0.25/tests/specify_cases/test-checking_typo_pkgbr/output.2p0000644002342000234200000000045412502671637024404 0ustar rzrrzr--- output.2.o 2012-07-02 15:35:05.818573714 +0300 +++ output.2 2012-07-02 15:35:05.930573717 +0300 @@ -1 +1,2 @@ +Warning: "BuildRequires" might be a typo of PkgBR or PkgConfigBR, please fix it Warning: NEW spec file created: output.spec, maybe customized spec content is needed! spectacle-0.25/tests/specify_cases/test-checking_typo_url/input.p0000644002342000234200000000051312502671637023612 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-15 12:26:52.000000000 +0800 +++ testpkg.yaml 2010-07-23 11:20:13.561442739 +0800 @@ -4,7 +4,7 @@ Version: 1.0 Release: 1 Group: System/Base License: BSD -URL: http://www.testpkg.org/ +Url: http://www.testpkg.org/ Sources: - http://www.testpkg.org/testpkg-%{version}.tar.gz Description: | spectacle-0.25/tests/specify_cases/test-checking_typo_url/output.2p0000644002342000234200000000042112502671637024073 0ustar rzrrzr--- output.2.o 2012-07-02 15:35:06.049573721 +0300 +++ output.2 2012-07-02 15:35:06.160573724 +0300 @@ -1 +1,2 @@ +Warning: "Url" might be a typo of URL, please fix it Warning: NEW spec file created: output.spec, maybe customized spec content is needed! spectacle-0.25/tests/specify_cases/test-checking_typo_url/output.p0000644002342000234200000000050712502671637024016 0ustar rzrrzr--- output.orig.spec 2012-07-02 15:35:06.049573721 +0300 +++ output.spec 2012-07-02 15:35:06.160573724 +0300 @@ -13,7 +13,6 @@ Version: 1.0 Release: 1 Group: System/Base License: BSD -URL: http://www.testpkg.org/ Source0: http://www.testpkg.org/testpkg-%{version}.tar.gz Source100: testpkg.yaml spectacle-0.25/tests/specify_cases/test-checking_wrong_py_modpath/input.p0000644002342000234200000000063612502671637025323 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-15 12:26:52.000000000 +0800 +++ testpkg.yaml 2010-05-18 20:03:30.000000000 +0800 @@ -12,8 +12,11 @@ Description: | the base of all testings. In this YAML file, only basic keywords specified, plus with one sub package "devel". -Configure: none -Builder: none +Builder: python +BuildArch: noarch + +Files: + - "%{python_sitearch}/*" SubPackages: - Name: devel spectacle-0.25/tests/specify_cases/test-checking_wrong_py_modpath/output.2p0000644002342000234200000000045412502671637025604 0ustar rzrrzr--- output.2.o 2012-07-02 15:35:06.279573727 +0300 +++ output.2 2012-07-02 15:35:06.391573730 +0300 @@ -1 +1 @@ -Warning: NEW spec file created: output.spec, maybe customized spec content is needed! +Error: please use %{python_sitelib} in %files to specify module installation path spectacle-0.25/tests/specify_cases/test-checking_wrong_py_modpath/output.no0000644002342000234200000000000012502671637025662 0ustar rzrrzrspectacle-0.25/tests/specify_cases/test-checking_wrong_py_modpath2/input.p0000644002342000234200000000061212502671637025377 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-15 12:26:52.000000000 +0800 +++ testpkg.yaml 2010-05-18 20:04:17.000000000 +0800 @@ -12,8 +12,10 @@ Description: | the base of all testings. In this YAML file, only basic keywords specified, plus with one sub package "devel". -Configure: none -Builder: none +Builder: python + +Files: + - "%{python_sitelib}/*" SubPackages: - Name: devel spectacle-0.25/tests/specify_cases/test-checking_wrong_py_modpath2/output.2p0000644002342000234200000000045512502671637025667 0ustar rzrrzr--- output.2.o 2012-07-02 15:35:06.511573733 +0300 +++ output.2 2012-07-02 15:35:06.623573736 +0300 @@ -1 +1 @@ -Warning: NEW spec file created: output.spec, maybe customized spec content is needed! +Error: please use %{python_sitearch} in %files to specify module installation path spectacle-0.25/tests/specify_cases/test-checking_wrong_py_modpath2/output.no0000644002342000234200000000000012502671637025744 0ustar rzrrzrspectacle-0.25/tests/specify_cases/test-checking_wrong_types/input.p0000644002342000234200000000106112502671637024314 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-09 17:48:35.000000000 +0800 +++ testpkg.yaml 2010-03-14 15:10:55.000000000 +0800 @@ -3,10 +3,10 @@ Summary: Sample package for spectacle te Version: 1.0 Release: 1 Group: System/Base -License: BSD +License: + - BSD URL: http://www.testpkg.org/ -Sources: - - http://www.testpkg.org/testpkg-%{version}.tar.gz +Sources: http://www.testpkg.org/testpkg-%{version}.tar.gz Description: | Sample package for spectacle testings, which will be used as the base of all testings. In this YAML file, only basic keywords spectacle-0.25/tests/specify_cases/test-checking_wrong_types/output.2p0000644002342000234200000000057412502671637024607 0ustar rzrrzr--- output.2.o 2012-07-02 15:35:06.744573739 +0300 +++ output.2 2012-07-02 15:35:06.855573742 +0300 @@ -1 +1,3 @@ +Warning: the value of "Sources" in main package is expected as list typed +Warning: the value of "License" in main package is expected as string typed Warning: NEW spec file created: output.spec, maybe customized spec content is needed! spectacle-0.25/tests/specify_cases/test-duplicate_autoreqs/input.p0000644002342000234200000000047012502671637024001 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-15 12:26:52.000000000 +0800 +++ testpkg.yaml 2010-03-30 19:58:43.000000000 +0800 @@ -14,6 +14,10 @@ Description: | Configure: none Builder: none +RequiresPost: /sbin/ldconfig +RequiresPostUn: /sbin/ldconfig +Files: + - "%{_libdir}/*.so" SubPackages: - Name: devel spectacle-0.25/tests/specify_cases/test-duplicate_autoreqs/output.2p0000644002342000234200000000105612502671637024265 0ustar rzrrzr--- output.2.o 2012-07-02 15:35:06.978573745 +0300 +++ output.2 2012-07-02 15:35:07.092573749 +0300 @@ -1 +1,5 @@ +Warning: the value of "RequiresPost" in main package is expected as list typed +Warning: the value of "RequiresPostUn" in main package is expected as list typed +Warning: duplicate item: /sbin/ldconfig for RequiresPostUn in package main +Warning: duplicate item: /sbin/ldconfig for RequiresPost in package main Warning: NEW spec file created: output.spec, maybe customized spec content is needed! spectacle-0.25/tests/specify_cases/test-duplicate_autoreqs/output.p0000644002342000234200000000113612502671637024202 0ustar rzrrzr--- output.orig.spec 2012-07-02 15:35:06.978573745 +0300 +++ output.spec 2012-07-02 15:35:07.092573749 +0300 @@ -16,6 +16,8 @@ License: BSD URL: http://www.testpkg.org/ Source0: http://www.testpkg.org/testpkg-%{version}.tar.gz Source100: testpkg.yaml +Requires(post): /sbin/ldconfig +Requires(postun): /sbin/ldconfig %description Sample package for spectacle testings, which will be used as @@ -56,8 +58,13 @@ rm -rf %{buildroot} # << install post +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + %files %defattr(-,root,root,-) +%{_libdir}/*.so # >> files # << files spectacle-0.25/tests/specify_cases/test-duplicate_cfg_opts/input.p0000644002342000234200000000066112502671637023744 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-09 17:48:35.000000000 +0800 +++ testpkg.yaml 2010-03-14 15:54:59.000000000 +0800 @@ -12,8 +12,11 @@ Description: | the base of all testings. In this YAML file, only basic keywords specified, plus with one sub package "devel". -Configure: none -Builder: none +Configure: configure +ConfigOptions: + - --disable-static + - --otheropt +Builder: make SubPackages: - Name: devel spectacle-0.25/tests/specify_cases/test-duplicate_cfg_opts/output.2p0000644002342000234200000000045512502671637024230 0ustar rzrrzr--- output.2.o 2012-07-02 15:35:07.219573752 +0300 +++ output.2 2012-07-02 15:35:07.329573755 +0300 @@ -1 +1,2 @@ +Warning: found duplicate configure options: "--disable-static", please remove it Warning: NEW spec file created: output.spec, maybe customized spec content is needed! spectacle-0.25/tests/specify_cases/test-duplicate_cfg_opts/output.p0000644002342000234200000000074012502671637024143 0ustar rzrrzr--- output.orig.spec 2012-07-02 15:35:07.219573752 +0300 +++ output.spec 2012-07-02 15:35:07.329573755 +0300 @@ -42,7 +42,10 @@ This package contains development files # >> build pre # << build pre +%configure --disable-static \ + --otheropt +make %{?jobs:-j%jobs} # >> build post # << build post @@ -51,6 +54,7 @@ This package contains development files rm -rf %{buildroot} # >> install pre # << install pre +%make_install # >> install post # << install post spectacle-0.25/tests/specify_cases/test-duplicate_files_attr/input.p0000644002342000234200000000042712502671637024274 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-09 17:48:35.000000000 +0800 +++ testpkg.yaml 2010-03-14 16:06:04.000000000 +0800 @@ -14,6 +14,9 @@ Description: | Configure: none Builder: none +Files: + - "%defattr(-,root,root,-)" + - "%{_bindir}/*" SubPackages: - Name: devel spectacle-0.25/tests/specify_cases/test-duplicate_files_attr/output.2p0000644002342000234200000000044612502671637024560 0ustar rzrrzr--- output.2.o 2012-07-02 15:35:07.498573761 +0300 +++ output.2 2012-07-02 15:35:07.609573762 +0300 @@ -1 +1,2 @@ +Warning: found duplicate "%defattr(-,root,root,-)" in file list, removed! Warning: NEW spec file created: output.spec, maybe customized spec content is needed! spectacle-0.25/tests/specify_cases/test-duplicate_files_attr/output.p0000644002342000234200000000033612502671637024474 0ustar rzrrzr--- output.orig.spec 2012-07-02 15:35:07.497573761 +0300 +++ output.spec 2012-07-02 15:35:07.609573762 +0300 @@ -58,6 +58,7 @@ rm -rf %{buildroot} %files %defattr(-,root,root,-) +%{_bindir}/* # >> files # << files spectacle-0.25/tests/specify_cases/test-duplicate_files_attr2/input.p0000644002342000234200000000250012502671637024350 0ustar rzrrzr--- /dev/null 2010-03-14 16:00:00.000000000 +0800 +++ output.spec 2010-03-14 16:21:19.000000000 +0800 @@ -0,0 +1,74 @@ +# +# Do not Edit! Generated by: +# spectacle version 0.13 +# +# >> macros +# << macros + +Name: testpkg +Summary: Sample package for spectacle testings +Version: 1.0 +Release: 1 +Group: System/Base +License: BSD +URL: http://www.testpkg.org/ +Source0: http://www.testpkg.org/testpkg-%{version}.tar.gz +Source100: testpkg.yaml + +%description +Sample package for spectacle testings, which will be used as +the base of all testings. In this YAML file, only basic keywords +specified, plus with one sub package "devel". + + + +%package devel +Summary: Development files for %{name} +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} + +%description devel +This package contains development files for %{name}. + + +%prep +%setup -q -n %{name}-%{version} + +# >> setup +# << setup + +%build +# >> build pre +# << build pre + + + +# >> build post +# << build post +%install +rm -rf %{buildroot} +# >> install pre +# << install pre + +# >> install post +# << install post + + + + + + + +%files +%defattr(-,root,root,-) +# >> files +%defattr(-,root,root,-) +%{_bindir}/* +# << files + + +%files devel +%defattr(-,root,root,-) +# >> files devel +# << files devel + spectacle-0.25/tests/specify_cases/test-duplicate_files_attr2/output.2p0000644002342000234200000000054512502671637024642 0ustar rzrrzr--- output.2.o 2012-07-02 15:35:07.730573766 +0300 +++ output.2 2012-07-02 15:35:07.843573769 +0300 @@ -1 +1,2 @@ -Warning: NEW spec file created: output.spec, maybe customized spec content is needed! +Warning: found duplicate "%defattr(-,root,root,-)" in file list, removed! +Info: Old spec file exists, patching output.spec ... spectacle-0.25/tests/specify_cases/test-duplicate_files_attr2/output.p0000644002342000234200000000035212502671637024554 0ustar rzrrzr--- output.orig.spec 2012-07-02 15:35:07.730573766 +0300 +++ output.spec 2012-07-02 15:35:07.843573769 +0300 @@ -59,6 +59,7 @@ rm -rf %{buildroot} %files %defattr(-,root,root,-) # >> files +%{_bindir}/* # << files %files devel spectacle-0.25/tests/specify_cases/test-duplicate_subpkg_reqs/input.p0000644002342000234200000000060112502671637024457 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-09 17:48:35.000000000 +0800 +++ testpkg.yaml 2010-03-14 15:57:04.000000000 +0800 @@ -19,4 +19,6 @@ SubPackages: - Name: devel Summary: Development files for %{name} Group: Development/Libraries + Requires: + - "%{name} = %{version}-%{release}" Description: This package contains development files for %{name}. spectacle-0.25/tests/specify_cases/test-duplicate_subpkg_reqs/output.2p0000644002342000234200000000050512502671637024745 0ustar rzrrzr--- output.2.o 2012-07-02 15:35:07.967573772 +0300 +++ output.2 2012-07-02 15:35:08.078573775 +0300 @@ -1 +1,2 @@ +Warning: found duplicate Requires for %{name} = %{version}-%{release} in sub-pkg:devel, please remove it Warning: NEW spec file created: output.spec, maybe customized spec content is needed! spectacle-0.25/tests/specify_cases/test-filesparsing_desktop/input.p0000644002342000234200000000041412502671637024321 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-09 17:48:35.000000000 +0800 +++ testpkg.yaml 2010-03-14 17:56:33.000000000 +0800 @@ -14,6 +14,8 @@ Description: | Configure: none Builder: none +Files: + - "%{_datadir}/applications/*.desktop" SubPackages: - Name: devel spectacle-0.25/tests/specify_cases/test-filesparsing_desktop/output.p0000644002342000234200000000131512502671637024523 0ustar rzrrzr--- output.orig.spec 2012-05-29 18:30:04.547967561 +0300 +++ output.spec 2012-05-29 18:30:05.175970683 +0300 @@ -16,6 +16,7 @@ License: BSD URL: http://www.testpkg.org/ Source0: http://www.testpkg.org/testpkg-%{version}.tar.gz Source100: testpkg.yaml +BuildRequires: desktop-file-utils %description Sample package for spectacle testings, which will be used as @@ -55,9 +56,13 @@ rm -rf %{buildroot} # >> install post # << install post +desktop-file-install --delete-original \ + --dir %{buildroot}%{_datadir}/applications \ + %{buildroot}%{_datadir}/applications/*.desktop %files %defattr(-,root,root,-) +%{_datadir}/applications/*.desktop # >> files # << files spectacle-0.25/tests/specify_cases/test-filesparsing_info/input.p0000644002342000234200000000037712502671637023613 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-09 17:48:35.000000000 +0800 +++ testpkg.yaml 2010-03-14 17:49:28.000000000 +0800 @@ -14,6 +14,8 @@ Description: | Configure: none Builder: none +Files: + - "%{_infodir}/*.info.gz" SubPackages: - Name: devel spectacle-0.25/tests/specify_cases/test-filesparsing_info/output.p0000644002342000234200000000124212502671637024004 0ustar rzrrzr--- output.orig.spec 2012-02-24 13:48:35.999047431 +0200 +++ output.spec 2012-02-24 13:48:36.171051303 +0200 @@ -16,6 +16,8 @@ License: BSD URL: http://www.testpkg.org/ Source0: http://www.testpkg.org/testpkg-%{version}.tar.gz Source100: testpkg.yaml +Requires(post): /sbin/install-info +Requires(postun): /sbin/install-info %description @@ -58,8 +60,17 @@ rm -rf %{buildroot} # << install post +%post +%install_info --info-dir=%_infodir %{_infodir}/*.info.gz + +%postun +if [ $1 = 0 ] ;then +%install_info_delete --info-dir=%{_infodir} %{_infodir}/*.info.gz +fi + %files %defattr(-,root,root,-) +%{_infodir}/*.info.gz # >> files # << files spectacle-0.25/tests/specify_cases/test-filesparsing_preserve_versioned_ones/input.p0000644002342000234200000000044512502671637027611 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-15 12:26:52.000000000 +0800 +++ testpkg.yaml 2010-03-30 20:01:22.000000000 +0800 @@ -14,6 +14,11 @@ Description: | Configure: none Builder: none +RequiresPost: + - GConf2 >= 0.14 + +Files: + - "%{_libdir}/*.schema" SubPackages: - Name: devel spectacle-0.25/tests/specify_cases/test-filesparsing_preserve_versioned_ones/output.p0000644002342000234200000000214512502671637030011 0ustar rzrrzr--- output.orig.spec 2012-02-24 13:49:53.522792704 +0200 +++ output.spec 2012-02-24 13:49:53.697796645 +0200 @@ -16,6 +16,10 @@ License: BSD URL: http://www.testpkg.org/ Source0: http://www.testpkg.org/testpkg-%{version}.tar.gz Source100: testpkg.yaml +Requires(pre): %{_bindir}/gconftool-2 +Requires(preun): %{_bindir}/gconftool-2 +Requires(post): GConf2 >= 0.14 +Requires(post): %{_bindir}/gconftool-2 %description @@ -58,8 +62,30 @@ rm -rf %{buildroot} # << install post +%pre +if [ "$1" -gt 1 ]; then + export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` + gconftool-2 --makefile-uninstall-rule \ + %{_libdir}/*.schema \ + > /dev/null || : +fi + +%preun +if [ "$1" -eq 0 ]; then + export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` + gconftool-2 --makefile-uninstall-rule \ + %{_libdir}/*.schema \ + > /dev/null || : +fi + +%post +export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` +gconftool-2 --makefile-install-rule \ + %{_libdir}/*.schema > /dev/null || : + %files %defattr(-,root,root,-) +%{_libdir}/*.schema # >> files # << files spectacle-0.25/tests/specify_cases/test-filesparsing_sharelib/input.p0000644002342000234200000000037112502671637024443 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-09 17:48:35.000000000 +0800 +++ testpkg.yaml 2010-03-14 17:55:13.000000000 +0800 @@ -14,6 +14,8 @@ Description: | Configure: none Builder: none +Files: + - "%{_libdir}/*.so" SubPackages: - Name: devel spectacle-0.25/tests/specify_cases/test-filesparsing_sharelib/output.p0000644002342000234200000000104212502671637024640 0ustar rzrrzr--- output.orig.spec 2012-02-24 13:50:40.536851122 +0200 +++ output.spec 2012-02-24 13:50:40.707854972 +0200 @@ -16,6 +16,8 @@ License: BSD URL: http://www.testpkg.org/ Source0: http://www.testpkg.org/testpkg-%{version}.tar.gz Source100: testpkg.yaml +Requires(post): /sbin/ldconfig +Requires(postun): /sbin/ldconfig %description @@ -58,8 +60,13 @@ rm -rf %{buildroot} # << install post +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + %files %defattr(-,root,root,-) +%{_libdir}/*.so # >> files # << files spectacle-0.25/tests/specify_cases/test-filesparsing_staticlib/input.p0000644002342000234200000000062712502671637024634 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-09 17:48:35.000000000 +0800 +++ testpkg.yaml 2010-03-14 15:35:14.000000000 +0800 @@ -12,8 +12,10 @@ Description: | the base of all testings. In this YAML file, only basic keywords specified, plus with one sub package "devel". -Configure: none -Builder: none +Configure: configure +Builder: make +Files: + - "%{_libdir}/*.a" SubPackages: - Name: devel spectacle-0.25/tests/specify_cases/test-filesparsing_staticlib/output.p0000644002342000234200000000130012502671637025022 0ustar rzrrzr--- output.orig.spec 2010-06-21 16:41:15.000000000 +0800 +++ output.spec 2010-06-21 16:41:15.000000000 +0800 @@ -4,6 +4,7 @@ # # >> macros # << macros +%define keepstatic 1 Name: testpkg Summary: Sample package for spectacle testings @@ -42,7 +43,8 @@ This package contains development files # >> build pre # << build pre - +%configure +make %{?jobs:-j%jobs} # >> build post # << build post @@ -50,6 +52,7 @@ This package contains development files rm -rf %{buildroot} # >> install pre # << install pre +%make_install # >> install post # << install post @@ -64,6 +67,7 @@ rm -rf %{buildroot} %files %defattr(-,root,root,-) +%{_libdir}/*.a # >> files # << files spectacle-0.25/tests/specify_cases/test-filesparsing_systemd/input.p0000644002342000234200000000074612502671637024350 0ustar rzrrzr--- ../base/testpkg.yaml 2010-09-07 11:40:02.000000000 +0800 +++ testpkg.yaml 2011-06-20 17:10:16.695491164 +0800 @@ -15,8 +15,13 @@ Description: | Configure: none Builder: none +Files: + - "/%{_lib}/systemd/system/abc.service" + SubPackages: - Name: devel Summary: Development files for %{name} Group: Development/Libraries Description: This package contains development files for %{name}. + Files: + - "/lib/systemd/system/xyz.service" spectacle-0.25/tests/specify_cases/test-filesparsing_systemd/output.p0000644002342000234200000000265512502671637024552 0ustar rzrrzr--- output.orig.spec 2012-06-06 13:07:56.834228873 +0300 +++ output.spec 2012-06-06 13:07:57.466232002 +0300 @@ -16,6 +16,10 @@ License: BSD URL: http://www.testpkg.org/ Source0: http://www.testpkg.org/testpkg-%{version}.tar.gz Source100: testpkg.yaml +Requires: systemd +Requires(preun): systemd +Requires(post): systemd +Requires(postun): systemd %description Sample package for spectacle testings, which will be used as @@ -27,6 +31,10 @@ specified, plus with one sub package "de Summary: Development files for %{name} Group: Development/Libraries Requires: %{name} = %{version}-%{release} +Requires: systemd +Requires(preun): systemd +Requires(post): systemd +Requires(postun): systemd %description devel This package contains development files for %{name}. @@ -56,12 +64,38 @@ rm -rf %{buildroot} # << install post +%preun +if [ "$1" -eq 0 ]; then +systemctl stop abc.service +fi + +%post +systemctl daemon-reload +systemctl reload-or-try-restart abc.service + +%postun +systemctl daemon-reload + +%preun devel +if [ "$1" -eq 0 ]; then +systemctl stop xyz.service +fi + +%post devel +systemctl daemon-reload +systemctl reload-or-try-restart xyz.service + +%postun devel +systemctl daemon-reload + %files %defattr(-,root,root,-) +/%{_lib}/systemd/system/abc.service # >> files # << files %files devel %defattr(-,root,root,-) +/lib/systemd/system/xyz.service # >> files devel # << files devel spectacle-0.25/tests/specify_cases/test-key_aswholename/input.p0000644002342000234200000000062112502671637023255 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-15 12:26:52.000000000 +0800 +++ testpkg.yaml 2010-03-15 16:21:22.000000000 +0800 @@ -16,7 +16,8 @@ Configure: none Builder: none SubPackages: - - Name: devel + - Name: haha-devel + AsWholeName: yes Summary: Development files for %{name} Group: Development/Libraries Description: This package contains development files for %{name}. spectacle-0.25/tests/specify_cases/test-key_aswholename/output.p0000644002342000234200000000121612502671637023457 0ustar rzrrzr--- output.orig.spec 2012-02-24 13:53:30.253671931 +0200 +++ output.spec 2012-02-24 13:53:30.430675915 +0200 @@ -25,12 +25,12 @@ specified, plus with one sub package "de -%package devel +%package -n haha-devel Summary: Development files for %{name} Group: Development/Libraries Requires: %{name} = %{version}-%{release} -%description devel +%description -n haha-devel This package contains development files for %{name}. @@ -63,7 +63,7 @@ rm -rf %{buildroot} # >> files # << files -%files devel +%files -n haha-devel %defattr(-,root,root,-) -# >> files devel -# << files devel +# >> files haha-devel +# << files haha-devel spectacle-0.25/tests/specify_cases/test-key_autodepend/input.p0000644002342000234200000000054612502671637023110 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-15 12:26:52.000000000 +0800 +++ testpkg.yaml 2010-03-15 16:15:18.000000000 +0800 @@ -17,6 +17,7 @@ Builder: none SubPackages: - Name: devel + AutoDepend: no Summary: Development files for %{name} Group: Development/Libraries Description: This package contains development files for %{name}. spectacle-0.25/tests/specify_cases/test-key_autodepend/output.p0000644002342000234200000000057712502671637023315 0ustar rzrrzr--- output.orig.spec 2010-03-17 21:15:09.000000000 +0800 +++ output.spec 2010-03-17 21:15:09.000000000 +0800 @@ -25,7 +25,6 @@ specified, plus with one sub package "de %package devel Summary: Development files for %{name} Group: Development/Libraries -Requires: %{name} = %{version}-%{release} %description devel This package contains development files for %{name}. spectacle-0.25/tests/specify_cases/test-key_autosubpackages/input.p0000644002342000234200000000066512502671637024143 0ustar rzrrzr--- ../base/testpkg.yaml 2011-09-30 10:44:02.158593700 +0300 +++ testpkg.yaml 2012-02-28 09:40:22.537926773 +0200 @@ -15,8 +15,9 @@ Description: | Configure: none Builder: none -SubPackages: - - Name: devel - Summary: Development files for %{name} - Group: Development/Libraries - Description: This package contains development files for %{name}. +AutoSubPackages: + - devel + - docs + - lang + - abc + spectacle-0.25/tests/specify_cases/test-key_autosubpackages/output.p0000644002342000234200000000226212502671637024337 0ustar rzrrzr--- output.orig.spec 2012-06-25 14:32:34.473173100 +0300 +++ output.spec 2012-06-25 14:32:34.580173103 +0300 @@ -29,7 +29,31 @@ Group: Development/Libraries Requires: %{name} = %{version}-%{release} %description devel -This package contains development files for %{name}. +Development files for %{name}. + +%package docs +Summary: Documentation files for %{name} +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} + +%description docs +Documentation files for %{name}. + +%package lang +Summary: Translation files for %{name} +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} + +%description lang +Translation files for %{name}. + +%package abc +Summary: Files for %{name} +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} + +%description abc +Files for %{name}. %prep @@ -65,3 +89,18 @@ rm -rf %{buildroot} %defattr(-,root,root,-) # >> files devel # << files devel + +%files docs +%defattr(-,root,root,-) +# >> files docs +# << files docs + +%files lang +%defattr(-,root,root,-) +# >> files lang +# << files lang + +%files abc +%defattr(-,root,root,-) +# >> files abc +# << files abc spectacle-0.25/tests/specify_cases/test-key_buildconflicts/input.p0000644002342000234200000000056612502671637023766 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-15 12:26:52.000000000 +0800 +++ testpkg.yaml 2010-06-21 16:34:38.000000000 +0800 @@ -12,6 +12,10 @@ Description: | the base of all testings. In this YAML file, only basic keywords specified, plus with one sub package "devel". +BuildConflicts: + - package-conflict1 + - package-conflict2 + Configure: none Builder: none spectacle-0.25/tests/specify_cases/test-key_buildconflicts/output.p0000644002342000234200000000054412502671637024163 0ustar rzrrzr--- output.orig.spec 2010-06-21 16:34:07.000000000 +0800 +++ output.spec 2010-06-21 16:34:38.000000000 +0800 @@ -14,6 +14,8 @@ License: BSD URL: http://www.testpkg.org/ Source0: http://www.testpkg.org/testpkg-%{version}.tar.gz Source100: testpkg.yaml +BuildConflicts: package-conflict1 +BuildConflicts: package-conflict2 %description spectacle-0.25/tests/specify_cases/test-key_check/input.p0000644002342000234200000000034412502671637022031 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-09 17:48:35.000000000 +0800 +++ testpkg.yaml 2010-03-14 23:12:48.000000000 +0800 @@ -14,6 +14,7 @@ Description: | Configure: none Builder: none +Check: yes SubPackages: - Name: devel spectacle-0.25/tests/specify_cases/test-key_check/output.p0000644002342000234200000000040612502671637022231 0ustar rzrrzr--- output.orig.spec 2012-02-24 13:54:04.146434954 +0200 +++ output.spec 2012-02-24 13:54:04.317438804 +0200 @@ -58,6 +58,11 @@ rm -rf %{buildroot} # << install post +%check +# >> check +make check +# << check + %files %defattr(-,root,root,-) # >> files spectacle-0.25/tests/specify_cases/test-key_configoptions/input.p0000644002342000234200000000065012502671637023635 0ustar rzrrzr--- ../base/testpkg.yaml 2010-09-07 11:40:02.000000000 +0800 +++ testpkg.yaml 2010-09-17 10:57:35.131317604 +0800 @@ -12,8 +12,11 @@ Description: | the base of all testings. In this YAML file, only basic keywords specified, plus with one sub package "devel". -Configure: none -Builder: none +Configure: configure +ConfigOptions: + - --yes-one + - --no-two +Builder: make SubPackages: - Name: devel spectacle-0.25/tests/specify_cases/test-key_configoptions/output.p0000644002342000234200000000075712502671637024046 0ustar rzrrzr--- output.orig.spec 2010-09-17 10:57:05.335249886 +0800 +++ output.spec 2010-09-17 10:57:35.262208389 +0800 @@ -42,7 +42,11 @@ This package contains development files # >> build pre # << build pre +%configure --disable-static \ + --yes-one \ + --no-two +make %{?jobs:-j%jobs} # >> build post # << build post @@ -50,6 +54,7 @@ This package contains development files rm -rf %{buildroot} # >> install pre # << install pre +%make_install # >> install post # << install post spectacle-0.25/tests/specify_cases/test-key_configure_default/input.p0000644002342000234200000000047612502671637024447 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-09 17:48:35.000000000 +0800 +++ testpkg.yaml 2010-03-11 23:37:17.000000000 +0800 @@ -12,7 +12,6 @@ Description: | the base of all testings. In this YAML file, only basic keywords specified, plus with one sub package "devel". -Configure: none Builder: none SubPackages: spectacle-0.25/tests/specify_cases/test-key_configure_default/output.p0000644002342000234200000000041512502671637024641 0ustar rzrrzr--- output.orig.spec 2010-03-17 21:15:04.000000000 +0800 +++ output.spec 2010-03-17 21:15:04.000000000 +0800 @@ -41,7 +41,7 @@ This package contains development files # >> build pre # << build pre - +%configure --disable-static # >> build post # << build post spectacle-0.25/tests/specify_cases/test-key_epoch/input.p0000644002342000234200000000044412502671637022053 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-09 17:48:35.000000000 +0800 +++ testpkg.yaml 2010-03-14 15:57:55.000000000 +0800 @@ -2,6 +2,7 @@ Name: testpkg Summary: Sample package for spectacle testings Version: 1.0 Release: 1 +Epoch: 1 Group: System/Base License: BSD URL: http://www.testpkg.org/ spectacle-0.25/tests/specify_cases/test-key_epoch/output.p0000644002342000234200000000121212502671637022246 0ustar rzrrzr--- output.orig.spec 2010-03-17 21:15:10.000000000 +0800 +++ output.spec 2010-03-17 21:15:10.000000000 +0800 @@ -9,6 +9,7 @@ Name: testpkg Summary: Sample package for spectacle testings Version: 1.0 Release: 1 +Epoch: 1 Group: System/Base License: BSD URL: http://www.testpkg.org/ @@ -25,7 +26,7 @@ specified, plus with one sub package "de %package devel Summary: Development files for %{name} Group: Development/Libraries -Requires: %{name} = %{version}-%{release} +Requires: %{name} = %{epoch}:%{version}-%{release} %description devel This package contains development files for %{name}. spectacle-0.25/tests/specify_cases/test-key_exclusivearch/input.p0000644002342000234200000000046312502671637023623 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-09 17:48:35.000000000 +0800 +++ testpkg.yaml 2010-03-10 23:53:57.000000000 +0800 @@ -4,6 +4,7 @@ Version: 1.0 Release: 1 Group: System/Base License: BSD +ExclusiveArch: amd64 URL: http://www.testpkg.org/ Sources: - http://www.testpkg.org/testpkg-%{version}.tar.gz spectacle-0.25/tests/specify_cases/test-key_exclusivearch/output.p0000644002342000234200000000053412502671637024023 0ustar rzrrzr--- output.orig.spec 2010-03-17 21:15:10.000000000 +0800 +++ output.spec 2010-03-17 21:15:10.000000000 +0800 @@ -11,6 +11,7 @@ Version: 1.0 Release: 1 Group: System/Base License: BSD +ExclusiveArch: amd64 URL: http://www.testpkg.org/ Source0: http://www.testpkg.org/testpkg-%{version}.tar.gz Source100: testpkg.yaml spectacle-0.25/tests/specify_cases/test-key_extrainstall/input.p0000644002342000234200000000043612502671637023470 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-09 17:48:35.000000000 +0800 +++ testpkg.yaml 2010-03-14 23:09:33.000000000 +0800 @@ -14,6 +14,9 @@ Description: | Configure: none Builder: none +ExtraInstall: | + # extra install scripts in %install + # etc. SubPackages: - Name: devel spectacle-0.25/tests/specify_cases/test-key_extrainstall/output.p0000644002342000234200000000047012502671637023667 0ustar rzrrzr--- output.orig.spec 2010-03-17 21:15:10.000000000 +0800 +++ output.spec 2010-03-17 21:15:11.000000000 +0800 @@ -49,6 +49,9 @@ This package contains development files rm -rf %{buildroot} # >> install pre # << install pre +# extra install scripts in %install +# etc. + # >> install post # << install post spectacle-0.25/tests/specify_cases/test-key_files/input.p0000644002342000234200000000042012502671637022051 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-09 17:48:35.000000000 +0800 +++ testpkg.yaml 2010-03-10 23:54:19.000000000 +0800 @@ -14,6 +14,9 @@ Description: | Configure: none Builder: none +Files: + - "%doc README INST" + - "%{_bindir}/*" SubPackages: - Name: devel spectacle-0.25/tests/specify_cases/test-key_files/output.p0000644002342000234200000000036012502671637022255 0ustar rzrrzr--- output.orig.spec 2010-03-17 21:15:11.000000000 +0800 +++ output.spec 2010-03-17 21:15:11.000000000 +0800 @@ -61,6 +61,8 @@ rm -rf %{buildroot} %files %defattr(-,root,root,-) +%doc README INST +%{_bindir}/* # >> files # << files spectacle-0.25/tests/specify_cases/test-key_filesinput/input.p0000644002342000234200000000036312502671637023137 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-09 17:48:35.000000000 +0800 +++ testpkg.yaml 2010-03-14 18:12:14.000000000 +0800 @@ -14,6 +14,7 @@ Description: | Configure: none Builder: none +FilesInput: morefiles.lst SubPackages: - Name: devel spectacle-0.25/tests/specify_cases/test-key_filesinput/output.p0000644002342000234200000000035312502671637023337 0ustar rzrrzr--- output.orig.spec 2010-03-17 21:15:11.000000000 +0800 +++ output.spec 2010-03-17 21:15:11.000000000 +0800 @@ -59,7 +59,7 @@ rm -rf %{buildroot} -%files +%files -f morefiles.lst %defattr(-,root,root,-) # >> files # << files spectacle-0.25/tests/specify_cases/test-key_localefilespkgname/input.p0000644002342000234200000000125412502671637024602 0ustar rzrrzr--- ../base/testpkg.yaml 2012-06-25 14:18:41.048150783 +0300 +++ testpkg.yaml 2012-07-02 15:12:12.869536868 +0300 @@ -12,11 +12,15 @@ Description: | the base of all testings. In this YAML file, only basic keywords specified, plus with one sub package "devel". +PkgBR: + - intltool + Configure: none Builder: none +LocaleFilesPkgName: mylocale SubPackages: - - Name: devel - Summary: Development files for %{name} + - Name: mylocale + Summary: My locale files for %{name} Group: Development/Libraries - Description: This package contains development files for %{name}. + Description: This package contains locale files for %{name}. spectacle-0.25/tests/specify_cases/test-key_localefilespkgname/output.p0000644002342000234200000000220112502671637024774 0ustar rzrrzr--- output.orig.spec 2012-07-02 15:11:19.251535512 +0300 +++ output.spec 2012-07-02 15:12:13.125536955 +0300 @@ -16,6 +16,7 @@ License: BSD URL: http://www.testpkg.org/ Source0: http://www.testpkg.org/testpkg-%{version}.tar.gz Source100: testpkg.yaml +BuildRequires: intltool %description Sample package for spectacle testings, which will be used as @@ -23,13 +24,13 @@ the base of all testings. In this YAML f specified, plus with one sub package "devel". -%package devel -Summary: Development files for %{name} +%package mylocale +Summary: My locale files for %{name} Group: Development/Libraries Requires: %{name} = %{version}-%{release} -%description devel -This package contains development files for %{name}. +%description mylocale +This package contains locale files for %{name}. %prep @@ -55,13 +56,14 @@ rm -rf %{buildroot} # >> install post # << install post +%find_lang testpkg %files %defattr(-,root,root,-) # >> files # << files -%files devel +%files mylocale -f testpkg.lang %defattr(-,root,root,-) -# >> files devel -# << files devel +# >> files mylocale +# << files mylocale spectacle-0.25/tests/specify_cases/test-key_localename/input.p0000644002342000234200000000044212502671637023053 0ustar rzrrzr--- ../base/testpkg.yaml 2012-06-25 14:18:41.048150783 +0300 +++ testpkg.yaml 2012-07-02 14:40:12.890485506 +0300 @@ -14,7 +14,7 @@ Description: | Configure: none Builder: none - +LocaleName: localenametest SubPackages: - Name: devel Summary: Development files for %{name} spectacle-0.25/tests/specify_cases/test-key_localename/output.p0000644002342000234200000000046012502671637023254 0ustar rzrrzr--- output.orig.spec 2012-07-02 14:39:53.682485018 +0300 +++ output.spec 2012-07-02 14:40:13.041485537 +0300 @@ -55,8 +55,9 @@ rm -rf %{buildroot} # >> install post # << install post +%find_lang localenametest -%files +%files -f localenametest.lang %defattr(-,root,root,-) # >> files # << files spectacle-0.25/tests/specify_cases/test-key_localeopts_without_localename/input.p0000644002342000234200000000035712502671637027070 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-09 17:48:35.000000000 +0800 +++ testpkg.yaml 2010-03-14 15:09:42.000000000 +0800 @@ -14,6 +14,7 @@ Description: | Configure: none Builder: none +LocaleOptions: -gnome SubPackages: - Name: devel spectacle-0.25/tests/specify_cases/test-key_localeopts_without_localename/output.2p0000644002342000234200000000043112502671637027344 0ustar rzrrzr--- output.2.o 2012-07-02 15:35:08.199573778 +0300 +++ output.2 2012-07-02 15:35:08.308573781 +0300 @@ -1 +1,2 @@ +Warning: lost "LocaleName" keyword, use "%{name}" as default Warning: NEW spec file created: output.spec, maybe customized spec content is needed! spectacle-0.25/tests/specify_cases/test-key_localeopts_without_localename/output.p0000644002342000234200000000045112502671637027264 0ustar rzrrzr--- output.orig.spec 2012-07-02 15:35:08.199573778 +0300 +++ output.spec 2012-07-02 15:35:08.308573781 +0300 @@ -55,8 +55,9 @@ rm -rf %{buildroot} # >> install post # << install post +%find_lang %{name} -gnome -%files +%files -f %{name}.lang %defattr(-,root,root,-) # >> files # << files spectacle-0.25/tests/specify_cases/test-key_macros/input.p0000644002342000234200000000053212502671637022237 0ustar rzrrzr--- ../base/testpkg.yaml 2011-09-30 10:44:02.158593700 +0300 +++ testpkg.yaml 2012-02-24 15:02:54.521492540 +0200 @@ -12,6 +12,9 @@ Description: | the base of all testings. In this YAML file, only basic keywords specified, plus with one sub package "devel". +Macros: + - macros_key;macros_value + Configure: none Builder: none spectacle-0.25/tests/specify_cases/test-key_macros/output.p0000644002342000234200000000042412502671637022440 0ustar rzrrzr--- output.orig.spec 2012-02-24 15:02:35.635069569 +0200 +++ output.spec 2012-02-24 15:02:54.695496407 +0200 @@ -7,6 +7,7 @@ Name: testpkg # >> macros # << macros +%define macros_key macros_value Summary: Sample package for spectacle testings Version: 1.0 spectacle-0.25/tests/specify_cases/test-key_macros2/input.p0000644002342000234200000000053512502671637022324 0ustar rzrrzr--- ../base/testpkg.yaml 2011-09-30 10:44:02.158593700 +0300 +++ testpkg.yaml 2012-02-24 15:01:50.909068078 +0200 @@ -12,6 +12,9 @@ Description: | the base of all testings. In this YAML file, only basic keywords specified, plus with one sub package "devel". +Macros2: + - macros2_key;macros2_value + Configure: none Builder: none spectacle-0.25/tests/specify_cases/test-key_macros2/output.p0000644002342000234200000000046112502671637022523 0ustar rzrrzr--- output.orig.spec 2012-02-24 15:01:25.458498103 +0200 +++ output.spec 2012-02-24 15:01:51.080071835 +0200 @@ -34,6 +34,8 @@ Requires: %{name} = %{version}-%{relea This package contains development files for %{name}. +%define macros2_key macros2_value + %prep %setup -q -n %{name}-%{version} spectacle-0.25/tests/specify_cases/test-key_noautolocale/input.p0000644002342000234200000000040312502671637023435 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-15 12:26:52.000000000 +0800 +++ testpkg.yaml 2010-03-18 16:04:23.000000000 +0800 @@ -14,6 +14,9 @@ Description: | Configure: none Builder: none +PkgBR: + - intltool +NoAutoLocale: yes SubPackages: - Name: devel spectacle-0.25/tests/specify_cases/test-key_noautolocale/output.p0000644002342000234200000000056412502671637023646 0ustar rzrrzr--- output.orig.spec 2010-03-18 16:06:30.000000000 +0800 +++ output.spec 2010-03-18 16:06:30.000000000 +0800 @@ -14,6 +14,7 @@ License: BSD URL: http://www.testpkg.org/ Source0: http://www.testpkg.org/testpkg-%{version}.tar.gz Source100: testpkg.yaml +BuildRequires: intltool %description Sample package for spectacle testings, which will be used as spectacle-0.25/tests/specify_cases/test-key_noautoreq_noautoprov/input.p0000644002342000234200000000052112502671637025262 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-09 17:48:35.000000000 +0800 +++ testpkg.yaml 2010-03-14 15:06:15.000000000 +0800 @@ -12,6 +12,8 @@ Description: | the base of all testings. In this YAML file, only basic keywords specified, plus with one sub package "devel". +NoAutoReq: yes +NoAutoProv: yes Configure: none Builder: none spectacle-0.25/tests/specify_cases/test-key_noautoreq_noautoprov/output.p0000644002342000234200000000046712502671637025474 0ustar rzrrzr--- output.orig.spec 2010-07-06 18:53:41.052001337 +0800 +++ output.spec 2010-07-06 18:53:41.206652613 +0800 @@ -14,6 +14,8 @@ License: BSD URL: http://www.testpkg.org/ Source0: http://www.testpkg.org/testpkg-%{version}.tar.gz Source100: testpkg.yaml +AutoReq: 0 +AutoProv: 0 %description spectacle-0.25/tests/specify_cases/test-key_nodesktop/input.p0000644002342000234200000000043412502671637022762 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-15 12:26:52.000000000 +0800 +++ testpkg.yaml 2010-04-22 19:12:36.000000000 +0800 @@ -14,6 +14,9 @@ Description: | Configure: none Builder: none +NoDesktop: yes +Files: + - "%{_datadir}/applications/*.desktop" SubPackages: - Name: devel spectacle-0.25/tests/specify_cases/test-key_nodesktop/output.p0000644002342000234200000000036412502671637023165 0ustar rzrrzr--- output.orig.spec 2010-05-16 19:00:18.000000000 +0800 +++ output.spec 2010-05-16 19:00:18.000000000 +0800 @@ -64,6 +64,7 @@ rm -rf %{buildroot} %files %defattr(-,root,root,-) +%{_datadir}/applications/*.desktop # >> files # << files spectacle-0.25/tests/specify_cases/test-key_nosetup/input.p0000644002342000234200000000047612502671637022457 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-09 17:48:35.000000000 +0800 +++ testpkg.yaml 2010-03-10 23:54:35.000000000 +0800 @@ -12,6 +12,7 @@ Description: | the base of all testings. In this YAML file, only basic keywords specified, plus with one sub package "devel". +NoSetup: yes Configure: none Builder: none spectacle-0.25/tests/specify_cases/test-key_nosetup/output.p0000644002342000234200000000037212502671637022653 0ustar rzrrzr--- output.orig.spec 2010-03-17 21:15:12.000000000 +0800 +++ output.spec 2010-03-17 21:15:12.000000000 +0800 @@ -32,7 +32,7 @@ This package contains development files %prep -%setup -q -n %{name}-%{version} +# No setup # >> setup # << setup spectacle-0.25/tests/specify_cases/test-key_prefix/input.p0000644002342000234200000000034612502671637022253 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-15 12:26:52.000000000 +0800 +++ testpkg.yaml 2010-07-07 09:40:21.655437506 +0800 @@ -14,6 +14,7 @@ Description: | Configure: none Builder: none +Prefix: /opt SubPackages: - Name: devel spectacle-0.25/tests/specify_cases/test-key_prefix/output.p0000644002342000234200000000052412502671637022452 0ustar rzrrzr--- output.orig.spec 2010-07-07 09:40:12.216880219 +0800 +++ output.spec 2010-07-07 09:40:22.080459763 +0800 @@ -11,6 +11,7 @@ Version: 1.0 Release: 1 Group: System/Base License: BSD +Prefix: /opt URL: http://www.testpkg.org/ Source0: http://www.testpkg.org/testpkg-%{version}.tar.gz Source100: testpkg.yaml spectacle-0.25/tests/specify_cases/test-key_qmakeoptions/input.p0000644002342000234200000000062712502671637023472 0ustar rzrrzr--- ../base/testpkg.yaml 2010-09-07 11:40:02.000000000 +0800 +++ testpkg.yaml 2010-09-17 10:58:15.238565836 +0800 @@ -12,8 +12,10 @@ Description: | the base of all testings. In this YAML file, only basic keywords specified, plus with one sub package "devel". -Configure: none -Builder: none +Builder: qmake +QMakeOptions: + - --qmake-one + - --qmake-two SubPackages: - Name: devel spectacle-0.25/tests/specify_cases/test-key_qmakeoptions/output.p0000644002342000234200000000074112502671637023670 0ustar rzrrzr--- output.orig.spec 2010-09-17 10:57:44.102208294 +0800 +++ output.spec 2010-09-17 10:58:15.364208593 +0800 @@ -42,7 +42,11 @@ This package contains development files # >> build pre # << build pre +%qmake \ + --qmake-one \ + --qmake-two +make %{?jobs:-j%jobs} # >> build post # << build post @@ -50,6 +54,7 @@ This package contains development files rm -rf %{buildroot} # >> install pre # << install pre +%qmake_install # >> install post # << install post spectacle-0.25/tests/specify_cases/test-key_qmakeoptions_multidistros/input.p0000644002342000234200000000066112502671637026312 0ustar rzrrzr--- ../base/testpkg.yaml 2010-09-07 11:40:02.000000000 +0800 +++ testpkg.yaml 2010-09-17 10:58:52.978252858 +0800 @@ -12,8 +12,11 @@ Description: | the base of all testings. In this YAML file, only basic keywords specified, plus with one sub package "devel". -Configure: none -Builder: none +SupportOtherDistros: yes +Builder: qmake +QMakeOptions: + - --qmake-one + - --qmake-two SubPackages: - Name: devel spectacle-0.25/tests/specify_cases/test-key_qmakeoptions_multidistros/output.p0000644002342000234200000000203512502671637026510 0ustar rzrrzr--- output.orig.spec 2012-02-24 13:55:41.010615651 +0200 +++ output.spec 2012-02-24 13:55:41.182619524 +0200 @@ -16,6 +16,7 @@ License: BSD URL: http://www.testpkg.org/ Source0: http://www.testpkg.org/testpkg-%{version}.tar.gz Source100: testpkg.yaml +BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -44,15 +45,34 @@ This package contains development files # >> build pre # << build pre +%if 0%{?moblin_version} +%qmake \ +%else +qmake -makefile -nocache \ + "QMAKE_CFLAGS_RELEASE=${CFLAGS:-%optflags}" \ + "QMAKE_CFLAGS_DEBUG=${CFLAGS:-%optflags}" \ + "QMAKE_CXXFLAGS_RELEASE=${CXXFLAGS:-%optflags}" \ + "QMAKE_CXXFLAGS_DEBUG=${CXXFLAGS:-%optflags}" \ + QMAKE_STRIP=: \ + PREFIX=%{_prefix} \ +%endif + --qmake-one \ + --qmake-two +make %{?jobs:-j%jobs} # >> build post # << build post %install -rm -rf %{buildroot} +rm -rf $RPM_BUILD_ROOT # >> install pre # << install pre +%if 0%{?moblin_version} +%qmake_install +%else +%makeinstall +%endif # >> install post # << install post spectacle-0.25/tests/specify_cases/test-key_runfdupes/input.p0000644002342000234200000000036212502671637022767 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-09 17:48:35.000000000 +0800 +++ testpkg.yaml 2010-03-14 17:36:16.000000000 +0800 @@ -14,6 +14,7 @@ Description: | Configure: none Builder: none +RunFdupes: "%{_datadir}" SubPackages: - Name: devel spectacle-0.25/tests/specify_cases/test-key_runfdupes/output.p0000644002342000234200000000071212502671637023167 0ustar rzrrzr--- output.orig.spec 2012-02-24 13:56:16.145406638 +0200 +++ output.spec 2012-02-24 13:56:16.315410467 +0200 @@ -16,6 +16,7 @@ License: BSD URL: http://www.testpkg.org/ Source0: http://www.testpkg.org/testpkg-%{version}.tar.gz Source100: testpkg.yaml +BuildRequires: fdupes %description @@ -57,6 +58,7 @@ rm -rf %{buildroot} # >> install post # << install post +%fdupes %{buildroot}/%{_datadir} %files %defattr(-,root,root,-) spectacle-0.25/tests/specify_cases/test-key_setupoptions/input.p0000644002342000234200000000037212502671637023531 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-09 17:48:35.000000000 +0800 +++ testpkg.yaml 2010-03-14 23:06:35.000000000 +0800 @@ -14,6 +14,7 @@ Description: | Configure: none Builder: none +SetupOptions: --setup-opt-sample SubPackages: - Name: devel spectacle-0.25/tests/specify_cases/test-key_setupoptions/output.p0000644002342000234200000000041112502671637023724 0ustar rzrrzr--- output.orig.spec 2010-03-17 21:15:12.000000000 +0800 +++ output.spec 2010-03-17 21:15:13.000000000 +0800 @@ -32,7 +32,7 @@ This package contains development files %prep -%setup -q -n %{name}-%{version} +%setup --setup-opt-sample # >> setup # << setup spectacle-0.25/tests/specify_cases/test-key_sourceprefix/input.p0000644002342000234200000000051312502671637023470 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-09 17:48:35.000000000 +0800 +++ testpkg.yaml 2010-03-11 15:37:40.000000000 +0800 @@ -12,6 +12,7 @@ Description: | the base of all testings. In this YAML file, only basic keywords specified, plus with one sub package "devel". +SourcePrefix: fake-prefix Configure: none Builder: none spectacle-0.25/tests/specify_cases/test-key_sourceprefix/output.p0000644002342000234200000000041012502671637023665 0ustar rzrrzr--- output.orig.spec 2010-03-17 21:15:13.000000000 +0800 +++ output.spec 2010-03-17 21:15:13.000000000 +0800 @@ -32,7 +32,7 @@ This package contains development files %prep -%setup -q -n %{name}-%{version} +%setup -q -n fake-prefix # >> setup # << setup spectacle-0.25/tests/specify_cases/test-key_supportotherdistros/input.p0000644002342000234200000000046612502671637025147 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-09 17:48:35.000000000 +0800 +++ testpkg.yaml 2010-03-14 17:54:17.000000000 +0800 @@ -13,7 +13,8 @@ Description: | specified, plus with one sub package "devel". Configure: none -Builder: none +Builder: python +SupportOtherDistros: yes SubPackages: - Name: devel spectacle-0.25/tests/specify_cases/test-key_supportotherdistros/output.p0000644002342000234200000000212412502671637025341 0ustar rzrrzr--- output.orig.spec 2012-02-24 13:57:10.149622436 +0200 +++ output.spec 2012-02-24 13:57:10.318626241 +0200 @@ -8,6 +8,7 @@ Name: testpkg # >> macros # << macros +%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} Summary: Sample package for spectacle testings Version: 1.0 Release: 1 @@ -16,6 +17,7 @@ License: BSD URL: http://www.testpkg.org/ Source0: http://www.testpkg.org/testpkg-%{version}.tar.gz Source100: testpkg.yaml +BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -44,15 +46,20 @@ This package contains development files # >> build pre # << build pre - +CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build # >> build post # << build post %install -rm -rf %{buildroot} +rm -rf $RPM_BUILD_ROOT # >> install pre # << install pre +%if 0%{?suse_version} +%{__python} setup.py install --root=$RPM_BUILD_ROOT --prefix=%{_prefix} +%else +%{__python} setup.py install --root=$RPM_BUILD_ROOT -O1 +%endif # >> install post # << install post spectacle-0.25/tests/specify_cases/test-key_updatedesktopdb/input.p0000644002342000234200000000044212502671637024135 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-15 12:26:52.000000000 +0800 +++ testpkg.yaml 2010-04-22 19:12:36.000000000 +0800 @@ -14,6 +14,9 @@ Description: | Configure: none Builder: none +UpdateDesktopDB: yes +Files: + - "%{_datadir}/applications/*.desktop" SubPackages: - Name: devel spectacle-0.25/tests/specify_cases/test-key_updatedesktopdb/output.p0000644002342000234200000000172312502671637024341 0ustar rzrrzr--- output.orig.spec 2012-05-29 18:29:53.547913017 +0300 +++ output.spec 2012-05-29 18:29:54.183916168 +0300 @@ -16,6 +16,9 @@ License: BSD URL: http://www.testpkg.org/ Source0: http://www.testpkg.org/testpkg-%{version}.tar.gz Source100: testpkg.yaml +Requires(post): %{_bindir}/update-desktop-database +Requires(postun): %{_bindir}/update-desktop-database +BuildRequires: desktop-file-utils %description Sample package for spectacle testings, which will be used as @@ -55,9 +58,19 @@ rm -rf %{buildroot} # >> install post # << install post +desktop-file-install --delete-original \ + --dir %{buildroot}%{_datadir}/applications \ + %{buildroot}%{_datadir}/applications/*.desktop + +%post +update-desktop-database %{_datadir}/applications &> /dev/null || : + +%postun +update-desktop-database %{_datadir}/applications &> /dev/null || : %files %defattr(-,root,root,-) +%{_datadir}/applications/*.desktop # >> files # << files spectacle-0.25/tests/specify_cases/test-key_useasneeded/input.p0000644002342000234200000000035112502671637023237 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-09 17:48:35.000000000 +0800 +++ testpkg.yaml 2010-03-14 15:07:40.000000000 +0800 @@ -14,6 +14,7 @@ Description: | Configure: none Builder: none +UseAsNeeded: no SubPackages: - Name: devel spectacle-0.25/tests/specify_cases/test-key_useasneeded/output.p0000644002342000234200000000036412502671637023444 0ustar rzrrzr--- output.orig.spec 2010-03-17 21:15:18.000000000 +0800 +++ output.spec 2010-03-17 21:15:19.000000000 +0800 @@ -38,6 +38,7 @@ This package contains development files # << setup %build +unset LD_AS_NEEDED # >> build pre # << build pre spectacle-0.25/tests/specify_cases/test-namespace_configoptions/input.p0000644002342000234200000000071012502671637024776 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-15 12:26:52.000000000 +0800 +++ testpkg.yaml 2010-03-30 17:16:49.000000000 +0800 @@ -12,8 +12,13 @@ Description: | the base of all testings. In this YAML file, only basic keywords specified, plus with one sub package "devel". -Configure: none -Builder: none +Configure: configure +ConfigOptions: + - --common-opt + - arm:--arm-opt + - ix86:--x86-opt + +Builder: make SubPackages: - Name: devel spectacle-0.25/tests/specify_cases/test-namespace_configoptions/output.p0000644002342000234200000000106712502671637025205 0ustar rzrrzr--- output.orig.spec 2010-06-21 16:41:36.000000000 +0800 +++ output.spec 2010-06-21 16:41:36.000000000 +0800 @@ -42,7 +42,16 @@ This package contains development files # >> build pre # << build pre +%configure --disable-static \ + --common-opt \ +%ifarch %{arm} + --arm-opt \ +%endif +%ifarch %{ix86} + --x86-opt +%endif +make %{?jobs:-j%jobs} # >> build post # << build post @@ -50,6 +59,7 @@ This package contains development files rm -rf %{buildroot} # >> install pre # << install pre +%make_install # >> install post # << install post spectacle-0.25/tests/specify_cases/test-namespace_files/input.p0000644002342000234200000000055012502671637023221 0ustar rzrrzr--- ../base/testpkg.yaml 2010-09-07 11:40:02.000000000 +0800 +++ testpkg.yaml 2011-06-20 16:50:04.845494495 +0800 @@ -15,6 +15,11 @@ Description: | Configure: none Builder: none +Files: + - arm:%{_bin}/testpkg-arm + - ix86:%{_bin}/testpkg-ix86 + - "%{_bin}/testpkg" + SubPackages: - Name: devel Summary: Development files for %{name} spectacle-0.25/tests/specify_cases/test-namespace_files/output.p0000644002342000234200000000047612502671637023431 0ustar rzrrzr--- output.orig.spec 2011-06-20 16:48:59.504678925 +0800 +++ output.spec 2011-06-20 16:50:04.992678935 +0800 @@ -64,6 +64,13 @@ rm -rf %{buildroot} %files %defattr(-,root,root,-) +%ifarch %{arm} +%{_bin}/testpkg-arm +%endif +%ifarch %{ix86} +%{_bin}/testpkg-ix86 +%endif +%{_bin}/testpkg # >> files # << files spectacle-0.25/tests/specify_cases/test-namespace_patches/input.p0000644002342000234200000000073312502671637023551 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-15 12:26:52.000000000 +0800 +++ testpkg.yaml 2010-03-30 17:13:43.000000000 +0800 @@ -7,6 +7,10 @@ License: BSD URL: http://www.testpkg.org/ Sources: - http://www.testpkg.org/testpkg-%{version}.tar.gz +Patches: + - common-patch + - arm:arm-only-patch + - ix86:x86-only-patch Description: | Sample package for spectacle testings, which will be used as the base of all testings. In this YAML file, only basic keywords spectacle-0.25/tests/specify_cases/test-namespace_patches/output.p0000644002342000234200000000125512502671637023752 0ustar rzrrzr--- output.orig.spec 2010-12-09 13:51:58.537023891 +0800 +++ output.spec 2010-12-09 13:51:58.654023776 +0800 @@ -14,6 +14,13 @@ License: BSD URL: http://www.testpkg.org/ Source0: http://www.testpkg.org/testpkg-%{version}.tar.gz Source100: testpkg.yaml +Patch0: common-patch +%ifarch %{arm} +Patch1: arm-only-patch +%endif +%ifarch %{ix86} +Patch2: x86-only-patch +%endif %description @@ -35,6 +42,16 @@ This package contains development files %prep %setup -q -n %{name}-%{version} +# common-patch +%patch0 -p1 +%ifarch %{arm} +# arm-only-patch +%patch1 -p1 +%endif +%ifarch %{ix86} +# x86-only-patch +%patch2 -p1 +%endif # >> setup # << setup spectacle-0.25/tests/specify_cases/test-namespace_pkgbr/input.p0000644002342000234200000000056112502671637023226 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-15 12:26:52.000000000 +0800 +++ testpkg.yaml 2010-03-30 17:14:41.000000000 +0800 @@ -12,6 +12,11 @@ Description: | the base of all testings. In this YAML file, only basic keywords specified, plus with one sub package "devel". +PkgBR: + - common-br + - arm:arm-br + - ix86:x86-br + Configure: none Builder: none spectacle-0.25/tests/specify_cases/test-namespace_pkgbr/output.p0000644002342000234200000000072712502671637023433 0ustar rzrrzr--- output.orig.spec 2010-03-30 17:14:08.000000000 +0800 +++ output.spec 2010-03-30 17:14:42.000000000 +0800 @@ -14,6 +14,13 @@ License: BSD URL: http://www.testpkg.org/ Source0: http://www.testpkg.org/testpkg-%{version}.tar.gz Source100: testpkg.yaml +BuildRequires: common-br +%ifarch %{arm} +BuildRequires: arm-br +%endif +%ifarch %{ix86} +BuildRequires: x86-br +%endif %description Sample package for spectacle testings, which will be used as spectacle-0.25/tests/specify_cases/test-namespace_pkgconfigbr/input.p0000644002342000234200000000063512502671637024416 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-15 12:26:52.000000000 +0800 +++ testpkg.yaml 2010-03-30 17:15:43.000000000 +0800 @@ -12,6 +12,11 @@ Description: | the base of all testings. In this YAML file, only basic keywords specified, plus with one sub package "devel". +PkgConfigBR: + - common-pkgcfg + - arm:arm-pkgcfg >= 0.11 + - ix86:x86-pkgcfg >= %{xxx_version} + Configure: none Builder: none spectacle-0.25/tests/specify_cases/test-namespace_pkgconfigbr/output.p0000644002342000234200000000103612502671637024613 0ustar rzrrzr--- output.orig.spec 2010-03-30 17:14:57.000000000 +0800 +++ output.spec 2010-03-30 17:15:44.000000000 +0800 @@ -14,6 +14,13 @@ License: BSD URL: http://www.testpkg.org/ Source0: http://www.testpkg.org/testpkg-%{version}.tar.gz Source100: testpkg.yaml +BuildRequires: pkgconfig(common-pkgcfg) +%ifarch %{arm} +BuildRequires: pkgconfig(arm-pkgcfg) >= 0.11 +%endif +%ifarch %{ix86} +BuildRequires: pkgconfig(x86-pkgcfg) >= %{xxx_version} +%endif %description Sample package for spectacle testings, which will be used as spectacle-0.25/tests/specify_cases/test-namespace_qmakeoptions/input.p0000644002342000234200000000071512502671637024634 0ustar rzrrzr--- ../base/testpkg.yaml 2010-09-07 11:40:02.000000000 +0800 +++ testpkg.yaml 2010-09-17 11:00:19.520567286 +0800 @@ -12,8 +12,12 @@ Description: | the base of all testings. In this YAML file, only basic keywords specified, plus with one sub package "devel". -Configure: none -Builder: none +SupportOtherDistros: yes +Builder: qmake +QMakeOptions: + - arm:--arm-only + - ix86:--ix86-only + - --common-one SubPackages: - Name: devel spectacle-0.25/tests/specify_cases/test-namespace_qmakeoptions/output.p0000644002342000234200000000214112502671637025030 0ustar rzrrzr--- output.orig.spec 2012-02-24 13:58:20.120197684 +0200 +++ output.spec 2012-02-24 13:58:20.290201511 +0200 @@ -16,6 +16,7 @@ License: BSD URL: http://www.testpkg.org/ Source0: http://www.testpkg.org/testpkg-%{version}.tar.gz Source100: testpkg.yaml +BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -44,15 +45,39 @@ This package contains development files # >> build pre # << build pre +%if 0%{?moblin_version} +%qmake \ +%else +qmake -makefile -nocache \ + "QMAKE_CFLAGS_RELEASE=${CFLAGS:-%optflags}" \ + "QMAKE_CFLAGS_DEBUG=${CFLAGS:-%optflags}" \ + "QMAKE_CXXFLAGS_RELEASE=${CXXFLAGS:-%optflags}" \ + "QMAKE_CXXFLAGS_DEBUG=${CXXFLAGS:-%optflags}" \ + QMAKE_STRIP=: \ + PREFIX=%{_prefix} \ +%endif +%ifarch %{arm} + --arm-only \ +%endif +%ifarch %{ix86} + --ix86-only \ +%endif + --common-one +make %{?jobs:-j%jobs} # >> build post # << build post %install -rm -rf %{buildroot} +rm -rf $RPM_BUILD_ROOT # >> install pre # << install pre +%if 0%{?moblin_version} +%qmake_install +%else +%makeinstall +%endif # >> install post # << install post spectacle-0.25/tests/specify_cases/test-namespace_requires/input.p0000644002342000234200000000131312502671637023754 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-15 12:26:52.000000000 +0800 +++ testpkg.yaml 2010-03-30 17:11:48.000000000 +0800 @@ -11,6 +11,10 @@ Description: | Sample package for spectacle testings, which will be used as the base of all testings. In this YAML file, only basic keywords specified, plus with one sub package "devel". +Requires: + - arm:arm-pkgs + - ix86:x86-pkgs + - common-pkgs Configure: none Builder: none @@ -20,3 +24,7 @@ SubPackages: Summary: Development files for %{name} Group: Development/Libraries Description: This package contains development files for %{name}. + Requires: + - arm:arm-pkgs + - ix86:x86-pkgs + - common-pkgs spectacle-0.25/tests/specify_cases/test-namespace_requires/output.p0000644002342000234200000000151212502671637024156 0ustar rzrrzr--- output.orig.spec 2010-03-30 17:12:36.000000000 +0800 +++ output.spec 2010-03-30 17:12:37.000000000 +0800 @@ -14,6 +14,13 @@ License: BSD URL: http://www.testpkg.org/ Source0: http://www.testpkg.org/testpkg-%{version}.tar.gz Source100: testpkg.yaml +%ifarch %{arm} +Requires: arm-pkgs +%endif +%ifarch %{ix86} +Requires: x86-pkgs +%endif +Requires: common-pkgs %description Sample package for spectacle testings, which will be used as @@ -26,6 +33,13 @@ specified, plus with one sub package "de Summary: Development files for %{name} Group: Development/Libraries Requires: %{name} = %{version}-%{release} +%ifarch %{arm} +Requires: arm-pkgs +%endif +%ifarch %{ix86} +Requires: x86-pkgs +%endif +Requires: common-pkgs %description devel This package contains development files for %{name}. spectacle-0.25/tests/specify_cases/test-pholder_postun/input.p0000644002342000234200000000255512502671637023157 0ustar rzrrzr--- /dev/null 2010-03-01 09:42:51.548118450 +0800 +++ output.spec 2010-03-16 17:58:02.000000000 +0800 @@ -0,0 +1,77 @@ +# +# Do not Edit! Generated by: +# spectacle version 0.13 +# +# >> macros +# << macros + +Name: testpkg +Summary: Sample package for spectacle testings +Version: 1.0 +Release: 1 +Group: System/Base +License: BSD +URL: http://www.testpkg.org/ +Source0: http://www.testpkg.org/testpkg-%{version}.tar.gz +Source100: testpkg.yaml + +%description +Sample package for spectacle testings, which will be used as +the base of all testings. In this YAML file, only basic keywords +specified, plus with one sub package "devel". + + + +%package devel +Summary: Development files for %{name} +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} + +%description devel +This package contains development files for %{name}. + + +%prep +%setup -q -n %{name}-%{version} + +# >> setup +# << setup + +%build +# >> build pre +# << build pre + + + +# >> build post +# << build post +%install +rm -rf %{buildroot} +# >> install pre +# << install pre + +# >> install post +# << install post + + + + + +%postun +# >> postun +# customized postun scripts here +# for testing +# << postun + + +%files +%defattr(-,root,root,-) +# >> files +# << files + + +%files devel +%defattr(-,root,root,-) +# >> files devel +# << files devel + spectacle-0.25/tests/specify_cases/test-pholder_postun/output.2p0000644002342000234200000000041712502671637023435 0ustar rzrrzr--- output.2.o 2012-07-02 15:35:08.430573784 +0300 +++ output.2 2012-07-02 15:35:08.546573787 +0300 @@ -1 +1 @@ -Warning: NEW spec file created: output.spec, maybe customized spec content is needed! +Info: Old spec file exists, patching output.spec ... spectacle-0.25/tests/specify_cases/test-pholder_postun/output.p0000644002342000234200000000045612502671637023356 0ustar rzrrzr--- output.orig.spec 2012-07-02 15:35:08.430573784 +0300 +++ output.spec 2012-07-02 15:35:08.546573787 +0300 @@ -56,6 +56,12 @@ rm -rf %{buildroot} # << install post +%postun +# >> postun +# customized postun scripts here +# for testing +# << postun + %files %defattr(-,root,root,-) # >> files spectacle-0.25/tests/specify_cases/test-pholder_pre/input.p0000644002342000234200000000253212502671637022410 0ustar rzrrzr--- /dev/null 2010-03-01 09:42:51.548118450 +0800 +++ output.spec 2010-03-16 18:06:45.000000000 +0800 @@ -0,0 +1,78 @@ +# +# Do not Edit! Generated by: +# spectacle version 0.13 +# +# >> macros +# << macros + +Name: testpkg +Summary: Sample package for spectacle testings +Version: 1.0 +Release: 1 +Group: System/Base +License: BSD +URL: http://www.testpkg.org/ +Source0: http://www.testpkg.org/testpkg-%{version}.tar.gz +Source100: testpkg.yaml + +%description +Sample package for spectacle testings, which will be used as +the base of all testings. In this YAML file, only basic keywords +specified, plus with one sub package "devel". + + + +%package devel +Summary: Development files for %{name} +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} + +%description devel +This package contains development files for %{name}. + + +%prep +%setup -q -n %{name}-%{version} + +# >> setup +# << setup + +%build +# >> build pre +# << build pre + + + +# >> build post +# << build post +%install +rm -rf %{buildroot} +# >> install pre +# << install pre + +# >> install post +# << install post + + + +%pre +# >> pre +# extra pre scripts +# for testing +# << pre + + + + + +%files +%defattr(-,root,root,-) +# >> files +# << files + + +%files devel +%defattr(-,root,root,-) +# >> files devel +# << files devel + spectacle-0.25/tests/specify_cases/test-pholder_pre/output.2p0000644002342000234200000000041712502671637022673 0ustar rzrrzr--- output.2.o 2012-07-02 15:35:08.668573791 +0300 +++ output.2 2012-07-02 15:35:08.785573794 +0300 @@ -1 +1 @@ -Warning: NEW spec file created: output.spec, maybe customized spec content is needed! +Info: Old spec file exists, patching output.spec ... spectacle-0.25/tests/specify_cases/test-pholder_pre/output.p0000644002342000234200000000043012502671637022604 0ustar rzrrzr--- output.orig.spec 2012-07-02 15:35:08.668573791 +0300 +++ output.spec 2012-07-02 15:35:08.785573794 +0300 @@ -56,6 +56,12 @@ rm -rf %{buildroot} # << install post +%pre +# >> pre +# extra pre scripts +# for testing +# << pre + %files %defattr(-,root,root,-) # >> files spectacle-0.25/tests/specify_cases/test-pholder_preun/input.p0000644002342000234200000000254212502671637022754 0ustar rzrrzr--- /dev/null 2010-03-01 09:42:51.548118450 +0800 +++ output.spec 2010-03-16 18:06:45.000000000 +0800 @@ -0,0 +1,78 @@ +# +# Do not Edit! Generated by: +# spectacle version 0.13 +# +# >> macros +# << macros + +Name: testpkg +Summary: Sample package for spectacle testings +Version: 1.0 +Release: 1 +Group: System/Base +License: BSD +URL: http://www.testpkg.org/ +Source0: http://www.testpkg.org/testpkg-%{version}.tar.gz +Source100: testpkg.yaml + +%description +Sample package for spectacle testings, which will be used as +the base of all testings. In this YAML file, only basic keywords +specified, plus with one sub package "devel". + + + +%package devel +Summary: Development files for %{name} +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} + +%description devel +This package contains development files for %{name}. + + +%prep +%setup -q -n %{name}-%{version} + +# >> setup +# << setup + +%build +# >> build pre +# << build pre + + + +# >> build post +# << build post +%install +rm -rf %{buildroot} +# >> install pre +# << install pre + +# >> install post +# << install post + + + +%preun +# >> preun +# extra preun scripts +# for testing +# << preun + + + + + +%files +%defattr(-,root,root,-) +# >> files +# << files + + +%files devel +%defattr(-,root,root,-) +# >> files devel +# << files devel + spectacle-0.25/tests/specify_cases/test-pholder_preun/output.2p0000644002342000234200000000041712502671637023236 0ustar rzrrzr--- output.2.o 2012-07-02 15:35:08.912573797 +0300 +++ output.2 2012-07-02 15:35:09.027573800 +0300 @@ -1 +1 @@ -Warning: NEW spec file created: output.spec, maybe customized spec content is needed! +Info: Old spec file exists, patching output.spec ... spectacle-0.25/tests/specify_cases/test-pholder_preun/output.p0000644002342000234200000000044012502671637023150 0ustar rzrrzr--- output.orig.spec 2012-07-02 15:35:08.912573797 +0300 +++ output.spec 2012-07-02 15:35:09.027573800 +0300 @@ -56,6 +56,12 @@ rm -rf %{buildroot} # << install post +%preun +# >> preun +# extra preun scripts +# for testing +# << preun + %files %defattr(-,root,root,-) # >> files spectacle-0.25/tests/specify_cases/test-series_conf/input.p0000644002342000234200000000027412502671637022405 0ustar rzrrzr--- /dev/null 2010-03-10 23:37:54.000000000 +0800 +++ series.conf 2010-03-10 23:37:41.000000000 +0800 @@ -0,0 +1,4 @@ +# comment of patch1 +patch1.patch +# comment of patch2 +patch2.patch spectacle-0.25/tests/specify_cases/test-series_conf/output.p0000644002342000234200000000106512502671637022605 0ustar rzrrzr--- output.orig.spec 2010-12-09 13:51:45.727876005 +0800 +++ output.spec 2010-12-09 13:51:45.843107241 +0800 @@ -14,6 +14,8 @@ License: BSD URL: http://www.testpkg.org/ Source0: http://www.testpkg.org/testpkg-%{version}.tar.gz Source100: testpkg.yaml +Patch0: patch1.patch +Patch1: patch2.patch %description @@ -35,6 +37,12 @@ This package contains development files %prep %setup -q -n %{name}-%{version} +# comment of patch1 +# patch1.patch +%patch0 -p1 +# comment of patch2 +# patch2.patch +%patch1 -p1 # >> setup # << setup spectacle-0.25/tests/specify_cases/test-sourceprefix_from_tarball/input.p0000644002342000234200000000051312502671637025344 0ustar rzrrzr--- ../base/testpkg.yaml 2010-03-09 17:48:35.000000000 +0800 +++ testpkg.yaml 2010-03-11 15:37:40.000000000 +0800 @@ -12,6 +12,7 @@ Description: | the base of all testings. In this YAML file, only basic keywords specified, plus with one sub package "devel". +SourcePrefix: fake-prefix Configure: none Builder: none spectacle-0.25/tests/specify_cases/test-sourceprefix_from_tarball/output.p0000644002342000234200000000041012502671637025541 0ustar rzrrzr--- output.orig.spec 2010-03-17 21:15:18.000000000 +0800 +++ output.spec 2010-03-17 21:15:18.000000000 +0800 @@ -32,7 +32,7 @@ This package contains development files %prep -%setup -q -n this-is-new-prefix +%setup -q -n fake-prefix # >> setup # << setup spectacle-0.25/tests/specify_cases/test-sourceprefix_from_tarball/testpkg-1.0.tar.gz0000644002342000234200000000024512502671637027132 0ustar rzrrzr‹V ™KíÑA Â0…á%(Nâ$=`ƒ”ÒFÔÛlq£„lŠÿGàmd’I‡n¬ó9·×ºÚØÝ6Ui"Òxož¦§SÎŒµ[ N‚·ÎˆUu¡2¾ø$\Æ´ò(ûc\ìåZ\jÌïxåJ¤÷ý·§>ÝKÞ‘ÿ#¨þ²¯¯Œ”â›?ß?€õz°S (spectacle-0.25/tests/test_specify.py0000644002342000234200000000353312502671637016045 0ustar rzrrzr#!/usr/bin/python -tt # vim: ai ts=4 sts=4 et sw=4 # Copyright (c) 2009 Intel Corporation # # 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; version 2 of the License # # 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, write to the Free Software Foundation, Inc., 59 # Temple Place - Suite 330, Boston, MA 02111-1307, USA. import os,sys import glob import tempfile import subprocess import unittest from testbase import * class TestSpecifyKeys(unittest.TestCase): cases_dir = 'specify_cases' # build cases on the fly based on directories if os.path.isdir(cases_dir): for case in glob.glob(os.path.join(cases_dir, 'test-*')): if not os.path.exists(os.path.join(case, 'input.p')): continue case = os.path.basename(case)[5:] newmethod = """ def test_%s(self): print "case %s ok" self.assertTrue(self._compare_out_file("%s")) """ % (case, case, case) exec newmethod in locals() def _compare_out_file(self, case): prep_working_env(self.cases_dir, case, self.work_dir) if run_and_check(self.work_dir): return (compare_outfile(self.work_dir)) else: return False def setUp(self): self.work_dir = tempfile.mkdtemp() def tearDown(self): cleanup(self.work_dir) def suite(): tl = unittest.TestLoader() return tl.loadTestsFromModule(sys.modules[__name__]) spectacle-0.25/tests/testbase.py0000644002342000234200000000766512502671637015170 0ustar rzrrzr#!/usr/bin/python -tt # vim: ai ts=4 sts=4 et sw=4 # Copyright (c) 2009 Intel Corporation # # 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; version 2 of the License # # 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, write to the Free Software Foundation, Inc., 59 # Temple Place - Suite 330, Boston, MA 02111-1307, USA. SCRIPTS = """ specify -N -n -o output.spec testpkg.yaml 1>output.1.o 2>output.2.o mv output.spec output.orig.spec patch -s < input.p specify -N -n -o output.spec testpkg.yaml 1>ouput.1 2>output.2 if [ ! -f output.no -a ! -f output.spec ]; then mv output.2 output.error exit 1 fi if [ -f output.p ]; then diff -upN output.orig.spec output.spec > newoutput.p mv output.spec output.new.spec patch < output.p >/dev/null fi if [ -f output.1p ]; then diff -upN output.1.o output.1 > newoutput.1p mv output.1 output.1.n patch < output.1p >/dev/null fi if [ -f output.2p ]; then diff -upN output.2.o output.2 > newoutput.2p mv output.2 output.2.n patch < output.2p >/dev/null fi """ import os,sys import glob import shutil import filecmp BLUE='\033[%dm' % 34 RED='\033[%dm' % 31 RESET = '\033[0m' def prep_working_env(cases_dir, case, dst_dir): shutil.copy(os.path.join(cases_dir, 'base', 'testpkg.yaml'), dst_dir) for out in glob.glob(os.path.join(cases_dir, 'test-'+case, '*')): try: if not os.path.isdir(out): shutil.copy(out, dst_dir) except: pass # ignore if file missing def cleanup(work_dir): shutil.rmtree(work_dir) def run_and_check(work_dir): result = True cwd = os.getcwd() os.chdir(work_dir) os.system(SCRIPTS) if os.path.exists('output.error'): # something wrong with tested tools print >> sys.stderr, file(os.path.join(work_dir, 'output.error')).read() result = False os.chdir(cwd) return result def compare_outfile(work_dir): all_equ = True #print glob.glob(os.path.join(work_dir, '*')) desc = {'output.p': '*.spec', 'output.1p': 'STDOUT', 'output.2p': 'STDERR'} orig = {'output.p': 'output.orig.spec', 'output.1p': 'output.1.o', 'output.2p': 'output.2.o'} new = {'output.p': 'output.new.spec', 'output.1p': 'output.1.n', 'output.2p': 'output.2.n'} for out in ('output.p', 'output.1p', 'output.2p'): fp = os.path.join(work_dir, out) if os.path.exists(fp): if not filecmp.cmp(os.path.join(work_dir, orig[out]),\ os.path.join(work_dir, new[out])): all_equ = False exp_output_diff = file(fp).read().strip() output_diff = file(os.path.join(work_dir, 'new'+out)).read().strip() if not output_diff: output_diff = '' if not exp_output_diff: exp_output_diff = '' print "%sExpected changes of %s:" % (BLUE,desc[out]) print '----------------------------------------------------------------------%s' % RESET print exp_output_diff print '%s----------------------------------------------------------------------%s' % (BLUE,RESET) print "%sActual:" % RED print '----------------------------------------------------------------------%s' % RESET print output_diff print '%s----------------------------------------------------------------------%s' % (RED,RESET) return all_equ spectacle-0.25/tools/deb2spectacle0000755002342000234200000003377412502671637015430 0ustar rzrrzr#!/usr/bin/python -tt # vim: ai ts=4 sts=4 et sw=4 # Copyright (c) 2009 Intel Corporation # # 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; version 2 of the License # # 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, write to the Free Software Foundation, Inc., 59 # Temple Place - Suite 330, Boston, MA 02111-1307, USA. """ Overview of deb2spectacle: Tool to convert debian file to spectacle compatibile YAML/spec The input files can be: """ INPUT_SRC=""" 1. "control" file for only package metainfo 2. "debian/" directory that contains all the deb files 3. tarball "debian.tar.gz" which contain all the deb files """ #TODO: 4. gzipped diff file with names *.diff.gz which include all the content of deb files #TODO: 5. binary .deb support using pure python parser import os, sys import re import string # spectacle modules from spectacle.convertor import * from spectacle.dumper import * from spectacle import logger from spectacle import deb822 from spectacle.__version__ import VERSION # global constants DEBTARBALL = 'debian.tar.gz' class DebConvertor(Convertor): """ Convertor for deb keys to yaml ones """ def __init__(self): deb_cv_table = { 'Section': 'Group', 'Build-Depends': 'PkgBR', 'Build-Depends-Indep': 'PkgBR', 'Build-Conflicts': 'BuildConflicts', 'Build-Conflicts-Indep': 'BuildConflicts', 'Depends': 'Requires', 'Pre-Depends': 'RequiresPre', 'Pre-Depends': 'RequiresPre', 'Suggests': 'Requires', # FIXME 'Recommends': 'Requires', # FIXME 'Replaces': 'Obsoletes', 'Breaks': 'Conflicts', 'Homepage': 'URL', 'Architecture': 'BuildArch', 'Vcs-Git': 'SCM', 'Vcs-Svn': 'SCM', 'Vcs-Cvs': 'SCM', 'Vcs-Hg': 'SCM', } self.re_debvar = re.compile('\$\{([^}]+)\}', re.M) self.debvars = { 'shlibs:Depends': '', # spec autodep/autopro can handle it 'shlibs:Pre-Depends': '', 'misc:Depends': '', 'python:Depends': 'python', 'python:Provides': '', 'perl:Depends': 'perl', 'binary:Version': '%{version}-%{release}', 'source:Version': '%{version}-%{release}', 'Source-Version': '%{version}-%{release}', #legacy one # TODO more } self.depkeys = ( 'PkgBR', 'Requires', 'RequiresPre', 'Provides', 'Obsoletes', 'Conflicts', 'BuildConflicts', ) self.re_userfield = re.compile('^X[BCS]+-.*') self.dropkeys = ( 'Maintainer', 'Uploaders', 'Changed-By', 'Priority', 'Essential', 'Standards-Version', 'Vcs-Browser', 'Vcs-Bzr' ) # regex of depends compare self.re_depcomp = re.compile('\(([<>=]+)\s*([^)]*)\)') # regex of depends about os and arch self.re_deposarch = re.compile('(.*)\[[^]]*\](.*)$') Convertor.__init__(self, deb_cv_table) def _replace_var(self, val): if isinstance(val, list): return val while self.re_debvar.search(val): nval = val for m in self.re_debvar.finditer(val): var = m.group(1) if var in self.debvars: rep = self.debvars[var] nval = nval.replace('${%s}' % var, rep) if val == nval: break val = nval return val def _conv_dep(self, single): def comp_replace(dep): if not dep: return None dep = dep.strip() m = self.re_deposarch.search(dep) if m: (old, name, rest) = m.group(0, 1, 2) dep = dep.replace(old,'%s %s' %(name, rest)) m = self.re_depcomp.search(dep) if m: (old, op, ver) = m.group(0, 1, 2) if op == '>>': op = '>' elif op == '<<': op = '<' dep = dep.replace(old, '%s %s' %(op, ver)) return dep return filter(lambda x:x, map(comp_replace, str(single).split(','))) def _translate_keys(self, items): """ override parent class method for pre-processing """ #! at this point, all keys name have been translated # drop debian only keys for key in items.keys(): if key in self.dropkeys or self.re_userfield.match(key): del items[key] # split 'Description' to 'Summary' + 'Description' lines = items['Description'].splitlines() items['Summary'] = lines[0] items['Description'] = '\n'.join(lines[1:]) # expand all debian variables for key, val in items.iteritems(): items[key] = self._replace_var(val) # depends keys handling for key, val in items.iteritems(): if key in self.depkeys: items[key] = self._conv_dep(val) # architecture translate if 'BuildArch' in items: if items['BuildArch'] == 'any': items['BuildArch'] = 'noarch' # otherwise, no BuildArch needed del items['BuildArch'] Convertor._translate_keys(self, items) class DebInfo: """ Container of package information from debian files """ def __init__(self, binver, license): self.fields = {'Version': binver, 'License': license, 'Release': '1', } self.pkgname = None self.sec_section = None def _get_subpkgname(self, raw): if raw.startswith(self.pkgname): left = raw.lstrip(self.pkgname) try: int(left) # should be main pkg return self.pkgname except ValueError: # not pure number string if left.startswith('-'): # sub packages with main-name prefix subname = left.lstrip('-') if subname == 'dev': # the rpm tradition return 'devel' else: return subname # return orignal value without special recog return raw def format_filelist(self, filelist): """ format the debian filelist format """ ret = [] for file in filelist: file = string.replace (file, 'debian/tmp', '') file = file.strip() if file.find (' ') != -1: base = file.split (' ')[0].split ('/')[-1] dir = file.split (' ')[1] file = '%s/%s' % (dir, base) ret.append (file) return ret def feed(self, ctl, rules=None): """ feed in the file content of: ctl: "control" rules: "rules", optional """ for para in deb822.Deb822.iter_paragraphs(ctl.splitlines()): items = dict(para.items()) if 'Source' in items: # Source paragraph, and must be the 1st para items['Name'] = items['Source'] del items['Source'] items['Sources'] = '%s-%s.tar.gz' % (items['Name'], self.fields['Version']) self.fields.update(items) self.pkgname = items['Name'] self.src_section = items['Section'] else: # confirm the format of input if 'Package' not in items or not self.pkgname: logger.error('input debian control is in wrong format') bpkg = items['Package'] del items['Package'] subpkg = self._get_subpkgname(bpkg) if subpkg == self.pkgname: # main package if os.path.isdir('debian') and os.path.isfile('debian/%s.install' % (subpkg)): items['Files'] = self.format_filelist (open('debian/%s.install' % (subpkg)).readlines()) self.fields.update(items) else: # sub-packages if 'SubPackages' not in self.fields: self.fields['SubPackages'] = [] if os.path.isdir('debian') and os.path.isfile('debian/%s.install' % (subpkg)): items['Files'] = self.format_filelist (open('debian/%s.install' % (subpkg)).readlines()) items['Name'] = subpkg if subpkg == bpkg: items['AsWholeName'] = 'True' if 'Section' not in items: items['Section'] = self.src_section self.fields['SubPackages'].append(items) def all_info(self): return self.fields def convert_deb(ctl, binver, license, outdir): """ Generate spectacle files based on content of debain/control argument :ctl contain the content of debian/control """ convertor = DebConvertor() # feed in the debian/control file to parser debi = DebInfo(binver, license) debi.feed(ctl) # Dump data to yaml dumper = SpectacleDumper(opath = '%s/%s.yaml' % (outdir, debi.pkgname)) spec_fpath = dumper.dump(convertor.convert(debi.all_info())) logger.info('YAML and SPEC file are created with pkg name %s in dir: %s' % (debi.pkgname, outdir)) def get_binver_from_dsc(dsc_fp): re_ver = re.compile('^Version:\s*(.*)') try: with open(dsc_fp) as f: for line in f: line = line.strip() if not line: continue m = re_ver.match(line) if m: return m.group(1) logger.error('cannot found version information in dsc file %s, please specify version using -V|--version' % dsc_fp) except OSError: logger.error('cannot read dsc file %s' % dsc_fp) def parse_options(args): import optparse usage = """Usage: %prog [options] [debian-path] The "debian-path" can be:""" + INPUT_SRC parser = optparse.OptionParser(usage, version=VERSION) parser.add_option("-o", "--outdir", type="string", dest="outdir", default=None, help="Path of output yaml/spec files") parser.add_option("-V", "--binver", type="string", help="The version string of binary packages") parser.add_option("", "--dsc", type="string", help='The path of "dsc" file for version information') parser.add_option("-L", "--license", type="string", help="The License string of this package") return parser.parse_args() if __name__ == '__main__': """ Main Function """ (opts, args) = parse_options(sys.argv[1:]) if not opts.binver and not opts.dsc: logger.error('Must provide one of the two options "-V|--binver" and "--dsc"') if not opts.license: logger.error('Must provide the License string using "-L|--license" options') ctl_path = None if not args: if os.path.isfile('control'): ctl_path = os.path.abspath('./control') logger.info('using "control" under current directory') elif os.path.isdir('debian') and os.path.isfile('debian/control'): ctl_path = os.path.abspath('./debian/control') logger.info('using "control" under "debian/" directory') elif os.path.isfile(DEBTARBALL): logger.info('using "%s" under current directory' % DEBTARBALL) else: # no debian packaging file found in cwd logger.error('found no debian files in current dir, please specify one') else: if not args[0].endswith(DEBTARBALL): ctl_path = os.path.abspath(os.path.expanduser(args[0])) if ctl_path: if not os.path.exists(ctl_path): # input file does not exist logger.error("%s: File does not exist" % ctl_path) ctl_cont = open(ctl_path).read() else: # means the input is debian.tar.gz # extract "control" from it import tarfile if tarfile.is_tarfile(DEBTARBALL): tar = tarfile.open(DEBTARBALL) found = False for member in tar.getmembers(): if member.name == 'debian/control' and \ member.isfile(): found = True break if found: ctl_cont = tar.extractfile('debian/control').read() tar.close() logger.info('using "debian/control" in debian.tar.gz archive') else: logger.error('debian.tar.gz contains no "debian/control" file') else: logger.error('debian.tar.gz is not a valid tarball') # prepare the output folder if opts.outdir: outdir = os.path.abspath(os.path.expanduser(opts.outdir)) else: outdir = os.path.abspath('./spectacle') if opts.binver: binver = opts.binver else: # opts.dsc must be valid binver = get_binver_from_dsc(opts.dsc) # TODO binver = binver.split('-',)[0] if not os.path.exists(outdir): os.makedirs(outdir) convert_deb(ctl_cont, binver, opts.license, outdir) spectacle-0.25/tools/ini2spectacle0000755002342000234200000002517312502671637015447 0ustar rzrrzr#!/usr/bin/python -tt # vim: ai ts=4 sts=4 et sw=4 # Copyright (c) 2009 Intel Corporation # # 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; version 2 of the License # # 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, write to the Free Software Foundation, Inc., 59 # Temple Place - Suite 330, Boston, MA 02111-1307, USA. """Overview of ini2yaml (1) ini2yaml reads the ini file and divides it into segments. (2) Parses the 'header' segment. Write out the key,value pairs (3) Expand the 'Files' if found (4) Parse the sub-packages segments if found """ import os import sys import re import shutil import optparse from ConfigParser import RawConfigParser # spectacle modules from spectacle.convertor import * from spectacle.dumper import * from spectacle import logger class SBConvertor(Convertor): """ Convertor for SpecBuild ini files """ def __init__(self): sb_cv_table = { 'BuildRequires': 'PkgBR', 'PkgConfig': 'PkgConfigBR', 'Extras': 'ExtraSources', 'Extra': 'extra', } Convertor.__init__(self, sb_cv_table) class SBConfigParser(RawConfigParser): """ SpecBuild ini specific parser """ # keys whose value need to split to list multi_keys = ('Sources', 'Patches', 'Extras', 'LocaleOptions', ) # keys whose value may have ver numbers reqs_keys = ('BuildRequires', 'PreRequires', 'Requires', 'PostRequires', 'PkgConfig', 'Provides', 'Obsoletes', 'Conflicts', ) # keys whose value need to be expand(reading extra file) expand_keys = ('Files', 'Description', 'PostMakeExtras', 'PostMakeInstallExtras', ) # boolean keys bool_keys = ('UseAsNeeded', 'NoAutoReq', 'NoAutoProv', 'AddCheck', ) # keys need to be placed to 'extra' extra_keys = ['Files', 'PostMakeExtras', 'PostMakeInstallExtras', ] # must have keys must_keys = {'Release': '1', 'Configure': 'configure', } def __init__(self, include_files): RawConfigParser.__init__(self) if include_files: self.extra_keys.remove('Files') self.record_used_files = [] self._check_Makefile() def _check_Makefile(self): """ Check whether Makefile in working dir should be moved """ if os.path.exists('Makefile'): try: cont = file('Makefile').read() if re.search('\s+spec-builder\s+', cont): # The Makefile is for spec-builder self.record_used_files.append('Makefile') except: pass def read(self, filenames): """ override super read to record input files """ if isinstance(filenames, basestring): filenames = [filenames] self.record_used_files.extend(filenames) return RawConfigParser.read(self, filenames) def optionxform(self, option): # Capitalize the first char lead = option[0] if lead.upper() != lead: return lead.upper() + option[1:] else: return option def _expand_single(self, filename): """ Helper function to expand *.desc """ if os.path.exists(filename): self.record_used_files.append(filename) return file(filename).read().strip() else: logger.warning("Warning: missing expected file %s" % filename) return None def _cook_config(self): """ Helper function to update fields for spec-builder specific ones """ all_items = {} main_extra = {} # for extra keys of main pkg for section in self.sections(): items = self._sections[section] # Convert space seperated string to list for key in self.multi_keys: if key in items: self.set(section, key, map(str.strip, items[key].split())) # Convert dependent like entry to list for key in self.reqs_keys: if key in items: reqs = [] for entry in re.findall('\S+\s+[<>=]+\s+\S+|\S+', items[key]): reqs.append(entry.split(',')[0]) self.set(section, key, reqs) # special cases for 'ConfigOptions' if 'ConfigOptions' in items: self.set(section, 'ConfigOptions', map(lambda s: '--'+s, [opt for opt in map(str.strip, items['ConfigOptions'].split('--')) if opt])) # special cases for 'LocaleOptions' if 'LocaleOptions' in items and 'LocaleName' not in items: self.set(section, 'LocaleName', '%{name}') # Convert boolean keys for key in self.bool_keys: if key in items: if items[key].upper() in ('NO', 'FALSE', '0'): del items[key] else: self.set(section, key, 'yes') # Convert keys which need expanding from external file for key in self.expand_keys: if key in items: content = self._expand_single(items[key]) if content: if key == 'Files': # 'Files' need split to list self.set(section, key, content.split('\n')) else: self.set(section, key, content) else: # if file empty or file not exists, remove the empty key del items[key] # move extra keys to 'extra' key extra = {} for key in self.extra_keys: if key in items: extra[key] = items[key] del items[key] if extra: if section not in ('header', 'configuration'): self.set(section, 'extra', extra) else: main_extra.update(extra) for section in self.sections(): if section in ('header', 'configuration'): all_items.update(dict(self.items(section))) if main_extra: all_items['extra'] = main_extra # Checking must-have keys for key, default in self.must_keys.iteritems(): if key not in all_items: all_items[key] = default # Re-structure sub packages to inner level if 'SubPackages' in all_items: subpkg_list = all_items['SubPackages'].split() all_items['SubPackages'] = [] for subpkg in subpkg_list: try: all_items['SubPackages'].append(dict(self.items(subpkg))) all_items['SubPackages'][-1].update({'Name': subpkg}) except NoSectionError, e: logger.warning('Needed section for sub-package %s not found' % subpkg) raise e return all_items def cooked_items(self): """ return all items, cooked to the input of convertor """ return self._cook_config() def parse_options(args): import spectacle.__version__ usage = "Usage: %prog [options] [ini-path]" parser = optparse.OptionParser(usage, version=spectacle.__version__.VERSION) parser.add_option("-o", "--output", type="string", dest="outfile_path", default=None, help="Path of output yaml file") parser.add_option("-f", "--include-files", action="store_true", dest="include_files", default=False, help="To store files list in YAML file") return parser.parse_args() if __name__ == '__main__': """ Main Function """ (options, args) = parse_options(sys.argv[1:]) if not args: # no ini-path specified, search in CWD import glob inils = glob.glob('*.ini') if not inils: logger.error('Cannot find valid spec-builder file(*.ini) in current directory, please specify one.') elif len(inils) > 1: logger.error('Find multiple spec-builder files(*.ini) in current directory, please specify one.') ini_fpath = inils[0] else: ini_fpath = args[0] # Check if the input file exists if not os.path.exists(ini_fpath): # input file does not exist logger.error("%s: File does not exist" % ini_fpath) # check the working path if ini_fpath.find('/') != -1 and os.path.dirname(ini_fpath) != os.path.curdir: wdir = os.path.dirname(ini_fpath) logger.info('Changing to working dir: %s' % wdir) os.chdir(wdir) ini_fname = os.path.basename(ini_fpath) if options.outfile_path: out_fpath = options.outfile_path else: if ini_fname.endswith('.ini'): out_fpath = ini_fname[:-3] + 'yaml' else: out_fpath = ini_fname + '.yaml' """Read the input file""" config = SBConfigParser(include_files = options.include_files) config.read(ini_fname) convertor = SBConvertor() """Dump them to spectacle file""" dumper = SpectacleDumper(format='yaml', opath = out_fpath) spec_fpath = dumper.dump(convertor.convert(config.cooked_items())) logger.info('Yaml file %s created' % out_fpath) if spec_fpath: logger.info('Spec file %s was created with extra data' % spec_fpath) # move old spec-builder files to backup dir backDir = 'spec-builder.backup' try: os.mkdir(backDir) except: pass if os.path.exists(backDir) and not os.path.isfile(backDir): logger.info('The following used spec-builder files are moved to dir: %s' % backDir) for file in config.record_used_files: logger.info('\t' + os.path.basename(file)) shutil.move(file, backDir) spectacle-0.25/tools/spec2spectacle0000755002342000234200000006205112502671637015616 0ustar rzrrzr#!/usr/bin/python -tt # vim: ai ts=4 sts=4 et sw=4 # Copyright (c) 2009 Intel Corporation # # 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; version 2 of the License # # 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, write to the Free Software Foundation, Inc., 59 # Temple Place - Suite 330, Boston, MA 02111-1307, USA. """Overview of spec2spectacle """ import os import sys import re import glob import optparse # spectacle modules from spectacle.convertor import * from spectacle.dumper import * from spectacle import logger class SpecError(Exception): def __ini__(self, cur_state, cur_pkg, cur_line): self.cur_state = cur_state self.cur_pkg = cur_pkg self.cur_line = cur_line def __repr__(self): return self.cur_state + self.cur_pkg + self.cur_line class SpecFormatError(SpecError): pass class SpecUnknowLineError(SpecError): pass class SpecUnknowHeaderError(SpecError): pass HEADERS = ( 'package', 'description', 'prep', 'build', 'install', 'clean', 'check', 'preun', 'pre', 'postun', 'post', 'files', 'changelog' ) SINGLES = ( 'Summary', 'Name', 'Version', 'Release', 'Epoch', 'URL', 'Url', 'Group', 'BuildArch', 'AutoReq', 'AutoProv', 'AutoReqProv', 'Autoreq', 'Autoprov', 'Autoreqprov', 'ExclusiveArch', 'Prefix', 'License' ) REQUIRES = ('BuildRequires', 'Requires', 'Requires(post)', 'Requires(postun)', 'Requires(pre)', 'PreRequires', 'PreReq', 'Prereq', # alias in old spec 'Requires(preun)', 'Provides', 'Obsoletes', 'Conflicts', 'BuildConflicts', ) SKIPS = ( 'BuildRoot',) # must have keys for 'main' package MUSTHAVE = {'Release': '1', } # state definition of parser ( ST_DEFINE, ST_MAIN, ST_INLINE, ST_SUBPKG, ) = range(4) class SpecConvertor(Convertor): """ Convertor for SpecBuild ini files """ def __init__(self): sb_cv_table = { 'BuildRequires': 'PkgBR', 'pre': 'install-pre', 'description': 'Description', 'Requires(post)': 'RequiresPost', 'Requires(postun)': 'RequiresPostUn', 'Requires(pre)': 'RequiresPre', 'PreRequires': 'RequiresPre', 'PreReq': 'RequiresPre', 'Prereq': 'RequiresPre', 'Requires(preun)': 'RequiresPreUn', 'Url': 'URL', 'Autoreq': 'AutoReq', 'Autoprov': 'AutoProv', 'Autoreqprov': 'AutoReqProv', } Convertor.__init__(self, sb_cv_table) class SpecParser(object): """ Parser of SPEC file of rpm package """ def __init__(self, replace_macros, builder_parsing, include_files): # runtime variables self.items = {} self.table = {} self.cur_pkg = 'main' self.include_files = include_files self.builder_parsing = builder_parsing self._Builder = None self._Configure = None self.replace_macros = replace_macros self.macros = [] def _switch_subpkg(self, subpkg, create=False): # whether '-n subpkg'? wholename = False ls = subpkg.split() if '-n' in ls: try: subpkg = ls[ls.index('-n')+1] wholename = True except IndexError: raise SpecFormatError(subpkg) else: subpkg = ls[0] subpkg_new = 'SubPackages' not in self.items or subpkg not in self.items['SubPackages'] if subpkg_new and not create: logger.warning(' un-declared subpkg %s found in spec' % subpkg) return None if subpkg_new: if 'SubPackages' not in self.items: self.items['SubPackages'] = {} if subpkg not in self.items['SubPackages']: self.items['SubPackages'][subpkg] = {} if wholename: self.items['SubPackages'][subpkg]['AsWholeName'] = True # switch self.cur_pkg = subpkg return self.items['SubPackages'][subpkg] def _do_package(self, items, pkg, h, v): # skip pass def _do_prep(self, items, pkg, h, v): logger.info(' the following is the content of PREP in original spec, please compare them with the generated carefully: \n%s' % v) def _do_build(self, items, pkg, h, v): """ to handle build script: trying to find out the most of the generic cases """ def _save_raw_in_post(items, lines): # make sure no 'make' generated auto items['Configure'] = 'none' items['Builder'] = 'none' # put all script to 'post install' items['extra']['PostMakeExtras'] = lines ### Sub START lines = v.splitlines() if lines[0].startswith('-'): lines.pop(0) if not self.builder_parsing: _save_raw_in_post(items, lines) return # parts of build script (PRE, POST_CFG, POST_BUILD) = range(3) parts = { 'pre': [], 'post': [] } cur_part = PRE cont_line = False for line in lines: if cont_line: whole_line = whole_line + ' ' + line.strip() else: if not line.strip() or line.startswith('#'): # empty line or comment line, skip continue whole_line = line.strip() if line[-1:] == '\\': cont_line = True whole_line = whole_line[:-1].strip() continue else: cont_line = False found_cfgr = False found_bldr = False # find configure in current line for cfgr in ('configure', 'reconfigure', 'autogen'): pieces = whole_line.split() if cfgr in pieces or '%'+cfgr in pieces: found_cfgr = True self._Configure = cfgr cfgr_line = whole_line[len(cfgr)+1:].strip() break # find builder in current line if re.match('^(%\{__)?make', whole_line): found_bldr = True self._Builder = 'make' elif re.search('python\W+setup.py\W+build', whole_line): found_bldr = True self._Builder = 'python' if cur_part == PRE: if found_cfgr: cur_part = POST_CFG elif found_bldr: cur_part = POST_BUILD else: parts['pre'].append(whole_line) elif cur_part == POST_CFG: if found_cfgr: # more 'configr', wrong cur_part = PRE break elif found_bldr: cur_part = POST_BUILD else: # another line(s) between configr and buildr, wrong # or no supported buildr found, wrong cur_part = PRE break elif cur_part == POST_BUILD: parts['post'].append(whole_line) if cur_part == PRE: # means match failed _save_raw_in_post(items, lines) else: if self._Configure: items['Configure'] = self._Configure # parse the configure options opts = map(lambda s: '--'+s, [opt for opt in map(str.strip, cfgr_line.split('--')) if opt]) if opts: items['ConfigOptions'] = opts else: # no configure found, only need builder items['Configure'] = 'none' if self._Builder: items['Builder'] = self._Builder if parts['pre']: items['extra']['PreMakeExtras'] = parts['pre'] if parts['post']: items['extra']['PostMakeExtras'] = parts['post'] def _do_install(self, items, pkg, h, v): """ to handle install script: trying to find out the most of the generic cases """ lines = v.splitlines() if lines[0].startswith('-'): lines.pop(0) # try to search %find_lang filter_lines = [] for line in lines: if line.startswith('%find_lang'): m = re.compile('^%find_lang\s+(.*)\s*').match(line) if m: parts = m.group(1).split() if '||' in parts: parts = parts[:parts.index('||')] items['LocaleName'] = parts.pop(0) if parts: items['LocaleOptions'] = parts continue filter_lines.append(line) lines = filter_lines parts = { 'pre': [], 'post': [] } if self._Builder == 'make': re_installer = re.compile('make[_ \t]*install') elif self._Builder == 'python': re_installer = re.compile('python\W+setup.py\W+install') re_cleanup = re.compile('(rm|\%\{__rm\})\W+-rf\W+(\$RPM_BUILD_ROOT|\%\{buildroot\})') if self._Builder: # have found 'Builder' in build scripts found_insaller = False for line in lines: if not found_insaller: if re_installer.search(line): found_insaller = True elif re_cleanup.search(line): # skip cleanup line pass else: parts['pre'].append(line) else: parts['post'].append(line) if found_insaller: if parts['pre']: items['extra']['PreMakeInstallExtras'] = parts['pre'] if parts['post']: items['extra']['PostMakeInstallExtras'] = parts['post'] return # false safe case items['extra']['PostMakeInstallExtras'] = lines def _do_clean(self, items, pkg, h, v): # skip pass def _do_check(self, items, pkg, h, v): items['extra']['check'] = v.strip() items['Check'] = True def _parse_prog_in_opt(self, header): ls = header.split() if '-p' in ls: try: return ls[ls.index('-p')+1] except IndexError: raise SpecFormatError(h) else: return '' def _do_extra_scripts(self, items, h, v): section = h.split()[0][1:] items['extra'][section] = v.strip().splitlines() inline_prog = self._parse_prog_in_opt(h) if inline_prog: items['extra'][section].insert(0, inline_prog) def _do_pre(self, items, pkg, h, v): self._do_extra_scripts(items, h, v) def _do_preun(self, items, pkg, h, v): self._do_extra_scripts(items, h, v) def _do_post(self, items, pkg, h, v): self._do_extra_scripts(items, h, v) def _do_postun(self, items, pkg, h, v): self._do_extra_scripts(items, h, v) def _do_changelog(self, items, pkg, h, v): logger.warning(' Please move changelog in %changelog to *.changes file.') def _remove_attrs(self, files): # try to remove duplicate '%defattr' in files list dup = '%defattr(-,root,root,-)' dup2 = '%defattr(-,root,root)' if dup in files: files.remove(dup) if dup2 in files: files.remove(dup2) def _do_files(self, items, pkg, h, v): files = map(str.strip, v.strip().splitlines()) if files: # skip option line if files[0].startswith('-'): files.pop(0) self._remove_attrs(files) if self.include_files: items['Files'] = files else: items['extra']['Files'] = files def _do_description(self, items, pkg, h, v): items['Description'] = v.strip() def read(self, filename): """ read in all recognized directives and headers """ comment = re.compile('^#.*') directive = re.compile('^([\w()]+):[ \t]*(.*)') define_re = re.compile('^%(define|global)\s+(\w+)\s+(.*)') header_re = re.compile('^%(' + '|'.join(HEADERS) + ')\s*(.*)') state = ST_DEFINE items = self.items for line in file(filename): if state == ST_DEFINE: line = line.strip() if not line or comment.match(line): # skip comment line and empty line continue m = define_re.match(line) if m: if self.replace_macros: self.table[m.group(2)] = m.group(3) else: self.macros.append(line) continue #short-cut else: state = ST_MAIN # fall through if state == ST_INLINE: if header_re.match(line): state = ST_MAIN # fall through else: if items: items[cur_block] += line continue if state == ST_MAIN: line = line.strip() if not line or comment.match(line): # skip comment line and empty line continue dm = directive.match(line) if not dm: hm = header_re.match(line) if dm: key = dm.group(1) val = dm.group(2) # special case for Source and Patch if key.startswith('Source'): key = 'Sources' elif key.startswith('Patch'): key = 'Patches' if key not in items: items[key] = [val] else: items[key].append(val) elif hm: header = hm.group(1) opt = hm.group(2) if header not in HEADERS: raise SpecUnknowHeaderError(state, self.cur_pkg, header) if header == 'package': if not opt: raise SpecFormatError(line) items = self._switch_subpkg(opt, True) else: # inline sections of other headers state = ST_INLINE if opt and (not opt.startswith('-') or '-n' in opt): # section with sub-pkg specified items = self._switch_subpkg(opt) else: # for 'main' package items = self.items if items: cur_block = header if cur_block not in items: items[cur_block] = line+'\n' """ # options in header line as the first line if ' -' in line: items[cur_block] = line[line.index(' -'):] + '\n' """ else: # unparsed line known_skips = ('python_sitelib', 'python_sitearch') msg = True for skip in known_skips: if skip in line: msg = False break if msg: logger.warning(' un-parsed spec line skipped: %s' % line) def cooked_items(self): """ return all items, cooked to the input of convertor """ return self._cook_items('main', self.items) def _cook_items(self, pkg_name, items): """ helper function to transfer data structure """ # pattern of macros macro_re = re.compile('%{(\w+)}') ck_items = {'extra': {}} if pkg_name != 'main': ck_items['Name'] = pkg_name for k, v in items.iteritems(): if k in SKIPS or k in HEADERS or k == 'SubPackages': continue if self.table: # macro replacing nv = [] for vi in v: while macro_re.search(vi): nvi = vi for m in macro_re.finditer(vi): macro, name = m.group(0, 1) if name in self.table: nvi = nvi.replace(macro, self.table[name]) if vi == nvi: break # break to exit 'while' loop vi = nvi # now nvi is the replaced string nv.append(vi) v = nv if k in SINGLES: # special case for Release if k == 'Release': m = re.match('(\S+)%{\?dist}', v[0]) if m: ck_items[k] = m.group(1) else: ck_items[k] = v[0] else: ck_items[k] = v[0] elif k in REQUIRES: nbr = [] # new 'PkgConfigBR' list nv = [] for vi in v: if 'perl' in vi: nv.append(vi) elif ',' in vi: reqs = [] for entry in re.findall('\S+\s+[<>=]+\s+[^,\s]+|[^,\s]+', vi): reqs.append(entry) nv += reqs elif ' ' in vi: reqs = [] for entry in re.findall('\S+\s+[<>=]+\s+\S+|\S+', vi): reqs.append(entry) nv += reqs else: nv.append(vi) if 'pkgconfig' in vi and k == 'BuildRequires': for nvi in nv: pkgbr = re.sub(r'pkgconfig\s*\(\s*([^\)]*)\s*\)', r'\1', nvi) if pkgbr != nvi: nbr.append(pkgbr) nv.remove(nvi) ck_items[k] = nv if nbr: ck_items['PkgConfigBR'] = nbr else: ck_items[k] = v # handle all sectinos with header, IN-ORDER for hdr in HEADERS: if hdr in items: routine = getattr(self, '_do_' + hdr) hdr_line, Drop, content = items[hdr].partition('\n') routine(ck_items, pkg_name, hdr_line, content) if pkg_name != 'main': # shortcut for subpkg return ck_items # handle subpackages if 'SubPackages' in items: ck_items['SubPackages'] = [] for sub, sub_items in items['SubPackages'].iteritems(): ck_items['SubPackages'].append(self._cook_items(sub, sub_items)) # check must-have keys for key, default in MUSTHAVE.iteritems(): if key not in ck_items: ck_items[key] = default # check for global macros if self.macros: ck_items['extra']['macros'] = self.macros return ck_items def parse_options(args): import spectacle.__version__ usage = "Usage: %prog [options] [spec-path]" parser = optparse.OptionParser(usage, version=spectacle.__version__.VERSION) parser.add_option("-o", "--output", type="string", dest="outfile_path", default=None, help="Path of output yaml file") parser.add_option("-r", "--replace-macros", action="store_true", dest="replace_macros", default=False, help="To replace self-defined macros in spec file") parser.add_option("", "--no-builder-parsing", action="store_false", dest="builder_parsing", default=True, help="Do NOT try to parse build/install scripts") parser.add_option("-f", "--include-files", action="store_true", dest="include_files", default=False, help="To store files list in YAML file") return parser.parse_args() def check_yaml_file(spec_fpath): specDir = os.path.dirname(spec_fpath) if not specDir: specDir = os.path.curdir yaml_s = glob.glob('*.yaml') if yaml_s: answer = logger.ask(""""*.yaml" file(s) exists in working dir: %s Maybe this package has been converted to spectacle enabled one. Continue?""" % ' '.join(yaml_s), False) if not answer: sys.exit(1) def check_ini_file(spec_fpath): specDir = os.path.dirname(spec_fpath) if not specDir: specDir = os.path.curdir ini_s = glob.glob('*.ini') if ini_s: answer = logger.ask(""""*.ini" file(s) exists in working dir: %s If being spec-builder file(s), please use ini2spectacle to convert. Continue?""" % ' '.join(ini_s), False) if not answer: sys.exit(1) def check_spec_file(spec_fpath): heads = """# # Do not Edit! Generated by: # spectacle version """ new_heads = """# # Do NOT Edit the Auto-generated Part! # Generated by: spectacle version """ fcont = file(spec_fpath).read() if fcont.startswith(heads) or fcont.startswith(new_heads): logger.error(' Input spec file is a spectacle generated one, do NOT convert it again.') if __name__ == '__main__': """ Main Function """ (options, args) = parse_options(sys.argv[1:]) if not args: # no spec-path specified, search in CWD specls = glob.glob('*.spec') if not specls: logger.error(' Cannot find valid spec file in current directory, please specify one.') elif len(specls) > 1: logger.error(' Find multiple spec files in current directory, please specify one.') spec_fpath = specls[0] else: spec_fpath = args[0] # Check if YAML file exists check_yaml_file(spec_fpath) # Check if spec-build's INI file exists check_ini_file(spec_fpath) # Check if the input file exists if not os.path.exists(spec_fpath): # input file does not exist logger.error(" %s: File does not exist" % spec_fpath) # Check if spec file is spectacle generated one check_spec_file(spec_fpath) # check the working path if spec_fpath.find('/') != -1 and os.path.dirname(spec_fpath) != os.path.curdir: wdir = os.path.dirname(spec_fpath) logger.info(' Changing to working dir: %s' % wdir) os.chdir(wdir) spec_fname = os.path.basename(spec_fpath) if options.outfile_path: out_fpath = options.outfile_path else: if spec_fname.endswith('.spec'): out_fpath = spec_fname[:-4] + 'yaml' else: out_fpath = spec_fname + '.yaml' """Read the input file""" spec_parser = SpecParser(replace_macros = options.replace_macros, builder_parsing = options.builder_parsing, include_files = options.include_files ) try: spec_parser.read(spec_fname) except SpecFormatError, e: logger.warning(' Spec syntax error: %s' % str(e)) except SpecUnknowHeaderError, e: logger.warning(' Unknown spec header: %s' % str(e)) convertor = SpecConvertor() """Dump them to spectacle file""" dumper = SpectacleDumper(format='yaml', opath = out_fpath) newspec_fpath = dumper.dump(convertor.convert(spec_parser.cooked_items())) logger.info(' Yaml file %s created' % out_fpath) if newspec_fpath: bak_spec_fpath = os.path.join('spec.backup', newspec_fpath) logger.info(' New spec file %s was generated by new yaml file,' % newspec_fpath) logger.info(' and orignal spec file was saved as %s' % bak_spec_fpath) spectacle-0.25/tools/specify0000755002342000234200000001376612502671637014371 0ustar rzrrzr#!/usr/bin/python -tt # vim: ai ts=4 sts=4 et sw=4 # Copyright (c) 2009 Intel Corporation # # 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; version 2 of the License # # 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, write to the Free Software Foundation, Inc., 59 # Temple Place - Suite 330, Boston, MA 02111-1307, USA. from __future__ import with_statement import os,sys import optparse import glob from spectacle import specify from spectacle import logger def new_yaml(fpath): from spectacle import dumper if not fpath.endswith('.yaml'): fpath += '.yaml' autokeys = list(specify.MAND_KEYS) + ['Sources', 'Requires', 'PkgBR', 'PkgConfigBR'] items = [] for key in autokeys: if key in specify.STR_KEYS: items.append((key, '^^^')) elif key in specify.LIST_KEYS: items.append((key, ['^^^'])) dumper = dumper.SpectacleDumper(format='yaml', opath = fpath) dumper.dump(items) # append comments with open(fpath, 'a') as f: f.write("""# Please replace all "^^^" with valid values, or remove the unused keys. # And cleanup these comments lines for the best. """) logger.info('New spectacle yaml file created: %s' % fpath) if logger.ask('Continue to edit the new file?'): if 'EDITOR' in os.environ: editor = sys.environ['EDITOR'] else: editor = 'vi' os.system('%s %s' % (editor, fpath)) def new_subpkg(fpath, sub): def _has_subs(path): import re with open(path) as f: lines = f.read() if re.search('^SubPackages:', lines, re.M): return True else: return False if _has_subs(fpath): str_sub = '\n' else: str_sub = '\nSubPackages:\n' str_sub +=""" - Name: %s Summary: ^^^ Group: ^^^ # Please replace all "^^^" with valid values, and cleanup this comment line. """ % sub with open(fpath, 'a') as f: f.write(str_sub) def parse_options(args): import spectacle.__version__ usage = "Usage: %prog [options] [yaml-path]" parser = optparse.OptionParser(usage, version=spectacle.__version__.VERSION) parser.add_option("-o", "--output", type="string", dest="outfile_path", default=None, help="Path of output spec file") parser.add_option("-s", "--skip-scm", action="store_true", dest="skip_scm", default=False, help="Skip to check upstream SCM when specified in YAML") parser.add_option("-N", "--not-download", action="store_true", dest="not_download", default=False, help="Do not try to download newer source files") parser.add_option("-n", "--non-interactive", action="store_true", dest="noninteractive", default=False, help="Non interactive running, to use default answers") parser.add_option("", "--new", type="string", dest="newyaml", default=None, help="Create a new yaml from template") parser.add_option("", "--newsub", type="string", dest="newsub", default=None, help="Append a new sub-package to current yaml") return parser.parse_args() if __name__ == '__main__': """ Main Function """ (options, args) = parse_options(sys.argv[1:]) if options.noninteractive: logger.set_mode(False) if options.newyaml: if glob.glob('*.yaml'): if not logger.ask('Yaml file found in current dir, continue to create a new one?', False): sys.exit(0) elif glob.glob('*.spec'): if not logger.ask('Spec file found in current dir, maybe you need spec2spectacle to convert it, continue?', False): sys.exit(0) new_yaml(options.newyaml) sys.exit(0) if not args: # no YAML-path specified, search in CWD yamlls = glob.glob('*.yaml') if not yamlls: logger.error('Cannot find valid spectacle file(*.yaml) in current directory, please specify one.') elif len(yamlls) > 1: logger.error('Find multiple spectacle files(*.yaml) in current directory, please specify one.') yaml_fpath = yamlls[0] else: yaml_fpath = args[0] # check if the input file exists if not os.path.isfile(yaml_fpath): # input file does not exist logger.error("%s: File does not exist" % yaml_fpath) if options.newsub: new_subpkg(yaml_fpath, options.newsub) logger.info('Yaml file: %s has been appended with new subpkg: %s' % (yaml_fpath, options.newsub)) sys.exit(0) if options.outfile_path: if os.path.sep in options.outfile_path: out_fpath = os.path.abspath(options.outfile_path) else: out_fpath = options.outfile_path else: # %{name}.spec as the default if not specified out_fpath = None # check the working path if yaml_fpath.find(os.path.sep) != -1 and os.path.dirname(yaml_fpath) != os.path.curdir: wdir = os.path.dirname(yaml_fpath) logger.info('Changing to working dir: %s' % wdir) os.chdir(wdir) yaml_fname = os.path.basename(yaml_fpath) spec_fpath, newspec = specify.generate_rpm(yaml_fname, spec_fpath=out_fpath, download_new=not options.not_download, skip_scm=options.skip_scm) if newspec: logger.warning("NEW spec file created: %s, maybe customized spec content is needed!" % spec_fpath) else: logger.info("Old spec file exists, patching %s ..." % spec_fpath)