From 544831854014d160b8f9100d6442219da90aacea Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 10 Dec 2015 02:27:59 +0100 Subject: a bunch of stuff... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- .gitignore | 4 + COPYING | 681 +++++++++++++++++++++++++++++++++++++++++++++++- INSTALL | 99 +++---- LICENSE | 674 ----------------------------------------------- Makefile | 81 ------ Makefile.in | 96 +++++++ README | 5 +- TODO | 11 +- configure | 55 ++++ doc/man/scrotty.1 | 12 +- doc/man/scrotty.sv.1 | 4 +- mk/README | 28 +- mk/all.mk | 27 +- mk/clean.mk | 21 +- mk/configure | 719 +++++++++++++++++++++++++++++++++++++++++++++++++++ mk/copy.mk | 8 +- mk/dist.mk | 35 ++- mk/empty.mk | 8 + mk/i18n.mk | 17 +- mk/lang-c.mk | 32 ++- mk/lowerpath.mk | 279 ++++++++++++++++++++ mk/man.mk | 23 +- mk/path.mk | 66 +++-- mk/prologue.mk | 16 ++ mk/texinfo.mk | 100 ++++--- mk/tools.mk | 91 ++++++- po/sv.po | 32 ++- src/scrotty.c | 69 ++++- 28 files changed, 2313 insertions(+), 980 deletions(-) delete mode 100644 LICENSE delete mode 100644 Makefile create mode 100644 Makefile.in create mode 100755 configure create mode 100644 mk/configure create mode 100644 mk/lowerpath.mk create mode 100644 mk/prologue.mk diff --git a/.gitignore b/.gitignore index 15781f6..b0e1fc9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ _/ /bin/ /obj/ +/aux/ \#*\# .* !.git* @@ -23,4 +24,7 @@ _/ *.tar.* *.checksums *.sig +/config.status +/Makefile +/scrotty-* diff --git a/COPYING b/COPYING index ecb4d60..94a9ed0 100644 --- a/COPYING +++ b/COPYING @@ -1,17 +1,674 @@ -scrotty — Framebuffer screenshot program + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 -Copyright © 2014, 2015 Mattias Andrée (maandree@member.fsf.org) + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. + Preamble -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. + The GNU General Public License is a free, copyleft license for +software and other kinds of works. -You should have received a copy of the GNU General Public License -along with this program. If not, see . + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/INSTALL b/INSTALL index 6a7c319..c267f74 100644 --- a/INSTALL +++ b/INSTALL @@ -1,87 +1,76 @@ -For most users the following should be sufficient: +Type './configure --help' for configuration options. The normal settings for a +GNU package should work. If not, please make a bug report. - make - make install DESTDIR="pkg" # install to ./pkg temporarily instead - # of to /, installed files can then be - # moved by root. + On a common GNU/Linux distribution the following should + be sufficient for most users: -Note however, `make install` will not run `install-info' -to add the info manual to `info '(dir)'`. Distributors -should postinstall and preuninstall commands: + ./configure --prefix=/usr + make + make install DESTDIR="somewhere you want the files for now" + # Now let the package manager put the files in place... - infodir="usr/share/info" + Or for an unstaged install: + + ./configure --prefix=/usr + make + sudo make install + +By default any applicable pre-install, post-install, pre-uninstall, and +post-install commands is run. This suppress these, run 'make' with 'N=true' +or 'N=:'. IF you want to know which these commands are, you can use the +methods specificed in the GNU Coding Standards. Another method is found in +mk/README. However, for this packages, these will be: + + infodir="usr/local/share/info" ## Assuming default prefix. - post_install() { + post_install () { install-info -- "${infodir}/scrotty.info" "${infodir}/dir" } - post_upgrade() { - post_install "$1" - } - - pre_uninstall() { + pre_uninstall () { install-info --delete -- "${infodir}/scrotty.info" "${infodir}/dir" } -If you want to install absolutely everything, you can -instead use the commands below: - - make everything - make install-everything DESTDIR="pkg" - -Or if you only want to absolute basics: - - make base - make install-base DESTDIR="pkg" - ──────────────────────────────────────────────────────────────────────────────── INTERNATIONALISATION ──────────────────────────────────────────────────────────────────────────────── -If you want to do not want internationalisation build and install -with WITHOUT_GETTEXT=1. For example: +You can chose to restrict the locales to install: - make base WITHOUT_GETTEXT=1 - make install-base WITHOUT_GETTEXT=1 DESTDIR="pkg" + ./configure LOCALES=sv -You can also chose to restrict the locales to install: +You can select which translations of the man page you +want to install too: - make all LOCALES=sv - make install LOCALES=sv DESTDIR="pkg" - -You can select which translations of the man page you want to -install too: - - make install MAN_LOCALES=sv DESTDIR="pkg" + ./configure MAN_LOCALES=sv ──────────────────────────────────────────────────────────────────────────────── CUSTOMISED COMPILATION ──────────────────────────────────────────────────────────────────────────────── -If you do not have GCC, you may want to set WARN to an empty string: +The makefile is configured to compile the C code with -O2 -g, you can +change this by setting OPTIMISE, or with CFLAGS and LDFLAGS if you want +to change all optional flags compiling and linking flags: - make WARN= + ./configure OPTIMISE="-Og -g" -The makefile is configured to compile the C code with -O2, you can -change this by setting OPTIMISE: - make OPTIMISE="-Og -g" - -If you want to build the package with another prefix the /usr, set -PREFIX: +──────────────────────────────────────────────────────────────────────────────── +CUSTOMISED INSTALLATION +──────────────────────────────────────────────────────────────────────────────── - make PREFIX=/usr/local +If you want to install absolutely everything, you can +instead use the commands below: -See the beginning of the Makefile for further file system hierarchy -customisations. These changes, including PREFIX, should be used both -when compiling and installing. + make everything + make install-everything DESTDIR="pkg" +Or if you only want to absolute basics: -──────────────────────────────────────────────────────────────────────────────── -CUSTOMISED INSTALLATION -──────────────────────────────────────────────────────────────────────────────── + make base + make install-base DESTDIR="pkg" You can select freely what parts of the package to install and not to install. This rules are available: @@ -91,9 +80,7 @@ to install. This rules are available: ├─────────────┼─────────────────────┼────────────────────────────────────────────┤ │ base │ install-base │ Install be basics: │ │ cmd │ install-cmd │ Install the scrotty command. │ -│ │ install-copyright │ Install legal documents: │ -│ │ install-copying │ Install copyright notice. │ -│ │ install-license │ Install the GNU GPL version 3. │ +│ │ install-copyright │ Install GNU GPL version 3. │ │ doc │ install-doc │ Include all manuals: │ │ info │ install-info │ Include info manual. (Texinfo) │ │ dvi │ install-dvi │ Include DVI manual. (Texinfo) │ diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 94a9ed0..0000000 --- a/LICENSE +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/Makefile b/Makefile deleted file mode 100644 index 3d6635e..0000000 --- a/Makefile +++ /dev/null @@ -1,81 +0,0 @@ -# Copyright (C) 2015 Mattias Andrée -# -# Copying and distribution of this file, with or without modification, -# are permitted in any medium without royalty provided the copyright -# notice and this notice are preserved. This file is offered as-is, -# without any warranty. - - -### See INSTALL for information on how to install this package. ### - - -# Prototype directory paths. You can change them! -include mk/path.mk - - - -# The name of the command as it should be installed. -COMMAND = scrotty -# The name of the package as it should be installed. -PKGNAME = scrotty - -# Additional options for compiling DVI, PDF, and PostScript manuals. -TEXINFO_FLAGS = - -# List of translations. -LOCALES = sv - -# Ucomment to remove internationalisation support. -#WITHOUT_GETTEXT = yes - -# List of man page translations. -MAN_LOCALES = sv - - - -# YOU, AS A USER, SHOULD NOT CHANGE THESE VARIABLES. {{ - -# Package information. -_PROJECT = scrotty -_VERSION = 1.1 - -# Used by mk/lang-c.mk -_C_STD = c99 -_PEDANTIC = yes -_BIN = scrotty -_OBJ_scrotty = scrotty -_HEADER_DIRLEVELS = 0 -_CPPFLAGS = -D'PACKAGE="$(PKGNAME)"' -D'PROGRAM_VERSION="$(_VERSION)"' - -# Used by mk/i18n.mk -_SRC = $(foreach B,$(_BIN),$(_OBJ_$(B))) -_PROJECT_FULL = scrotty -_COPYRIGHT_HOLDER = Mattias Andrée (maandree@member.fsf.org) - -# Used by mk/texinfo.mk -_TEXINFO_DIRLEVELS = 2 -_INFOPARTS = 0 -_HAVE_TEXINFO_MANUAL = yes -_HTML_FILES = Free-Software-Needs-Free-Documentation.html GNU-Free-Documentation-License.html \ - GNU-General-Public-License.html index.html Invoking.html Overview.html strftime.html - -# Used by mk/man.mk -_MAN_PAGE_SECTIONS = 1 -_MAN_1 = scrotty -_MAN_sv_1 = scrotty - -# Used by mk/copy.mk -_COPYING = COPYING -_LICENSE = LICENSE - -# }} - - -# All of the make rules. -include mk/all.mk - -# In case you want add some configurations. -# Primarily intended for maintainers. -# Perhaps add GPG_KEY here. --include .make-configurations - diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..71385d0 --- /dev/null +++ b/Makefile.in @@ -0,0 +1,96 @@ +# Copyright (C) 2015 Mattias Andrée +# +# Copying and distribution of this file, with or without modification, +# are permitted in any medium without royalty provided the copyright +# notice and this notice are preserved. This file is offered as-is, +# without any warranty. + + +### This file will be stored to Makefile once you have run ./configure. ### +### See INSTALL for information on how to install this package. ### + + + +# List of translations to install. +LOCALES = sv + +# List of man page translations to install. +MAN_LOCALES = sv + +# Can change these variables with ./configure in the same why you +# would configure them when running make. + + + +##### What is below this line is configurable, but is seldom useful. ##### + + +# Additional options for compiling DVI, PDF, and PostScript manuals. +TEXINFO_FLAGS = + +# The name of the command as it should be installed. +COMMAND = scrotty + +# The name of the package as it should be installed. +PKGNAME = scrotty + + + +##### Nothing interesting below this. ##### + + +# In case you want add some configurations. Primarily +# intended for maintainers. Perhaps add GPG_KEY here. +# Of course, you can declare everthing with ./configure, +# but with this you are less likely to forget it. +-include .make-configurations + + +# YOU, AS A USER, SHOULD NOT CHANGE THESE VARIABLES. {{ + +# Package information. +_PROJECT = scrotty +_VERSION = 1.1 + +# Used by mk/lang-c.mk +_C_STD = c99 +_PEDANTIC = yes +_BIN = scrotty +_OBJ_scrotty = scrotty +_HEADER_DIRLEVELS = 0 +_CPPFLAGS = -D'PACKAGE="$(PKGNAME)"' -D'PROGRAM_VERSION="$(_VERSION)"' + +# Used by mk/i18n.mk +_SRC = $(foreach B,$(_BIN),$(_OBJ_$(B)).c) +_PROJECT_FULL = scrotty +_COPYRIGHT_HOLDER = Mattias Andrée (maandree@member.fsf.org) + +# Used by mk/texinfo.mk +_TEXINFO_DIRLEVELS = 2 +_INFOPARTS = 0 +_HAVE_TEXINFO_MANUAL = yes +_HTML_FILES = Free-Software-Needs-Free-Documentation.html GNU-Free-Documentation-License.html \ + GNU-General-Public-License.html index.html Invoking.html Overview.html strftime.html + +# Used by mk/man.mk +_MAN_PAGE_SECTIONS = 1 +_MAN_1 = scrotty +_MAN_sv_1 = scrotty + +# Used by mk/copy.mk +_COPYING = COPYING + +# Used by mk/dist.mk +_EVERYTHING_INFO = scrotty titlepage-data content hardcopy-copying \ + appx/fdl appx/free-software-needs-free-documentation appx/gpl \ + chap/invoking chap/overview chap/strftime \ + reusable/macros reusable/paper reusable/titlepage +_EVERYTHING = $(foreach F,$(_EVERYTHING_INFO),doc/info/$(F).texinfo) \ + $(__EVERYTHING_ALL_COMMON) DEPENDENCIES INSTALL NEWS $(__todo) doc/concept + +# }} + + +# All of the make rules and the configurations. +include $(v)mk/all.mk + diff --git a/README b/README index 77ae9e6..2ed2e42 100644 --- a/README +++ b/README @@ -59,12 +59,13 @@ FUTURE DIRECTIONS Support for TTY:s in other kernels should be added. RATIONALE - Taking screenshots was a pain before this. Screenshots + Taking screenshots was a pain before this (except, fbcat + already existed without my knowledge.) Screenshots are useful if you want to remember something or send an image of how something looks. SEE ALSO - scrot(1), convert(1), strftime(3) + scrot(1), convert(1), strftime(3), fbcat(1), setterm(1) Full documentation available locally via: info '(scrotty)' diff --git a/TODO b/TODO index 4b63e5a..010d596 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,13 @@ -(maybe) Support for short options. +Use getopt. + +Support for short options. Use auto-auto-complete. +(maybe) include date and time by default in filenames. + +Do not require imagemagick for mere conversion. + +Take the screenshot the the framebuffers +more simultaneously. + diff --git a/configure b/configure new file mode 100755 index 0000000..70669bd --- /dev/null +++ b/configure @@ -0,0 +1,55 @@ +#!/bin/sh + +# Copyright (C) 2015 Mattias Andrée +# +# Copying and distribution of this file, with or without modification, +# are permitted in any medium without royalty provided the copyright +# notice and this notice are preserved. This file is offered as-is, +# without any warranty. + + +# Run './configure --help' for usage information. + + +PKGNAME=scrotty +MAN_SECTION_SUFFIX= +MAN_SECTION=1 + + +list_optional_features_help () +{ +cat < +# +# Copying and distribution of this file, with or without modification, +# are permitted in any medium without royalty provided the copyright +# notice and this notice are preserved. This file is offered as-is, +# without any warranty. + + +# Run './configure --help' for usage information. + + +# FOR DEVELOPERS USING THIS SCRIPT: +# This file is used by include this file, via the . builtin, +# in your ./configure. Before doing so, you must declare +# PKGNAME=the_name_of_your_package +# MAN_SECTION_SUFFIX=default_suffix_to_append_to_man_page_section # (usually empty) +# MAN_SECTION=the_section_your_man_page_is_in # (do no declare if you do not use exacly one section) +# Define the function list_optional_features_help, see the help output. +# Define the function unrecognised_argument to deal with any unrecognised argument. + + + +# Store command for rebuilding Makefile to config.status. +exec 10>config.status + +# Store configurations to .config.mk. +exec 20>.config.mk + + +# Parse command line. +incomplete= +dashed= +f_help= +f_gnulinux= +f_bin_merger= +for option; do + if test -n "${incomplete}"; then + option="${incomplete}=${option}" + incomplete= + fi + + # For --{with{,out},{en,dis}able}-*. + feature="${option#--*}" + feature="${feature#*-}" + feature="$(echo "${feature}" | tr qwertyuiopasdfghjklzxcvbnm- QWERTYUIOPASDFGHJKLZXCVBNM_)" + + # For directories and filename tweaks. + nodash=_novar + + case "${dashed}${option}" in +# general + (--) + dashed=yes ;; + (--help) + f_help=yes ;; + (--destdir | --destdir=* | --pkgdir | --pkgdir=*) + nodash=destdir ;; + (--srcdir | --srcdir) + nodash=srcdir ;; + +# directory automation + (--gnu-linux) + f_gnulinux=yes ;; + (--bin-merger) + f_bin_merger=yes ;; + +# directories and filenames + (--prefix | --prefix=*) + nodash=prefix ;; + (--exec-prefix | --exec-prefix=* | --exec_prefix | --exec_prefix=*) + nodash=exec_prefix ;; + (--bindir | --bindir=*) + nodash=bindir ;; + (--sbindir | --sbindir=*) + nodash=sbindir ;; + (--libexecdir | --libexecdir=*) + nodash=libexecdir ;; + (--libdir | --libdir=*) + nodash=libdir ;; + (--includedir | --includedir=*) + nodash=includedir ;; + (--oldincludedir | --oldincludedir=*) + nodash=oldincludedir ;; + (--datarootdir | --datarootdir=*) + nodash=datarootdir ;; + (--datadir | --datadir=*) + nodash=datadir ;; + (--libdatarootdir | --libdatarootdir=*) + nodash=libdatarootdir ;; + (--libdatadir | --libdatadir=*) + nodash=libdatadir ;; + (--sysconfdir | --sysconfdir=*) + nodash=sysconfdir ;; + (--sharedstatedir | --=sharedstatedir*) + nodash=sharedstatedir ;; + (--localstatedir | --localstatedir=*) + nodash=localstatedir ;; + (--runstatedir | --runstatedir=*) + nodash=runstatedir ;; + (--lispdir | --lispdir=*) + nodash=lispdir ;; + (--localedir | --localedir=*) + nodash=localedir ;; + (--licensedir | --licensedir=*) + nodash=licensedir ;; + (--emptydir | --emptydir=*) + nodash=emptydir ;; + (--cachedir | --cachedir=*) + nodash=cachedir ;; + (--spooldir | --spooldir=*) + nodash=spooldir ;; + (--logdir | --logdir=*) + nodash=logdir ;; + (--statedir | --statedir=*) + nodash=statedir ;; + (--gamedir | --gamedir=*) + nodash=gamedir ;; + (--sharedcachedir | --sharedcachedir=*) + nodash=sharedcachedir ;; + (--sharedspooldir | --sharedspooldir=*) + nodash=sharedspooldir ;; + (--sharedlogdir | --sharedlogdir=*) + nodash=sharedlogdir ;; + (--sharedstatedir | --sharedstatedir=*) + nodash=sharedstatedir ;; + (--sharedgamedir | --sharedgamedir=*) + nodash=sharedgamedir ;; + (--tmpdir | --tmpdir=*) + nodash=tmpdir ;; + (--localtmpdir | --localtmpdir=*) + nodash=localtmpdir ;; + (--sharedtmpdir | --sharedtmpdir=*) + nodash=sharedtmpdir ;; + (--lockdir | --lockdir=*) + nodash=lockdir ;; + (--skeldir | --skeldir=*) + nodash=skeldir ;; + (--devdir | --devdir=*) + nodash=devdir ;; + (--sysdir | --sysdir=*) + nodash=sysdir ;; + (--procdir | --procdir=*) + nodash=procdir ;; + (--selfprocdir | --selfprocdir=*) + nodash=selfprocdir ;; + (--docdir | --docdir=*) + nodash=docdir ;; + (--infodir | --infodir=*) + nodash=infodir ;; + (--dvidir | --dvidir=*) + nodash=dvidir ;; + (--pdfdir | --pdfdir=*) + nodash=pdfdir ;; + (--psdir | --psdir=*) + nodash=psdir ;; + (--htmldir | --htmldir=*) + nodash=htmldir ;; + (--mandir | --mandir=*) + nodash=mandir ;; + (--man0 | --man0=*) + nodash=man0 ;; + (--man1 | --man1=*) + nodash=man1 ;; + (--man2 | --man2=*) + nodash=man2 ;; + (--man3 | --man3=*) + nodash=man3 ;; + (--man4 | --man4=*) + nodash=man4 ;; + (--man5 | --man5=*) + nodash=man5 ;; + (--man6 | --man6=*) + nodash=man6 ;; + (--man7 | --man7=*) + nodash=man7 ;; + (--man8 | --man8=*) + nodash=man8 ;; + (--man9 | --man9=*) + nodash=man9 ;; + (--man0ext | --man0ext=*) + nodash=man0ext ;; + (--man1ext | --man1ext=*) + nodash=man1ext ;; + (--man2ext | --man2ext=*) + nodash=man2ext ;; + (--man3ext | --man3ext=*) + nodash=man3ext ;; + (--man4ext | --man4ext=*) + nodash=man4ext ;; + (--man5ext | --man5ext=*) + nodash=man5ext ;; + (--man6ext | --man6ext=*) + nodash=man6ext ;; + (--man7ext | --man7ext=*) + nodash=man7ext ;; + (--man8ext | --man8ext=*) + nodash=man8ext ;; + (--man9ext | --man9ext=*) + nodash=man9ext ;; + (--manext | --manext=*) + if test -n "${MAN_SECTION}"; then + nodash=manext + else + printf "\e[01;31m%s: warning: ignoring: %s\e[00m\n" "${0}" "${option}" >&2 + sleep 1 + fi + ;; + +# ignored + # Unrecognised directories, and settings that cannot be used with internationalisation. + (--*dir=* | --*dir | --man?dir | --man?dir=*) + printf "\e[01;31m%s: warning: ignoring: %s\e[00m\n" "${0}" "${option}" >&2 + sleep 1 + ;; + +# feature tweaking + (--with-*) + feature="WITH_${feature}" + echo "${feature}" = yes >&20 + export "${feature}"=yes + ;; + + (--without-*) + feature="WITHOUT_${feature}" + echo "${feature}" = yes >&20 + export "${feature}"=yes + ;; + + (--enable-*=*) + param="${feature#*=}" + feature="${feature%%=*}" + if ! test "${param}" = "no"; then + feature="ENABLE_${feature}" + else + feature="DISABLE_${feature}" + param=yes + fi + echo "${feature}" = "${param}" >&20 + export "${feature}"="${param}" + ;; + + (--enable-*) + feature="DISABLE_${feature}" + echo "${feature}" = yes >&20 + export "${feature}"=yes + ;; + + (--disable-*) + feature="DISABLE_${feature}" + echo "${feature}" = yes >&20 + export "${feature}"=yes + ;; + +# unrecognised + (${dashed}--*) + unrecognised_argument "${option}" + ;; + +# variables + (${dashed}*=*) + var="${option%%=*}" + val="${option#*=}" + if test -n "$(echo "${var}" | tr -d '[_a-zA-Z0-9-]')"; then + # Variable is not used and is potentially not + # formatted in a compatible way. + printf "\e[01;31m%s: warning: ignoring because of bad format: %s\e[00m\n" "${0}" "${option}" >&2 + sleep 1 + fi + echo "${var}" = "${val}" >&20 + ;; + +# unrecognised + (*) + unrecognised_argument "${option}" + ;; + esac + + if test "${option%%=*}" = "${option}"; then + incomplete="${option}" + else + eval "${nodash}=${option#*=}" + eval "have_${nodash}=yes" + fi +done + + +# Print usage information. This is parsed by +# the auto-completion script for ./configure. +if test -n "${f_help}"; then + cat <&10 +echo >&10 +echo '# This file was generated by ./configure, its purpose is two-fold:' >&10 +echo '# 1) It lets you rebuild Makefile with the same configurations you' >&10 +echo '# used last time you run ./configure.' >&10 +echo '# 2) It lets Makefile rebuild itself transparently when out of date.' >&10 +echo >&10 + +# config.status should adjust CWD. +echo 'cd "$(dirname "${0}")"' >&10 + +# config.status calls ./configure with all arguments you called ./configure. +echo "exec ${0}" "$@" >&10 + +# Close config.status. +exec 10>&- + + +# Store environment (with restrictions). +env | while read line; do + var="${line%%=*}" + val="${line#*=}" + if test "${var}" = "${line}"; then + # Malformated variables. (Can happen!, sigh...) + continue + elif test -n "$(echo "${var}" | tr -d '[_a-zA-Z0-9-]')"; then + # Variable is not used and is potentially not + # formatted in a compatible way. + continue + fi + case "${var}" in + (_ | PWD | SHELL | SHLVL | TERM | COLORTERM | MAKEFLAGS) + # We do not want to propagate these. + ;; + (*) + echo "${var}" = "${val}" >&20 + ;; + esac +done + +# Store directories and filenames. +if test -n "${destdir}"; then + echo DESTDIR = "${destdir}" >&20 +fi +echo PREFIX = "${prefix}" >&20 +echo SYSCONFDIR = "${sysconfdir}" >&20 +echo COMDIR = "${sharedstatedir}" >&20 +echo VARDIR = "${localstatedir}" >&20 +echo RUNDIR = "${runstatedir}" >&20 +echo TMPDIR = "${tmpdir}" >&20 +echo DEVDIR = "${devdir}" >&20 +echo SYSDIR = "${sysdir}" >&20 +echo PROCDIR = "${procdir}" >&20 +echo EXEC_PREFIX = "${exec_prefix}" >&20 +echo BINDIR = "${bindir}" >&20 +echo SBINDIR = "${sbindir}" >&20 +echo LIBEXECDIR = "${libexecdir}" >&20 +echo LIBDIR = "${libdir}" >&20 +echo INCLUDEDIR = "${includedir}" >&20 +echo OLDINCLUDEDIR = "${oldincludedir}" >&20 +echo DATADIR = "${datarootdir}" >&20 +echo RESDIR = "${datadir}" >&20 +echo SYSDEPDATADIR = "${libdatarootdir}" >&20 +echo SYSDEPRESDIR = "${libdatadir}" >&20 +echo LISPDIR = "${lispdir}" >&20 +echo LOCALEDIR = "${localedir}" >&20 +echo LICENSEDIR = "${licensedir}" >&20 +echo CACHEDIR = "${cachedir}" >&20 +echo SPOOLDIR = "${spooldir}" >&20 +echo EMPTYDIR = "${emptydir}" >&20 +echo LOGDIR = "${logdir}" >&20 +echo STATEDIR = "${statedir}" >&20 +echo GAMEDIR = "${gamedir}" >&20 +echo COMCACHEDIR = "${sharedcachedir}" >&20 +echo COMPOOLDIR = "${sharedpooldir}" >&20 +echo COMLOGDIR = "${sharedlogdir}" >&20 +echo COMSTATEDIR = "${sharedstatedir}" >&20 +echo COMGAMEDIR = "${sharedgamedir}" >&20 +echo LOCALTMPDIR = "${localtmpdir}" >&20 +echo SHAREDTMPDIR = "${sharedtmpdir}" >&20 +echo LOCKDIR = "${lockdir}" >&20 +echo SKELDIR = "${skeldir}" >&20 +echo SELFPROCDIR = "${selfprocdir}" >&20 +echo DOCDIR = "${docdir}" >&20 +echo INFODIR = "${infodir}" >&20 +echo DVIDIR = "${dvidir}" >&20 +echo PDFDIR = "${pdfdir}" >&20 +echo PSDIR = "${psdir}" >&20 +echo HTMLDIR = "${htmldir}" >&20 +echo MANDIR = "${mandir}" >&20 +echo MAN0 = "${man0}" >&20 +echo MAN1 = "${man1}" >&20 +echo MAN2 = "${man2}" >&20 +echo MAN3 = "${man3}" >&20 +echo MAN4 = "${man4}" >&20 +echo MAN5 = "${man5}" >&20 +echo MAN6 = "${man6}" >&20 +echo MAN7 = "${man7}" >&20 +echo MAN8 = "${man8}" >&20 +echo MAN9 = "${man9}" >&20 +echo MAN0EXT = "${man0ext}" >&20 +echo MAN1EXT = "${man1ext}" >&20 +echo MAN2EXT = "${man2ext}" >&20 +echo MAN3EXT = "${man3ext}" >&20 +echo MAN4EXT = "${man4ext}" >&20 +echo MAN5EXT = "${man5ext}" >&20 +echo MAN6EXT = "${man6ext}" >&20 +echo MAN7EXT = "${man7ext}" >&20 +echo MAN8EXT = "${man8ext}" >&20 +echo MAN9EXT = "${man9ext}" >&20 + +# Close .config.mk. +exec 20>&- + +# Now, make Makefile available. +if test -f Makefile; then + chmod u+w Makefile # This scripts makes it read-only. +fi +exec 30>Makefile +echo "# ----------------------------------------------------- #" >&30 +echo "# This file was created by ./configure from Makefile.in #" >&30 +echo "# ----------------------------------------------------- #" >&30 +echo >&30 +if test -n "${srcdir}"; then + echo v = "${srcdir}" >&30 +fi +cat "${srcdir_proper}"Makefile.in >&30 +exec 30>&- + + +# config.status should be executable. +chmod a+x config.status + +# Makefile should be read-only to ones does not edit it by mistake. +chmod a-w Makefile + + +# Help functions for the parent script. +test_with () +{ + with="$(eval echo '${WITH_'"${1}"'}')" + without="$(eval echo '${WITHOUT_'"${1}"'}')" + if ! test -n "${with}" && ! test -n "${without}"; then + echo "${2}" + elif ! test -n "${with}" && test -n "${without}"; then + echo "no" + elif test -n "${with}" && ! test -n "${without}"; then + echo "yes" + elif test "${2}" = yes; then + echo "no" + else + echo "yes" + fi +} +test_enable () +{ + enable="$(eval echo '${ENABLE_'"${1}"'}')" + disable="$(eval echo '${DISABLE_'"${1}"'}')" + if ! test -n "${enable}" && ! test -n "${disable}"; then + echo "${2}" + elif ! test -n "${enable}" && test -n "${disable}"; then + echo "no" + elif test -n "${enable}" && ! test -n "${disable}"; then + echo "${enable}" + elif test "${2}" = yes ; then + echo "no" + else + echo "${enable}" + fi +} + + +# After including this file, you may want +# to do something like: +# +# cat < $@ + $(Q)$(RM) $(_PROJECT)-$(_VERSION) +endif @$(ECHO_EMPTY) # Compression rule for xz-compression. Used on the tarball. diff --git a/mk/empty.mk b/mk/empty.mk index 6e95a1e..81c06fb 100644 --- a/mk/empty.mk +++ b/mk/empty.mk @@ -25,6 +25,10 @@ cmd: doc: +.PHONY: check +check: + + .PHONY: install install: @@ -41,6 +45,10 @@ install-cmd: install-doc: +.PHONY: installcheck +installcheck: + + .PHONY: uninstall uninstall: diff --git a/mk/i18n.mk b/mk/i18n.mk index 842377b..cc27903 100644 --- a/mk/i18n.mk +++ b/mk/i18n.mk @@ -19,6 +19,9 @@ # # If WITHOUT_GETTEXT is defined, `locale` and # `install-locale` will not do anything. +# +# _SRC should list all sources files, excluding the src/ +# at the beginning of the pathnames. ifdef LOCALES @@ -50,9 +53,9 @@ endif update-po: $(foreach L,$(LOCALES),po/$(L).po) # Generate template for translations. -obj/$(_PROJECT).pot: $(foreach S,$(_SRC),src/$(S).c) +aux/$(_PROJECT).pot: $(foreach S,$(_SRC),$(v)src/$(S)) @$(PRINTF_INFO) '\e[00;01;31mPOT\e[34m %s\e[00m$A\n' "$@" - @$(MKDIR) -p obj + @$(MKDIR) -p aux $(Q)$(CPP) -DUSE_GETTEXT=1 $^ | \ $(XGETTEXT) -o "$@" -Lc --from-code utf-8 --package-name "$(_PROJECT_FULL)" \ --package-version $(_VERSION) --no-wrap --force-po \ @@ -60,22 +63,22 @@ obj/$(_PROJECT).pot: $(foreach S,$(_SRC),src/$(S).c) @$(ECHO_EMPTY) # Create or update a translation file. -po/%.po: obj/$(_PROJECT).pot +po/%.po: aux/$(_PROJECT).pot @$(PRINTF_INFO) '\e[00;01;31mPO\e[34m %s\e[00m$A\n' "$@" @$(MKDIR) -p po $(Q)if ! $(TEST) -e $@; then \ - $(MSGINIT) --no-translator --no-wrap -i $< -o $@ -l $*; \ + $(MSGINIT) --no-translator --no-wrap -i aux/$(_PROJECT).pot -o $@ -l $*; \ else \ - $(MSGMERGE) --no-wrap -U $@ $<; \ + $(MSGMERGE) --no-wrap -U $@ aux/$(_PROJECT).pot; \ fi #$Z @$(TOUCH) $@ @$(ECHO_EMPTY) # Compile a translation file. -bin/mo/%/messages.mo: po/%.po +bin/mo/%/messages.mo: $(v)po/%.po @$(PRINTF_INFO) '\e[00;01;31mMO\e[34m %s\e[00m$A\n' "$@" @$(MKDIR) -p bin/mo/$* - $(Q)cd bin/mo/$* && $(MSGFMT) ../../../$< #$Z + $(Q)cd bin/mo/$* && $(MSGFMT) $(__back3unless_v)$< #$Z @$(ECHO_EMPTY) diff --git a/mk/lang-c.mk b/mk/lang-c.mk index 9d5dc8d..83e305b 100644 --- a/mk/lang-c.mk +++ b/mk/lang-c.mk @@ -34,7 +34,7 @@ # should be the basenames. For each command # you should be the variable _OBJ_$(COMMAND) # that lists all objects files (without the -# suffix and without the obj/ prefix) that +# suffix and without the aux/ prefix) that # are required to build the command. @@ -60,12 +60,12 @@ endif # BUILD VARIABLES: # Optimisation settings for C code compilation. -ifdef DEBUG -OPTIMISE = -Og -g +ifndef DEBUG +OPTIMISE = -O2 -g endif ifndef DEBUG -ifndef OPTIMISE -OPTIMISE = -O2 +ifdef OPTIMISE +OPTIMISE = -Og -g endif endif @@ -73,6 +73,10 @@ endif ifdef _PEDANTIC _PEDANTIC = -pedantic endif +ifndef DEBUG +WARN = -Wall +endif +ifdef DEBUG ifdef __USING_GCC WARN = -Wall -Wextra $(_PEDANTIC) -Wdouble-promotion -Wformat=2 -Winit-self -Wmissing-include-dirs \ -Wtrampolines -Wmissing-prototypes -Wmissing-declarations -Wnested-externs \ @@ -89,6 +93,7 @@ endif ifndef __USING_GCC WARN = -Wall -Wextra $(_PEDANTIC) endif +endif # Support for internationalisation? ifndef WITHOUT_GETTEXT @@ -102,10 +107,13 @@ _CPPFLAGS += $(foreach D,$(_ALL_DIRS),-D'$(D)="$($(D))"') # MORE HELP VARIABLES: # Compilation and linking flags, and command. -__CC = $(CC) -std=$(_C_STD) $(OPTIMISE) $(WARN) $(_CPPFLAGS) $(_CFLAGS) -c -__LD = $(CC) -std=$(_C_STD) $(OPTIMISE) $(WARN) $(_LDFLAGS) -__CC_POST = $(CPPFLAGS) $(CFLAGS) -__LD_POST = $(LDFLAGS) +CPPFLAGS = $(_CPPFLAGS) +CFLAGS = $(OPTIMISE) $(WARN) $(_CFLAGS) +LDFLAGS = $(OPTIMISE) $(WARN) $(_LDFLAGS) +__CC = $(CC) -std=$(_C_STD) -c +__LD = $(CC) -std=$(_C_STD) +__CC_POST = $(CPPFLAGS) $(CFLAGS) $(EXTRA_CPPFLAGS) $(EXTRA_CFLAGS) +__LD_POST = $(LDFLAGS) $(EXTRA_LDFLAGS) # Header files. __H = @@ -133,9 +141,9 @@ endif cmd-c: $(foreach B,$(_BIN),bin/$(B)) # Compile a C file into an object file. -obj/%.o: src/%.c $(__H) +aux/%.o: $(v)src/%.c $(foreach H,$(__H),$(v)$(H)) @$(PRINTF_INFO) '\e[00;01;31mCC\e[34m %s\e[00m$A\n' "$@" - @$(MKDIR) -p $(shell dirname $@) + @$(MKDIR) -p $(shell $(DIRNAME) $@) $(Q)$(__CC) -o $@ $< $(__CC_POST) #$Z @$(ECHO_EMPTY) @@ -148,7 +156,7 @@ bin/%: @$(ECHO_EMPTY) # Dependencies for the rule above. -$(foreach B,$(_BIN),$(foreach O,$(_OBJ_$(B)),bin/$(B): obj/$(O).o\ +$(foreach B,$(_BIN),$(foreach O,$(_OBJ_$(B)),bin/$(B): aux/$(O).o\ )) diff --git a/mk/lowerpath.mk b/mk/lowerpath.mk new file mode 100644 index 0000000..aadb91f --- /dev/null +++ b/mk/lowerpath.mk @@ -0,0 +1,279 @@ +# Copyright (C) 2015 Mattias Andrée +# +# Copying and distribution of this file, with or without modification, +# are permitted in any medium without royalty provided the copyright +# notice and this notice are preserved. This file is offered as-is, +# without any warranty. + + +#=== This file overrides values uppercase path variables with values lowercase path variables. ===# + + +ifdef srcdir +VPATH = $(srcdir) +endif + +ifdef prefix +PREFIX = $(prefix) +endif + +ifdef sysconfdir +SYSCONFDIR = $(sysconfdir) +endif + +ifdef sharedstatedir +COMDIR = $(sharedstatedir) +endif + +ifdef localstatedir +VARDIR = $(localstatedir) +endif + +ifdef runstatedir +RUNDIR = $(runstatedir) +endif + +ifdef tmpdir +TMPDIR = $(tmpdir) +endif + +ifdef devdir +DEVDIR = $(devdir) +endif + +ifdef sysdir +SYSDIR = $(sysdir) +endif + +ifdef procdir +PROCDIR = $(procdir) +endif + +ifdef exec_prefix +EXEC_PREFIX = $(exec_prefix) +endif + +ifdef bindir +BINDIR = $(bindir) +endif + +ifdef sbindir +SBINDIR = $(sbindir) +endif + +ifdef libexecdir +LIBEXECDIR = $(libexecdir) +endif + +ifdef libdir +LIBDIR = $(libdir) +endif + +ifdef includedir +INCLUDEDIR = $(includedir) +endif + +ifdef oldincludedir +OLDINCLUDEDIR = $(oldincludedir) +endif + +ifdef datarootdir +DATADIR = $(datarootdir) +endif + +ifdef datadir +RESDIR = $(datadir) +endif + +ifdef libdatarootdir +SYSDEPDATADIR = $(libdatarootdir) +endif + +ifdef libdatadir +SYSDEPRESDIR = $(libdatadir) +endif + +ifdef lispdir +LISPDIR = $(lispdir) +endif + +ifdef localedir +LOCALEDIR = $(localedir) +endif + +ifdef licensedir +LICENSEDIR = $(licensedir) +endif + +ifdef cachedir +CACHEDIR = $(cachedir) +endif + +ifdef spooldir +SPOOLDIR = $(spooldir) +endif + +ifdef emptydir +EMPTYDIR = $(emptydir) +endif + +ifdef logdir +LOGDIR = $(logdir) +endif + +ifdef statedir +STATEDIR = $(statedir) +endif + +ifdef gamedir +GAMEDIR = $(gamedir) +endif + +ifdef sharedcachedir +COMCACHEDIR = $(sharedcachedir) +endif + +ifdef sharedpooldir +COMPOOLDIR = $(sharedpooldir) +endif + +ifdef sharedlogdir +COMLOGDIR = $(sharedlogdir) +endif + +ifdef sharedlogdir +COMSTATEDIR = $(sharedstatedir) +endif + +ifdef sharedgamedir +COMGAMEDIR = $(sharedgamedir) +endif + +ifdef localtmpdir +VARTMPDIR = $(localtmpdir) +endif + +ifdef sharedtmpdir +COMTMPDIR = $(sharedtmpdir) +endif + +ifdef lockdir +LOCKDIR = $(lockdir) +endif + +ifdef skeldir +SKELDIR = $(skeldir) +endif + +ifdef selfprocdir +SELFPROCDIR = $(selfprocdir) +endif + +ifdef docdir +DOCDIR = $(docdir) +endif + +ifdef infodir +INFODIR = $(infodir) +endif + +ifdef dvidir +DVIDIR = $(dvidir) +endif + +ifdef pdfdir +PDFDIR = $(pdfdir) +endif + +ifdef psdir +PSDIR = $(psdir) +endif + +ifdef htmldir +HTMLDIR = $(htmldir) +endif + +ifdef mandir +MANDIR = $(mandir) +endif + +ifdef man0 +MAN0 = $(man0) +endif + +ifdef man1 +MAN1 = $(man1) +endif + +ifdef man2 +MAN2 = $(man2) +endif + +ifdef man3 +MAN3 = $(man3) +endif + +ifdef man4 +MAN4 = $(man4) +endif + +ifdef man5 +MAN5 = $(man5) +endif + +ifdef man6 +MAN6 = $(man6) +endif + +ifdef man7 +MAN7 = $(man7) +endif + +ifdef man8 +MAN8 = $(man8) +endif + +ifdef man9 +MAN9 = $(man9) +endif + +ifdef man0ext +MAN0EXT = $(man0ext) +endif + +ifdef man1ext +MAN1EXT = $(man1ext) +endif + +ifdef man2ext +MAN2EXT = $(man2ext) +endif + +ifdef man3ext +MAN3EXT = $(man3ext) +endif + +ifdef man4ext +MAN4EXT = $(man4ext) +endif + +ifdef man5ext +MAN5EXT = $(man5ext) +endif + +ifdef man6ext +MAN6EXT = $(man6ext) +endif + +ifdef man7ext +MAN7EXT = $(man7ext) +endif + +ifdef man8ext +MAN8EXT = $(man8ext) +endif + +ifdef man9ext +MAN9EXT = $(man9ext) +endif + diff --git a/mk/man.mk b/mk/man.mk index 20beb50..8105249 100644 --- a/mk/man.mk +++ b/mk/man.mk @@ -56,7 +56,7 @@ ifdef COMMAND ifeq ($(shell $(PRINTF) '%s\n' $(COMMAND) | $(WC) -l),1) ifeq ($(shell $(PRINTF) '%s\n' $(_MAN_PAGE_SECTIONS) | $(WC) -l),1) ifeq ($(shell $(PRINTF) '%s\n' $(_MAN_$(_MAN_PAGE_SECTIONS)) | $(WC) -l),1) -__MAN_COMMAND = $(COMMAND).$(MAN$(_MAN_PAGE_SECTIONS)EXT) +__MAN_COMMAND = $(COMMAND)$(MAN$(_MAN_PAGE_SECTIONS)EXT) endif endif endif @@ -71,40 +71,39 @@ install-man: install-man-untranslated install-man-locale .PHONY: install-man-untranslated install-man-untranslated: @$(PRINTF_INFO) '\e[00;01;31mINSTALL\e[34m %s\e[00m\n' "$@" - $(Q)$(INSTALL_DIR) -- $(foreach S,$(_MAN_PAGE_SECTIONS),"$(DESTDIR)$(MANDIR)$(MAN$(S))") + $(Q)$(INSTALL_DIR) -- $(foreach S,$(_MAN_PAGE_SECTIONS),"$(DESTDIR)$(MANDIR)/$(MAN$(S))") ifndef __MAN_COMMAND - $(Q)$(foreach S,$(_MAN_PAGE_SECTIONS),$(foreach P,$(_MAN_$(S)),$(INSTALL_DATA) doc/man/$(P).$(S) -- "$(DESTDIR)$(MANDIR)$(MAN$(S))/$(P).$(MAN$(S)EXT)" &&)) $(TRUE) + $(Q)$(foreach S,$(_MAN_PAGE_SECTIONS),$(foreach P,$(_MAN_$(S)),$(INSTALL_DATA) $(v)doc/man/$(P).$(S) -- "$(DESTDIR)$(MANDIR)/$(MAN$(S))/$(P)$(MAN$(S)EXT)" &&)) $(TRUE) endif ifdef __MAN_COMMAND - $(Q)$(foreach S,$(_MAN_PAGE_SECTIONS),$(foreach P,$(_MAN_$(S)),$(INSTALL_DATA) doc/man/$(P).$(S) -- "$(DESTDIR)$(MANDIR)$(MAN$(S))/$(__MAN_COMMAND)" &&)) $(TRUE) + $(Q)$(foreach S,$(_MAN_PAGE_SECTIONS),$(foreach P,$(_MAN_$(S)),$(INSTALL_DATA) $(v)doc/man/$(P).$(S) -- "$(DESTDIR)$(MANDIR)/$(MAN$(S))/$(__MAN_COMMAND)" &&)) $(TRUE) endif @$(ECHO_EMPTY) .PHONY: install-man-locale install-man-locale: @$(PRINTF_INFO) '\e[00;01;31mINSTALL\e[34m %s\e[00m\n' "$@" - $(Q)$(foreach L,$(MAN_LOCALES),$(INSTALL_DIR) -- $(foreach S,$(_MAN_PAGE_SECTIONS),"$(DESTDIR)$(MANDIR)/$(L)$(MAN$(S))") &&) $(TRUE) + $(Q)$(foreach L,$(MAN_LOCALES),$(INSTALL_DIR) -- $(foreach S,$(_MAN_PAGE_SECTIONS),"$(DESTDIR)$(MANDIR)/$(L)/$(MAN$(S))") &&) $(TRUE) ifndef __MAN_COMMAND - $(Q)$(foreach L,$(MAN_LOCALES),$(foreach S,$(_MAN_PAGE_SECTIONS),$(foreach P,$(_MAN_$(L)_$(S)),$(INSTALL_DATA) doc/man/$(P).$(L).$(S) -- "$(DESTDIR)$(MANDIR)/$(L)$(MAN$(S))/$(P).$(MAN$(S)EXT)" &&))) $(TRUE) + $(Q)$(foreach L,$(MAN_LOCALES),$(foreach S,$(_MAN_PAGE_SECTIONS),$(foreach P,$(_MAN_$(L)_$(S)),$(INSTALL_DATA) $(v)doc/man/$(P).$(L).$(S) -- "$(DESTDIR)$(MANDIR)/$(L)/$(MAN$(S))/$(P)$(MAN$(S)EXT)" &&))) $(TRUE) endif ifdef __MAN_COMMAND - $(Q)$(foreach L,$(MAN_LOCALES),$(foreach S,$(_MAN_PAGE_SECTIONS),$(foreach P,$(_MAN_$(L)_$(S)),$(INSTALL_DATA) doc/man/$(P).$(L).$(S) -- "$(DESTDIR)$(MANDIR)/$(L)$(MAN$(S))/$(__MAN_COMMAND)" &&))) $(TRUE) + $(Q)$(foreach L,$(MAN_LOCALES),$(foreach S,$(_MAN_PAGE_SECTIONS),$(foreach P,$(_MAN_$(L)_$(S)),$(INSTALL_DATA) $(v)doc/man/$(P).$(L).$(S) -- "$(DESTDIR)$(MANDIR)/$(L)/$(MAN$(S))/$(__MAN_COMMAND)" &&))) $(TRUE) endif @$(ECHO_EMPTY) - # UNINSTALL RULES: .PHONY: uninstall-man uninstall-man: ifndef __MAN_COMMAND - -$(Q)$(RM) -- $(foreach S,$(_MAN_PAGE_SECTIONS),$(foreach P,$(_MAN_$(S)),"$(DESTDIR)$(MANDIR)$(MAN$(S))/$(P).$(MAN$(S)EXT)")) - -$(Q)$(RM) -- $(foreach L,$(MAN_LOCALES),$(foreach S,$(_MAN_PAGE_SECTIONS),$(foreach P,$(_MAN_$(L)_$(S)),"$(DESTDIR)$(MANDIR)/$(L)$(MAN$(S))/$(P).$(MAN$(S)EXT)"))) + -$(Q)$(RM) -- $(foreach S,$(_MAN_PAGE_SECTIONS),$(foreach P,$(_MAN_$(S)),"$(DESTDIR)$(MANDIR)/$(MAN$(S))/$(P).$(MAN$(S)EXT)")) + -$(Q)$(RM) -- $(foreach L,$(MAN_LOCALES),$(foreach S,$(_MAN_PAGE_SECTIONS),$(foreach P,$(_MAN_$(L)_$(S)),"$(DESTDIR)$(MANDIR)/$(L)/$(MAN$(S))/$(P)$(MAN$(S)EXT)"))) endif ifdef __MAN_COMMAND - -$(Q)$(RM) -- "$(DESTDIR)$(MANDIR)$(MAN$(_MAN_PAGE_SECTIONS))/$(__MAN_COMMAND)" - -$(Q)$(RM) -- $(foreach L,$(MAN_LOCALES),$(foreach S,$(_MAN_PAGE_SECTIONS),$(foreach P,$(_MAN_$(L)_$(S)),"$(DESTDIR)$(MANDIR)/$(L)$(MAN$(S))/$(__MAN_COMMAND)"))) + -$(Q)$(RM) -- "$(DESTDIR)$(MANDIR)/$(MAN$(_MAN_PAGE_SECTIONS))/$(__MAN_COMMAND)" + -$(Q)$(RM) -- $(foreach L,$(MAN_LOCALES),$(foreach S,$(_MAN_PAGE_SECTIONS),$(foreach P,$(_MAN_$(L)_$(S)),"$(DESTDIR)$(MANDIR)/$(L)/$(MAN$(S))/$(__MAN_COMMAND)"))) endif diff --git a/mk/path.mk b/mk/path.mk index 060a1c0..a65b7b8 100644 --- a/mk/path.mk +++ b/mk/path.mk @@ -17,6 +17,8 @@ __PATH_MK_INCLUDED = 1 # The package path prefix, if you want to install to another root, set DESTDIR to that root. PREFIX = /usr +# The package path prefix for /bin, /sbin, /lib and /libexec. +EXEC_PREFIX = /usr # The command path excluding prefix. BIN = /bin # The administration command path excluding prefix. @@ -42,21 +44,32 @@ MAN8 = /man8 MAN9 = /man9 # The command path including prefix. -BINDIR = $(PREFIX)$(BIN) +BINDIR = $(EXEC_PREFIX)$(BIN) # The administration command path including prefix. -SBINDIR = $(PREFIX)$(SBIN) +SBINDIR = $(EXEC_PREFIX)$(SBIN) # The library path including prefix. -LIBDIR = $(PREFIX)$(LIB) +LIBDIR = $(EXEC_PREFIX)$(LIB) # The executable library path including prefix. -LIBEXECDIR = $(PREFIX)$(LIBEXEC) +LIBEXECDIR = $(EXEC_PREFIX)$(LIBEXEC) # The header-file path including prefix. INCLUDEDIR = $(PREFIX)$(INCLUDE) -# The resource path including prefix. +# The header-file path including prefix. Must not be /usr/local. +ifeq ($(PREFIX),/usr/lcoal) +OLDINCLUDEDIR = /usr$(INCLUDE) +endif +ifneq ($(PREFIX),/usr/lcoal) +OLDINCLUDEDIR = $(PREFIX)$(INCLUDE) +endif +# The data path including prefix. DATADIR = $(PREFIX)$(DATA) +# The architecture-dependent data path including prefix. +SYSDEPDATADIR = $(DATADIR) +# The resource path including prefix. +RESDIR = $(DATADIR) # The architecture-dependent resource path including prefix. -SYSDEPDATA = $(DATADIR) +SYSDEPRESDIR = $(RESDIR) # The generic documentation path including prefix. -DOCDIR = $(DATADIR)/doc +DOCDIR = $(DATADIR)/doc/$(PKGNAME) # The info manual documentation path including prefix. INFODIR = $(DATADIR)/info # The DVI documentation path including prefix. @@ -69,6 +82,8 @@ PSDIR = $(DOCDIR) HTMLDIR = $(DOCDIR) # The man page documentation path including prefix. MANDIR = $(DATADIR)/man +# The Emacs LISP path including prefix. +LISPDIR = $(DATADIR)/emacs/site-lisp # The locale path including prefix. LOCALEDIR = $(DATADIR)/locale # The license base path including prefix. @@ -115,8 +130,6 @@ SKELDIR = $(SYSCONFDIR)/skel COMCACHEDIR = $(COMDIR)/cache # The network-common spool directory. COMSPOOLDIR = $(COMDIR)/spool -# The network-common empty directory. -COMEMPTYDIR = $(COMDIR)/empty # The network-common logfile directory. COMLOGDIR = $(COMDIR)/log # The network-common state directory. @@ -128,28 +141,35 @@ COMGAMEDIR = $(COMDIR)/games # FILENAME SUFFIXES: # Filename suffixes for man pages by section. -MAN0EXT = 0 -MAN1EXT = 1 -MAN2EXT = 2 -MAN3EXT = 3 -MAN4EXT = 4 -MAN5EXT = 5 -MAN6EXT = 6 -MAN7EXT = 7 -MAN8EXT = 8 -MAN9EXT = 9 +MAN0EXT = .0 +MAN1EXT = .1 +MAN2EXT = .2 +MAN3EXT = .3 +MAN4EXT = .4 +MAN5EXT = .5 +MAN6EXT = .6 +MAN7EXT = .7 +MAN8EXT = .8 +MAN9EXT = .9 # HELP VARIABLES: # All path variables that includes the prefix, # or are unaffected by the prefix. -_ALL_DIRS = BINDIR SBINDIR LIBDIR LIBEXECDIR INCLUDEDIR DATADIR SYSDEPDATA DOCDIR \ +_ALL_DIRS = BINDIR SBINDIR LIBDIR LIBEXECDIR INCLUDEDIR DATADIR SYSDEPDATADIR DOCDIR \ INFODIR DVIDIR PDFDIR PSDIR HTMLDIR MANDIR LOCALEDIR LICENSEDIR VARDIR \ - VARTMPDIR COMDIR COMTMPDIR TMPDIR RUNDIR SYSCONFDIR DEVDIR SYSDIR \ + RESDIR VARTMPDIR COMDIR COMTMPDIR TMPDIR RUNDIR SYSCONFDIR DEVDIR SYSDIR \ PROCDIR SELFPROCDIR CACHEDIR SPOOLDIR EMPTYDIR LOGDIR STATEDIR GAMEDIR \ - LOCKDIR SKELDIR COMCACHEDIR COMSPOOLDIR COMEMPTYDIR COMLOGDIR COMSTATEDIR \ - COMGAMEDIR + LOCKDIR SKELDIR COMCACHEDIR COMSPOOLDIR COMLOGDIR COMSTATEDIR COMGAMEDIR \ + SYSDEPRESDIR OLDINCLUDEDIR + +# ../, ../../, and ../../../, ignored if v is used, which if an absolute path. +ifndef v +__back1unless_v = ../ +__back2unless_v = ../../ +__back3unless_v = ../../../ +endif endif diff --git a/mk/prologue.mk b/mk/prologue.mk new file mode 100644 index 0000000..525da28 --- /dev/null +++ b/mk/prologue.mk @@ -0,0 +1,16 @@ +# Copyright (C) 2015 Mattias Andrée +# +# Copying and distribution of this file, with or without modification, +# are permitted in any medium without royalty provided the copyright +# notice and this notice are preserved. This file is offered as-is, +# without any warranty. + + +#=== This file includes rules for automatically rebuilding the makefile. ===# + + +base: Makefile + +Makefile: $(v)Makefile.in config.status $(v)configure $(v)mk/configure + ./config.status + diff --git a/mk/texinfo.mk b/mk/texinfo.mk index db7fa07..d08cb6b 100644 --- a/mk/texinfo.mk +++ b/mk/texinfo.mk @@ -6,6 +6,7 @@ # without any warranty. +# TODO ((support translations)) #=== These rules are used for Texinfo manuals. ===# @@ -64,15 +65,15 @@ uninstall: uninstall-info uninstall-dvi uninstall-pdf uninstall-ps uninstall-htm __TEXI_SRC = ifdef _TEXINFO_DIRLEVELS ifeq ($(_TEXINFO_DIRLEVELS),1) -__TEXI_SRC += doc/info/*.texinfo +__TEXI_SRC += $(v)doc/info/*.texinfo endif ifneq ($(_TEXINFO_DIRLEVELS),1) ifeq ($(_TEXINFO_DIRLEVELS),2) -__TEXI_SRC += doc/info/*.texinfo -__TEXI_SRC += doc/info/*/*.texinfo +__TEXI_SRC += $(v)doc/info/*.texinfo +__TEXI_SRC += $(v)doc/info/*/*.texinfo endif ifneq ($(_TEXINFO_DIRLEVELS),2) -__TEXI_SRC += $(foreach W,$(shell $(SEQ) $(_TEXINFO_DIRLEVELS) | while read n; do $(ECHO) $$($(SEQ) $$n)" " | $(SED) 's/[^ ]* /\/\*/g'; done | $(XARGS) $(ECHO)),doc/info$(W).texinfo) +__TEXI_SRC += $(foreach W,$(shell $(SEQ) $(_TEXINFO_DIRLEVELS) | while read n; do $(ECHO) $$($(SEQ) $$n)" " | $(SED) 's/[^ ]* /\/\*/g'; done | $(XARGS) $(ECHO)),$(v)doc/info$(W).texinfo) endif endif endif @@ -95,37 +96,37 @@ endif ifdef _LOGO # Prepare conversion of logo. -obj/$(_LOGO).svg: doc/$(_LOGO).svg +aux/$(_LOGO).svg: $(v)doc/$(_LOGO).svg @$(PRINTF_INFO) '\e[00;01;31mCP\e[34m %s\e[00m$A\n' "$@" - @$(MKDIR) -p obj - $(Q)$(CP) $< $@ #$Z + @$(MKDIR) -p aux + $(Q)$(CP) $^ $@ #$Z @$(ECHO_EMPTY) # Intermediate format for the logo for DVI and PostScript manuals. -obj/$(_LOGO).ps: doc/$(_LOGO).svg +aux/$(_LOGO).ps: $(v)doc/$(_LOGO).svg @$(PRINTF_INFO) '\e[00;01;31mPS\e[34m %s\e[00m$A\n' "$@" - @$(MKDIR) -p obj - $(Q)$(SVG2PS) $< > $@ #$Z + @$(MKDIR) -p aux + $(Q)$(SVG2PS) $^ > $@ #$Z @$(ECHO_EMPTY) # Logo for DVI and PostScript manuals. -obj/$(_LOGO).eps: obj/$(_LOGO).ps +aux/$(_LOGO).eps: aux/$(_LOGO).ps @$(PRINTF_INFO) '\e[00;01;31mEPS\e[34m %s\e[00m$A\n' "$@" - $(Q)$(PS2EPS) $< #$Z + $(Q)$(PS2EPS) $^ #$Z @$(ECHO_EMPTY) # Logo for PDF manual. -obj/$(_LOGO).pdf: doc/$(_LOGO).svg +aux/$(_LOGO).pdf: doc/$(_LOGO).svg @$(PRINTF_INFO) '\e[00;01;31mPDF\e[34m %s\e[00m$A\n' "$@" - @$(MKDIR) -p obj - $(Q)$(SVG2PDF) $< > $@ #$Z + @$(MKDIR) -p aux + $(Q)$(SVG2PDF) $^ > $@ #$Z @$(ECHO_EMPTY) endif # Build info manual. .PHONY: info info: bin/$(_PROJECT).info -bin/%.info $(foreach P,$(__INFOPARTS),bin/%.info-$(P)): doc/info/%.texinfo $(__TEXI_SRC) +bin/%.info $(foreach P,$(__INFOPARTS),bin/%.info-$(P)): $(v)doc/info/%.texinfo $(__TEXI_SRC) @$(PRINTF_INFO) '\e[00;01;31mTEXI\e[34m %s\e[00m$A\n' "$@" @$(MKDIR) -p bin $(Q)$(MAKEINFO) $< #$Z @@ -136,47 +137,47 @@ bin/%.info $(foreach P,$(__INFOPARTS),bin/%.info-$(P)): doc/info/%.texinfo $(__T # Build DVI manual. .PHONY: dvi dvi: bin/$(_PROJECT).dvi -bin/%.dvi: doc/info/%.texinfo $(__TEXI_SRC) $(foreach L,$(_LOGO),obj/$(L).eps) +bin/%.dvi: $(v)doc/info/%.texinfo $(__TEXI_SRC) $(foreach L,$(_LOGO),aux/$(L).eps) @$(PRINTF_INFO) '\e[00;01;31mTEXI\e[34m %s\e[00m$A\n' "$@" - @! $(TEST) -d obj/dvi/$* || $(RM) -rf obj/dvi/$* - @$(MKDIR) -p obj/dvi/$* bin - $(Q)cd obj/dvi/$* && $(TEXI2DVI) ../../../$< $(__TEXINFO_FLAGS) < /dev/null #$Z + @! $(TEST) -d aux/dvi/$* || $(RM) -rf aux/dvi/$* + @$(MKDIR) -p aux/dvi/$* bin + $(Q)cd aux/dvi/$* && $(TEXI2DVI) $(__back3unless_v)$< $(__TEXINFO_FLAGS) < /dev/null #$Z @$(PRINTF_INFO) '$A' - $(Q)$(MV) obj/dvi/$*/$*.dvi $@ #$Z + $(Q)$(MV) aux/dvi/$*/$*.dvi $@ #$Z @$(ECHO_EMPTY) # Build PDF manual. .PHONY: pdf pdf: bin/$(_PROJECT).pdf -bin/%.pdf: doc/info/%.texinfo $(__TEXI_SRC) $(foreach L,$(_LOGO),obj/$(L).pdf) +bin/%.pdf: $(v)doc/info/%.texinfo $(__TEXI_SRC) $(foreach L,$(_LOGO),aux/$(L).pdf) @$(PRINTF_INFO) '\e[00;01;31mTEXI\e[34m %s\e[00m$A\n' "$@" - @! $(TEST) -d obj/pdf/$* || $(RM) -rf obj/pdf/$* - @$(MKDIR) -p obj/pdf/$* bin - $(Q)cd obj/pdf/$* && $(TEXI2PDF) ../../../$< $(__TEXINFO_FLAGS) < /dev/null #$Z + @! $(TEST) -d aux/pdf/$* || $(RM) -rf aux/pdf/$* + @$(MKDIR) -p aux/pdf/$* bin + $(Q)cd aux/pdf/$* && $(TEXI2PDF) $(__back3unless_v)$< $(__TEXINFO_FLAGS) < /dev/null #$Z @$(PRINTF_INFO) '$A' - $(Q)$(MV) obj/pdf/$*/$*.pdf $@ #$Z + $(Q)$(MV) aux/pdf/$*/$*.pdf $@ #$Z @$(ECHO_EMPTY) # Build PostScript manual. .PHONY: ps ps: bin/$(_PROJECT).ps -bin/%.ps: doc/info/%.texinfo $(__TEXI_SRC) $(foreach L,$(_LOGO),obj/$(L).eps) +bin/%.ps: $(v)doc/info/%.texinfo $(__TEXI_SRC) $(foreach L,$(_LOGO),aux/$(L).eps) @$(PRINTF_INFO) '\e[00;01;31mTEXI\e[34m %s\e[00m$A\n' "$@" - @! $(TEST) -d obj/ps/$* || $(RM) -rf obj/ps/$* - @$(MKDIR) -p obj/ps/$* bin - $(Q)cd obj/ps/$* && $(TEXI2PS) ../../../$< $(__TEXINFO_FLAGS) < /dev/null #$Z + @! $(TEST) -d aux/ps/$* || $(RM) -rf aux/ps/$* + @$(MKDIR) -p aux/ps/$* bin + $(Q)cd aux/ps/$* && $(TEXI2PS) $(__back3unless_v)$< $(__TEXINFO_FLAGS) < /dev/null #$Z @$(PRINTF_INFO) '$A' - $(Q)$(MV) obj/ps/$*/$*.ps $@ #$Z + $(Q)$(MV) aux/ps/$*/$*.ps $@ #$Z @$(ECHO_EMPTY) # Build HTML manual. .PHONY: html html: bin/html/$(_PROJECT)/index.html -bin/html/%/index.html: doc/info/%.texinfo $(__TEXI_SRC) +bin/html/%/index.html: $(v)doc/info/%.texinfo $(__TEXI_SRC) @$(PRINTF_INFO) '\e[00;01;31mTEXI\e[34m %s\e[00m$A\n' "$@" @! $(TEST) -d bin/html/$* || $(RM) -rf bin/html/$* @$(MKDIR) -p bin/html - $(Q)cd bin/html && $(MAKEINFO_HTML) ../../$< < /dev/null #$Z + $(Q)cd bin/html && $(MAKEINFO_HTML) $(__back2unless_v)$< < /dev/null #$Z @$(ECHO_EMPTY) @@ -187,8 +188,19 @@ bin/html/%/index.html: doc/info/%.texinfo $(__TEXI_SRC) install-info: bin/$(_PROJECT).info $(foreach P,$(__INFOPARTS),bin/%.info-$(P)) @$(PRINTF_INFO) '\e[00;01;31mINSTALL\e[34m %s\e[00m\n' "$@" $(Q)$(INSTALL_DIR) -- "$(DESTDIR)$(INFODIR)" - $(Q)$(INSTALL_DATA) $< -- "$(DESTDIR)$(INFODIR)/$(PKGNAME).info" + $(Q)$(INSTALL_DATA) bin/$(_PROJECT).info -- "$(DESTDIR)$(INFODIR)/$(PKGNAME).info" $(Q)$(forearch P,$(__INFOPARTS),$(INSTALL_DATA) bin/$*.info-$(P) -- "$(DESTDIR)$(INFODIR)/$(PKGNAME).info-$(P)" &&) $(TRUE) +ifdef POST_INSTALL + $(POST_INSTALL) +endif + $(Q)if $(SHELL) -c '$(N) $(INSTALL_INFO) --version' > /dev/null 2>&1; then \ + $(N)$(z) $(INSTALL_INFO) -- "${DESTDIR}${INFODIR}/$(PKGNAME).info" "${DESTDIR}${INFODIR}/dir"; \ + else \ + $(TRUE); \ + fi +ifdef POST_INSTALL + $(NORMAL_INSTALL) +endif @$(ECHO_EMPTY) # Install DVI manual. @@ -196,7 +208,7 @@ install-info: bin/$(_PROJECT).info $(foreach P,$(__INFOPARTS),bin/%.info-$(P)) install-dvi: bin/$(_PROJECT).dvi @$(PRINTF_INFO) '\e[00;01;31mINSTALL\e[34m %s\e[00m\n' "$@" $(Q)$(INSTALL_DIR) -- "$(DESTDIR)$(DVIDIR)" - $(Q)$(INSTALL_DATA) $< -- "$(DESTDIR)$(DVIDIR)/$(PKGNAME).dvi" + $(Q)$(INSTALL_DATA) $^ -- "$(DESTDIR)$(DVIDIR)/$(PKGNAME).dvi" @$(ECHO_EMPTY) # Install PDF manual. @@ -204,7 +216,7 @@ install-dvi: bin/$(_PROJECT).dvi install-pdf: bin/$(_PROJECT).pdf @$(PRINTF_INFO) '\e[00;01;31mINSTALL\e[34m %s\e[00m\n' "$@" $(Q)$(INSTALL_DIR) -- "$(DESTDIR)$(PDFDIR)" - $(Q)$(INSTALL_DATA) $< -- "$(DESTDIR)$(PDFDIR)/$(PKGNAME).pdf" + $(Q)$(INSTALL_DATA) $^ -- "$(DESTDIR)$(PDFDIR)/$(PKGNAME).pdf" @$(ECHO_EMPTY) # Install PostScript manual. @@ -212,15 +224,15 @@ install-pdf: bin/$(_PROJECT).pdf install-ps: bin/$(_PROJECT).ps @$(PRINTF_INFO) '\e[00;01;31mINSTALL\e[34m %s\e[00m\n' "$@" $(Q)$(INSTALL_DIR) -- "$(DESTDIR)$(PSDIR)" - $(Q)$(INSTALL_DATA) $< -- "$(DESTDIR)$(PSDIR)/$(PKGNAME).ps" + $(Q)$(INSTALL_DATA) $^ -- "$(DESTDIR)$(PSDIR)/$(PKGNAME).ps" @$(ECHO_EMPTY) # Install HTML manual. .PHONY: install-html install-html: $(foreach F,$(_HTML_FILES),bin/html/$(_PROJECT)/$(F)) @$(PRINTF_INFO) '\e[00;01;31mINSTALL\e[34m %s\e[00m\n' "$@" - $(Q)$(INSTALL_DIR) -- "$(DESTDIR)$(HTMLDIR)/$(PKGNAME)/html" - $(Q)$(INSTALL_DATA) $^ -- "$(DESTDIR)$(HTMLDIR)/$(PKGNAME)/html/" + $(Q)$(INSTALL_DIR) -- "$(DESTDIR)$(HTMLDIR)/$(PKGNAME)" + $(Q)$(INSTALL_DATA) $^ -- "$(DESTDIR)$(HTMLDIR)/$(PKGNAME)/" @$(ECHO_EMPTY) @@ -229,6 +241,13 @@ install-html: $(foreach F,$(_HTML_FILES),bin/html/$(_PROJECT)/$(F)) # Uninstall info manual. .PHONY: uninstall-info uninstall-info: +ifdef PRE_UNINSTALL + $(PRE_UNINSTALL) +endif + -$(Q)$(N)$(a) $(INSTALL_INFO) --delete -- "${DESTDIR}${INFODIR}/$(PKGNAME).info" "${DESTDIR}${INFODIR}/dir" +ifdef PRE_UNINSTALL + $(NORMAL_UNINSTALL) +endif -$(Q)$(RM) -- "$(DESTDIR)$(INFODIR)/$(PKGNAME).info" $(forearch P,$(__INFOPARTS),"$(DESTDIR)$(INFODIR)/$(PKGNAME).info-$(P)") # Uninstall DVI manual. @@ -249,8 +268,7 @@ uninstall-ps: # Uninstall HTML manual. .PHONY: uninstall-html uninstall-html: - -$(Q)$(RM) -- $(foreach F,$(_HTML_FILES),"$(DESTDIR)$(HTMLDIR)/$(PKGNAME)/html/$(F)") - -$(Q)$(RM) -- "$(DESTDIR)$(HTMLDIR)/$(PKGNAME)/html" + -$(Q)$(RM) -- $(foreach F,$(_HTML_FILES),"$(DESTDIR)$(HTMLDIR)/$(PKGNAME)/$(F)") -$(Q)$(RM) -- "$(DESTDIR)$(HTMLDIR)/$(PKGNAME)" diff --git a/mk/tools.mk b/mk/tools.mk index 6793840..5801d4f 100644 --- a/mk/tools.mk +++ b/mk/tools.mk @@ -10,27 +10,70 @@ # Part of GNU Coreutils: -MKDIR ?= mkdir +BASENAME ?= basename +CHGRP ?= chgrp +CHMOD ?= chmod +CHOWN ?= chown CP ?= cp +CPLIT ?= cplit +CUT ?= cut +DATE ?= date +DIRNAME ?= dirname +ECHO ?= echo +ENV ?= env +EXPAND ?= expand +EXPR ?= expr +FALS ?= false +FMT ?= fmt +FOLD ?= fold +HEAD ?= head +INSTALL ?= install +INSTALL_DATA ?= $(INSTALL) -m644 +INSTALL_DIR ?= $(INSTALL) -dm755 +INSTALL_PROGRAM ?= $(INSTALL) -m755 +JOIN ?= join +LN ?= ln +MKDIR ?= mkdir +MKFIFO ?= mkfifo +MKNOD ?= mknod MV ?= mv +NL ?= nl +NPROC ?= nproc +NUMFMT ?= numfmt +OD ?= od +PASTE ?= paste +PATHCHK ?= pathchk +PR ?= pr +PRINTF ?= printf +READLINK ?= readlink +REALPATH ?= realpath RM ?= rm RMDIR ?= rmdir -TRUE ?= true -TEST ?= test -TOUCH ?= touch -ECHO ?= echo -CUT ?= cut +SEQ ?= seq +SLEEP ?= sleep +SORT ?= sort +SPLIT ?= split +STAT ?= stat TAC ?= tac TAIL ?= tail -HEAD ?= head -SORT ?= sort +TEE ?= tee +TEST ?= test +TOUCH ?= touch +TR ?= tr +TRUE ?= true +TRUNCATE ?= truncate +TSORT ?= tsort +UNAME ?= uname +UNEXPAND ?= unexpand UNIQ ?= uniq -PRINTF ?= printf WC ?= wc -INSTALL ?= install -INSTALL_PROGRAM ?= $(INSTALL) -m755 -INSTALL_DATA ?= $(INSTALL) -m644 -INSTALL_DIR ?= $(INSTALL) -dm755 +YES ?= yes + +# Part of GNU help2man: +HELP2MAN ?= help2man + +# Part of GNU tar: +TAR ?= tar # Part of GNU Findutils: FIND ?= find @@ -38,6 +81,8 @@ XARGS ?= xargs # Part of GNU Grep: GREP ?= grep +EGREP ?= egrep +FGREP ?= fgrep # Part of GNU Sed: SED ?= sed @@ -48,6 +93,7 @@ GPG ?= gpg # Part of Texinfo: MAKEINFO ?= makeinfo MAKEINFO_HTML ?= $(MAKEINFO) --html +INSTALL_INFO ?= install-info # Part of Texlive-plainextra: TEXI2PDF ?= texi2pdf @@ -62,9 +108,26 @@ RSVG_CONVERT ?= rsvg-convert SVG2PS ?= $(RSVG_CONVERT) --format=ps SVG2PDF ?= $(RSVG_CONVERT) --format=pdf -# Part of GCC: +# Part of GNU Compiler Collection: CC ?= cc CPP ?= cpp +CXX ?= c++ + +# Part of GNU Binutils: +AR ?= ar +LD ?= ld +RANLIB ?= ranlib + +# Part of GNU Bison: +BISON ?= bison +YACC ?= yacc + +# Part of Flex: +FLEX ?= FLEX +LEX ?= lex + +# Part of GNU C Library: +LDCONFIG ?= ldconfig # Part of GNU Gettext: XGETTEXT ?= xgettext diff --git a/po/sv.po b/po/sv.po index 1ca0970..c12e235 100644 --- a/po/sv.po +++ b/po/sv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: scrotty 1.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-12-07 22:07+0100\n" +"POT-Creation-Date: 2015-12-10 02:23+0100\n" "PO-Revision-Date: 2015-12-07 18:50+0100\n" "Last-Translator: Mattias Andrée \n" "Language-Team: none\n" @@ -17,12 +17,12 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: src/scrotty.c:605 +#: src/scrotty.c:606 #, c-format msgid "Saved framebuffer %i to %s,\n" msgstr "Bildrutebuffert %i sparad till %s.\n" -#: src/scrotty.c:647 +#: src/scrotty.c:686 #, c-format msgid "" "SYNOPSIS\n" @@ -93,7 +93,7 @@ msgstr "" "\tslutet av strängen, och om ett sådant även förekom direkt framför.\n" "\n" -#: src/scrotty.c:692 +#: src/scrotty.c:731 #, fuzzy, c-format msgid "" "%s\n" @@ -112,7 +112,7 @@ msgstr "" "\n" "Skriven av Mattias Andrée.\n" -#: src/scrotty.c:712 +#: src/scrotty.c:751 #, c-format msgid "" "scrotty -- Screenshot program for Linux's TTY\n" @@ -147,20 +147,34 @@ msgstr "" "Du skall ha fått en kopia av GNU General Public License tillsammans\n" "med det här programmet. Om inte, se .\n" -#: src/scrotty.c:774 src/scrotty.c:781 +#: src/scrotty.c:813 src/scrotty.c:820 #, c-format msgid "%s: %s. Type '%s --help' for help.\n" msgstr "%s: %s. Kör '%s --help' för hjälp.\n" -#: src/scrotty.c:774 +#: src/scrotty.c:813 msgid "Unrecognised option." msgstr "Val känns inte igen." -#: src/scrotty.c:781 +#: src/scrotty.c:820 msgid "--exec has no argument." msgstr "--exec saknar argument." -#: src/scrotty.c:818 +#: src/scrotty.c:860 +#, fuzzy, c-format +msgid "%s: Unable to find a framebuffer.\n" +msgstr "%s: Kunde inte hitta någon bildrutebuffert.\n" + +#: src/scrotty.c:867 +#, c-format +msgid "%s: It looks like you are inside a display server. If this is correct, what you see is probably not what you get.\n" +msgstr "%s: Det ser ut som att du är innan för en grafikserver. Om detta är korrect, vad de ser är troligtvis inte vad du får.\n" + +#: src/scrotty.c:879 #, c-format msgid "%s: %s: %s\n" msgstr "%s: %s: %s\n" + +#, fuzzy +#~ msgid "%s: %i %i.\n" +#~ msgstr "%s: %s: %s\n" diff --git a/src/scrotty.c b/src/scrotty.c index 5e9c1a5..54e5b7d 100644 --- a/src/scrotty.c +++ b/src/scrotty.c @@ -40,6 +40,7 @@ #include #ifdef USE_GETTEXT # include +# include #endif @@ -330,7 +331,7 @@ measure (int fbno, long *width, long *height) int saved_errno; /* Open the file with the framebuffer's dimensions. */ - sprintf (buf, SYSDIR "/class/graphics/fb%i/virtual_size", fbno); + sprintf (buf, "%s/class/graphics/fb%i/virtual_size", SYSDIR, fbno); sizefd = open (buf, O_RDONLY); if (sizefd == -1) FILE_FAILURE (buf); @@ -575,7 +576,7 @@ save_fb (int fbno, int raw, const char *filepattern, const char *execpattern) int i, saved_errno; /* Get pathname for framebuffer, and stop if we have read all existing ones. */ - sprintf (fbpath, DEVDIR "/fb%i", fbno); + sprintf (fbpath, "%s/fb%i", DEVDIR, fbno); if (access (fbpath, F_OK)) return 1; @@ -636,6 +637,44 @@ save_fb (int fbno, int raw, const char *filepattern, const char *execpattern) } +/** + * Figure out whether the user is in a display server. + * We will print a warning in `main` if so. + */ +static int +have_display (void) +{ + char *env; + + /* X (should also contain a ':'.) */ + env = getenv("DISPLAY"); + if (env && *env) + return 1; + + /* mds (should also contain a ':'.) */ + env = getenv("MDS_DISPLAY"); + if (env && *env) + return 1; + + /* Mir (not verified, have not been able to find documentation.) */ + env = getenv("MIR_DISPLAY"); + if (env && *env) + return 1; + + /* Wayland. */ + env = getenv("WAYLAND_DISPLAY"); + if (env && *env) + return 1; + + /* Proposed metavariable. */ + env = getenv("PREFERRED_DISPLAY"); + if (env && *env) + return 1; + + return 0; +} + + /** * Print usage information. * @@ -742,7 +781,7 @@ main (int argc, char *argv[]) #define EXIT_USAGE(MSG) \ return fprintf (stderr, _("%s: %s. Type '%s --help' for help.\n"), execname, MSG, execname), 1 - int fbno, r, i, dash = argc, exec = -1, help = 0; + int fbno, r, i, dash = argc, exec = -1, help = 0, found = 0; int raw = 0, version = 0, copyright = 0, filepattern = -1; static char convert_args_0[] = "convert"; static char convert_args_1[] = DEVDIR "/stdin"; @@ -806,7 +845,29 @@ main (int argc, char *argv[]) if (r < 0) goto fail; if (r > 0) - break; + { + if (fbno) /* Perhaps framebuffer 1 is the first. */ + break; + else + continue; + } + found = 1; + } + + /* Did not find any framebuffer? */ + if (found == 0) + { + fprintf (stderr, _("%s: Unable to find a framebuffer.\n"), execname); + return 1; + } + + /* Warn about being inside a display server. */ + if (have_display ()) + { + fprintf (stderr, _("%s: It looks like you are inside a " + "display server. If this is correct, " + "what you see is probably not what " + "you get.\n"), execname); } return 0; -- cgit v1.2.3-70-g09d2