├── .gitattributes ├── .gitignore ├── .travis.yml ├── AUTHORS ├── CHANGES ├── COPYRIGHT ├── LICENSE ├── Makefile.am ├── Makefile.in ├── PERL_MODULES ├── README.md ├── VERSION ├── bin └── lxadm ├── bootstrap ├── configure ├── configure.ac ├── conftools ├── install-sh └── missing ├── doc └── lxadm.pod ├── lib ├── LXadm │ ├── Config.pm │ ├── Images.pm │ └── Utils.pm ├── Makefile.am └── Makefile.in └── thirdparty ├── Makefile.am └── Makefile.in /.gitattributes: -------------------------------------------------------------------------------- 1 | Makefile.in linguist-vendored 2 | bootstrap linguist-vendored 3 | conftools/** linguist-vendored 4 | configure linguist-vendored 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | aclocal.m4 2 | autom4te.cache/ 3 | *.tar.gz 4 | /blib/ 5 | /.build/ 6 | _build/ 7 | cover_db/ 8 | inc/ 9 | Build 10 | !Build/ 11 | thirdparty/* 12 | !thirdparty/ 13 | !thirdparty/Makefile.am 14 | !thirdparty/Makefile.in 15 | Build.bat 16 | .last_cover_stats 17 | Makefile 18 | Makefile.old 19 | MANIFEST.bak 20 | /META.yml 21 | /META.json 22 | /MYMETA.* 23 | nytprof.out 24 | /pm_to_blib 25 | *.o 26 | *.bs 27 | /_eumm/ 28 | var/ 29 | man/ 30 | config.* 31 | etc/okshop.cfg 32 | *~ -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: perl 2 | 3 | perl: 4 | - "5.26" 5 | - "5.24" 6 | - "5.22" 7 | - "5.20" 8 | - "5.18" 9 | - "5.16" 10 | - "5.14" 11 | - "5.12" 12 | - "5.10" 13 | 14 | # disable dependency install 15 | install: 16 | - true 17 | 18 | script: 19 | - ./bootstrap 20 | - ./configure --prefix=$HOME/lxadm 21 | - make install 22 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Dominik Hassler 2 | Tobias Oetiker 3 | -------------------------------------------------------------------------------- /CHANGES: -------------------------------------------------------------------------------- 1 | commit 139c2408d24263afcf404c0d9913febe577516ad 2 | Author: Dominik Hassler 3 | Date: Mon Dec 11 15:31:44 2017 +0100 4 | 5 | lx brand filter 6 | 7 | commit 9a492c76282758f9f9c221b6c360943c3972ba4e 8 | Author: Dominik Hassler 9 | Date: Sun Oct 1 17:06:44 2017 +0200 10 | 11 | ready for 0.1.5 12 | 13 | commit 09a5bbdc1f6bc0445b83d5f940d46f767041bef9 14 | Author: Dominik Hassler 15 | Date: Sun Oct 1 16:55:34 2017 +0200 16 | 17 | remove lx brand check 18 | 19 | commit a324f641eeb18d906fd324ae4f5f7bf890dbf2ad 20 | Author: Dominik Hassler 21 | Date: Sun Oct 1 16:45:03 2017 +0200 22 | 23 | build now allows setting of var data dir 24 | 25 | commit 561cc65baf33f6ac155c21334f7cc34926d3f9d8 26 | Author: Dominik Hassler 27 | Date: Fri Sep 29 15:34:17 2017 +0200 28 | 29 | fix readme 30 | 31 | commit 4f0908401444ee51cd24cb8b13ef4e2fc8ee499a 32 | Author: Dominik Hassler 33 | Date: Sat Aug 19 14:15:37 2017 +0200 34 | 35 | ready for 0.1.4 36 | 37 | commit e83702a49a026140850bfbc99e84178f1821e9db 38 | Author: Dominik Hassler 39 | Date: Sat Aug 19 14:04:31 2017 +0200 40 | 41 | make 'net' resource optional 42 | 43 | commit af385e44bff2b04988c9bfa9c5c97d0a998742c2 44 | Author: Dominik Hassler 45 | Date: Tue Jan 24 10:05:17 2017 +0100 46 | 47 | ready for 0.1.3 48 | 49 | commit 67141922732dc671e29502a9aadab40108f79269 50 | Author: Dominik Hassler 51 | Date: Tue Jan 24 09:52:03 2017 +0100 52 | 53 | - remove empty attr resources 54 | 55 | commit b991ba5dc9b462bc9d345baed424e149a7e479dc 56 | Author: Dominik Hassler 57 | Date: Fri Dec 16 17:03:50 2016 +0100 58 | 59 | ready for 0.1.2 60 | 61 | commit 30dacac13a58814f53b4050601e941a78cca57e0 62 | Author: Dominik Hassler 63 | Date: Fri Dec 16 16:32:52 2016 +0100 64 | 65 | - use Illumos::Zones 0.1.4 66 | 67 | commit 928870755508610bba60bf11186929a175a5968a 68 | Author: Dominik Hassler 69 | Date: Fri Dec 16 16:07:17 2016 +0100 70 | 71 | - proper rctl handling by aliases 72 | 73 | commit 5f2182ae720cdab9263f35d309e079e6c61da3f8 74 | Author: Dominik Hassler 75 | Date: Fri Dec 16 15:03:09 2016 +0100 76 | 77 | - check if zone is a lx zone 78 | 79 | commit d803069818b0a5e9b523d3501453c70efde3872d 80 | Author: Dominik Hassler 81 | Date: Thu Dec 15 19:25:54 2016 +0100 82 | 83 | - typos 84 | 85 | commit aee02ac54616bbf1a18c5359352dab3f841347cf 86 | Author: Dominik Hassler 87 | Date: Thu Dec 15 15:59:56 2016 +0100 88 | 89 | - git attributes, perl 5.22 90 | 91 | commit 85fe41c4ac9cd3952a468ee27cb7917a593f8128 92 | Author: Dominik Hassler 93 | Date: Thu Dec 15 15:48:15 2016 +0100 94 | 95 | - gitattributes added 96 | 97 | commit 94c16cffbef933c943feac3e28795e8a08bf8727 98 | Author: Dominik Hassler 99 | Date: Thu Dec 15 15:32:51 2016 +0100 100 | 101 | ready for 0.1.1 102 | 103 | commit c214e09efa01b34f128c3c2106bda8ce3072c5a7 104 | Author: Dominik Hassler 105 | Date: Thu Dec 15 14:50:43 2016 +0100 106 | 107 | - fix dependencies 108 | 109 | commit 82e1d6335b998e46c8d44852238e111e84fdca0c 110 | Author: Dominik Hassler 111 | Date: Wed Dec 14 16:31:22 2016 +0100 112 | 113 | - docu fixes 114 | 115 | commit 690fc6b53693602e65142f73d7781cd14b5197d3 116 | Author: Dominik Hassler 117 | Date: Wed Dec 14 15:12:39 2016 +0100 118 | 119 | - gitter again 120 | 121 | commit 3dfe2d424d259638e7f79f462604ffc38ad746d1 122 | Author: Dominik Hassler 123 | Date: Wed Dec 14 14:02:30 2016 +0100 124 | 125 | - remove gitter for now 126 | 127 | commit eb02abd836e5781d9c8a1bd380e6ca81205e9b03 128 | Author: Dominik Hassler 129 | Date: Tue Dec 13 19:39:36 2016 +0100 130 | 131 | - add gitter 132 | 133 | commit 69c6033c773c9ebe8a4bf39d2303f412f5312bb9 134 | Author: Dominik Hassler 135 | Date: Tue Dec 13 16:56:53 2016 +0100 136 | 137 | - fix travis 138 | 139 | commit d31cbd333c90969cb4faa3c466735731ef92bb20 140 | Author: Dominik Hassler 141 | Date: Tue Dec 13 16:50:14 2016 +0100 142 | 143 | ready for 0.1.0 144 | 145 | commit cef17cf5a3106a1f65c68e964f982e046777eb10 146 | Author: Dominik Hassler 147 | Date: Tue Dec 13 15:11:37 2016 +0100 148 | 149 | - readme 150 | 151 | commit 15aea698be4b760f845aa49798e25b8209c5d858 152 | Author: Dominik Hassler 153 | Date: Tue Dec 13 14:56:40 2016 +0100 154 | 155 | - ready for first beta release 156 | 157 | commit 8e79ee318013169ca4555b16083d3176b4171e1f 158 | Author: Dominik Hassler 159 | Date: Mon Dec 5 01:59:00 2016 +0100 160 | 161 | - perl lib dir 162 | 163 | commit b8b7fe6b7645ac58d3fed0eb012a1d189cef19e4 164 | Author: Tobias Oetiker 165 | Date: Mon Dec 5 01:20:22 2016 +0100 166 | 167 | Auto update (#2) 168 | 169 | fix automake 170 | 171 | commit e4b3e04e831df8162df4bab9d46f4bd0e56be500 172 | Author: Dominik Hassler 173 | Date: Mon Dec 5 01:13:07 2016 +0100 174 | 175 | ready for release 0.1.0-rc1 176 | 177 | commit 00a04abf5bf0530969d1de5c4beef49bf298e02b 178 | Author: Dominik Hassler 179 | Date: Mon Dec 5 00:52:33 2016 +0100 180 | 181 | - authors 182 | 183 | commit e602980138bacf27eefb84777cacc40434d45200 184 | Author: Tobias Oetiker 185 | Date: Mon Dec 5 00:39:29 2016 +0100 186 | 187 | autoconf ahoi 188 | 189 | commit 6cb5428eb9f2953aa02810e09b25488412289187 190 | Author: Dominik Hassler 191 | Date: Sun Dec 4 23:20:37 2016 +0100 192 | 193 | - wip 194 | 195 | commit d4b7bb6476a67f07ecd23dc80499426c856610e2 196 | Author: Dominik Hassler 197 | Date: Fri Dec 2 14:54:33 2016 +0100 198 | 199 | Initial commit 200 | -------------------------------------------------------------------------------- /COPYRIGHT: -------------------------------------------------------------------------------- 1 | lxadm 2 | 3 | Manage Illumos lx zones. 4 | 5 | All rights reserved. 6 | 7 | GNU GPL License 8 | =============== 9 | 10 | This program is free software; you can redistribute it and/or modify it 11 | under the terms of the GNU General Public License as published by the Free 12 | Software Foundation; either version 3 of the License, or (at your option) 13 | any later version. 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 17 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 18 | more details. 19 | 20 | You should have received a copy of the GNU General Public License along 21 | with this program; if not, write to the Free Software Foundation, Inc., 22 | 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2016 Tobias Oetiker 2 | 3 | AUTOMAKE_OPTIONS = foreign 4 | 5 | SUBDIRS = thirdparty lib 6 | 7 | BIN = bin/$(SCRIPT_NAME) 8 | 9 | MAN = man/$(SCRIPT_NAME).1 10 | POD = doc/$(SCRIPT_NAME).pod 11 | 12 | #PERLTESTS := $(shell find t -name "*.t") 13 | 14 | THIRDPARTY_DIR := $(shell pwd)/thirdparty 15 | 16 | EXTRA_DIST = VERSION COPYRIGHT README.md LICENSE CHANGES AUTHORS PERL_MODULES $(BIN) $(MAN) 17 | 18 | YEAR := $(shell date +%Y) 19 | DATE := $(shell date +%Y-%m-%d) 20 | 21 | datadir = $(prefix) 22 | 23 | README.md COPYRIGHT : VERSION 24 | $(PERL) -i -p -e 's/(#VERSION#|\d+\.\d+\.\d+(?:-\w+)?)/$(PACKAGE_VERSION)/g;s/(#YEAR#|20[1-4]\d)/$(YEAR)/g;s/(#DATE#|20[1-9]\d-[01]\d-[0-3]\d)/$(DATE)/g;' $@ 25 | 26 | imandir = $(mandir)/man1 27 | iman_DATA = $(MAN) 28 | 29 | doc/%.pod: bin/% VERSION 30 | $(AM_V_GEN)mkdir -p doc;grep -A100000 '=head1 NAME' $< > $@ 31 | 32 | man/%.1: bin/% VERSION 33 | $(AM_V_GEN)mkdir -p man; test $(POD2MAN) = "no" || $(POD2MAN) --release=$(VERSION) --center=$(PACKAGE_NAME) $< > $@ 34 | 35 | dist_bin_SCRIPTS = $(BIN) 36 | 37 | dist-hook: thirdparty 38 | $(PERL) -i -p -e 's/^our\s+\$$VERSION\s*=\s*".+?";/our \$$VERSION = "$(PACKAGE_VERSION)";/;' $(distdir)/lib/$(CLASS_NAME)/*.pm 39 | 40 | dist-hook: $(POD) 41 | $(PERL) -i -p -e 's/^my .*# VERSION/my \$$VERSION = q{$(PACKAGE_VERSION)}; # VERSION/' $(distdir)/$(BIN) 42 | 43 | install-exec-hook: 44 | [ "$(PERL5LIB)" == "" ] || cd "$(DESTDIR)$(exec_prefix)" && $(PERL) -i -p -e 's{.*# PERL5LIB}{use lib qw($(PERL5LIB)); # PERL5LIB}' $(BIN) || true 45 | cd "$(DESTDIR)$(exec_prefix)" && $(PERL) -i -p -e 's{.*# LIBDIR}{use lib qw($(libdir)); # LIBDIR}' $(BIN) 46 | cd "$(DESTDIR)$(exec_prefix)" && $(PERL) -i -p -e 's{^#!.*perl.*}{#!$(PERL)};' $(BIN) 47 | cd "$(DESTDIR)$(libdir)/LXadm" && $(PERL) -i -p -e 's{^my .*# CACHEPATH}{my \$$CACHE_PATH = "$(localstatedir)/cache"; # CACHEPATH};' Images.pm 48 | [ ! -d $(THIRDPARTY_DIR)/lib/perl5 ] || cp -fr $(THIRDPARTY_DIR)/lib/perl5/* $(DESTDIR)$(libdir) 49 | 50 | #test: 51 | # $(PERL) "-MExtUtils::Command::MM" "-e" "test_harness(0, 'lib','thirdparty/lib/perl5')" t/*.t 52 | 53 | -------------------------------------------------------------------------------- /Makefile.in: -------------------------------------------------------------------------------- 1 | # Makefile.in generated by automake 1.14.1 from Makefile.am. 2 | # @configure_input@ 3 | 4 | # Copyright (C) 1994-2013 Free Software Foundation, Inc. 5 | 6 | # This Makefile.in is free software; the Free Software Foundation 7 | # gives unlimited permission to copy and/or distribute it, 8 | # with or without modifications, as long as this notice is preserved. 9 | 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without 12 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 13 | # PARTICULAR PURPOSE. 14 | 15 | @SET_MAKE@ 16 | 17 | # Copyright (C) 2016 Tobias Oetiker 18 | 19 | 20 | VPATH = @srcdir@ 21 | am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' 22 | am__make_running_with_option = \ 23 | case $${target_option-} in \ 24 | ?) ;; \ 25 | *) echo "am__make_running_with_option: internal error: invalid" \ 26 | "target option '$${target_option-}' specified" >&2; \ 27 | exit 1;; \ 28 | esac; \ 29 | has_opt=no; \ 30 | sane_makeflags=$$MAKEFLAGS; \ 31 | if $(am__is_gnu_make); then \ 32 | sane_makeflags=$$MFLAGS; \ 33 | else \ 34 | case $$MAKEFLAGS in \ 35 | *\\[\ \ ]*) \ 36 | bs=\\; \ 37 | sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ 38 | | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ 39 | esac; \ 40 | fi; \ 41 | skip_next=no; \ 42 | strip_trailopt () \ 43 | { \ 44 | flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ 45 | }; \ 46 | for flg in $$sane_makeflags; do \ 47 | test $$skip_next = yes && { skip_next=no; continue; }; \ 48 | case $$flg in \ 49 | *=*|--*) continue;; \ 50 | -*I) strip_trailopt 'I'; skip_next=yes;; \ 51 | -*I?*) strip_trailopt 'I';; \ 52 | -*O) strip_trailopt 'O'; skip_next=yes;; \ 53 | -*O?*) strip_trailopt 'O';; \ 54 | -*l) strip_trailopt 'l'; skip_next=yes;; \ 55 | -*l?*) strip_trailopt 'l';; \ 56 | -[dEDm]) skip_next=yes;; \ 57 | -[JT]) skip_next=yes;; \ 58 | esac; \ 59 | case $$flg in \ 60 | *$$target_option*) has_opt=yes; break;; \ 61 | esac; \ 62 | done; \ 63 | test $$has_opt = yes 64 | am__make_dryrun = (target_option=n; $(am__make_running_with_option)) 65 | am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 66 | pkgdatadir = $(datadir)/@PACKAGE@ 67 | pkgincludedir = $(includedir)/@PACKAGE@ 68 | pkglibdir = $(libdir)/@PACKAGE@ 69 | pkglibexecdir = $(libexecdir)/@PACKAGE@ 70 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 71 | install_sh_DATA = $(install_sh) -c -m 644 72 | install_sh_PROGRAM = $(install_sh) -c 73 | install_sh_SCRIPT = $(install_sh) -c 74 | INSTALL_HEADER = $(INSTALL_DATA) 75 | transform = $(program_transform_name) 76 | NORMAL_INSTALL = : 77 | PRE_INSTALL = : 78 | POST_INSTALL = : 79 | NORMAL_UNINSTALL = : 80 | PRE_UNINSTALL = : 81 | POST_UNINSTALL = : 82 | subdir = . 83 | DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ 84 | $(top_srcdir)/configure $(am__configure_deps) \ 85 | $(dist_bin_SCRIPTS) AUTHORS conftools/install-sh \ 86 | conftools/missing $(top_srcdir)/conftools/install-sh \ 87 | $(top_srcdir)/conftools/missing 88 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 89 | am__aclocal_m4_deps = $(top_srcdir)/configure.ac 90 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 91 | $(ACLOCAL_M4) 92 | am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ 93 | configure.lineno config.status.lineno 94 | mkinstalldirs = $(install_sh) -d 95 | CONFIG_CLEAN_FILES = 96 | CONFIG_CLEAN_VPATH_FILES = 97 | am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; 98 | am__vpath_adj = case $$p in \ 99 | $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ 100 | *) f=$$p;; \ 101 | esac; 102 | am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; 103 | am__install_max = 40 104 | am__nobase_strip_setup = \ 105 | srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` 106 | am__nobase_strip = \ 107 | for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" 108 | am__nobase_list = $(am__nobase_strip_setup); \ 109 | for p in $$list; do echo "$$p $$p"; done | \ 110 | sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ 111 | $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ 112 | if (++n[$$2] == $(am__install_max)) \ 113 | { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ 114 | END { for (dir in files) print dir, files[dir] }' 115 | am__base_list = \ 116 | sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ 117 | sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' 118 | am__uninstall_files_from_dir = { \ 119 | test -z "$$files" \ 120 | || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ 121 | || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ 122 | $(am__cd) "$$dir" && rm -f $$files; }; \ 123 | } 124 | am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(imandir)" 125 | SCRIPTS = $(dist_bin_SCRIPTS) 126 | AM_V_P = $(am__v_P_@AM_V@) 127 | am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) 128 | am__v_P_0 = false 129 | am__v_P_1 = : 130 | AM_V_GEN = $(am__v_GEN_@AM_V@) 131 | am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) 132 | am__v_GEN_0 = @echo " GEN " $@; 133 | am__v_GEN_1 = 134 | AM_V_at = $(am__v_at_@AM_V@) 135 | am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) 136 | am__v_at_0 = @ 137 | am__v_at_1 = 138 | SOURCES = 139 | DIST_SOURCES = 140 | RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ 141 | ctags-recursive dvi-recursive html-recursive info-recursive \ 142 | install-data-recursive install-dvi-recursive \ 143 | install-exec-recursive install-html-recursive \ 144 | install-info-recursive install-pdf-recursive \ 145 | install-ps-recursive install-recursive installcheck-recursive \ 146 | installdirs-recursive pdf-recursive ps-recursive \ 147 | tags-recursive uninstall-recursive 148 | am__can_run_installinfo = \ 149 | case $$AM_UPDATE_INFO_DIR in \ 150 | n|no|NO) false;; \ 151 | *) (install-info --version) >/dev/null 2>&1;; \ 152 | esac 153 | DATA = $(iman_DATA) 154 | RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ 155 | distclean-recursive maintainer-clean-recursive 156 | am__recursive_targets = \ 157 | $(RECURSIVE_TARGETS) \ 158 | $(RECURSIVE_CLEAN_TARGETS) \ 159 | $(am__extra_recursive_targets) 160 | AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ 161 | cscope distdir dist dist-all distcheck 162 | am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) 163 | # Read a list of newline-separated strings from the standard input, 164 | # and print each of them once, without duplicates. Input order is 165 | # *not* preserved. 166 | am__uniquify_input = $(AWK) '\ 167 | BEGIN { nonempty = 0; } \ 168 | { items[$$0] = 1; nonempty = 1; } \ 169 | END { if (nonempty) { for (i in items) print i; }; } \ 170 | ' 171 | # Make sure the list of sources is unique. This is necessary because, 172 | # e.g., the same source file might be shared among _SOURCES variables 173 | # for different programs/libraries. 174 | am__define_uniq_tagged_files = \ 175 | list='$(am__tagged_files)'; \ 176 | unique=`for i in $$list; do \ 177 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 178 | done | $(am__uniquify_input)` 179 | ETAGS = etags 180 | CTAGS = ctags 181 | CSCOPE = cscope 182 | DIST_SUBDIRS = $(SUBDIRS) 183 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 184 | distdir = $(PACKAGE)-$(VERSION) 185 | top_distdir = $(distdir) 186 | am__remove_distdir = \ 187 | if test -d "$(distdir)"; then \ 188 | find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ 189 | && rm -rf "$(distdir)" \ 190 | || { sleep 5 && rm -rf "$(distdir)"; }; \ 191 | else :; fi 192 | am__post_remove_distdir = $(am__remove_distdir) 193 | am__relativize = \ 194 | dir0=`pwd`; \ 195 | sed_first='s,^\([^/]*\)/.*$$,\1,'; \ 196 | sed_rest='s,^[^/]*/*,,'; \ 197 | sed_last='s,^.*/\([^/]*\)$$,\1,'; \ 198 | sed_butlast='s,/*[^/]*$$,,'; \ 199 | while test -n "$$dir1"; do \ 200 | first=`echo "$$dir1" | sed -e "$$sed_first"`; \ 201 | if test "$$first" != "."; then \ 202 | if test "$$first" = ".."; then \ 203 | dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ 204 | dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ 205 | else \ 206 | first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ 207 | if test "$$first2" = "$$first"; then \ 208 | dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ 209 | else \ 210 | dir2="../$$dir2"; \ 211 | fi; \ 212 | dir0="$$dir0"/"$$first"; \ 213 | fi; \ 214 | fi; \ 215 | dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ 216 | done; \ 217 | reldir="$$dir2" 218 | DIST_ARCHIVES = $(distdir).tar.gz 219 | GZIP_ENV = --best 220 | DIST_TARGETS = dist-gzip 221 | distuninstallcheck_listfiles = find . -type f -print 222 | am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ 223 | | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' 224 | distcleancheck_listfiles = find . -type f -print 225 | ACLOCAL = @ACLOCAL@ 226 | AMTAR = @AMTAR@ 227 | AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ 228 | AUTOCONF = @AUTOCONF@ 229 | AUTOHEADER = @AUTOHEADER@ 230 | AUTOMAKE = @AUTOMAKE@ 231 | AWK = @AWK@ 232 | CLASS_NAME = @CLASS_NAME@ 233 | CURL = @CURL@ 234 | CYGPATH_W = @CYGPATH_W@ 235 | DEFS = @DEFS@ 236 | ECHO_C = @ECHO_C@ 237 | ECHO_N = @ECHO_N@ 238 | ECHO_T = @ECHO_T@ 239 | GMAKE = @GMAKE@ 240 | GREP = @GREP@ 241 | INSTALL = @INSTALL@ 242 | INSTALL_DATA = @INSTALL_DATA@ 243 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ 244 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ 245 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ 246 | LIBOBJS = @LIBOBJS@ 247 | LIBS = @LIBS@ 248 | LTLIBOBJS = @LTLIBOBJS@ 249 | MAINT = @MAINT@ 250 | MAKEINFO = @MAKEINFO@ 251 | MKDIR_P = @MKDIR_P@ 252 | PACKAGE = @PACKAGE@ 253 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ 254 | PACKAGE_NAME = @PACKAGE_NAME@ 255 | PACKAGE_STRING = @PACKAGE_STRING@ 256 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ 257 | PACKAGE_URL = @PACKAGE_URL@ 258 | PACKAGE_VERSION = @PACKAGE_VERSION@ 259 | PATH_SEPARATOR = @PATH_SEPARATOR@ 260 | PERL = @PERL@ 261 | PERL5LIB = @PERL5LIB@ 262 | POD2MAN = @POD2MAN@ 263 | SCRIPT_NAME = @SCRIPT_NAME@ 264 | SET_MAKE = @SET_MAKE@ 265 | SHELL = @SHELL@ 266 | STRIP = @STRIP@ 267 | URL_CAT = @URL_CAT@ 268 | VERSION = @VERSION@ 269 | WGET = @WGET@ 270 | abs_builddir = @abs_builddir@ 271 | abs_srcdir = @abs_srcdir@ 272 | abs_top_builddir = @abs_top_builddir@ 273 | abs_top_srcdir = @abs_top_srcdir@ 274 | am__leading_dot = @am__leading_dot@ 275 | am__tar = @am__tar@ 276 | am__untar = @am__untar@ 277 | bindir = @bindir@ 278 | build_alias = @build_alias@ 279 | builddir = @builddir@ 280 | datadir = $(prefix) 281 | datarootdir = @datarootdir@ 282 | docdir = @docdir@ 283 | dvidir = @dvidir@ 284 | enable_pkgonly = @enable_pkgonly@ 285 | exec_prefix = @exec_prefix@ 286 | host_alias = @host_alias@ 287 | htmldir = @htmldir@ 288 | includedir = @includedir@ 289 | infodir = @infodir@ 290 | install_sh = @install_sh@ 291 | libdir = @libdir@ 292 | libexecdir = @libexecdir@ 293 | localedir = @localedir@ 294 | localstatedir = @localstatedir@ 295 | mandir = @mandir@ 296 | mkdir_p = @mkdir_p@ 297 | oldincludedir = @oldincludedir@ 298 | pdfdir = @pdfdir@ 299 | prefix = @prefix@ 300 | program_transform_name = @program_transform_name@ 301 | psdir = @psdir@ 302 | sbindir = @sbindir@ 303 | sharedstatedir = @sharedstatedir@ 304 | srcdir = @srcdir@ 305 | sysconfdir = @sysconfdir@ 306 | target_alias = @target_alias@ 307 | top_build_prefix = @top_build_prefix@ 308 | top_builddir = @top_builddir@ 309 | top_srcdir = @top_srcdir@ 310 | AUTOMAKE_OPTIONS = foreign 311 | SUBDIRS = thirdparty lib 312 | BIN = bin/$(SCRIPT_NAME) 313 | MAN = man/$(SCRIPT_NAME).1 314 | POD = doc/$(SCRIPT_NAME).pod 315 | 316 | #PERLTESTS := $(shell find t -name "*.t") 317 | THIRDPARTY_DIR := $(shell pwd)/thirdparty 318 | EXTRA_DIST = VERSION COPYRIGHT README.md LICENSE CHANGES AUTHORS PERL_MODULES $(BIN) $(MAN) 319 | YEAR := $(shell date +%Y) 320 | DATE := $(shell date +%Y-%m-%d) 321 | imandir = $(mandir)/man1 322 | iman_DATA = $(MAN) 323 | dist_bin_SCRIPTS = $(BIN) 324 | all: all-recursive 325 | 326 | .SUFFIXES: 327 | am--refresh: Makefile 328 | @: 329 | $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) 330 | @for dep in $?; do \ 331 | case '$(am__configure_deps)' in \ 332 | *$$dep*) \ 333 | echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ 334 | $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ 335 | && exit 0; \ 336 | exit 1;; \ 337 | esac; \ 338 | done; \ 339 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ 340 | $(am__cd) $(top_srcdir) && \ 341 | $(AUTOMAKE) --foreign Makefile 342 | .PRECIOUS: Makefile 343 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 344 | @case '$?' in \ 345 | *config.status*) \ 346 | echo ' $(SHELL) ./config.status'; \ 347 | $(SHELL) ./config.status;; \ 348 | *) \ 349 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ 350 | cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ 351 | esac; 352 | 353 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) 354 | $(SHELL) ./config.status --recheck 355 | 356 | $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) 357 | $(am__cd) $(srcdir) && $(AUTOCONF) 358 | $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) 359 | $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) 360 | $(am__aclocal_m4_deps): 361 | install-dist_binSCRIPTS: $(dist_bin_SCRIPTS) 362 | @$(NORMAL_INSTALL) 363 | @list='$(dist_bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ 364 | if test -n "$$list"; then \ 365 | echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ 366 | $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ 367 | fi; \ 368 | for p in $$list; do \ 369 | if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ 370 | if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ 371 | done | \ 372 | sed -e 'p;s,.*/,,;n' \ 373 | -e 'h;s|.*|.|' \ 374 | -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ 375 | $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ 376 | { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ 377 | if ($$2 == $$4) { files[d] = files[d] " " $$1; \ 378 | if (++n[d] == $(am__install_max)) { \ 379 | print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ 380 | else { print "f", d "/" $$4, $$1 } } \ 381 | END { for (d in files) print "f", d, files[d] }' | \ 382 | while read type dir files; do \ 383 | if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ 384 | test -z "$$files" || { \ 385 | echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ 386 | $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ 387 | } \ 388 | ; done 389 | 390 | uninstall-dist_binSCRIPTS: 391 | @$(NORMAL_UNINSTALL) 392 | @list='$(dist_bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ 393 | files=`for p in $$list; do echo "$$p"; done | \ 394 | sed -e 's,.*/,,;$(transform)'`; \ 395 | dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) 396 | install-imanDATA: $(iman_DATA) 397 | @$(NORMAL_INSTALL) 398 | @list='$(iman_DATA)'; test -n "$(imandir)" || list=; \ 399 | if test -n "$$list"; then \ 400 | echo " $(MKDIR_P) '$(DESTDIR)$(imandir)'"; \ 401 | $(MKDIR_P) "$(DESTDIR)$(imandir)" || exit 1; \ 402 | fi; \ 403 | for p in $$list; do \ 404 | if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ 405 | echo "$$d$$p"; \ 406 | done | $(am__base_list) | \ 407 | while read files; do \ 408 | echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(imandir)'"; \ 409 | $(INSTALL_DATA) $$files "$(DESTDIR)$(imandir)" || exit $$?; \ 410 | done 411 | 412 | uninstall-imanDATA: 413 | @$(NORMAL_UNINSTALL) 414 | @list='$(iman_DATA)'; test -n "$(imandir)" || list=; \ 415 | files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ 416 | dir='$(DESTDIR)$(imandir)'; $(am__uninstall_files_from_dir) 417 | 418 | # This directory's subdirectories are mostly independent; you can cd 419 | # into them and run 'make' without going through this Makefile. 420 | # To change the values of 'make' variables: instead of editing Makefiles, 421 | # (1) if the variable is set in 'config.status', edit 'config.status' 422 | # (which will cause the Makefiles to be regenerated when you run 'make'); 423 | # (2) otherwise, pass the desired values on the 'make' command line. 424 | $(am__recursive_targets): 425 | @fail=; \ 426 | if $(am__make_keepgoing); then \ 427 | failcom='fail=yes'; \ 428 | else \ 429 | failcom='exit 1'; \ 430 | fi; \ 431 | dot_seen=no; \ 432 | target=`echo $@ | sed s/-recursive//`; \ 433 | case "$@" in \ 434 | distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ 435 | *) list='$(SUBDIRS)' ;; \ 436 | esac; \ 437 | for subdir in $$list; do \ 438 | echo "Making $$target in $$subdir"; \ 439 | if test "$$subdir" = "."; then \ 440 | dot_seen=yes; \ 441 | local_target="$$target-am"; \ 442 | else \ 443 | local_target="$$target"; \ 444 | fi; \ 445 | ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ 446 | || eval $$failcom; \ 447 | done; \ 448 | if test "$$dot_seen" = "no"; then \ 449 | $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ 450 | fi; test -z "$$fail" 451 | 452 | ID: $(am__tagged_files) 453 | $(am__define_uniq_tagged_files); mkid -fID $$unique 454 | tags: tags-recursive 455 | TAGS: tags 456 | 457 | tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 458 | set x; \ 459 | here=`pwd`; \ 460 | if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ 461 | include_option=--etags-include; \ 462 | empty_fix=.; \ 463 | else \ 464 | include_option=--include; \ 465 | empty_fix=; \ 466 | fi; \ 467 | list='$(SUBDIRS)'; for subdir in $$list; do \ 468 | if test "$$subdir" = .; then :; else \ 469 | test ! -f $$subdir/TAGS || \ 470 | set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ 471 | fi; \ 472 | done; \ 473 | $(am__define_uniq_tagged_files); \ 474 | shift; \ 475 | if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ 476 | test -n "$$unique" || unique=$$empty_fix; \ 477 | if test $$# -gt 0; then \ 478 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 479 | "$$@" $$unique; \ 480 | else \ 481 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 482 | $$unique; \ 483 | fi; \ 484 | fi 485 | ctags: ctags-recursive 486 | 487 | CTAGS: ctags 488 | ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 489 | $(am__define_uniq_tagged_files); \ 490 | test -z "$(CTAGS_ARGS)$$unique" \ 491 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ 492 | $$unique 493 | 494 | GTAGS: 495 | here=`$(am__cd) $(top_builddir) && pwd` \ 496 | && $(am__cd) $(top_srcdir) \ 497 | && gtags -i $(GTAGS_ARGS) "$$here" 498 | cscope: cscope.files 499 | test ! -s cscope.files \ 500 | || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) 501 | clean-cscope: 502 | -rm -f cscope.files 503 | cscope.files: clean-cscope cscopelist 504 | cscopelist: cscopelist-recursive 505 | 506 | cscopelist-am: $(am__tagged_files) 507 | list='$(am__tagged_files)'; \ 508 | case "$(srcdir)" in \ 509 | [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ 510 | *) sdir=$(subdir)/$(srcdir) ;; \ 511 | esac; \ 512 | for i in $$list; do \ 513 | if test -f "$$i"; then \ 514 | echo "$(subdir)/$$i"; \ 515 | else \ 516 | echo "$$sdir/$$i"; \ 517 | fi; \ 518 | done >> $(top_builddir)/cscope.files 519 | 520 | distclean-tags: 521 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags 522 | -rm -f cscope.out cscope.in.out cscope.po.out cscope.files 523 | 524 | distdir: $(DISTFILES) 525 | $(am__remove_distdir) 526 | test -d "$(distdir)" || mkdir "$(distdir)" 527 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 528 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 529 | list='$(DISTFILES)'; \ 530 | dist_files=`for file in $$list; do echo $$file; done | \ 531 | sed -e "s|^$$srcdirstrip/||;t" \ 532 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ 533 | case $$dist_files in \ 534 | */*) $(MKDIR_P) `echo "$$dist_files" | \ 535 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ 536 | sort -u` ;; \ 537 | esac; \ 538 | for file in $$dist_files; do \ 539 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ 540 | if test -d $$d/$$file; then \ 541 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 542 | if test -d "$(distdir)/$$file"; then \ 543 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 544 | fi; \ 545 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ 546 | cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ 547 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 548 | fi; \ 549 | cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ 550 | else \ 551 | test -f "$(distdir)/$$file" \ 552 | || cp -p $$d/$$file "$(distdir)/$$file" \ 553 | || exit 1; \ 554 | fi; \ 555 | done 556 | @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ 557 | if test "$$subdir" = .; then :; else \ 558 | $(am__make_dryrun) \ 559 | || test -d "$(distdir)/$$subdir" \ 560 | || $(MKDIR_P) "$(distdir)/$$subdir" \ 561 | || exit 1; \ 562 | dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ 563 | $(am__relativize); \ 564 | new_distdir=$$reldir; \ 565 | dir1=$$subdir; dir2="$(top_distdir)"; \ 566 | $(am__relativize); \ 567 | new_top_distdir=$$reldir; \ 568 | echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ 569 | echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ 570 | ($(am__cd) $$subdir && \ 571 | $(MAKE) $(AM_MAKEFLAGS) \ 572 | top_distdir="$$new_top_distdir" \ 573 | distdir="$$new_distdir" \ 574 | am__remove_distdir=: \ 575 | am__skip_length_check=: \ 576 | am__skip_mode_fix=: \ 577 | distdir) \ 578 | || exit 1; \ 579 | fi; \ 580 | done 581 | $(MAKE) $(AM_MAKEFLAGS) \ 582 | top_distdir="$(top_distdir)" distdir="$(distdir)" \ 583 | dist-hook 584 | -test -n "$(am__skip_mode_fix)" \ 585 | || find "$(distdir)" -type d ! -perm -755 \ 586 | -exec chmod u+rwx,go+rx {} \; -o \ 587 | ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ 588 | ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ 589 | ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ 590 | || chmod -R a+r "$(distdir)" 591 | dist-gzip: distdir 592 | tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz 593 | $(am__post_remove_distdir) 594 | 595 | dist-bzip2: distdir 596 | tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 597 | $(am__post_remove_distdir) 598 | 599 | dist-lzip: distdir 600 | tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz 601 | $(am__post_remove_distdir) 602 | 603 | dist-xz: distdir 604 | tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz 605 | $(am__post_remove_distdir) 606 | 607 | dist-tarZ: distdir 608 | @echo WARNING: "Support for shar distribution archives is" \ 609 | "deprecated." >&2 610 | @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 611 | tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z 612 | $(am__post_remove_distdir) 613 | 614 | dist-shar: distdir 615 | @echo WARNING: "Support for distribution archives compressed with" \ 616 | "legacy program 'compress' is deprecated." >&2 617 | @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 618 | shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz 619 | $(am__post_remove_distdir) 620 | 621 | dist-zip: distdir 622 | -rm -f $(distdir).zip 623 | zip -rq $(distdir).zip $(distdir) 624 | $(am__post_remove_distdir) 625 | 626 | dist dist-all: 627 | $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' 628 | $(am__post_remove_distdir) 629 | 630 | # This target untars the dist file and tries a VPATH configuration. Then 631 | # it guarantees that the distribution is self-contained by making another 632 | # tarfile. 633 | distcheck: dist 634 | case '$(DIST_ARCHIVES)' in \ 635 | *.tar.gz*) \ 636 | GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ 637 | *.tar.bz2*) \ 638 | bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ 639 | *.tar.lz*) \ 640 | lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ 641 | *.tar.xz*) \ 642 | xz -dc $(distdir).tar.xz | $(am__untar) ;;\ 643 | *.tar.Z*) \ 644 | uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ 645 | *.shar.gz*) \ 646 | GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ 647 | *.zip*) \ 648 | unzip $(distdir).zip ;;\ 649 | esac 650 | chmod -R a-w $(distdir) 651 | chmod u+w $(distdir) 652 | mkdir $(distdir)/_build $(distdir)/_inst 653 | chmod a-w $(distdir) 654 | test -d $(distdir)/_build || exit 0; \ 655 | dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ 656 | && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ 657 | && am__cwd=`pwd` \ 658 | && $(am__cd) $(distdir)/_build \ 659 | && ../configure \ 660 | $(AM_DISTCHECK_CONFIGURE_FLAGS) \ 661 | $(DISTCHECK_CONFIGURE_FLAGS) \ 662 | --srcdir=.. --prefix="$$dc_install_base" \ 663 | && $(MAKE) $(AM_MAKEFLAGS) \ 664 | && $(MAKE) $(AM_MAKEFLAGS) dvi \ 665 | && $(MAKE) $(AM_MAKEFLAGS) check \ 666 | && $(MAKE) $(AM_MAKEFLAGS) install \ 667 | && $(MAKE) $(AM_MAKEFLAGS) installcheck \ 668 | && $(MAKE) $(AM_MAKEFLAGS) uninstall \ 669 | && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ 670 | distuninstallcheck \ 671 | && chmod -R a-w "$$dc_install_base" \ 672 | && ({ \ 673 | (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ 674 | && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ 675 | && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ 676 | && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ 677 | distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ 678 | } || { rm -rf "$$dc_destdir"; exit 1; }) \ 679 | && rm -rf "$$dc_destdir" \ 680 | && $(MAKE) $(AM_MAKEFLAGS) dist \ 681 | && rm -rf $(DIST_ARCHIVES) \ 682 | && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ 683 | && cd "$$am__cwd" \ 684 | || exit 1 685 | $(am__post_remove_distdir) 686 | @(echo "$(distdir) archives ready for distribution: "; \ 687 | list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ 688 | sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' 689 | distuninstallcheck: 690 | @test -n '$(distuninstallcheck_dir)' || { \ 691 | echo 'ERROR: trying to run $@ with an empty' \ 692 | '$$(distuninstallcheck_dir)' >&2; \ 693 | exit 1; \ 694 | }; \ 695 | $(am__cd) '$(distuninstallcheck_dir)' || { \ 696 | echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ 697 | exit 1; \ 698 | }; \ 699 | test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ 700 | || { echo "ERROR: files left after uninstall:" ; \ 701 | if test -n "$(DESTDIR)"; then \ 702 | echo " (check DESTDIR support)"; \ 703 | fi ; \ 704 | $(distuninstallcheck_listfiles) ; \ 705 | exit 1; } >&2 706 | distcleancheck: distclean 707 | @if test '$(srcdir)' = . ; then \ 708 | echo "ERROR: distcleancheck can only run from a VPATH build" ; \ 709 | exit 1 ; \ 710 | fi 711 | @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ 712 | || { echo "ERROR: files left in build directory after distclean:" ; \ 713 | $(distcleancheck_listfiles) ; \ 714 | exit 1; } >&2 715 | check-am: all-am 716 | check: check-recursive 717 | all-am: Makefile $(SCRIPTS) $(DATA) 718 | installdirs: installdirs-recursive 719 | installdirs-am: 720 | for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(imandir)"; do \ 721 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \ 722 | done 723 | install: install-recursive 724 | install-exec: install-exec-recursive 725 | install-data: install-data-recursive 726 | uninstall: uninstall-recursive 727 | 728 | install-am: all-am 729 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am 730 | 731 | installcheck: installcheck-recursive 732 | install-strip: 733 | if test -z '$(STRIP)'; then \ 734 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 735 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 736 | install; \ 737 | else \ 738 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 739 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 740 | "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ 741 | fi 742 | mostlyclean-generic: 743 | 744 | clean-generic: 745 | 746 | distclean-generic: 747 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) 748 | -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) 749 | 750 | maintainer-clean-generic: 751 | @echo "This command is intended for maintainers to use" 752 | @echo "it deletes files that may require special tools to rebuild." 753 | clean: clean-recursive 754 | 755 | clean-am: clean-generic mostlyclean-am 756 | 757 | distclean: distclean-recursive 758 | -rm -f $(am__CONFIG_DISTCLEAN_FILES) 759 | -rm -f Makefile 760 | distclean-am: clean-am distclean-generic distclean-tags 761 | 762 | dvi: dvi-recursive 763 | 764 | dvi-am: 765 | 766 | html: html-recursive 767 | 768 | html-am: 769 | 770 | info: info-recursive 771 | 772 | info-am: 773 | 774 | install-data-am: install-imanDATA 775 | 776 | install-dvi: install-dvi-recursive 777 | 778 | install-dvi-am: 779 | 780 | install-exec-am: install-dist_binSCRIPTS 781 | @$(NORMAL_INSTALL) 782 | $(MAKE) $(AM_MAKEFLAGS) install-exec-hook 783 | install-html: install-html-recursive 784 | 785 | install-html-am: 786 | 787 | install-info: install-info-recursive 788 | 789 | install-info-am: 790 | 791 | install-man: 792 | 793 | install-pdf: install-pdf-recursive 794 | 795 | install-pdf-am: 796 | 797 | install-ps: install-ps-recursive 798 | 799 | install-ps-am: 800 | 801 | installcheck-am: 802 | 803 | maintainer-clean: maintainer-clean-recursive 804 | -rm -f $(am__CONFIG_DISTCLEAN_FILES) 805 | -rm -rf $(top_srcdir)/autom4te.cache 806 | -rm -f Makefile 807 | maintainer-clean-am: distclean-am maintainer-clean-generic 808 | 809 | mostlyclean: mostlyclean-recursive 810 | 811 | mostlyclean-am: mostlyclean-generic 812 | 813 | pdf: pdf-recursive 814 | 815 | pdf-am: 816 | 817 | ps: ps-recursive 818 | 819 | ps-am: 820 | 821 | uninstall-am: uninstall-dist_binSCRIPTS uninstall-imanDATA 822 | 823 | .MAKE: $(am__recursive_targets) install-am install-exec-am \ 824 | install-strip 825 | 826 | .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ 827 | am--refresh check check-am clean clean-cscope clean-generic \ 828 | cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ 829 | dist-gzip dist-hook dist-lzip dist-shar dist-tarZ dist-xz \ 830 | dist-zip distcheck distclean distclean-generic distclean-tags \ 831 | distcleancheck distdir distuninstallcheck dvi dvi-am html \ 832 | html-am info info-am install install-am install-data \ 833 | install-data-am install-dist_binSCRIPTS install-dvi \ 834 | install-dvi-am install-exec install-exec-am install-exec-hook \ 835 | install-html install-html-am install-imanDATA install-info \ 836 | install-info-am install-man install-pdf install-pdf-am \ 837 | install-ps install-ps-am install-strip installcheck \ 838 | installcheck-am installdirs installdirs-am maintainer-clean \ 839 | maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ 840 | pdf-am ps ps-am tags tags-am uninstall uninstall-am \ 841 | uninstall-dist_binSCRIPTS uninstall-imanDATA 842 | 843 | 844 | README.md COPYRIGHT : VERSION 845 | $(PERL) -i -p -e 's/(#VERSION#|\d+\.\d+\.\d+(?:-\w+)?)/$(PACKAGE_VERSION)/g;s/(#YEAR#|20[1-4]\d)/$(YEAR)/g;s/(#DATE#|20[1-9]\d-[01]\d-[0-3]\d)/$(DATE)/g;' $@ 846 | 847 | doc/%.pod: bin/% VERSION 848 | $(AM_V_GEN)mkdir -p doc;grep -A100000 '=head1 NAME' $< > $@ 849 | 850 | man/%.1: bin/% VERSION 851 | $(AM_V_GEN)mkdir -p man; test $(POD2MAN) = "no" || $(POD2MAN) --release=$(VERSION) --center=$(PACKAGE_NAME) $< > $@ 852 | 853 | dist-hook: thirdparty 854 | $(PERL) -i -p -e 's/^our\s+\$$VERSION\s*=\s*".+?";/our \$$VERSION = "$(PACKAGE_VERSION)";/;' $(distdir)/lib/$(CLASS_NAME)/*.pm 855 | 856 | dist-hook: $(POD) 857 | $(PERL) -i -p -e 's/^my .*# VERSION/my \$$VERSION = q{$(PACKAGE_VERSION)}; # VERSION/' $(distdir)/$(BIN) 858 | 859 | install-exec-hook: 860 | [ "$(PERL5LIB)" == "" ] || cd "$(DESTDIR)$(exec_prefix)" && $(PERL) -i -p -e 's{.*# PERL5LIB}{use lib qw($(PERL5LIB)); # PERL5LIB}' $(BIN) || true 861 | cd "$(DESTDIR)$(exec_prefix)" && $(PERL) -i -p -e 's{.*# LIBDIR}{use lib qw($(libdir)); # LIBDIR}' $(BIN) 862 | cd "$(DESTDIR)$(exec_prefix)" && $(PERL) -i -p -e 's{^#!.*perl.*}{#!$(PERL)};' $(BIN) 863 | cd "$(DESTDIR)$(libdir)/LXadm" && $(PERL) -i -p -e 's{^my .*# CACHEPATH}{my \$$CACHE_PATH = "$(localstatedir)/cache"; # CACHEPATH};' Images.pm 864 | [ ! -d $(THIRDPARTY_DIR)/lib/perl5 ] || cp -fr $(THIRDPARTY_DIR)/lib/perl5/* $(DESTDIR)$(libdir) 865 | 866 | #test: 867 | # $(PERL) "-MExtUtils::Command::MM" "-e" "test_harness(0, 'lib','thirdparty/lib/perl5')" t/*.t 868 | 869 | # Tell versions [3.59,3.63) of GNU make to not export all variables. 870 | # Otherwise a system limit (for SysV at least) may be exceeded. 871 | .NOEXPORT: 872 | -------------------------------------------------------------------------------- /PERL_MODULES: -------------------------------------------------------------------------------- 1 | Illumos::Zones 2 | Data::Processor 3 | JSON 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | lxadm 0.1.6 2 | ============ 3 | Manage illumos LX zones. 4 | 5 | [![Build Status](https://travis-ci.org/hadfl/lxadm.svg?branch=master)](https://travis-ci.org/hadfl/lxadm) 6 | 7 | --- 8 | 9 | ## This project is unmaintained and has been superseded by [zadm](https://github.com/omniosorg/zadm). 10 | 11 | --- 12 | 13 | `lxadm` takes care of setting up LX zones on illumos derived operating systems. 14 | 15 | Setup 16 | ----- 17 | 18 | `lxadm` comes as a prebuilt pure perl package, so it should install out of 19 | the box on any machine with a current perl installation. 20 | 21 | ```sh 22 | wget https://github.com/hadfl/lxadm/releases/download/v0.1.6/lxadm-0.1.6.tar.gz 23 | tar zxvf lxadm-0.1.6.tar.gz 24 | cd lxadm-0.1.6 25 | ./configure --prefix=/opt/lxadm-0.1.6 26 | ``` 27 | 28 | Now you can run 29 | 30 | ```sh 31 | gmake 32 | gmake install 33 | ``` 34 | 35 | Check the [man page](doc/lxadm.pod) for information about how to use lxadm. 36 | 37 | Support and Contributions 38 | ------------------------- 39 | If you find a problem with `lxadm`, please open an Issue on GitHub. 40 | 41 | And if you have a contribution, please send a pull request. 42 | 43 | Enjoy! 44 | 45 | Dominik Hassler & Tobi Oetiker 46 | 2017-12-11 47 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 0.1.6 2 | -------------------------------------------------------------------------------- /bin/lxadm: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use lib qw(); # PERL5LIB 4 | use FindBin; 5 | # PERL5LIB 6 | use lib "$FindBin::RealBin/../lib"; use lib "$FindBin::RealBin/../thirdparty/lib/perl5"; # LIBDIR 7 | use strict; 8 | use warnings; 9 | 10 | use Pod::Usage; 11 | use File::Temp qw(tempfile); 12 | use File::Basename qw(basename); 13 | use JSON; 14 | use Getopt::Long qw(:config posix_default no_ignore_case); 15 | use LXadm::Images; 16 | use LXadm::Config; 17 | use Illumos::Zones; 18 | use Data::Dumper; 19 | 20 | my $VERSION = '0.dev'; # VERSION 21 | 22 | my %delPurgeMap = map { $_ => 1 } qw(vnic); 23 | my $lxConfig; 24 | 25 | #fix perldoc pager if not set 26 | $ENV{PERLDOC_PAGER} ||= '/usr/bin/less -rins' if -x '/usr/bin/less'; 27 | 28 | sub editConfig { 29 | my $configJSON = shift; 30 | 31 | my ($fh, $filename) = tempfile(); 32 | print $fh "$configJSON\n"; 33 | close $fh; 34 | 35 | my $modified = (stat $filename)[9]; 36 | 37 | my $editor = $ENV{VISUAL} || $ENV{EDITOR} || '/usr/bin/vi'; 38 | system($editor, $filename) and die "ERROR: executing editor\n"; 39 | 40 | open $fh, '<', $filename or die "ERROR: cannot open temp file $filename: $!\n"; 41 | $configJSON = do { local $/; <$fh>; }; 42 | close $fh; 43 | 44 | $modified = (stat $filename)[9] != $modified; 45 | unlink $filename; 46 | 47 | return ($modified, $configJSON); 48 | } 49 | 50 | sub writeConfig { 51 | my $lxName = shift; 52 | my $uuid = shift; 53 | my $config = shift; 54 | my $configJSON = JSON->new->pretty->encode($config); 55 | 56 | my $configValid = 0; 57 | 58 | while (!$configValid){ 59 | local $@; 60 | eval { 61 | local $SIG{__DIE__}; 62 | 63 | (my $modified, $configJSON) = editConfig($configJSON); 64 | $config = JSON->new->decode($configJSON); 65 | 66 | return if !$modified; 67 | 68 | $lxConfig->writeConfig($lxName, $uuid, $config); 69 | }; 70 | if ($@){ 71 | print $@; 72 | print "Do you want to retry [Y/n]? "; 73 | chomp(my $check = ); 74 | 75 | $configValid = $check =~ /^no?$/i 76 | } 77 | else{ 78 | $configValid = 1; 79 | } 80 | } 81 | } 82 | 83 | sub main { 84 | my $mainOpt = shift; 85 | 86 | # check if we are in global zone 87 | Illumos::Zones->isGZ or die "ERROR: lxadm can only be run from global zone\n"; 88 | 89 | defined $mainOpt or pod2usage(1); 90 | 91 | $lxConfig = LXadm::Config->new(); 92 | my $zone = Illumos::Zones->new(); 93 | my $img = LXadm::Images->new(); 94 | 95 | defined $mainOpt or pod2usage(1); 96 | 97 | for ($mainOpt) { 98 | /^create$/ && do { 99 | my $uuid = shift @ARGV; 100 | my $lxName = shift @ARGV; 101 | 102 | defined $lxName && defined $uuid or pod2usage(1); 103 | 104 | # get image details and adjust config 105 | my $img = $img->downloadImage($uuid); 106 | my $config = $lxConfig->getTemplate; 107 | $config->{zonename} = $lxName; 108 | $config->{'kernel-version'} = $img->{tags}->{kernel_version}; 109 | 110 | $zone->zoneExists($lxName) 111 | && die "ERROR: zone '$lxName' already exists. use 'edit' to change properties\n"; 112 | 113 | writeConfig($lxName, $img->{uuid}, $config); 114 | 115 | last; 116 | }; 117 | /^import$/ && do { 118 | my $uuid = shift @ARGV; 119 | my $fileName = shift @ARGV; 120 | 121 | defined $uuid && defined $fileName or pod2usage(1); 122 | 123 | open my $fh, '<', $fileName or die 'ERROR: open file ' . $fileName . ":$!\n"; 124 | my $configJSON = do { local $/; <$fh>; }; 125 | close $fh; 126 | 127 | # get image details 128 | my $img = $img->downloadImage($uuid); 129 | my $config = JSON->new->decode($configJSON); 130 | for my $lx (keys %$config){ 131 | $zone->zoneExists($lx) 132 | && die "ERROR: zone '$lx' already exists. use 'edit' to change properties\n"; 133 | 134 | $config->{$lx}->{'kernel-version'} = $img->{tags}->{kernel_version}; 135 | writeConfig($lx, $img->{uuid}, $config->{$lx}); 136 | } 137 | 138 | last; 139 | }; 140 | /^edit$/ && do { 141 | my $lxName = shift @ARGV; 142 | defined $lxName or pod2usage(1); 143 | 144 | $zone->zoneExists($lxName) 145 | || die "ERROR: zone '$lxName' does not exist. use 'create' to create a zone\n"; 146 | 147 | my $config = $lxConfig->readConfig($lxName); 148 | writeConfig($lxName, undef, $config); 149 | 150 | last; 151 | }; 152 | /^delete$/ && do { 153 | my $lxName = pop @ARGV; 154 | defined $lxName or pod2usage(1); 155 | 156 | my $opts = {}; 157 | GetOptions($opts, qw(purge=s)) or exit 1; 158 | #split all features into individual options 159 | if ($opts->{purge}) { 160 | for my $purge (split /,/, $opts->{purge}) { 161 | $delPurgeMap{$purge} or die "ERROR: purge '$purge' not supported\n"; 162 | $opts->{$purge} = 1; 163 | } 164 | delete $opts->{purge}; 165 | } 166 | 167 | $lxConfig->removeLX($lxName, $opts); 168 | last; 169 | }; 170 | /^list$/ && do { 171 | my $lxName = shift @ARGV; 172 | 173 | print JSON->new->pretty->encode($lxConfig->listLX($lxName)); 174 | last; 175 | }; 176 | /^list-images$/ && do { 177 | $img->dumpImages(); 178 | 179 | last; 180 | }; 181 | /^refresh$/ && do { 182 | # force download of index 183 | $img->fetchImages(1); 184 | 185 | last; 186 | }; 187 | /^start$/ && do { 188 | my $lxName = shift @ARGV; 189 | defined $lxName or pod2usage(1); 190 | 191 | $zone->boot($lxName); 192 | last; 193 | }; 194 | /^stop$/ && do { 195 | my $lxName = shift @ARGV; 196 | defined $lxName or pod2usage(1); 197 | 198 | $zone->shutdown($lxName); 199 | last; 200 | }; 201 | /^restart$/ && do { 202 | my $lxName = shift @ARGV; 203 | defined $lxName or pod2usage(1); 204 | 205 | $zone->reboot($lxName); 206 | last; 207 | }; 208 | /^man$/ && do { 209 | pod2usage(-exitstatus => 0, -verbose => 2); 210 | 211 | last; 212 | }; 213 | /^help$/ && do { 214 | pod2usage(-exitval => 'NOEXIT'); 215 | 216 | last; 217 | }; 218 | /^version$/ && do { 219 | print basename($0) . " $VERSION\n"; 220 | 221 | last; 222 | }; 223 | #main argument invalid 224 | pod2usage(1); 225 | } 226 | return 1; 227 | } 228 | 229 | main(shift); 230 | 231 | 1; 232 | 233 | __END__ 234 | 235 | =head1 NAME 236 | 237 | lxadm - Manage Illumos LX zones. 238 | 239 | =head1 SYNOPSIS 240 | 241 | B I [I] 242 | 243 | where 'command' is one of the following: 244 | 245 | create 246 | 247 | import 248 | 249 | delete [--purge=vnic] 250 | 251 | edit 252 | 253 | list [lx_name] 254 | 255 | list-images 256 | 257 | refresh 258 | 259 | start 260 | 261 | stop 262 | 263 | restart 264 | 265 | help 266 | 267 | man 268 | 269 | version 270 | 271 | =head1 DESCRIPTION 272 | 273 | Use lxadm to create/edit your LX zones. 274 | 275 | =head2 B 276 | 277 | creates a LX zone with the name B. Create will open an editor 278 | where the properties can be set. vnics which do not exist will be created. 279 | 280 | zone properties are according to I. 281 | global properties can be set as "property" : "value" pair, single 282 | resources as "resource" : { } hash structure and multiple resources 283 | as "resource" : [ { }, ... ] array of hash structures. 284 | 285 | =head2 B 286 | 287 | imports a LX zone configuration from a file. 288 | 289 | =head2 B 290 | 291 | deletes the LX zone with the name B. 292 | 293 | =head2 B 294 | 295 | modify the configuration of a LX zone. See the descriptions in the B 296 | function for details. 297 | 298 | =head2 B 299 | 300 | lists the available LX zones with their properties. Lists details for B 301 | if given. 302 | 303 | =head2 B 304 | 305 | list all available LX images ready for download and install. 306 | 307 | =head2 B 308 | 309 | forces image index refresh. 310 | 311 | =head2 B 312 | 313 | starts the LX zone B 314 | 315 | =head2 B 316 | 317 | stops the LX zone B 318 | 319 | =head2 B 320 | 321 | restarts the LX zone B 322 | 323 | =head1 EXAMPLES 324 | 325 | create a LX zone with the name 'lx-test' and image UUID '12345678' 326 | 327 | lxadm create 12345678 lx-test 328 | 329 | check the LX zone properties 330 | 331 | lxadm list lx-test 332 | 333 | copy a LX zone 334 | 335 | lxadm list lx-test > lx-test.json 336 | 337 | lxadm import 12345678 lx-test.json 338 | 339 | basic zone setup 340 | 341 | { 342 | "zonepath" : "/zones/lx-test", 343 | "brand" : "lx", 344 | "ip-type" : "exclusive" 345 | } 346 | 347 | mounting a filesystem to the LX zone 348 | 349 | { 350 | ... 351 | "fs" : [ 352 | { 353 | "dir" : "/opt", 354 | "special" : "/tank/lx-test/opt", 355 | "type" : "lofs", 356 | "options" : "[nodevices]" 357 | } 358 | ] 359 | } 360 | 361 | =head1 COPYRIGHT 362 | 363 | Copyright 2017 OmniOS Community Edition (OmniOSce) Association. 364 | 365 | =head1 LICENSE 366 | 367 | This program is free software: you can redistribute it and/or modify it 368 | under the terms of the GNU General Public License as published by the Free 369 | Software Foundation, either version 3 of the License, or (at your option) 370 | any later version. 371 | 372 | This program is distributed in the hope that it will be useful, but WITHOUT 373 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 374 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 375 | more details. 376 | 377 | You should have received a copy of the GNU General Public License along with 378 | this program. If not, see L. 379 | 380 | =head1 AUTHOR 381 | 382 | Shadfl@cpan.orgE> 383 | Stobi@oetiker.chE> 384 | 385 | =head1 ACKNOWLEDGMENT 386 | 387 | Joyent: for LX zones 388 | OmniTI: for porting LX zones to OmniOS 389 | 390 | =head1 HISTORY 391 | 392 | 2016-12-02 had Initial Version 393 | 394 | =cut 395 | -------------------------------------------------------------------------------- /bootstrap: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | autoreconf --force --install --verbose --make 3 | git log --full-history --simplify-merges --dense --no-merges > CHANGES 4 | # EOF 5 | -------------------------------------------------------------------------------- /configure.ac: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 Tobias Oetiker 2 | 3 | AC_INIT([lxadm],m4_esyscmd([tr -d '\n' < VERSION]),[hadfl@cpan.org]) 4 | AC_PREREQ([2.59]) 5 | AC_CONFIG_AUX_DIR(conftools) 6 | SCRIPT_NAME=lxadm 7 | AC_SUBST(SCRIPT_NAME) 8 | CLASS_NAME=LXadm 9 | AC_SUBST(CLASS_NAME) 10 | 11 | # need this to allow long path names 12 | AM_INIT_AUTOMAKE([1.9 tar-ustar foreign]) 13 | AM_MAINTAINER_MODE 14 | 15 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) 16 | 17 | AC_PREFIX_DEFAULT(/opt/$PACKAGE_NAME-$PACKAGE_VERSION) 18 | 19 | AC_ARG_VAR(PERL, [Path to local perl binary]) 20 | AC_PATH_PROG(PERL, perl, no) 21 | AC_PATH_PROG(CURL, curl, no) 22 | AC_PATH_PROG(WGET, wget, no) 23 | AC_PATH_PROG(POD2MAN, pod2man, no) 24 | 25 | URL_CAT="neither curl nor wget found" 26 | if test -x "$WGET"; then 27 | URL_CAT="$WGET -O -" 28 | else 29 | if test -x "$CURL"; then 30 | URL_CAT="$CURL --location --insecure" 31 | fi 32 | fi 33 | 34 | AC_SUBST(URL_CAT) 35 | 36 | 37 | ac_perl_version="5.10.1" 38 | 39 | if test "x$PERL" != "x"; then 40 | AC_MSG_CHECKING(for perl version greater than or equal to $ac_perl_version) 41 | $PERL -e "use $ac_perl_version;" >/dev/null 2>&1 42 | if test $? -ne 0; then 43 | AC_MSG_RESULT(no); 44 | AC_MSG_ERROR(at least version 5.10.1 is required to run mojolicious) 45 | else 46 | AC_MSG_RESULT(ok); 47 | fi 48 | else 49 | AC_MSG_ERROR(could not find perl) 50 | fi 51 | 52 | AC_PROG_GREP 53 | 54 | AC_ARG_VAR(GMAKE, [Path to local GNU Make binary]) 55 | AC_PATH_PROGS(GMAKE, [gnumake gmake make]) 56 | 57 | AC_MSG_CHECKING([for gnu make availablility]) 58 | if ( $GMAKE --version 2> /dev/null | $GREP GNU > /dev/null 2>&1 ); then 59 | AC_MSG_RESULT([$GMAKE is GNU make]) 60 | else 61 | AC_MSG_ERROR([GNU make not found. Try setting the GMAKE environment variable.]) 62 | fi 63 | 64 | AC_ARG_ENABLE(pkgonly, 65 | AC_HELP_STRING([--enable-pkgonly], 66 | [Skip all checking])) 67 | AC_SUBST(enable_pkgonly) 68 | 69 | actual_prefix=$prefix 70 | if test x$actual_prefix = xNONE; then 71 | actual_prefix=$ac_default_prefix 72 | fi 73 | 74 | AC_ARG_VAR(PERL5LIB, [Colon separated list of perl library directories]) 75 | AC_SUBST(PERL5LIB) 76 | 77 | AC_CONFIG_FILES([ 78 | Makefile 79 | lib/Makefile 80 | thirdparty/Makefile 81 | ]) 82 | 83 | AC_SUBST(VERSION) 84 | 85 | AC_OUTPUT 86 | 87 | cat <&2 149 | exit 1;; 150 | esac 151 | shift;; 152 | 153 | -o) chowncmd="$chownprog $2" 154 | shift;; 155 | 156 | -s) stripcmd=$stripprog;; 157 | 158 | -t) dst_arg=$2 159 | # Protect names problematic for 'test' and other utilities. 160 | case $dst_arg in 161 | -* | [=\(\)!]) dst_arg=./$dst_arg;; 162 | esac 163 | shift;; 164 | 165 | -T) no_target_directory=true;; 166 | 167 | --version) echo "$0 $scriptversion"; exit $?;; 168 | 169 | --) shift 170 | break;; 171 | 172 | -*) echo "$0: invalid option: $1" >&2 173 | exit 1;; 174 | 175 | *) break;; 176 | esac 177 | shift 178 | done 179 | 180 | if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then 181 | # When -d is used, all remaining arguments are directories to create. 182 | # When -t is used, the destination is already specified. 183 | # Otherwise, the last argument is the destination. Remove it from $@. 184 | for arg 185 | do 186 | if test -n "$dst_arg"; then 187 | # $@ is not empty: it contains at least $arg. 188 | set fnord "$@" "$dst_arg" 189 | shift # fnord 190 | fi 191 | shift # arg 192 | dst_arg=$arg 193 | # Protect names problematic for 'test' and other utilities. 194 | case $dst_arg in 195 | -* | [=\(\)!]) dst_arg=./$dst_arg;; 196 | esac 197 | done 198 | fi 199 | 200 | if test $# -eq 0; then 201 | if test -z "$dir_arg"; then 202 | echo "$0: no input file specified." >&2 203 | exit 1 204 | fi 205 | # It's OK to call 'install-sh -d' without argument. 206 | # This can happen when creating conditional directories. 207 | exit 0 208 | fi 209 | 210 | if test -z "$dir_arg"; then 211 | do_exit='(exit $ret); exit $ret' 212 | trap "ret=129; $do_exit" 1 213 | trap "ret=130; $do_exit" 2 214 | trap "ret=141; $do_exit" 13 215 | trap "ret=143; $do_exit" 15 216 | 217 | # Set umask so as not to create temps with too-generous modes. 218 | # However, 'strip' requires both read and write access to temps. 219 | case $mode in 220 | # Optimize common cases. 221 | *644) cp_umask=133;; 222 | *755) cp_umask=22;; 223 | 224 | *[0-7]) 225 | if test -z "$stripcmd"; then 226 | u_plus_rw= 227 | else 228 | u_plus_rw='% 200' 229 | fi 230 | cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; 231 | *) 232 | if test -z "$stripcmd"; then 233 | u_plus_rw= 234 | else 235 | u_plus_rw=,u+rw 236 | fi 237 | cp_umask=$mode$u_plus_rw;; 238 | esac 239 | fi 240 | 241 | for src 242 | do 243 | # Protect names problematic for 'test' and other utilities. 244 | case $src in 245 | -* | [=\(\)!]) src=./$src;; 246 | esac 247 | 248 | if test -n "$dir_arg"; then 249 | dst=$src 250 | dstdir=$dst 251 | test -d "$dstdir" 252 | dstdir_status=$? 253 | else 254 | 255 | # Waiting for this to be detected by the "$cpprog $src $dsttmp" command 256 | # might cause directories to be created, which would be especially bad 257 | # if $src (and thus $dsttmp) contains '*'. 258 | if test ! -f "$src" && test ! -d "$src"; then 259 | echo "$0: $src does not exist." >&2 260 | exit 1 261 | fi 262 | 263 | if test -z "$dst_arg"; then 264 | echo "$0: no destination specified." >&2 265 | exit 1 266 | fi 267 | dst=$dst_arg 268 | 269 | # If destination is a directory, append the input filename; won't work 270 | # if double slashes aren't ignored. 271 | if test -d "$dst"; then 272 | if test -n "$no_target_directory"; then 273 | echo "$0: $dst_arg: Is a directory" >&2 274 | exit 1 275 | fi 276 | dstdir=$dst 277 | dst=$dstdir/`basename "$src"` 278 | dstdir_status=0 279 | else 280 | # Prefer dirname, but fall back on a substitute if dirname fails. 281 | dstdir=` 282 | (dirname "$dst") 2>/dev/null || 283 | expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ 284 | X"$dst" : 'X\(//\)[^/]' \| \ 285 | X"$dst" : 'X\(//\)$' \| \ 286 | X"$dst" : 'X\(/\)' \| . 2>/dev/null || 287 | echo X"$dst" | 288 | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ 289 | s//\1/ 290 | q 291 | } 292 | /^X\(\/\/\)[^/].*/{ 293 | s//\1/ 294 | q 295 | } 296 | /^X\(\/\/\)$/{ 297 | s//\1/ 298 | q 299 | } 300 | /^X\(\/\).*/{ 301 | s//\1/ 302 | q 303 | } 304 | s/.*/./; q' 305 | ` 306 | 307 | test -d "$dstdir" 308 | dstdir_status=$? 309 | fi 310 | fi 311 | 312 | obsolete_mkdir_used=false 313 | 314 | if test $dstdir_status != 0; then 315 | case $posix_mkdir in 316 | '') 317 | # Create intermediate dirs using mode 755 as modified by the umask. 318 | # This is like FreeBSD 'install' as of 1997-10-28. 319 | umask=`umask` 320 | case $stripcmd.$umask in 321 | # Optimize common cases. 322 | *[2367][2367]) mkdir_umask=$umask;; 323 | .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; 324 | 325 | *[0-7]) 326 | mkdir_umask=`expr $umask + 22 \ 327 | - $umask % 100 % 40 + $umask % 20 \ 328 | - $umask % 10 % 4 + $umask % 2 329 | `;; 330 | *) mkdir_umask=$umask,go-w;; 331 | esac 332 | 333 | # With -d, create the new directory with the user-specified mode. 334 | # Otherwise, rely on $mkdir_umask. 335 | if test -n "$dir_arg"; then 336 | mkdir_mode=-m$mode 337 | else 338 | mkdir_mode= 339 | fi 340 | 341 | posix_mkdir=false 342 | case $umask in 343 | *[123567][0-7][0-7]) 344 | # POSIX mkdir -p sets u+wx bits regardless of umask, which 345 | # is incompatible with FreeBSD 'install' when (umask & 300) != 0. 346 | ;; 347 | *) 348 | # $RANDOM is not portable (e.g. dash); use it when possible to 349 | # lower collision chance 350 | tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ 351 | trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 352 | 353 | # As "mkdir -p" follows symlinks and we work in /tmp possibly; so 354 | # create the $tmpdir first (and fail if unsuccessful) to make sure 355 | # that nobody tries to guess the $tmpdir name. 356 | if (umask $mkdir_umask && 357 | $mkdirprog $mkdir_mode "$tmpdir" && 358 | exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 359 | then 360 | if test -z "$dir_arg" || { 361 | # Check for POSIX incompatibilities with -m. 362 | # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or 363 | # other-writable bit of parent directory when it shouldn't. 364 | # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. 365 | test_tmpdir="$tmpdir/a" 366 | ls_ld_tmpdir=`ls -ld "$test_tmpdir"` 367 | case $ls_ld_tmpdir in 368 | d????-?r-*) different_mode=700;; 369 | d????-?--*) different_mode=755;; 370 | *) false;; 371 | esac && 372 | $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { 373 | ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` 374 | test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" 375 | } 376 | } 377 | then posix_mkdir=: 378 | fi 379 | rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 380 | else 381 | # Remove any dirs left behind by ancient mkdir implementations. 382 | rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null 383 | fi 384 | trap '' 0;; 385 | esac;; 386 | esac 387 | 388 | if 389 | $posix_mkdir && ( 390 | umask $mkdir_umask && 391 | $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" 392 | ) 393 | then : 394 | else 395 | 396 | # The umask is ridiculous, or mkdir does not conform to POSIX, 397 | # or it failed possibly due to a race condition. Create the 398 | # directory the slow way, step by step, checking for races as we go. 399 | 400 | case $dstdir in 401 | /*) prefix='/';; 402 | [-=\(\)!]*) prefix='./';; 403 | *) prefix='';; 404 | esac 405 | 406 | eval "$initialize_posix_glob" 407 | 408 | oIFS=$IFS 409 | IFS=/ 410 | $posix_glob set -f 411 | set fnord $dstdir 412 | shift 413 | $posix_glob set +f 414 | IFS=$oIFS 415 | 416 | prefixes= 417 | 418 | for d 419 | do 420 | test X"$d" = X && continue 421 | 422 | prefix=$prefix$d 423 | if test -d "$prefix"; then 424 | prefixes= 425 | else 426 | if $posix_mkdir; then 427 | (umask=$mkdir_umask && 428 | $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break 429 | # Don't fail if two instances are running concurrently. 430 | test -d "$prefix" || exit 1 431 | else 432 | case $prefix in 433 | *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; 434 | *) qprefix=$prefix;; 435 | esac 436 | prefixes="$prefixes '$qprefix'" 437 | fi 438 | fi 439 | prefix=$prefix/ 440 | done 441 | 442 | if test -n "$prefixes"; then 443 | # Don't fail if two instances are running concurrently. 444 | (umask $mkdir_umask && 445 | eval "\$doit_exec \$mkdirprog $prefixes") || 446 | test -d "$dstdir" || exit 1 447 | obsolete_mkdir_used=true 448 | fi 449 | fi 450 | fi 451 | 452 | if test -n "$dir_arg"; then 453 | { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && 454 | { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && 455 | { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || 456 | test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 457 | else 458 | 459 | # Make a couple of temp file names in the proper directory. 460 | dsttmp=$dstdir/_inst.$$_ 461 | rmtmp=$dstdir/_rm.$$_ 462 | 463 | # Trap to clean up those temp files at exit. 464 | trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 465 | 466 | # Copy the file name to the temp name. 467 | (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && 468 | 469 | # and set any options; do chmod last to preserve setuid bits. 470 | # 471 | # If any of these fail, we abort the whole thing. If we want to 472 | # ignore errors from any of these, just make sure not to ignore 473 | # errors from the above "$doit $cpprog $src $dsttmp" command. 474 | # 475 | { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && 476 | { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && 477 | { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && 478 | { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && 479 | 480 | # If -C, don't bother to copy if it wouldn't change the file. 481 | if $copy_on_change && 482 | old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && 483 | new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && 484 | 485 | eval "$initialize_posix_glob" && 486 | $posix_glob set -f && 487 | set X $old && old=:$2:$4:$5:$6 && 488 | set X $new && new=:$2:$4:$5:$6 && 489 | $posix_glob set +f && 490 | 491 | test "$old" = "$new" && 492 | $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 493 | then 494 | rm -f "$dsttmp" 495 | else 496 | # Rename the file to the real destination. 497 | $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || 498 | 499 | # The rename failed, perhaps because mv can't rename something else 500 | # to itself, or perhaps because mv is so ancient that it does not 501 | # support -f. 502 | { 503 | # Now remove or move aside any old file at destination location. 504 | # We try this two ways since rm can't unlink itself on some 505 | # systems and the destination file might be busy for other 506 | # reasons. In this case, the final cleanup might fail but the new 507 | # file should still install successfully. 508 | { 509 | test ! -f "$dst" || 510 | $doit $rmcmd -f "$dst" 2>/dev/null || 511 | { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && 512 | { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } 513 | } || 514 | { echo "$0: cannot unlink or rename $dst" >&2 515 | (exit 1); exit 1 516 | } 517 | } && 518 | 519 | # Now rename the file to the real destination. 520 | $doit $mvcmd "$dsttmp" "$dst" 521 | } 522 | fi || exit 1 523 | 524 | trap '' 0 525 | fi 526 | done 527 | 528 | # Local variables: 529 | # eval: (add-hook 'write-file-hooks 'time-stamp) 530 | # time-stamp-start: "scriptversion=" 531 | # time-stamp-format: "%:y-%02m-%02d.%02H" 532 | # time-stamp-time-zone: "UTC" 533 | # time-stamp-end: "; # UTC" 534 | # End: 535 | -------------------------------------------------------------------------------- /conftools/missing: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Common wrapper for a few potentially missing GNU programs. 3 | 4 | scriptversion=2013-10-28.13; # UTC 5 | 6 | # Copyright (C) 1996-2013 Free Software Foundation, Inc. 7 | # Originally written by Fran,cois Pinard , 1996. 8 | 9 | # This program is free software; you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation; either version 2, or (at your option) 12 | # any later version. 13 | 14 | # This program is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | 19 | # You should have received a copy of the GNU General Public License 20 | # along with this program. If not, see . 21 | 22 | # As a special exception to the GNU General Public License, if you 23 | # distribute this file as part of a program that contains a 24 | # configuration script generated by Autoconf, you may include it under 25 | # the same distribution terms that you use for the rest of that program. 26 | 27 | if test $# -eq 0; then 28 | echo 1>&2 "Try '$0 --help' for more information" 29 | exit 1 30 | fi 31 | 32 | case $1 in 33 | 34 | --is-lightweight) 35 | # Used by our autoconf macros to check whether the available missing 36 | # script is modern enough. 37 | exit 0 38 | ;; 39 | 40 | --run) 41 | # Back-compat with the calling convention used by older automake. 42 | shift 43 | ;; 44 | 45 | -h|--h|--he|--hel|--help) 46 | echo "\ 47 | $0 [OPTION]... PROGRAM [ARGUMENT]... 48 | 49 | Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due 50 | to PROGRAM being missing or too old. 51 | 52 | Options: 53 | -h, --help display this help and exit 54 | -v, --version output version information and exit 55 | 56 | Supported PROGRAM values: 57 | aclocal autoconf autoheader autom4te automake makeinfo 58 | bison yacc flex lex help2man 59 | 60 | Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 61 | 'g' are ignored when checking the name. 62 | 63 | Send bug reports to ." 64 | exit $? 65 | ;; 66 | 67 | -v|--v|--ve|--ver|--vers|--versi|--versio|--version) 68 | echo "missing $scriptversion (GNU Automake)" 69 | exit $? 70 | ;; 71 | 72 | -*) 73 | echo 1>&2 "$0: unknown '$1' option" 74 | echo 1>&2 "Try '$0 --help' for more information" 75 | exit 1 76 | ;; 77 | 78 | esac 79 | 80 | # Run the given program, remember its exit status. 81 | "$@"; st=$? 82 | 83 | # If it succeeded, we are done. 84 | test $st -eq 0 && exit 0 85 | 86 | # Also exit now if we it failed (or wasn't found), and '--version' was 87 | # passed; such an option is passed most likely to detect whether the 88 | # program is present and works. 89 | case $2 in --version|--help) exit $st;; esac 90 | 91 | # Exit code 63 means version mismatch. This often happens when the user 92 | # tries to use an ancient version of a tool on a file that requires a 93 | # minimum version. 94 | if test $st -eq 63; then 95 | msg="probably too old" 96 | elif test $st -eq 127; then 97 | # Program was missing. 98 | msg="missing on your system" 99 | else 100 | # Program was found and executed, but failed. Give up. 101 | exit $st 102 | fi 103 | 104 | perl_URL=http://www.perl.org/ 105 | flex_URL=http://flex.sourceforge.net/ 106 | gnu_software_URL=http://www.gnu.org/software 107 | 108 | program_details () 109 | { 110 | case $1 in 111 | aclocal|automake) 112 | echo "The '$1' program is part of the GNU Automake package:" 113 | echo "<$gnu_software_URL/automake>" 114 | echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" 115 | echo "<$gnu_software_URL/autoconf>" 116 | echo "<$gnu_software_URL/m4/>" 117 | echo "<$perl_URL>" 118 | ;; 119 | autoconf|autom4te|autoheader) 120 | echo "The '$1' program is part of the GNU Autoconf package:" 121 | echo "<$gnu_software_URL/autoconf/>" 122 | echo "It also requires GNU m4 and Perl in order to run:" 123 | echo "<$gnu_software_URL/m4/>" 124 | echo "<$perl_URL>" 125 | ;; 126 | esac 127 | } 128 | 129 | give_advice () 130 | { 131 | # Normalize program name to check for. 132 | normalized_program=`echo "$1" | sed ' 133 | s/^gnu-//; t 134 | s/^gnu//; t 135 | s/^g//; t'` 136 | 137 | printf '%s\n' "'$1' is $msg." 138 | 139 | configure_deps="'configure.ac' or m4 files included by 'configure.ac'" 140 | case $normalized_program in 141 | autoconf*) 142 | echo "You should only need it if you modified 'configure.ac'," 143 | echo "or m4 files included by it." 144 | program_details 'autoconf' 145 | ;; 146 | autoheader*) 147 | echo "You should only need it if you modified 'acconfig.h' or" 148 | echo "$configure_deps." 149 | program_details 'autoheader' 150 | ;; 151 | automake*) 152 | echo "You should only need it if you modified 'Makefile.am' or" 153 | echo "$configure_deps." 154 | program_details 'automake' 155 | ;; 156 | aclocal*) 157 | echo "You should only need it if you modified 'acinclude.m4' or" 158 | echo "$configure_deps." 159 | program_details 'aclocal' 160 | ;; 161 | autom4te*) 162 | echo "You might have modified some maintainer files that require" 163 | echo "the 'autom4te' program to be rebuilt." 164 | program_details 'autom4te' 165 | ;; 166 | bison*|yacc*) 167 | echo "You should only need it if you modified a '.y' file." 168 | echo "You may want to install the GNU Bison package:" 169 | echo "<$gnu_software_URL/bison/>" 170 | ;; 171 | lex*|flex*) 172 | echo "You should only need it if you modified a '.l' file." 173 | echo "You may want to install the Fast Lexical Analyzer package:" 174 | echo "<$flex_URL>" 175 | ;; 176 | help2man*) 177 | echo "You should only need it if you modified a dependency" \ 178 | "of a man page." 179 | echo "You may want to install the GNU Help2man package:" 180 | echo "<$gnu_software_URL/help2man/>" 181 | ;; 182 | makeinfo*) 183 | echo "You should only need it if you modified a '.texi' file, or" 184 | echo "any other file indirectly affecting the aspect of the manual." 185 | echo "You might want to install the Texinfo package:" 186 | echo "<$gnu_software_URL/texinfo/>" 187 | echo "The spurious makeinfo call might also be the consequence of" 188 | echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" 189 | echo "want to install GNU make:" 190 | echo "<$gnu_software_URL/make/>" 191 | ;; 192 | *) 193 | echo "You might have modified some files without having the proper" 194 | echo "tools for further handling them. Check the 'README' file, it" 195 | echo "often tells you about the needed prerequisites for installing" 196 | echo "this package. You may also peek at any GNU archive site, in" 197 | echo "case some other package contains this missing '$1' program." 198 | ;; 199 | esac 200 | } 201 | 202 | give_advice "$1" | sed -e '1s/^/WARNING: /' \ 203 | -e '2,$s/^/ /' >&2 204 | 205 | # Propagate the correct exit status (expected to be 127 for a program 206 | # not found, 63 for a program that failed due to version mismatch). 207 | exit $st 208 | 209 | # Local variables: 210 | # eval: (add-hook 'write-file-hooks 'time-stamp) 211 | # time-stamp-start: "scriptversion=" 212 | # time-stamp-format: "%:y-%02m-%02d.%02H" 213 | # time-stamp-time-zone: "UTC" 214 | # time-stamp-end: "; # UTC" 215 | # End: 216 | -------------------------------------------------------------------------------- /doc/lxadm.pod: -------------------------------------------------------------------------------- 1 | =head1 NAME 2 | 3 | lxadm - Manage Illumos LX zones. 4 | 5 | =head1 SYNOPSIS 6 | 7 | B I [I] 8 | 9 | where 'command' is one of the following: 10 | 11 | create 12 | 13 | import 14 | 15 | delete [--purge=vnic] 16 | 17 | edit 18 | 19 | list [lx_name] 20 | 21 | list-images 22 | 23 | refresh 24 | 25 | start 26 | 27 | stop 28 | 29 | restart 30 | 31 | help 32 | 33 | man 34 | 35 | version 36 | 37 | =head1 DESCRIPTION 38 | 39 | Use lxadm to create/edit your LX zones. 40 | 41 | =head2 B 42 | 43 | creates a LX zone with the name B. Create will open an editor 44 | where the properties can be set. vnics which do not exist will be created. 45 | 46 | zone properties are according to I. 47 | global properties can be set as "property" : "value" pair, single 48 | resources as "resource" : { } hash structure and multiple resources 49 | as "resource" : [ { }, ... ] array of hash structures. 50 | 51 | =head2 B 52 | 53 | imports a LX zone configuration from a file. 54 | 55 | =head2 B 56 | 57 | deletes the LX zone with the name B. 58 | 59 | =head2 B 60 | 61 | modify the configuration of a LX zone. See the descriptions in the B 62 | function for details. 63 | 64 | =head2 B 65 | 66 | lists the available LX zones with their properties. Lists details for B 67 | if given. 68 | 69 | =head2 B 70 | 71 | list all available LX images ready for download and install. 72 | 73 | =head2 B 74 | 75 | forces image index refresh. 76 | 77 | =head2 B 78 | 79 | starts the LX zone B 80 | 81 | =head2 B 82 | 83 | stops the LX zone B 84 | 85 | =head2 B 86 | 87 | restarts the LX zone B 88 | 89 | =head1 EXAMPLES 90 | 91 | create a LX zone with the name 'lx-test' and image UUID '12345678' 92 | 93 | lxadm create 12345678 lx-test 94 | 95 | check the LX zone properties 96 | 97 | lxadm list lx-test 98 | 99 | copy a LX zone 100 | 101 | lxadm list lx-test > lx-test.json 102 | 103 | lxadm import 12345678 lx-test.json 104 | 105 | basic zone setup 106 | 107 | { 108 | "zonepath" : "/zones/lx-test", 109 | "brand" : "lx", 110 | "ip-type" : "exclusive" 111 | } 112 | 113 | mounting a filesystem to the LX zone 114 | 115 | { 116 | ... 117 | "fs" : [ 118 | { 119 | "dir" : "/opt", 120 | "special" : "/tank/lx-test/opt", 121 | "type" : "lofs", 122 | "options" : "[nodevices]" 123 | } 124 | ] 125 | } 126 | 127 | =head1 COPYRIGHT 128 | 129 | Copyright 2017 OmniOS Community Edition (OmniOSce) Association. 130 | 131 | =head1 LICENSE 132 | 133 | This program is free software: you can redistribute it and/or modify it 134 | under the terms of the GNU General Public License as published by the Free 135 | Software Foundation, either version 3 of the License, or (at your option) 136 | any later version. 137 | 138 | This program is distributed in the hope that it will be useful, but WITHOUT 139 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 140 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 141 | more details. 142 | 143 | You should have received a copy of the GNU General Public License along with 144 | this program. If not, see L. 145 | 146 | =head1 AUTHOR 147 | 148 | Shadfl@cpan.orgE> 149 | Stobi@oetiker.chE> 150 | 151 | =head1 ACKNOWLEDGMENT 152 | 153 | Joyent: for LX zones 154 | OmniTI: for porting LX zones to OmniOS 155 | 156 | =head1 HISTORY 157 | 158 | 2016-12-02 had Initial Version 159 | 160 | =cut 161 | -------------------------------------------------------------------------------- /lib/LXadm/Config.pm: -------------------------------------------------------------------------------- 1 | package LXadm::Config; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use Illumos::Zones; 7 | use Data::Processor; 8 | use LXadm::Images; 9 | use LXadm::Utils; 10 | 11 | # constants/programs 12 | my $TEMPLATE = { 13 | zonename => '', 14 | zonepath => '', 15 | brand => 'lx', 16 | 'ip-type' => 'exclusive', 17 | net => [ 18 | { 19 | physical => '', 20 | gateway => '', 21 | ips => [ 22 | '', 23 | ], 24 | primary => 'true', 25 | }, 26 | ], 27 | 'dns-domain' => '', 28 | resolvers => [ 29 | '', 30 | ], 31 | 'kernel-version' => '', 32 | }; 33 | 34 | my @SPECIALRES = qw(dns-domain resolvers kernel-version); 35 | 36 | my $SCHEMA = sub { 37 | my $sv = LXadm::Utils->new(); 38 | 39 | return { 40 | net => { 41 | optional => 1, 42 | members => { 43 | physical => { 44 | validator => $sv->nicName($sv->nicName(Illumos::Zones->isGZ)), 45 | }, 46 | over => { 47 | optional => 1, 48 | description => 'physical nic where vnic traffic goes over', 49 | example => '"over" : "igb0"', 50 | validator => $sv->regexp(qr/^[-\w]+$/), 51 | }, 52 | }, 53 | }, 54 | 'dns-domain' => { 55 | optional => 1, 56 | description => 'DNS search domain', 57 | example => '"dns-domain" : "example.com"', 58 | validator => sub { return undef; }, 59 | }, 60 | resolvers => { 61 | optional => 1, 62 | array => 1, 63 | description => 'DNS resolvers', 64 | example => '"resolvers" : [ "8.8.8.8", "8.8.4.4" ]', 65 | validator => sub { return undef; }, 66 | }, 67 | 'kernel-version' => { 68 | description => 'Kernel version', 69 | validator => sub { return undef; }, 70 | } 71 | } # return 72 | }; 73 | 74 | # private methods 75 | my $decodeRes = sub { 76 | my $self = shift; 77 | my $cfg = shift; 78 | 79 | my $schema = $SCHEMA->(); 80 | 81 | for (my $i = $#{$cfg->{attr}}; $i >= 0; $i--) { 82 | my $name = $cfg->{attr}->[$i]->{name}; 83 | next if !grep { $_ eq $name } @SPECIALRES; 84 | 85 | $cfg->{$name} = $schema->{$name}->{array} ? [ split /,/, $cfg->{attr}->[$i]->{value} ] 86 | : $cfg->{attr}->[$i]->{value}; 87 | 88 | splice @{$cfg->{attr}}, $i, 1; 89 | } 90 | # check if attr is empty. if so remove it 91 | delete $cfg->{attr} if !@{$cfg->{attr}}; 92 | 93 | # add VNIC over property 94 | return if !exists $cfg->{net}; 95 | for my $vnic (@{$cfg->{net}}) { 96 | my $over = $self->{util}->getVNicOver($vnic->{physical}); 97 | $vnic->{over} = $over if $over; 98 | } 99 | }; 100 | 101 | my $encodeRes = sub { 102 | my $self = shift; 103 | my $cfg = shift; 104 | 105 | my $schema = $SCHEMA->(); 106 | 107 | $cfg->{attr} //= []; 108 | 109 | for my $res (@SPECIALRES) { 110 | my %elem = ( 111 | name => $res, 112 | type => 'string', 113 | ); 114 | 115 | # don't process empty res 116 | next if !$cfg->{$res}; 117 | 118 | $elem{value} = ref $cfg->{$res} eq 'ARRAY' ? join (',', @{$cfg->{$res}}) 119 | : $cfg->{$res}; 120 | 121 | push @{$cfg->{attr}}, { %elem }; 122 | delete $cfg->{$res}; 123 | } 124 | 125 | # remove vnic over property 126 | delete $_->{over} for (@{$cfg->{net}}); 127 | }; 128 | 129 | # constructor 130 | sub new { 131 | my $class = shift; 132 | my $self = { @_ }; 133 | 134 | $self->{zone} = Illumos::Zones->new(debug => $self->{debug}); 135 | $self->{imgs} = LXadm::Images->new(debug => $self->{debug}); 136 | $self->{util} = LXadm::Utils->new(); 137 | 138 | $self->{cfg} = Data::Processor->new($self->{zone}->schema); 139 | $self->{cfg}->merge_schema($SCHEMA->()); 140 | 141 | return bless $self, $class; 142 | } 143 | 144 | sub getTemplate { 145 | my $self = shift; 146 | 147 | return { %$TEMPLATE }; 148 | } 149 | 150 | sub checkConfig { 151 | my $self = shift; 152 | my $config = shift; 153 | 154 | my $ec = $self->{cfg}->validate($config); 155 | $ec->count and die join ("\n", map { $_->stringify } @{$ec->{errors}}) . "\n"; 156 | 157 | return 1; 158 | } 159 | 160 | sub removeLX { 161 | my $self = shift; 162 | my $lxName = shift; 163 | my $opts = shift; 164 | 165 | my $config = $self->readConfig($lxName); 166 | my $zoneState = $self->{zone}->zoneState($lxName); 167 | 168 | $zoneState eq 'running' 169 | and die "ERROR: zone '$lxName' still running. use 'lxadm stop $lxName' to stop it first...\n"; 170 | 171 | for (keys %$opts) { 172 | /^vnic$/ && do { 173 | $self->{util}->purgeVnic($config); 174 | next; 175 | }; 176 | } 177 | 178 | $zoneState ne 'configured' && $self->{zone}->uninstallZone($lxName); 179 | $self->{zone}->deleteZone($lxName); 180 | } 181 | 182 | sub writeConfig { 183 | my $self = shift; 184 | my $lxName = shift; 185 | my $uuid = shift; 186 | my $config = shift; 187 | 188 | $self->checkConfig($config); 189 | $self->$encodeRes($config); 190 | 191 | $self->{zone}->setZoneProperties($lxName, $config, ($uuid ? $self->{imgs}->cachePath . "/$uuid.gz" : ())); 192 | 193 | return 1; 194 | } 195 | 196 | sub readConfig { 197 | my $self = shift; 198 | my $lxName = shift; 199 | 200 | my $config = $self->{zone}->getZoneProperties($lxName); 201 | %$config or die "ERROR: zone '$lxName' does not exist\n"; 202 | 203 | # check if we are working on a lx zone 204 | $config->{brand} eq 'lx' or die "ERROR: zone '$lxName' is not a lx zone\n"; 205 | # remove 'rctl' as they are set by aliases 206 | delete $config->{rctl}; 207 | $self->$decodeRes($config); 208 | 209 | return $config; 210 | } 211 | 212 | sub listLX { 213 | my $self = shift; 214 | my $lxName = shift; 215 | 216 | my $lxZones = $lxName ? [ $lxName ] : [ map { $_->{zonename} } @{$self->{zone}->listZones({ brandFilter => qr/^lx$/ })} ]; 217 | 218 | # save a copy of $_ in $key as $_ gets modified in function 219 | return { map { my $key = $_; $key => $self->readConfig($_) } @$lxZones }; 220 | } 221 | 222 | 1; 223 | 224 | __END__ 225 | 226 | =head1 NAME 227 | 228 | LXadm::Config - lxadm config class 229 | 230 | =head1 SYNOPSIS 231 | 232 | use LXadm::Config; 233 | 234 | =head1 DESCRIPTION 235 | 236 | reads, writes and checkes lxadm configuration 237 | 238 | =head1 COPYRIGHT 239 | 240 | Copyright 2017 OmniOS Community Edition (OmniOSce) Association. 241 | 242 | =head1 LICENSE 243 | 244 | This program is free software: you can redistribute it and/or modify it 245 | under the terms of the GNU General Public License as published by the Free 246 | Software Foundation, either version 3 of the License, or (at your option) 247 | any later version. 248 | 249 | This program is distributed in the hope that it will be useful, but WITHOUT 250 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 251 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 252 | more details. 253 | 254 | You should have received a copy of the GNU General Public License along with 255 | this program. If not, see L. 256 | 257 | =head1 AUTHOR 258 | 259 | Shadfl@cpan.orgE>, 260 | 261 | =head1 HISTORY 262 | 263 | 2016-12-13 had Initial Version 264 | 265 | =cut 266 | -------------------------------------------------------------------------------- /lib/LXadm/Images.pm: -------------------------------------------------------------------------------- 1 | package LXadm::Images; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use Data::Dumper; 7 | use JSON; 8 | use File::Path qw(make_path); 9 | use File::Basename qw(dirname); 10 | use File::stat; 11 | use Time::localtime; 12 | use Digest::SHA; 13 | 14 | use FindBin; 15 | my ($BASEDIR) = dirname($FindBin::RealBin); 16 | 17 | # constants/programs 18 | my $IMGURL = 'https://images.joyent.com/images'; 19 | my $MAX_AGE = 24 * 60 * 60; 20 | my $CURL = '/usr/bin/curl'; 21 | my $PKG = '/usr/bin/pkg'; 22 | my $CACHE_PATH = "/var$BASEDIR/cache"; # CACHEPATH 23 | my @DUMPSET = ( 24 | { 25 | name => 'UUID', 26 | len => 10, 27 | key => [ qw(uuid) ], 28 | trans => sub { my $str = shift; return substr $str, length ($str) - 8; } 29 | }, 30 | { 31 | name => 'Name', 32 | len => 16, 33 | key => [ qw(name) ], 34 | }, 35 | { 36 | name => 'Version', 37 | len => 10, 38 | key => [ qw(version) ], 39 | }, 40 | { 41 | name => 'Kernel', 42 | len => 10, 43 | key => [ qw(tags kernel_version) ], 44 | }, 45 | { 46 | name => 'Description', 47 | len => 50, 48 | key => [ qw(description) ], 49 | trans => sub { return (shift =~ /^[^\s]+\s+(.+\.)\s+Built/)[0]; } 50 | }, 51 | ); 52 | 53 | # globals 54 | my $images = []; 55 | 56 | # private methods 57 | my $getHashValue = sub { 58 | my $value = shift; 59 | my $item = shift; 60 | 61 | $value = $value->{$_} for (@{$item->{key}}); 62 | 63 | return $value; 64 | }; 65 | 66 | my $getImageByUUID = sub { 67 | my $self = shift; 68 | my $uuid = shift; 69 | 70 | my $imgs = [ grep { $_->{uuid} =~ /$uuid/ } @{$self->listImages} ]; 71 | 72 | @$imgs < 1 and die "ERROR: image UUID containing '$uuid' not found.\n"; 73 | @$imgs > 1 and die "ERROR: more than one image uuid contains '$uuid'.\n"; 74 | 75 | return $imgs->[0]; 76 | }; 77 | 78 | my $getFile = sub { 79 | my $fileName = shift; 80 | my $url = shift; 81 | 82 | print "downloading file...\n"; 83 | my @cmd = ($CURL, '-o', "$CACHE_PATH/$fileName", $url); 84 | system (@cmd) && die "ERROR: cannot download url '$url'.\n"; 85 | }; 86 | 87 | my $checkChecksum = sub { 88 | my $fileName = shift; 89 | my $checksum = shift; 90 | 91 | print "checking checksum of '$fileName'...\n"; 92 | if (Digest::SHA->new('sha1')->addfile("$CACHE_PATH/$fileName")->hexdigest 93 | eq $checksum) { 94 | 95 | return 1; 96 | } 97 | print "checksum not ok...\n"; 98 | return 0; 99 | }; 100 | 101 | my $downloadFile = sub { 102 | my $fileName = shift; 103 | my $url = shift; 104 | my $opts = { @_ }; 105 | 106 | # check if cache directory exists 107 | -d "$CACHE_PATH" || make_path("$CACHE_PATH") || do { 108 | die "ERROR: cannot create directory $CACHE_PATH\n"; 109 | }; 110 | 111 | print "checking cache for '$fileName'...\n"; 112 | my $freshDl = 0; 113 | -f "$CACHE_PATH/$fileName" || do { 114 | print "file not found in cache...\n"; 115 | $getFile->($fileName, $url); 116 | $freshDl = 1; 117 | }; 118 | 119 | # check if cache file has a max_age property and redownload if expired 120 | exists $opts->{max_age} && !$freshDl 121 | && (time - stat("$CACHE_PATH/$fileName")->mtime > $opts->{max_age}) 122 | && $getFile->($fileName, $url); 123 | 124 | # check checksum if sha1 option is set 125 | exists $opts->{sha1} && do { 126 | return if $checkChecksum->($fileName, $opts->{sha1}); 127 | $getFile->($fileName, $url); 128 | $checkChecksum->($fileName, $opts->{sha1}) || die "ERROR: chechsum mismatch for downloaded file\n"; 129 | }; 130 | }; 131 | 132 | # constructor 133 | sub new { 134 | my $class = shift; 135 | my $self = { @_ }; 136 | 137 | return bless $self, $class; 138 | } 139 | 140 | # public methods 141 | sub cachePath { 142 | return $CACHE_PATH; 143 | } 144 | 145 | sub fetchImages { 146 | my $self = shift; 147 | my $force = shift; 148 | 149 | $downloadFile->('index.json', $IMGURL, (max_age => ($force ? -1 : $MAX_AGE))); 150 | open my $index, '<', "$CACHE_PATH/index.json" or die "ERROR: cannot open 'index.json': $!\n"; 151 | my $imgs = JSON->new->decode(do { local $/; <$index>; }); 152 | ref $imgs eq 'ARRAY' or die "ERROR: 'index.json' invalid\n"; 153 | 154 | # filter so we only get lx-datasets 155 | $images = [ grep { $_->{type} eq 'lx-dataset' } @$imgs ]; 156 | } 157 | 158 | sub listImages { 159 | my $self = shift; 160 | my $uuid = shift; 161 | 162 | @$images || $self->fetchImages; 163 | 164 | # check if UUID matches a unique item 165 | defined $uuid && return $self->$getImageByUUID($uuid); 166 | 167 | return $images; 168 | } 169 | 170 | sub dumpImages { 171 | my $self = shift; 172 | my $uuid_len = shift; 173 | 174 | my $imgs = $self->listImages; 175 | 176 | print $_->{name} . (' ' x ($_->{len} - length ($_->{name}))) for (@DUMPSET); 177 | print "\n"; 178 | for my $img (@$imgs) { 179 | for my $item (@DUMPSET) { 180 | my $tmpStr = exists $item->{trans} ? $item->{trans}->($getHashValue->($img, $item)) 181 | : $getHashValue->($img, $item); 182 | 183 | $tmpStr = length ($tmpStr) > $item->{len} ? substr ($tmpStr, 0, $item->{len}) 184 | : $tmpStr . (' ' x ($item->{len} - length ($tmpStr))); 185 | 186 | print $tmpStr; 187 | } 188 | print "\n"; 189 | } 190 | } 191 | 192 | sub downloadImage { 193 | my $self = shift; 194 | my $uuid = shift; 195 | 196 | # get image by UUID 197 | my $img = $self->$getImageByUUID($uuid); 198 | 199 | $downloadFile->("$img->{uuid}.gz", "$IMGURL/$img->{uuid}/file", ( sha1 => $img->{files}->[0]->{sha1} )); 200 | 201 | return $img; 202 | } 203 | 204 | 1; 205 | 206 | __END__ 207 | 208 | =head1 NAME 209 | 210 | LXadm::Images - lxadm images class 211 | 212 | =head1 SYNOPSIS 213 | 214 | use LXadm::Images; 215 | 216 | =head1 DESCRIPTION 217 | 218 | downloads and verifies lx zone images 219 | 220 | =head1 COPYRIGHT 221 | 222 | Copyright 2017 OmniOS Community Edition (OmniOSce) Association. 223 | 224 | =head1 LICENSE 225 | 226 | This program is free software: you can redistribute it and/or modify it 227 | under the terms of the GNU General Public License as published by the Free 228 | Software Foundation, either version 3 of the License, or (at your option) 229 | any later version. 230 | 231 | This program is distributed in the hope that it will be useful, but WITHOUT 232 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 233 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 234 | more details. 235 | 236 | You should have received a copy of the GNU General Public License along with 237 | this program. If not, see L. 238 | 239 | =head1 AUTHOR 240 | 241 | Shadfl@cpan.orgE>, 242 | 243 | =head1 HISTORY 244 | 245 | 2016-12-13 had Initial Version 246 | 247 | =cut 248 | 249 | -------------------------------------------------------------------------------- /lib/LXadm/Utils.pm: -------------------------------------------------------------------------------- 1 | package LXadm::Utils; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use Text::ParseWords qw(shellwords); 7 | 8 | my $DLADM = '/usr/sbin/dladm'; 9 | my $IFCONFIG = '/usr/sbin/ifconfig'; 10 | my $TEST = '/usr/bin/test'; 11 | 12 | # constructor 13 | sub new { 14 | my $class = shift; 15 | my $self = { @_ }; 16 | 17 | return bless $self, $class 18 | } 19 | 20 | # private methods 21 | my $numeric = sub { 22 | return shift =~ /^\d+$/; 23 | }; 24 | 25 | my $alphanumeric = sub { 26 | return shift =~ /^[-\w]+$/; 27 | }; 28 | 29 | # public methods 30 | sub regexp { 31 | my $self = shift; 32 | my $rx = shift; 33 | my $msg = shift; 34 | 35 | return sub { 36 | my $value = shift; 37 | return $value =~ /$rx/ ? undef : "$msg ($value)"; 38 | } 39 | } 40 | 41 | sub elemOf { 42 | my $self = shift; 43 | my $elems = [ @_ ]; 44 | 45 | return sub { 46 | my $value = shift; 47 | return (grep { $_ eq $value } @$elems) ? undef 48 | : 'expected a value from the list: ' . join(', ', @$elems); 49 | } 50 | } 51 | 52 | sub getVNicOver { 53 | my $self = shift; 54 | my $nicName = shift; 55 | 56 | #use string for 'link,over,vid' as perl will warn otherwise 57 | my @cmd = ($DLADM, qw(show-vnic -p -o), 'link,over'); 58 | 59 | open my $vnics, '-|', @cmd or die "ERROR: cannot get vnics\n"; 60 | 61 | while (<$vnics>){ 62 | chomp; 63 | my @nicProps = split ':', $_, 2; 64 | next if $nicProps[0] ne $nicName; 65 | 66 | return $nicProps[1]; 67 | }; 68 | 69 | return undef; 70 | }; 71 | 72 | sub nicName { 73 | my $self = shift; 74 | 75 | return sub { 76 | my ($nicName, $nic) = @_; 77 | 78 | my @cmd; 79 | 80 | # check if VNIC exists 81 | return undef if $self->getVNicOver($nicName); 82 | 83 | #only reach here if vnic does not exist 84 | #get first physical link if over is not given 85 | exists $nic->{over} || do { 86 | @cmd = ($DLADM, qw(show-phys -p -o link)); 87 | 88 | open my $nics, '-|', @cmd or die "ERROR: cannot get nics\n"; 89 | 90 | chomp($nic->{over} = <$nics>); 91 | close $nics; 92 | }; 93 | 94 | @cmd = ($DLADM, qw(create-vnic -l), $nic->{over}, $nicName); 95 | print STDERR "-> vnic '$nicName' does not exist. creating it...\n"; 96 | system(@cmd) && die "ERROR: cannot create vnic '$nicName'\n"; 97 | 98 | return undef; 99 | } 100 | } 101 | 102 | sub purgeVnic { 103 | my $self = shift; 104 | my $config = shift; 105 | 106 | for my $nic (@{$config->{net}}){ 107 | my @cmd = ($DLADM, qw(delete-vnic), $nic->{physical}); 108 | system(@cmd) && die "ERROR: cannot delete vnic '$nic->{physical}'\n"; 109 | } 110 | } 111 | 112 | 1; 113 | 114 | __END__ 115 | 116 | =head1 NAME 117 | 118 | LXadm::Utils - lxadm helper module 119 | 120 | =head1 SYNOPSIS 121 | 122 | use LXadm::Utils; 123 | 124 | =head1 DESCRIPTION 125 | 126 | methods to check lxadm configuration 127 | 128 | =head1 FUNCTIONS 129 | 130 | =head2 boolean 131 | 132 | checks if the argument is boolean 133 | 134 | =head2 numeric 135 | 136 | checks if the argument is numeric 137 | 138 | =head2 alphanumeric 139 | 140 | checks if the argument is alphanumeric 141 | 142 | =head2 get_vnic_over 143 | 144 | gets the physical nic of a vnic 145 | 146 | =head2 nic_name 147 | 148 | checks if a vnic exists, tires to create it if not 149 | 150 | =head2 serial_name 151 | 152 | checks if serial_name is not one of the reserved names 153 | 154 | =head2 purge_vnic 155 | 156 | deletes all vnic attached to the config 157 | 158 | =head1 COPYRIGHT 159 | 160 | Copyright 2017 OmniOS Community Edition (OmniOSce) Association. 161 | 162 | =head1 LICENSE 163 | 164 | This program is free software: you can redistribute it and/or modify it 165 | under the terms of the GNU General Public License as published by the Free 166 | Software Foundation, either version 3 of the License, or (at your option) 167 | any later version. 168 | 169 | This program is distributed in the hope that it will be useful, but WITHOUT 170 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 171 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 172 | more details. 173 | 174 | You should have received a copy of the GNU General Public License along with 175 | this program. If not, see L. 176 | 177 | =head1 AUTHOR 178 | 179 | Shadfl@cpan.orgE>, 180 | 181 | =head1 HISTORY 182 | 183 | 2016-12-13 had Initial Version 184 | 185 | =cut 186 | -------------------------------------------------------------------------------- /lib/Makefile.am: -------------------------------------------------------------------------------- 1 | PM := $(shell find . -type d -name ".??*" -prune -o -not -name ".*" -a -not -name "*~" -a -not -name "*.tmp" -a -not -name "Makefile*" -a -type f -print ) 2 | EXTRA_DIST = $(PM) 3 | datadir = $(libdir) 4 | nobase_data_DATA = $(PM) 5 | -------------------------------------------------------------------------------- /lib/Makefile.in: -------------------------------------------------------------------------------- 1 | # Makefile.in generated by automake 1.14.1 from Makefile.am. 2 | # @configure_input@ 3 | 4 | # Copyright (C) 1994-2013 Free Software Foundation, Inc. 5 | 6 | # This Makefile.in is free software; the Free Software Foundation 7 | # gives unlimited permission to copy and/or distribute it, 8 | # with or without modifications, as long as this notice is preserved. 9 | 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without 12 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 13 | # PARTICULAR PURPOSE. 14 | 15 | @SET_MAKE@ 16 | 17 | VPATH = @srcdir@ 18 | am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' 19 | am__make_running_with_option = \ 20 | case $${target_option-} in \ 21 | ?) ;; \ 22 | *) echo "am__make_running_with_option: internal error: invalid" \ 23 | "target option '$${target_option-}' specified" >&2; \ 24 | exit 1;; \ 25 | esac; \ 26 | has_opt=no; \ 27 | sane_makeflags=$$MAKEFLAGS; \ 28 | if $(am__is_gnu_make); then \ 29 | sane_makeflags=$$MFLAGS; \ 30 | else \ 31 | case $$MAKEFLAGS in \ 32 | *\\[\ \ ]*) \ 33 | bs=\\; \ 34 | sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ 35 | | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ 36 | esac; \ 37 | fi; \ 38 | skip_next=no; \ 39 | strip_trailopt () \ 40 | { \ 41 | flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ 42 | }; \ 43 | for flg in $$sane_makeflags; do \ 44 | test $$skip_next = yes && { skip_next=no; continue; }; \ 45 | case $$flg in \ 46 | *=*|--*) continue;; \ 47 | -*I) strip_trailopt 'I'; skip_next=yes;; \ 48 | -*I?*) strip_trailopt 'I';; \ 49 | -*O) strip_trailopt 'O'; skip_next=yes;; \ 50 | -*O?*) strip_trailopt 'O';; \ 51 | -*l) strip_trailopt 'l'; skip_next=yes;; \ 52 | -*l?*) strip_trailopt 'l';; \ 53 | -[dEDm]) skip_next=yes;; \ 54 | -[JT]) skip_next=yes;; \ 55 | esac; \ 56 | case $$flg in \ 57 | *$$target_option*) has_opt=yes; break;; \ 58 | esac; \ 59 | done; \ 60 | test $$has_opt = yes 61 | am__make_dryrun = (target_option=n; $(am__make_running_with_option)) 62 | am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 63 | pkgdatadir = $(datadir)/@PACKAGE@ 64 | pkgincludedir = $(includedir)/@PACKAGE@ 65 | pkglibdir = $(libdir)/@PACKAGE@ 66 | pkglibexecdir = $(libexecdir)/@PACKAGE@ 67 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 68 | install_sh_DATA = $(install_sh) -c -m 644 69 | install_sh_PROGRAM = $(install_sh) -c 70 | install_sh_SCRIPT = $(install_sh) -c 71 | INSTALL_HEADER = $(INSTALL_DATA) 72 | transform = $(program_transform_name) 73 | NORMAL_INSTALL = : 74 | PRE_INSTALL = : 75 | POST_INSTALL = : 76 | NORMAL_UNINSTALL = : 77 | PRE_UNINSTALL = : 78 | POST_UNINSTALL = : 79 | subdir = lib 80 | DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am 81 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 82 | am__aclocal_m4_deps = $(top_srcdir)/configure.ac 83 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 84 | $(ACLOCAL_M4) 85 | mkinstalldirs = $(install_sh) -d 86 | CONFIG_CLEAN_FILES = 87 | CONFIG_CLEAN_VPATH_FILES = 88 | AM_V_P = $(am__v_P_@AM_V@) 89 | am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) 90 | am__v_P_0 = false 91 | am__v_P_1 = : 92 | AM_V_GEN = $(am__v_GEN_@AM_V@) 93 | am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) 94 | am__v_GEN_0 = @echo " GEN " $@; 95 | am__v_GEN_1 = 96 | AM_V_at = $(am__v_at_@AM_V@) 97 | am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) 98 | am__v_at_0 = @ 99 | am__v_at_1 = 100 | SOURCES = 101 | DIST_SOURCES = 102 | am__can_run_installinfo = \ 103 | case $$AM_UPDATE_INFO_DIR in \ 104 | n|no|NO) false;; \ 105 | *) (install-info --version) >/dev/null 2>&1;; \ 106 | esac 107 | am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; 108 | am__vpath_adj = case $$p in \ 109 | $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ 110 | *) f=$$p;; \ 111 | esac; 112 | am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; 113 | am__install_max = 40 114 | am__nobase_strip_setup = \ 115 | srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` 116 | am__nobase_strip = \ 117 | for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" 118 | am__nobase_list = $(am__nobase_strip_setup); \ 119 | for p in $$list; do echo "$$p $$p"; done | \ 120 | sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ 121 | $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ 122 | if (++n[$$2] == $(am__install_max)) \ 123 | { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ 124 | END { for (dir in files) print dir, files[dir] }' 125 | am__base_list = \ 126 | sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ 127 | sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' 128 | am__uninstall_files_from_dir = { \ 129 | test -z "$$files" \ 130 | || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ 131 | || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ 132 | $(am__cd) "$$dir" && rm -f $$files; }; \ 133 | } 134 | am__installdirs = "$(DESTDIR)$(datadir)" 135 | DATA = $(nobase_data_DATA) 136 | am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) 137 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 138 | ACLOCAL = @ACLOCAL@ 139 | AMTAR = @AMTAR@ 140 | AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ 141 | AUTOCONF = @AUTOCONF@ 142 | AUTOHEADER = @AUTOHEADER@ 143 | AUTOMAKE = @AUTOMAKE@ 144 | AWK = @AWK@ 145 | CLASS_NAME = @CLASS_NAME@ 146 | CURL = @CURL@ 147 | CYGPATH_W = @CYGPATH_W@ 148 | DEFS = @DEFS@ 149 | ECHO_C = @ECHO_C@ 150 | ECHO_N = @ECHO_N@ 151 | ECHO_T = @ECHO_T@ 152 | GMAKE = @GMAKE@ 153 | GREP = @GREP@ 154 | INSTALL = @INSTALL@ 155 | INSTALL_DATA = @INSTALL_DATA@ 156 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ 157 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ 158 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ 159 | LIBOBJS = @LIBOBJS@ 160 | LIBS = @LIBS@ 161 | LTLIBOBJS = @LTLIBOBJS@ 162 | MAINT = @MAINT@ 163 | MAKEINFO = @MAKEINFO@ 164 | MKDIR_P = @MKDIR_P@ 165 | PACKAGE = @PACKAGE@ 166 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ 167 | PACKAGE_NAME = @PACKAGE_NAME@ 168 | PACKAGE_STRING = @PACKAGE_STRING@ 169 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ 170 | PACKAGE_URL = @PACKAGE_URL@ 171 | PACKAGE_VERSION = @PACKAGE_VERSION@ 172 | PATH_SEPARATOR = @PATH_SEPARATOR@ 173 | PERL = @PERL@ 174 | PERL5LIB = @PERL5LIB@ 175 | POD2MAN = @POD2MAN@ 176 | SCRIPT_NAME = @SCRIPT_NAME@ 177 | SET_MAKE = @SET_MAKE@ 178 | SHELL = @SHELL@ 179 | STRIP = @STRIP@ 180 | URL_CAT = @URL_CAT@ 181 | VERSION = @VERSION@ 182 | WGET = @WGET@ 183 | abs_builddir = @abs_builddir@ 184 | abs_srcdir = @abs_srcdir@ 185 | abs_top_builddir = @abs_top_builddir@ 186 | abs_top_srcdir = @abs_top_srcdir@ 187 | am__leading_dot = @am__leading_dot@ 188 | am__tar = @am__tar@ 189 | am__untar = @am__untar@ 190 | bindir = @bindir@ 191 | build_alias = @build_alias@ 192 | builddir = @builddir@ 193 | datadir = $(libdir) 194 | datarootdir = @datarootdir@ 195 | docdir = @docdir@ 196 | dvidir = @dvidir@ 197 | enable_pkgonly = @enable_pkgonly@ 198 | exec_prefix = @exec_prefix@ 199 | host_alias = @host_alias@ 200 | htmldir = @htmldir@ 201 | includedir = @includedir@ 202 | infodir = @infodir@ 203 | install_sh = @install_sh@ 204 | libdir = @libdir@ 205 | libexecdir = @libexecdir@ 206 | localedir = @localedir@ 207 | localstatedir = @localstatedir@ 208 | mandir = @mandir@ 209 | mkdir_p = @mkdir_p@ 210 | oldincludedir = @oldincludedir@ 211 | pdfdir = @pdfdir@ 212 | prefix = @prefix@ 213 | program_transform_name = @program_transform_name@ 214 | psdir = @psdir@ 215 | sbindir = @sbindir@ 216 | sharedstatedir = @sharedstatedir@ 217 | srcdir = @srcdir@ 218 | sysconfdir = @sysconfdir@ 219 | target_alias = @target_alias@ 220 | top_build_prefix = @top_build_prefix@ 221 | top_builddir = @top_builddir@ 222 | top_srcdir = @top_srcdir@ 223 | PM := $(shell find . -type d -name ".??*" -prune -o -not -name ".*" -a -not -name "*~" -a -not -name "*.tmp" -a -not -name "Makefile*" -a -type f -print ) 224 | EXTRA_DIST = $(PM) 225 | nobase_data_DATA = $(PM) 226 | all: all-am 227 | 228 | .SUFFIXES: 229 | $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) 230 | @for dep in $?; do \ 231 | case '$(am__configure_deps)' in \ 232 | *$$dep*) \ 233 | ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ 234 | && { if test -f $@; then exit 0; else break; fi; }; \ 235 | exit 1;; \ 236 | esac; \ 237 | done; \ 238 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign lib/Makefile'; \ 239 | $(am__cd) $(top_srcdir) && \ 240 | $(AUTOMAKE) --foreign lib/Makefile 241 | .PRECIOUS: Makefile 242 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 243 | @case '$?' in \ 244 | *config.status*) \ 245 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ 246 | *) \ 247 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ 248 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ 249 | esac; 250 | 251 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) 252 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 253 | 254 | $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) 255 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 256 | $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) 257 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 258 | $(am__aclocal_m4_deps): 259 | install-nobase_dataDATA: $(nobase_data_DATA) 260 | @$(NORMAL_INSTALL) 261 | @list='$(nobase_data_DATA)'; test -n "$(datadir)" || list=; \ 262 | if test -n "$$list"; then \ 263 | echo " $(MKDIR_P) '$(DESTDIR)$(datadir)'"; \ 264 | $(MKDIR_P) "$(DESTDIR)$(datadir)" || exit 1; \ 265 | fi; \ 266 | $(am__nobase_list) | while read dir files; do \ 267 | xfiles=; for file in $$files; do \ 268 | if test -f "$$file"; then xfiles="$$xfiles $$file"; \ 269 | else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \ 270 | test -z "$$xfiles" || { \ 271 | test "x$$dir" = x. || { \ 272 | echo " $(MKDIR_P) '$(DESTDIR)$(datadir)/$$dir'"; \ 273 | $(MKDIR_P) "$(DESTDIR)$(datadir)/$$dir"; }; \ 274 | echo " $(INSTALL_DATA) $$xfiles '$(DESTDIR)$(datadir)/$$dir'"; \ 275 | $(INSTALL_DATA) $$xfiles "$(DESTDIR)$(datadir)/$$dir" || exit $$?; }; \ 276 | done 277 | 278 | uninstall-nobase_dataDATA: 279 | @$(NORMAL_UNINSTALL) 280 | @list='$(nobase_data_DATA)'; test -n "$(datadir)" || list=; \ 281 | $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \ 282 | dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir) 283 | tags TAGS: 284 | 285 | ctags CTAGS: 286 | 287 | cscope cscopelist: 288 | 289 | 290 | distdir: $(DISTFILES) 291 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 292 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 293 | list='$(DISTFILES)'; \ 294 | dist_files=`for file in $$list; do echo $$file; done | \ 295 | sed -e "s|^$$srcdirstrip/||;t" \ 296 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ 297 | case $$dist_files in \ 298 | */*) $(MKDIR_P) `echo "$$dist_files" | \ 299 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ 300 | sort -u` ;; \ 301 | esac; \ 302 | for file in $$dist_files; do \ 303 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ 304 | if test -d $$d/$$file; then \ 305 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 306 | if test -d "$(distdir)/$$file"; then \ 307 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 308 | fi; \ 309 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ 310 | cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ 311 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 312 | fi; \ 313 | cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ 314 | else \ 315 | test -f "$(distdir)/$$file" \ 316 | || cp -p $$d/$$file "$(distdir)/$$file" \ 317 | || exit 1; \ 318 | fi; \ 319 | done 320 | check-am: all-am 321 | check: check-am 322 | all-am: Makefile $(DATA) 323 | installdirs: 324 | for dir in "$(DESTDIR)$(datadir)"; do \ 325 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \ 326 | done 327 | install: install-am 328 | install-exec: install-exec-am 329 | install-data: install-data-am 330 | uninstall: uninstall-am 331 | 332 | install-am: all-am 333 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am 334 | 335 | installcheck: installcheck-am 336 | install-strip: 337 | if test -z '$(STRIP)'; then \ 338 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 339 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 340 | install; \ 341 | else \ 342 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 343 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 344 | "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ 345 | fi 346 | mostlyclean-generic: 347 | 348 | clean-generic: 349 | 350 | distclean-generic: 351 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) 352 | -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) 353 | 354 | maintainer-clean-generic: 355 | @echo "This command is intended for maintainers to use" 356 | @echo "it deletes files that may require special tools to rebuild." 357 | clean: clean-am 358 | 359 | clean-am: clean-generic mostlyclean-am 360 | 361 | distclean: distclean-am 362 | -rm -f Makefile 363 | distclean-am: clean-am distclean-generic 364 | 365 | dvi: dvi-am 366 | 367 | dvi-am: 368 | 369 | html: html-am 370 | 371 | html-am: 372 | 373 | info: info-am 374 | 375 | info-am: 376 | 377 | install-data-am: install-nobase_dataDATA 378 | 379 | install-dvi: install-dvi-am 380 | 381 | install-dvi-am: 382 | 383 | install-exec-am: 384 | 385 | install-html: install-html-am 386 | 387 | install-html-am: 388 | 389 | install-info: install-info-am 390 | 391 | install-info-am: 392 | 393 | install-man: 394 | 395 | install-pdf: install-pdf-am 396 | 397 | install-pdf-am: 398 | 399 | install-ps: install-ps-am 400 | 401 | install-ps-am: 402 | 403 | installcheck-am: 404 | 405 | maintainer-clean: maintainer-clean-am 406 | -rm -f Makefile 407 | maintainer-clean-am: distclean-am maintainer-clean-generic 408 | 409 | mostlyclean: mostlyclean-am 410 | 411 | mostlyclean-am: mostlyclean-generic 412 | 413 | pdf: pdf-am 414 | 415 | pdf-am: 416 | 417 | ps: ps-am 418 | 419 | ps-am: 420 | 421 | uninstall-am: uninstall-nobase_dataDATA 422 | 423 | .MAKE: install-am install-strip 424 | 425 | .PHONY: all all-am check check-am clean clean-generic cscopelist-am \ 426 | ctags-am distclean distclean-generic distdir dvi dvi-am html \ 427 | html-am info info-am install install-am install-data \ 428 | install-data-am install-dvi install-dvi-am install-exec \ 429 | install-exec-am install-html install-html-am install-info \ 430 | install-info-am install-man install-nobase_dataDATA \ 431 | install-pdf install-pdf-am install-ps install-ps-am \ 432 | install-strip installcheck installcheck-am installdirs \ 433 | maintainer-clean maintainer-clean-generic mostlyclean \ 434 | mostlyclean-generic pdf pdf-am ps ps-am tags-am uninstall \ 435 | uninstall-am uninstall-nobase_dataDATA 436 | 437 | 438 | # Tell versions [3.59,3.63) of GNU make to not export all variables. 439 | # Otherwise a system limit (for SysV at least) may be exceeded. 440 | .NOEXPORT: 441 | -------------------------------------------------------------------------------- /thirdparty/Makefile.am: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 Tobias Oetiker 2 | 3 | AUTOMAKE_OPTIONS = foreign 4 | 5 | THIRDPARTY_DIR := $(shell pwd) 6 | 7 | THIRDPARTY_DIST := $(shell test -d CPAN && find CPAN -type d -name ".??*" -prune -o -not -name ".*" -a -not -name "*~" -a -not -name "*.tmp" -a -type f -print ) 8 | 9 | EXTRA_DIST = $(THIRDPARTY_DIST) $(wildcard bin/cpanm) 10 | 11 | all-local: touch 12 | 13 | touch: CPAN/touch ../config.status ../PERL_MODULES 14 | $(AM_V_GEN)cat ../PERL_MODULES | PERL_CPANM_HOME=$(THIRDPARTY_DIR) xargs $(PERL) $(THIRDPARTY_DIR)/bin/cpanm -q --notest --local-lib-contained $(THIRDPARTY_DIR) --mirror file://$(THIRDPARTY_DIR)/CPAN --mirror-only 15 | $(AM_V_GEN)touch touch 16 | 17 | CPAN/touch: ../PERL_MODULES 18 | echo "POPULATING OUR LOCAL micro CPAN" 19 | $(AM_V_GEN)$(URL_CAT) http://cpanmin.us | PERL_CPANM_HOME=$(THIRDPARTY_DIR) $(PERL) - -q --notest --local-lib $(THIRDPARTY_DIR) --save-dists $(THIRDPARTY_DIR)/CPAN --force App::cpanminus 20 | $(AM_V_GEN)PERL_CPANM_HOME=$(THIRDPARTY_DIR)/Ore $(THIRDPARTY_DIR)/bin/cpanm -q --notest --local-lib $(THIRDPARTY_DIR)/Ore File::Which OrePAN 21 | $(AM_V_GEN)cat ../PERL_MODULES | PERL_CPANM_HOME=$(THIRDPARTY_DIR) xargs $(PERL) $(THIRDPARTY_DIR)/bin/cpanm -q --self-contained --notest --local-lib-contained $(THIRDPARTY_DIR) --save-dists $(THIRDPARTY_DIR)/CPAN 22 | $(AM_V_GEN)PERL5LIB=$(THIRDPARTY_DIR)/Ore/lib/perl5 $(THIRDPARTY_DIR)/Ore/bin/orepan_index.pl --repository $(THIRDPARTY_DIR)/CPAN 23 | # Ore fails to extract the version form DBI 24 | $(AM_V_GEN)gunzip -c CPAN/modules/02packages.details.txt.gz | perl -pe 's{^(DBI\s+)undef(\s+\S+/DBI-)(\d+\.\d+)(\.tar)}{$$1$$3$$2$$3$$4}' | gzip | cat > x.gz && mv x.gz CPAN/modules/02packages.details.txt.gz 25 | $(AM_V_GEN)touch CPAN/touch 26 | 27 | clean-local: 28 | ls -1 | grep -v Makefile | grep -v bin | grep -v CPAN | xargs rm -rf 29 | 30 | distclean-local: 31 | ls -1 | grep -v Makefile. | xargs rm -rf 32 | -------------------------------------------------------------------------------- /thirdparty/Makefile.in: -------------------------------------------------------------------------------- 1 | # Makefile.in generated by automake 1.14.1 from Makefile.am. 2 | # @configure_input@ 3 | 4 | # Copyright (C) 1994-2013 Free Software Foundation, Inc. 5 | 6 | # This Makefile.in is free software; the Free Software Foundation 7 | # gives unlimited permission to copy and/or distribute it, 8 | # with or without modifications, as long as this notice is preserved. 9 | 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without 12 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 13 | # PARTICULAR PURPOSE. 14 | 15 | @SET_MAKE@ 16 | 17 | # Copyright (C) 2015 Tobias Oetiker 18 | VPATH = @srcdir@ 19 | am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' 20 | am__make_running_with_option = \ 21 | case $${target_option-} in \ 22 | ?) ;; \ 23 | *) echo "am__make_running_with_option: internal error: invalid" \ 24 | "target option '$${target_option-}' specified" >&2; \ 25 | exit 1;; \ 26 | esac; \ 27 | has_opt=no; \ 28 | sane_makeflags=$$MAKEFLAGS; \ 29 | if $(am__is_gnu_make); then \ 30 | sane_makeflags=$$MFLAGS; \ 31 | else \ 32 | case $$MAKEFLAGS in \ 33 | *\\[\ \ ]*) \ 34 | bs=\\; \ 35 | sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ 36 | | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ 37 | esac; \ 38 | fi; \ 39 | skip_next=no; \ 40 | strip_trailopt () \ 41 | { \ 42 | flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ 43 | }; \ 44 | for flg in $$sane_makeflags; do \ 45 | test $$skip_next = yes && { skip_next=no; continue; }; \ 46 | case $$flg in \ 47 | *=*|--*) continue;; \ 48 | -*I) strip_trailopt 'I'; skip_next=yes;; \ 49 | -*I?*) strip_trailopt 'I';; \ 50 | -*O) strip_trailopt 'O'; skip_next=yes;; \ 51 | -*O?*) strip_trailopt 'O';; \ 52 | -*l) strip_trailopt 'l'; skip_next=yes;; \ 53 | -*l?*) strip_trailopt 'l';; \ 54 | -[dEDm]) skip_next=yes;; \ 55 | -[JT]) skip_next=yes;; \ 56 | esac; \ 57 | case $$flg in \ 58 | *$$target_option*) has_opt=yes; break;; \ 59 | esac; \ 60 | done; \ 61 | test $$has_opt = yes 62 | am__make_dryrun = (target_option=n; $(am__make_running_with_option)) 63 | am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 64 | pkgdatadir = $(datadir)/@PACKAGE@ 65 | pkgincludedir = $(includedir)/@PACKAGE@ 66 | pkglibdir = $(libdir)/@PACKAGE@ 67 | pkglibexecdir = $(libexecdir)/@PACKAGE@ 68 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 69 | install_sh_DATA = $(install_sh) -c -m 644 70 | install_sh_PROGRAM = $(install_sh) -c 71 | install_sh_SCRIPT = $(install_sh) -c 72 | INSTALL_HEADER = $(INSTALL_DATA) 73 | transform = $(program_transform_name) 74 | NORMAL_INSTALL = : 75 | PRE_INSTALL = : 76 | POST_INSTALL = : 77 | NORMAL_UNINSTALL = : 78 | PRE_UNINSTALL = : 79 | POST_UNINSTALL = : 80 | subdir = thirdparty 81 | DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am 82 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 83 | am__aclocal_m4_deps = $(top_srcdir)/configure.ac 84 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 85 | $(ACLOCAL_M4) 86 | mkinstalldirs = $(install_sh) -d 87 | CONFIG_CLEAN_FILES = 88 | CONFIG_CLEAN_VPATH_FILES = 89 | AM_V_P = $(am__v_P_@AM_V@) 90 | am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) 91 | am__v_P_0 = false 92 | am__v_P_1 = : 93 | AM_V_GEN = $(am__v_GEN_@AM_V@) 94 | am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) 95 | am__v_GEN_0 = @echo " GEN " $@; 96 | am__v_GEN_1 = 97 | AM_V_at = $(am__v_at_@AM_V@) 98 | am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) 99 | am__v_at_0 = @ 100 | am__v_at_1 = 101 | SOURCES = 102 | DIST_SOURCES = 103 | am__can_run_installinfo = \ 104 | case $$AM_UPDATE_INFO_DIR in \ 105 | n|no|NO) false;; \ 106 | *) (install-info --version) >/dev/null 2>&1;; \ 107 | esac 108 | am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) 109 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 110 | ACLOCAL = @ACLOCAL@ 111 | AMTAR = @AMTAR@ 112 | AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ 113 | AUTOCONF = @AUTOCONF@ 114 | AUTOHEADER = @AUTOHEADER@ 115 | AUTOMAKE = @AUTOMAKE@ 116 | AWK = @AWK@ 117 | CLASS_NAME = @CLASS_NAME@ 118 | CURL = @CURL@ 119 | CYGPATH_W = @CYGPATH_W@ 120 | DEFS = @DEFS@ 121 | ECHO_C = @ECHO_C@ 122 | ECHO_N = @ECHO_N@ 123 | ECHO_T = @ECHO_T@ 124 | GMAKE = @GMAKE@ 125 | GREP = @GREP@ 126 | INSTALL = @INSTALL@ 127 | INSTALL_DATA = @INSTALL_DATA@ 128 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ 129 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ 130 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ 131 | LIBOBJS = @LIBOBJS@ 132 | LIBS = @LIBS@ 133 | LTLIBOBJS = @LTLIBOBJS@ 134 | MAINT = @MAINT@ 135 | MAKEINFO = @MAKEINFO@ 136 | MKDIR_P = @MKDIR_P@ 137 | PACKAGE = @PACKAGE@ 138 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ 139 | PACKAGE_NAME = @PACKAGE_NAME@ 140 | PACKAGE_STRING = @PACKAGE_STRING@ 141 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ 142 | PACKAGE_URL = @PACKAGE_URL@ 143 | PACKAGE_VERSION = @PACKAGE_VERSION@ 144 | PATH_SEPARATOR = @PATH_SEPARATOR@ 145 | PERL = @PERL@ 146 | PERL5LIB = @PERL5LIB@ 147 | POD2MAN = @POD2MAN@ 148 | SCRIPT_NAME = @SCRIPT_NAME@ 149 | SET_MAKE = @SET_MAKE@ 150 | SHELL = @SHELL@ 151 | STRIP = @STRIP@ 152 | URL_CAT = @URL_CAT@ 153 | VERSION = @VERSION@ 154 | WGET = @WGET@ 155 | abs_builddir = @abs_builddir@ 156 | abs_srcdir = @abs_srcdir@ 157 | abs_top_builddir = @abs_top_builddir@ 158 | abs_top_srcdir = @abs_top_srcdir@ 159 | am__leading_dot = @am__leading_dot@ 160 | am__tar = @am__tar@ 161 | am__untar = @am__untar@ 162 | bindir = @bindir@ 163 | build_alias = @build_alias@ 164 | builddir = @builddir@ 165 | datadir = @datadir@ 166 | datarootdir = @datarootdir@ 167 | docdir = @docdir@ 168 | dvidir = @dvidir@ 169 | enable_pkgonly = @enable_pkgonly@ 170 | exec_prefix = @exec_prefix@ 171 | host_alias = @host_alias@ 172 | htmldir = @htmldir@ 173 | includedir = @includedir@ 174 | infodir = @infodir@ 175 | install_sh = @install_sh@ 176 | libdir = @libdir@ 177 | libexecdir = @libexecdir@ 178 | localedir = @localedir@ 179 | localstatedir = @localstatedir@ 180 | mandir = @mandir@ 181 | mkdir_p = @mkdir_p@ 182 | oldincludedir = @oldincludedir@ 183 | pdfdir = @pdfdir@ 184 | prefix = @prefix@ 185 | program_transform_name = @program_transform_name@ 186 | psdir = @psdir@ 187 | sbindir = @sbindir@ 188 | sharedstatedir = @sharedstatedir@ 189 | srcdir = @srcdir@ 190 | sysconfdir = @sysconfdir@ 191 | target_alias = @target_alias@ 192 | top_build_prefix = @top_build_prefix@ 193 | top_builddir = @top_builddir@ 194 | top_srcdir = @top_srcdir@ 195 | AUTOMAKE_OPTIONS = foreign 196 | THIRDPARTY_DIR := $(shell pwd) 197 | THIRDPARTY_DIST := $(shell test -d CPAN && find CPAN -type d -name ".??*" -prune -o -not -name ".*" -a -not -name "*~" -a -not -name "*.tmp" -a -type f -print ) 198 | EXTRA_DIST = $(THIRDPARTY_DIST) $(wildcard bin/cpanm) 199 | all: all-am 200 | 201 | .SUFFIXES: 202 | $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) 203 | @for dep in $?; do \ 204 | case '$(am__configure_deps)' in \ 205 | *$$dep*) \ 206 | ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ 207 | && { if test -f $@; then exit 0; else break; fi; }; \ 208 | exit 1;; \ 209 | esac; \ 210 | done; \ 211 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign thirdparty/Makefile'; \ 212 | $(am__cd) $(top_srcdir) && \ 213 | $(AUTOMAKE) --foreign thirdparty/Makefile 214 | .PRECIOUS: Makefile 215 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 216 | @case '$?' in \ 217 | *config.status*) \ 218 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ 219 | *) \ 220 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ 221 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ 222 | esac; 223 | 224 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) 225 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 226 | 227 | $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) 228 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 229 | $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) 230 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 231 | $(am__aclocal_m4_deps): 232 | tags TAGS: 233 | 234 | ctags CTAGS: 235 | 236 | cscope cscopelist: 237 | 238 | 239 | distdir: $(DISTFILES) 240 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 241 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 242 | list='$(DISTFILES)'; \ 243 | dist_files=`for file in $$list; do echo $$file; done | \ 244 | sed -e "s|^$$srcdirstrip/||;t" \ 245 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ 246 | case $$dist_files in \ 247 | */*) $(MKDIR_P) `echo "$$dist_files" | \ 248 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ 249 | sort -u` ;; \ 250 | esac; \ 251 | for file in $$dist_files; do \ 252 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ 253 | if test -d $$d/$$file; then \ 254 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 255 | if test -d "$(distdir)/$$file"; then \ 256 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 257 | fi; \ 258 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ 259 | cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ 260 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 261 | fi; \ 262 | cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ 263 | else \ 264 | test -f "$(distdir)/$$file" \ 265 | || cp -p $$d/$$file "$(distdir)/$$file" \ 266 | || exit 1; \ 267 | fi; \ 268 | done 269 | check-am: all-am 270 | check: check-am 271 | all-am: Makefile all-local 272 | installdirs: 273 | install: install-am 274 | install-exec: install-exec-am 275 | install-data: install-data-am 276 | uninstall: uninstall-am 277 | 278 | install-am: all-am 279 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am 280 | 281 | installcheck: installcheck-am 282 | install-strip: 283 | if test -z '$(STRIP)'; then \ 284 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 285 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 286 | install; \ 287 | else \ 288 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 289 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 290 | "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ 291 | fi 292 | mostlyclean-generic: 293 | 294 | clean-generic: 295 | 296 | distclean-generic: 297 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) 298 | -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) 299 | 300 | maintainer-clean-generic: 301 | @echo "This command is intended for maintainers to use" 302 | @echo "it deletes files that may require special tools to rebuild." 303 | clean: clean-am 304 | 305 | clean-am: clean-generic clean-local mostlyclean-am 306 | 307 | distclean: distclean-am 308 | -rm -f Makefile 309 | distclean-am: clean-am distclean-generic distclean-local 310 | 311 | dvi: dvi-am 312 | 313 | dvi-am: 314 | 315 | html: html-am 316 | 317 | html-am: 318 | 319 | info: info-am 320 | 321 | info-am: 322 | 323 | install-data-am: 324 | 325 | install-dvi: install-dvi-am 326 | 327 | install-dvi-am: 328 | 329 | install-exec-am: 330 | 331 | install-html: install-html-am 332 | 333 | install-html-am: 334 | 335 | install-info: install-info-am 336 | 337 | install-info-am: 338 | 339 | install-man: 340 | 341 | install-pdf: install-pdf-am 342 | 343 | install-pdf-am: 344 | 345 | install-ps: install-ps-am 346 | 347 | install-ps-am: 348 | 349 | installcheck-am: 350 | 351 | maintainer-clean: maintainer-clean-am 352 | -rm -f Makefile 353 | maintainer-clean-am: distclean-am maintainer-clean-generic 354 | 355 | mostlyclean: mostlyclean-am 356 | 357 | mostlyclean-am: mostlyclean-generic 358 | 359 | pdf: pdf-am 360 | 361 | pdf-am: 362 | 363 | ps: ps-am 364 | 365 | ps-am: 366 | 367 | uninstall-am: 368 | 369 | .MAKE: install-am install-strip 370 | 371 | .PHONY: all all-am all-local check check-am clean clean-generic \ 372 | clean-local cscopelist-am ctags-am distclean distclean-generic \ 373 | distclean-local distdir dvi dvi-am html html-am info info-am \ 374 | install install-am install-data install-data-am install-dvi \ 375 | install-dvi-am install-exec install-exec-am install-html \ 376 | install-html-am install-info install-info-am install-man \ 377 | install-pdf install-pdf-am install-ps install-ps-am \ 378 | install-strip installcheck installcheck-am installdirs \ 379 | maintainer-clean maintainer-clean-generic mostlyclean \ 380 | mostlyclean-generic pdf pdf-am ps ps-am tags-am uninstall \ 381 | uninstall-am 382 | 383 | 384 | all-local: touch 385 | 386 | touch: CPAN/touch ../config.status ../PERL_MODULES 387 | $(AM_V_GEN)cat ../PERL_MODULES | PERL_CPANM_HOME=$(THIRDPARTY_DIR) xargs $(PERL) $(THIRDPARTY_DIR)/bin/cpanm -q --notest --local-lib-contained $(THIRDPARTY_DIR) --mirror file://$(THIRDPARTY_DIR)/CPAN --mirror-only 388 | $(AM_V_GEN)touch touch 389 | 390 | CPAN/touch: ../PERL_MODULES 391 | echo "POPULATING OUR LOCAL micro CPAN" 392 | $(AM_V_GEN)$(URL_CAT) http://cpanmin.us | PERL_CPANM_HOME=$(THIRDPARTY_DIR) $(PERL) - -q --notest --local-lib $(THIRDPARTY_DIR) --save-dists $(THIRDPARTY_DIR)/CPAN --force App::cpanminus 393 | $(AM_V_GEN)PERL_CPANM_HOME=$(THIRDPARTY_DIR)/Ore $(THIRDPARTY_DIR)/bin/cpanm -q --notest --local-lib $(THIRDPARTY_DIR)/Ore File::Which OrePAN 394 | $(AM_V_GEN)cat ../PERL_MODULES | PERL_CPANM_HOME=$(THIRDPARTY_DIR) xargs $(PERL) $(THIRDPARTY_DIR)/bin/cpanm -q --self-contained --notest --local-lib-contained $(THIRDPARTY_DIR) --save-dists $(THIRDPARTY_DIR)/CPAN 395 | $(AM_V_GEN)PERL5LIB=$(THIRDPARTY_DIR)/Ore/lib/perl5 $(THIRDPARTY_DIR)/Ore/bin/orepan_index.pl --repository $(THIRDPARTY_DIR)/CPAN 396 | # Ore fails to extract the version form DBI 397 | $(AM_V_GEN)gunzip -c CPAN/modules/02packages.details.txt.gz | perl -pe 's{^(DBI\s+)undef(\s+\S+/DBI-)(\d+\.\d+)(\.tar)}{$$1$$3$$2$$3$$4}' | gzip | cat > x.gz && mv x.gz CPAN/modules/02packages.details.txt.gz 398 | $(AM_V_GEN)touch CPAN/touch 399 | 400 | clean-local: 401 | ls -1 | grep -v Makefile | grep -v bin | grep -v CPAN | xargs rm -rf 402 | 403 | distclean-local: 404 | ls -1 | grep -v Makefile. | xargs rm -rf 405 | 406 | # Tell versions [3.59,3.63) of GNU make to not export all variables. 407 | # Otherwise a system limit (for SysV at least) may be exceeded. 408 | .NOEXPORT: 409 | --------------------------------------------------------------------------------