From 397f31fcb0b47000c6e5c5c4aaf441970ce06e3a Mon Sep 17 00:00:00 2001 From: rhatto Date: Tue, 19 Sep 2006 16:56:25 +0000 Subject: simplepkg 0.4.9pre2 git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@5 04377dda-e619-0410-9926-eae83683ac58 --- CHANGELOG | 55 ------ COPYING | 340 -------------------------------- README | 260 +----------------------- README.pt_BR | 254 ------------------------ README.simplaret | 143 -------------- README.simplaret.pt_BR | 148 -------------- TODO | 5 - common.sh | 180 ----------------- conf/repos.conf.new | 9 + conf/simplepkg.conf.new | 14 ++ createpkg | 182 ----------------- doc/CHANGELOG | 56 ++++++ doc/COPYING | 340 ++++++++++++++++++++++++++++++++ doc/README | 258 ++++++++++++++++++++++++ doc/README.pt_BR | 254 ++++++++++++++++++++++++ doc/README.simplaret | 143 ++++++++++++++ doc/README.simplaret.pt_BR | 148 ++++++++++++++ doc/TODO | 5 + doinst.sh | 2 - install/doinst.sh | 2 + install/slack-desc | 19 ++ jail-update | 62 ------ jail-upgrade | 107 ---------- lib/common.sh | 180 +++++++++++++++++ lspkg | 68 ------- metapkg | 60 ------ mkjail | 100 ---------- rebuildpkg | 83 -------- repos.conf.new | 9 - simplaret | 482 --------------------------------------------- simplepkg.SlackBuild | 18 +- simplepkg.conf.new | 14 -- slack-desc | 19 -- src/createpkg | 184 +++++++++++++++++ src/jail-update | 62 ++++++ src/jail-upgrade | 107 ++++++++++ src/lspkg | 68 +++++++ src/metapkg | 60 ++++++ src/mkjail | 100 ++++++++++ src/rebuildpkg | 83 ++++++++ src/simplaret | 482 +++++++++++++++++++++++++++++++++++++++++++++ src/templatepkg | 90 +++++++++ templatepkg | 90 --------- 43 files changed, 2675 insertions(+), 2670 deletions(-) delete mode 100644 CHANGELOG delete mode 100644 COPYING delete mode 100644 README.pt_BR delete mode 100644 README.simplaret delete mode 100644 README.simplaret.pt_BR delete mode 100644 TODO delete mode 100644 common.sh create mode 100644 conf/repos.conf.new create mode 100644 conf/simplepkg.conf.new delete mode 100644 createpkg create mode 100644 doc/CHANGELOG create mode 100644 doc/COPYING create mode 100644 doc/README create mode 100644 doc/README.pt_BR create mode 100644 doc/README.simplaret create mode 100644 doc/README.simplaret.pt_BR create mode 100644 doc/TODO delete mode 100644 doinst.sh create mode 100644 install/doinst.sh create mode 100644 install/slack-desc delete mode 100755 jail-update delete mode 100755 jail-upgrade create mode 100644 lib/common.sh delete mode 100755 lspkg delete mode 100755 metapkg delete mode 100755 mkjail delete mode 100755 rebuildpkg delete mode 100644 repos.conf.new delete mode 100755 simplaret delete mode 100644 simplepkg.conf.new delete mode 100644 slack-desc create mode 100644 src/createpkg create mode 100755 src/jail-update create mode 100755 src/jail-upgrade create mode 100755 src/lspkg create mode 100755 src/metapkg create mode 100755 src/mkjail create mode 100755 src/rebuildpkg create mode 100755 src/simplaret create mode 100755 src/templatepkg delete mode 100755 templatepkg diff --git a/CHANGELOG b/CHANGELOG deleted file mode 100644 index 2de335a..0000000 --- a/CHANGELOG +++ /dev/null @@ -1,55 +0,0 @@ -simplepkg changelog -------------------- - -0.4.9pre1: added createpkg - updated README and README.pt_BR - -0.4.8: simplaret: removed extra folder from slamd64 definition - and fixed a typo - -0.4.7: templatepkg bugfix on blank template lines and on package deletion - changed simplaret working dir in simplaret.conf.new - -0.4.6: small bugfix on jail-update that prevented template update - -0.4.5: vserver template update - -0.4.4: WARNING option on config file for simplaret - - SILENT env var, if a non-zero value, keeps simplaret - work silenty when purging and works like if WANRING is set - to not null. - - add SIMPLARET_DELETE_DURING config parameter: when set - to a non-zero value deletes each package rigth after its - installation - -0.4.3: openoffice.org template - -0.4.2: common.sh: fix on install_packages when handling - with similar package names - -0.4.1: templatepkg: fixed tagfiles and comment handling - -0.4: multi-plataform and version management - - now simplepkg supports jails with architectures and versions - others than the main system, read the docs for details. - - added simplaret: a small script for downloading packages - - jail-upgrade - - * arch checking via /etc/slackware-version on each jail - * supports multi-arch and multi-version repository - * integrated with simplaret - - common.sh: improved functions to support simplaret - -0.3.7-0.3.9: bugfix releases - -0.3.6: added "-u" option to eval_config to ask for a swaret --update - -0.3.5: "main" jail support for jail-update - -0.3.4: started changelog :) diff --git a/COPYING b/COPYING deleted file mode 100644 index d60c31a..0000000 --- a/COPYING +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/README b/README index 50b0e9d..b5c715c 100644 --- a/README +++ b/README @@ -1,258 +1,2 @@ -Simplepkg: installation manager and metapackage system ------------------------------------------------------- - -Author: Silvio Rhatto -Licence: GPL - -Simplepkg is a non-intrusive package management system running on top of pkgtool. -It uses templates -- lists of installed packages, scripts and configuration files --- allowing the creation of installation profiles that can be used do install a -complete and configured slackware system in another partition or to create chroot -environments. The same templating scheme extends slackware packaging system, adding -metapackages: a list of packages installed or removed with a single command. - -Documentation -------------- - - English documentation: README | http://slack.sarava.org/node/15 - Portuguese documentation: REAMDE.pt_BR | http://slack.sarava.org/node/12 - -Description ------------ - -All GNU/Linux distributions comes with a well developed packaging system. The question now -is how pratical is the way to install, configure and control any changes in a system. - -As an example, suppose you should keep a list of about 200 slackware machines, some -of them used as desktops, others as mail or webservers. If you lost some hardrives -or usually need to re-install or update some of those boxes. - -Using the slackware installation cd and configuring by hand all the time you got a crash -is a time loss activity and you'll never know if something remained missconfigured. An -alternative is to keep a complete backup of a machine or some parts of the tree, but for -a large number of different boxes this procedure costs a lots of resources. - -Simplepkg offers an alternative sollution for this and other problems related to installation -management, allowing you to keep templates of each machine and install a custom slackware -system with just one or a few commands. Creating and upgrading chroot and vservers is easy -with simplepkg. - -Architecture ------------- - -Simplepkg is a set of scripts wrote in the KISS philosophy. Its a pretty simple system, composed -by the following commands: - - - mkjail: build a slackware jail/installation in a folder - - metapkg: install or remove a metapackage - - templatepkg: create or update a package list of an installation template - - lspkg: show installed packages and its contents - - jail-upgrade: upgrade all or some of the jails/installations - - jail-update: update all configuration files of a template - - rebuildpkg: rebuild a package based on its /var/log/packages entry - - simplaret: package retrieval tool - - createpkg: donwload, compile and package creationg script based on http://slack.sarava.org/slackbuilds - -Simplepkg configs are placed at /etc/simplepkg. Templates are .template files containing an one-by-line -package list. A template can be something like this: - - aaa_base - aaa_elflibs - apache - bash - bin - coreutils - findutils - -Slackware's tagfile format can be used too as a template. - -Installation ------------- - -The latest version of simplepkg is locate at http://slack.sarava.org/packages/noarch/. -Install it with the usual way: - - installpkg simplepkg-VERSION-noarch-BUILD.tgz - -If you have a working swaret on your system, add this line on you swaret.conf: - - REPOS_ROOT=SlackMidiataticaNoarch%http://slack.sarava.org/packages/noarch - -and then issue those commands: - - swaret --update - swaret --install simplepkg - -Configuration -------------- - -As an example, we'll create a jail based on the packages installed in your slackware -system. Edit the config file /etc/simplepkg/simplepkg.conf: - - # /etc/simplepkg/simplepkg.conf - JAIL_ROOT="/vservers" # where jails are placed - SIMPLARET="simplaret" # package grabber program (can be swaret if you have it installed) - SIMPLARET_CLEAN="1" # clean package cache before installation - SIMPLARET_DELETE_DOWN="1" # clean package cache after the installation - SIMPLARET_UPDATE="0" # issue an simplaret --update before install the jail - SIMPLARET_PURGE_WEEKS="N" # delete packages older than N weeks from the cache - PATCHES_DIR="/storage/package/patches" # where patches are placed - DEFAULT_ARCH="i386" - DEFAULT=VERSION="10.2" - STORAGE="/storage/packages" # where simplepkg store packages - PASSIVE_FTP="1" - -You should also put in /etc/simplepkg/repos.conf all package repositories you use, like this: - - ROOT-i386="http://slack.sarava.org/packages/slackware" - REPOS-i386="slack-sarava%http://slack.sarava.org/packages/slackware/slackware-10.2/" - ROOT-x86_64-10.2="http://darkstar.ist.utl.pt/pub/slamd64/" - REPOS-x86_64-10.2="slamd-sarava%http://slack.sarava.org/packages/slamd64/slamd64-10.2/" - -Instead of simplaret you can use swaret to fetch packages and them your swaret.conf must -be configured to use the same place as STORAGE to the package cache. In this case you cant -keep installations and jails with multiple arquitetures and for that reason the use of -simplaret is recommended. - -Creating jails and replicating installations --------------------------------------------- - - templatepkg my-slackare - mkjail jail my-slackware - -The previous commands creates a template called my-slackware from based on your installed -softwares listed in /var/log/packages and then creates a completely new slackware -tree with all those packages in the folder /vservers/jail (depending on the value of JAIL_ROOT from -your simplepkg.conf). - -If you want that some config files get copied or some scripts executed after install this jail, -place in the folder /etc/simplepkg/my-slackware.d all your config files (preserving the file -system hierarchy, i.e, /etc/simplepkg/my-slackware/etc/apache/httpd.conf) and the scripts at -/etc/simplepkg/my-slackware.s/. The template vserver, which comes in the simplepkg package, has -an example script to use with mkjail. - -You can specify an alternative destination for your jail with a command like - - ROOT=/mnt mkjail hda2 my-slackware - -This does exactly what you think: installs slackware in /mnt/hda2 with exactly the same packages -you have on your system, replacing the need of the slackware installer! - -In case no template specified, mkjail uses the one called /etc/simplepkg/default.template. - -If you keep your jails in JAIL_ROOT with the same name as the template you used to create it, its -possible to use the command jail-update to copy all modifications made in the files which their -counterparts are placed at /etc/simplepkg/jail-name.d. Then you can copy all configuration files -you edited to the template folder and leave a crontab entry to everyday seek for changes and update -the template. When you issue the command - - jail-update - -all jails listed in /etc/simplepkg/jaillist are updated. This command also updates the package list -of the template. - -To add or remove packages from a template, you can just edit by hand the template file or use the -command templatepkg with the -a (append) flag, which adds just the new installed packages in the -template file. - -If you want to create a template from a jail, use - - templatepkg jail /vservers/jail - -Metapackages ------------- - -Another use for the templates is the creation of metapackegs: new users have lots of difficulties -to track dependencies when installing a software. Using a template containing the name of all -packages needed by some program allow users to easily install it through the command - - metapkg --install program-name - -This seems like swaret or slapt-get, with the only difference in the way metapkg deals with -dependence resolution. Slapt-get support the slack-required file, wich comes or not with the -package. Swaret has its own tool for dependence matching. - -Simplepkg doesn't wish to substitute those two dependence checking modes, but offer an alternate -way to distribute packages where dependences are resolved without an specific tool or a change -in the package itself. - -A metapackage, i.e, all installed packages from a template, can be removed with - - metapkg --remove program-name - -Upgrading jails ---------------- - -Both the main installation (your root system) and your jails are upgraded with the command -jail-upgrade: just adjust simplepkg.conf's PATCHES_DIR to where you store slackware patches -(that can be rsync'ed everyday) and do a - - jail-upgrade - -This will upgrade your main system and all jails living in JAIL_ROOT. To specify another -folder, use - - ROOT=/otherroot jail-upgrade - -If you want to upgrade just one specific jail, - - jail-upgrade jail-name - -To use a patches folder other than PATCHES_DIR, e.g when you have jails with different -slackware versions, use - - PATCHES=/alternative/patches/folder jail-upgrade jail-name - -Different archs and versions ----------------------------- - -Simplepkg was idealized to permit a template to create jails from any architecture and version -of a slackware-like system. Upgrading tasks also are unified. This feature just works if you -use simplaret and not swaret as the package retrieval tool. - -As another example, to create an slack 10.1 installation (assuming your /etc/simplepkg/repos.conf with -the right configuration), just type - - VERSION=10.1 mkjail my-jail server-template - -Different archs can be used too. If you have a x86_64 system and wants to install a slack 10.2 -in a partition, try something like - - ARCH=i386 VERSION=10.2 ROOT=/mnt mkjail hda2 my-slackware - -Note that the templates are arch and version independent, as they just contain package names, -configuration files and scripts. For this reason, the commands templatepkg, metapkg, lspkg and -jail-update can be used normaly. - -To upgrade jails with othes archs and versions, jail-upgrade checks this information through -/etc/slackware-version for each jail and applies the correspondent patches grabed from -simplaret (see the proper documentation). - -By this way, doesn't matter which versions and archs each of your jails has, jail-upgrade remains -the same since your patches are sorted by arch an version, as explained in simplaret documentation -found at http://slack.sarava.org/node/17. - -Auxiliar applications: rebuildpkg and createpkg ------------------------------------------------ - -Simplepkg comes with an additional helper tool that recover installed packages which the original -.tgz file was lost. The command rebuildpkg rebuilds a package from their entry in /var/log/packages. -As an example, - - rebuildpkg coreutils - -rebuilds the coreutils package using the files, scripts and metainformations stored in -/var/log/packages/ and /var/log/scripts/. - -If you want to build you own packages using the scripts available from http://slack.sarava.org/slackbuilds, -use the createpkg script: - - createpkg package-name - -Source ------- - -Source code for simplepkg and its package builder can be fetched via subversion: - - svn checkout svn://slack.sarava.org/simplepkg - +See doc/README for more information. +Portuguese documentation at doc/README.pt_BR diff --git a/README.pt_BR b/README.pt_BR deleted file mode 100644 index 4e814de..0000000 --- a/README.pt_BR +++ /dev/null @@ -1,254 +0,0 @@ -Simplepkg: gerenciamento de instalações e metapacotes ------------------------------------------------------ - -Autor: Silvio Rhatto -Licença: GPL - -O simplepkg é um sistema de gerenciamento de pacotes que roda sobre o pkgtool. -Ele trabalha com templates -- listas com pacotes instalados, scripts e arquivos de configuração --- permitindo criar perfis de instalação que podem ser então usados para instalar o sistema numa -outra partição, criar um chroot específico ou até trabalhar com o conceito de metapacotes: uma -lista de pacotes que pode ser instalada e removida com apenas um comando. - -Documentação ------------- - -A documentação mais atualizada do simplepkg está em http://slack.sarava.org/node/12 - -Descrição ---------- - -Todas as distribuições de GNU/Linux já tem algum sistema de empacotamento amadurecido. A questão -agora é a praticidade de instalar e controlar o que está instalado, tanto pacotes como arquivos -de configuração de uma máquina. - -Imagine por exemplo se você precisa manter uma lista de pacotes de 200 máquinas slackware, sendo -que algumas são usadas como desktop, outras como servidores web, alguma sendo o servidor de email -e assim por diante. Imagine agora que você perca o disco de algumas dessas máquinas ou que precise -cotidianamente reinstalar ou atualizar um sistema. - -Usar o cd de instalação do slackware e configurar na mão toda a vez que der um pau faria com que -você ficasse louco/a e desperdiçasse muito tempo, além do que sempre ocorre de esquecermos algum -detalhe ou pacote durante a configuração do sistema. Manter um backup completo de cada máquina, -por outro lado, pode ser muito custoso se o número delas for muito grande. - -O simplepkg permite que você mantenha um template para cada grupo de máquinas e com apenas um -comando instalar o template numa partição. Além do template, você precisa configurar o simplepkg -para obter pacotes de um repositório local ou remoto. - -Gerenciar instalações e metapacotes não é tudo o que o simplepkg faz. Ele pode ser usado até na -criação de vservers. - -Arquitetura ------------ - -O simplepkg é um conjunto de scripts escritos com a filosofia KISS em mente. Ele é um sistema muito -simples, composto pelos seguintes comandos: - - - mkjail: constrói uma jaula/instalação de slackware numa pasta - - metapkg: instala ou remove um metapacote - - templatepkg: criar ou adiciona pacotes a um template - - lspkg: lista pacotes instalados - - jail-upgrade: faz o upgrade nas jaulas - - rebuildpkg: reconstrói um pacote a partir de sua entrada no /var/log/packages - - simplaret: obtém pacotes de repositórios locais ou remotos - - createpkg: baixa, compila e empacota software de acordo com http://slack.sarava.org/slackbuilds - -A pasta de configuração e armazenamento de templates é a /etc/simplepkg. Templates são arquivos contendo -uma lista de pacotes, um pacote por linha e com a extensão .template. Como exemplo, um template poderia se -chamar minimo.template e conter a seguinte lista: - - aaa_base - aaa_elflibs - apache - bash - bin - coreutils - findutils - -Se você quiser também é possível usar um tagfile do slackware como template, sem nem precisar editá-lo. - -Instalando o simplepkg ----------------------- - -Para baixar o pacote do simplepkg, vá em http://slack.sarava.org/packages/noarch/. - - installpkg simplepkg-VERSAO-noarch-BUILD.tgz - -Alternativamente, se você está com o swaret instalado, adicione em seu swaret.conf a linha - - REPOS_ROOT=SlackMidiataticaNoarch%http://slack.sarava.org/packages/noarch - -e então digite - - swaret --update - swaret --install simplepkg - -Configurando o simplepkg ------------------------- - -Como exemplo, vamos criar uma jaula baseada nos pacotes instalados no seu slackware. Edite o -arquivo /etc/simplepkg/simplepkg.conf: - - # /etc/simplepkg/simplepkg.conf - JAIL_ROOT="/vservers" # local onde as jaulas serão criadas - SIMPLARET="simplaret" # programa que baixa os pacotes (pode ser o swaret se voce o tiver) - STORAGE="/var/simplaret" # local onde o simplepkg armazena seus pacotes - SIMPLARET_CLEAN="1" # apaga o cache de pacotes antes da instalação da jaula - SIMPLARET_DELETE_DOWN="1" # apaga o cache de pacotes após a instalação - SIMPLARET_UPDATE="0" # atualiza as listas de pacotes antes de iniciar a instalação da jaula - SIMPLARET_PURGE_WEEKS="N" # apaga os pacotes do cache mais velhos que N semanas antes de instalar - PATCHES_DIR="/var/simplaret/patches" # local os patches são armazenados - DEFAULT_ARCH="i386" - DEFAULT=VERSION="10.2" - STORAGE="/storage/packages" # where simplepkg store packages - PASSIVE_FTP="1" - -Para definir quais repositórios de pacotes você usará, edite o arquivo /etc/simplepkg/repos.conf, -colocando algo como - - ROOT-i386="http://slack.sarava.org/packages/slackware" - REPOS-i386="slack-sarava%http://slack.sarava.org/packages/slackware/slackware-10.2/" - ROOT-x86_64-10.2="http://darkstar.ist.utl.pt/pub/slamd64/" - REPOS-x86_64-10.2="slamd-sarava%http://slack.sarava.org/packages/slamd64/slamd64-10.2/" - -Para informações detalhadas sobre o simplaret, consulte seu artigo específico em http://slack.sarava.org/node/16 - -Se você quer utilizar o swaret em lugar do simplaret, o swaret.conf deve estar bem configurado para que ele -seja capaz de baixar e instalar todos os pacotes dos templates. Parâmetros como EXCLUDE podem ser um empecilho, -e se você os remover da sua instalação tenha muito cuidado ao atualizar o seu sistema via swaret --upgrade. -A desvantagem de usar o swaret é que você não terá como administrar jaulas e instalações de múltiplas arquiteturas. - -Criando jaulas e replicando instalações ---------------------------------------- - - templatepkg meu-slackware - mkjail jaula meu-slackware - -Isso cria o template meu-slackware a partir da sua lista de pacotes em /var/log/packages e cria uma nova árvore -com esses pacotes na pasta /vservers/jaula (dependendo de qual o valor da variável JAIL_ROOT do simplepkg.conf, é claro). - -Se você quiser que alguns arquivos de configuração e executar scripts após a instalação dessa jaula, basta colocarmos na -pasta /etc/simplepkg/meu-slackware.d/ os arquivos de configuração (dentro da hierarquia de pastas do sistema, isto é, -/etc/simplepkg/meu-slackware.d/etc/apache/httpd.conf) e os script em /etc/simplepkg/meu-slackware.s/. O template vserver, -que já vem no mkjail contém um exemplo de script. - -Você pode especificar também destinos alternativos para sua jaula, através de um comando do tipo - - ROOT=/mnt mkjail hda2 meu-slackware - -O comando acima faz exatamente o que você está pensando: replica sua instalação slackware em /mnt/hda2, dispensando -totalmente o programa de instalação do slackware! - -Caso nenhum template for especificado, o mkjail utiliza o template /etc/simplepkg/default.template. - -Se você manter uma jaula em JAIL_ROOT com o mesmo nome que um template, é possível ainda usar o script jail-update -para copiar todas as alterações de arquivos da jaula na pasta de arquivos do seu template (/etc/simplepkg/nome-da-jaula.d). -Assim, basta que você copie todos os arquivos de configuração que você editou para essa pasta e deixar o jail-update numa -crontab para que você tenha sempre um template atualizado e baseado nas jaulas / instalações que você tem rodando e que -estiverem listadas no arquivo /etc/simplepkg/jailist: - - jail-update - -Para adicionar ou remover pacotes de um template, basta editar o arquivo de template. Uma outra forma de adicionar -arquivos é usando o templatepkg com a opção -a, que adiciona apenas novos pacotes ao template. Se você quiser que o -templatepkg crie um template a partir de uma jaula, simplesmente use - - templatepkg jaula /vservers/jaula - -Metapacotes ------------ - -Outro uso dos templates é a criação de pacotes: imagine por exemplo a dificuldade de um usuário/a novo de slackware -para instalar o cinelerra e todas as suas dependências. Criando um template contendo o nome de todos os pacotes -necessários para rodar esse software permite que um usuário instale-o simplesmente com o comando - - metapkg --install cinelerra - -O comando sugere uma semelhança com o uso direto do swaret ou do slapt-get, com a única diferença residindo no -modo como cada um desses programas lida com as dependências de um pacote. Os slapt-get suporta o arquivo -slack-required, que pode ou não estar presente no pacote. Já o swaret possui uma ferramenta própria para a -criação de uma lista de dependências. - -O simplepkg não pretende substituir esses dois modos de checagem e sim propor uma alternativa de distribuição -de pacotes em que as dependências são resolvidas sem precisar de um repositório de dependências ou uma modificação -no próprio pacote, que é o caso do slack-required, um arquivo que na maioria das vezes não está presente. - -A remoção de um aplicativo e todas as suas dependências podem ser feitas simplesmente com o comando - - metapkg --remove cinelerra - -Upgrade de jaulas ------------------ - -O upgrade de jaulas que estejam em JAIL_ROOT pode ser efetuado com o comando jail-upgrade. Simplesmente coloque -os patches em PATCHES_DIR e dê o comando - - jail-upgrade - -Se você quiser atualizar apenas uma das jaulas que estão em JAIL_ROOT, use - - jail-upgrade nome-da-jaula - -Para especificar uma pasta contendo patches diferente de PATCHES_DIR (útil quando você possui jaulas com -diferentes versões do slackware), simplesmente use - - PATCHES=/local/dos/patches jail-upgrade nome-da-jaula - -De modo análogo ao mkjail, é possível indicar ao jail-upgrade uma outra pasta onde a jaula está armazenada: - - ROOT=/otherroot jail-upgrade - -Arquiteturas e versões diferentes ---------------------------------- - -O simplepkg foi idealizado para permitir que um mesmo template possa ser usado para criar jaulas de -arquiteturas e versões diferentes de sistemas padrão slackware. A atualização desses sistemas também -é unificada. Essa possibilidade só é permitida se você usa o simplaret e não o swaret como ferramenta -de obtenção de pacotes. - -Por exemplo, para criar uma instalação de slackware 10.1 (assumindo que suas definições de repositórios -do /etc/simplepkg/repos.conf contenham locais com slack 10.1), basta usar o comando - - VERSION=10.1 mkjail minha-jaula template-servidor - -Arquiteturas diferentes também podem ser usadas. Se você está num sistema x86_64 e quer instalar um -slack 10.2 numa partição, experimente - - ARCH=i386 VERSION=10.2 ROOT=/mnt mkjail hda2 meu-slackware - -Note que os templates independem de arquitetura e versão, já que eles só contém nomes de pacotes, -arquivos de configuração e scripts. Por isso, o templatepkg, o metapkg, o lspkg e o jail-update -funcionam normalmente. - -Para atualizar suas jaulas, o jail-upgrade checa antes qual a versão e arquitetura de cada uma -de suas jaulas através do /etc/slackware-version correspondente e a partir disso aplica os patches -da arquitetura e versão da mesma, usando para isso o simplaret (veja a documentação própria). - -Desse modo, mesmo que você tenha jaulas de versões e arquiteturas diversas, usar o comando "jail-upgrade" -faz a atualização sem problemas, desde que seus patches estejam organizados por arquitetura e versão, -conforme é detalhado na documentação do simplaret, em http://slack.sarava.org/node/16. - -Aplicativos auxiliares: rebuildpkg e createpkg ----------------------------------------------- - -O simplepkg acompanha ainda um aplicativo auxiliar que ajuda a recuperar pacotes instalados cujo tgz original -foi perdido. O comando rebuildpkg reconstrói um pacote a partir de uma entrada no /var/log/packages. O comando - - rebuildpkg coreutils - -reconstrói um pacote do coreutils usando os arquivos e as metainformações listadas no arquivo -do /var/log/packages/ correspondente ao coreutils. - -Se você quiser construir seus próprios pacotes baseados nos slackbuilds disponíveis em -http://slack.sarava.org/slackbuilds, basta utilizar o createpkg: - - createpkg nome-do-pacote - -Fonte ------ - -Se você quiser obter diretamente o código-fonte do simplepkg, baixe-o do repositório: - - svn checkout svn://slack.sarava.org/simplepkg - diff --git a/README.simplaret b/README.simplaret deleted file mode 100644 index ce7efbd..0000000 --- a/README.simplaret +++ /dev/null @@ -1,143 +0,0 @@ -simplaret: simplepkg retrieval tool ------------------------------------ - -Simplaret is a simplepkg tool used to download packages from local and remote repositories. -With simplaret, one can grab packages for all archictectures and versions of slackware-like -distributions that follows the mirror guidelines, allowing an easy management all -jails and slackware installations in a machine, no matter wich arquiteture or version -each one has. - -It was inspired in swaret behavior but don't tries to get its complexity level, but -execute package download in a different way, where the local repository is organized -by archictecture and version. It can also search for packages. - -Documentation -------------- - -The always updated english documentation is hosted at http://slack.sarava.org/node/17 - -Downloading and installing --------------------------- - -Simplaret comes with simplepkg, wich installation and configuration is detailed -at http://slack.sarava.org/node/15. Simplaret uses /etc/simplepkg/simplepkg.conf for -its definitions and /etc/simplepkg/repos.conf for repository information. - -Repository organization ------------------------ - -Simplaret local storage folder is defined through STORAGE parameter and is organized -in this manner: - - $STORAGE/arch/version/ - -Packages from contributed repositories (i.e, not from an official distro mirror) are -stored at - - $STORAGE/arch/version/repository-name/ - -This means, for example, that slack 10.2 packages are located in - - $STORAGE/i386/10.2/ - -And the slack.sarava.org's slamd64 packages can be stored in a place such as - - $STORAGE/x86_64/10.2/slack.sarava.org/ - -In the repository definition file (/etc/simplepkg/repos.conf), the entries must match -the following schema, something that remembers a swaret.conf: - - ROOT-i386="http://slack.sarava.org/slackware/" - ROOT-x86_64="http://ftp.heanet.ie/pub/slamd64/" - REPOS-i386-10.2="slack.sarava.org%http://slack.sarava.org/packages/slackware/slackware-10.2/" - REPOS-x86_64-10.2="slack.sarava.org%http://slack.sarava.org/packages/slamd64/slamd64-10.2/" - -Repositories defined as ROOT are those wich - - - Have packages from the official distro or - - Are organized by version according to the mirror guidelines - -Repositories defined as REPOS are those containing packages from a specific version or -non-oficial packages. - -When simplaret searches for a package, precedence is given first for ROOT definitions and then -for REPOS ones. REPOS definitions should also include a identification name, delimited from -the repository URL by the special sign %. - -Fetching the package list -------------------------- - -After configured, simplaret can fetch the package list with - - simplaret --update - -This updates the package list from arch defined in DEFAULT_ARCH and version from DEFAULT_VERSION. -To fetch package listings for x86_64 (slamd64) and version 10.2, use - - ARCH=x86_64 VERSION=10.2 simplaret --update - -Searching ---------- - -To search for a package, use the following commands as examples: - - simplaret --search coreutils - -for a Slack/390 package, - - ARCH=s390 simplaret --search x11 - -for slack 10.1 with contributed i686 packages, - - ARCH=i686 VERSION=10.1 simplaret --search icecast - -Downloading ------------ - -To download a package, - - simplaret --get icecast - -Simplaret downloads the first package found with the precedence explaned above. -Future versions should contain an option to explicit get a package from a -specific repository. - -Downloading patches -------------------- - -From the PATCHES_DIR parameter is possible to specify a folder where patches are -placed, sorted by arch and version. - -Patches for slack 10.2 are always located at - - $PATCHES_DIR/i386/10.2/ - -In reality, patches are downloaded with a "simplaret --get" and stored in the $STORAGE -subfolder for its arch and version and a symlink is created in $PATCHES_DIR/$ARCH/$VERSION. - -To grab all patches from an arch and version, use - - ARCH=architecture VERSION=version simplaret --get-patches - -Purging the cache ------------------ - -Simplaret cache from an arch and version can be purged with a - - simplaret --purge - -But why use that? ------------------ - -You may ask why someone wishes to use such tool. - -Simplaret was written with a *x86 environment in mind, where lots of jails with different archs -and versions are installed. Suppose a x86_64 with the following chroots installed: - - - slamd64 10.2 - - slackware 10.2 - - slackware 10.1 with additional i686 packages - - uSlack (i386 uClibc) - -Keep all this stuff update manually is really a headache. Simplaret just tries to make it trivial. - diff --git a/README.simplaret.pt_BR b/README.simplaret.pt_BR deleted file mode 100644 index 164294b..0000000 --- a/README.simplaret.pt_BR +++ /dev/null @@ -1,148 +0,0 @@ -simplaret: ferramenta para obtenção de pacotes ----------------------------------------------- - -O simplaret é a ferramenta do simplepkg utilizada para obter pacotes de repositórios locais -ou remotos. Com ele, você pode não só baixar pacotes do seu sistema slackware como também pode -baixar de qualquer versão ou arquitetura cujo repositório siga os mirror guidelines, permitindo -que você gerencie facilmente todas as suas jaulas e instalações de slackware, independentemente -da arquitetura ou versão que elas utilizem. - -Ele foi inspirado no comportamento do swaret mas não pretende de modo algum chegar no nível de -complexidade deste, mas sim executar a obtenção de pacotes de um modo diferente. Sua finalidade -é apenas baixar pacotes para que os aplicativos do simplepkg possam utilizá-lo posteriormente. -O simplaret ainda pode ser usado sozinho para procurar e baixar pacotes. - -Documentação ------------- - -A documentação atualizada do simplaret se encontra em http://slack.sarava.org/node/16 - -Obtendo e instalando --------------------- - -O simplaret acompanha o simplepkg e por isso sua instalação e configuração é dada no artigo dosimplepkg. -Ele utiliza o mesmo arquivo de configuração do simplepkg, o /etc/simplepkg/simplepkg.conf e guarda as -definições de repositórios em /etc/simplepkg/repos.conf. - -Organização do repositório --------------------------- - -O repositório de armazenamento local do simplaret é definido pelo parâmetro STORAGE e é organizado -da seguinte maneira: - - $STORAGE/arch/version/ - -Pacotes obtidos num repositório que não seja oficial da distribuição ficam em - - $STORAGE/arch/version/repository-name/ - -Isso quer dizer, por exemplo, que pacotes do slackware 10.2 ficariam em - - $STORAGE/i386/10.2/ - -e os pacotes obtidos a partir do repositório slamd64 do slack.sarava.org ficaria, por exemplo, em - - $STORAGE/x86_64/10.2/slack.sarava.org/ - -No arquivo de repositórios (/etc/simplepkg/repos.conf), as definições de repositório seguem o -seguinte esquema, semelhante ao formato de configuração do swaret: - - ROOT-i386="http://slack.sarava.org/slackware/" - ROOT-x86_64="http://ftp.heanet.ie/pub/slamd64/" - REPOS-i386-10.2="slack.sarava.org%http://slack.sarava.org/packages/slackware/slackware-10.2/" - REPOS-x86_64-10.2="slack.sarava.org%http://slack.sarava.org/packages/slamd64/slamd64-10.2/" - -Repositórios definidos como ROOT são aqueles que - - - Possuem pacotes da distribuição oficial ou - - Estão organizados por versão, de acordo com os mirror guidelines - -Já os repositórios definidos como REPOS são aqueles que contém pacotes para uma versão específica e/ou -que são não-oficiais. - -Quando o simplaret busca ou obtém um pacote, a precedência pelos repositórios é dada às definições de -ROOT e em seguinda às de REPOS. As definições REPOS ainda devem possuir, além da URL do repositório, um -nome para identificá-lo, sendo que esses dois campos são separados por um delimitador. - -Baixando as listas de pacotes ------------------------------ - -Após configurá-lo, é preciso atualizar a lista de pacotes: - - simplaret --update - -Isso atualiza a lista de pacotes da arquitetura definida em DEFAULT_ARCH e da versão DEFAULT_VERSION -apenas. Se você quiser forçar a atualização, por exemplo, para a arquitetura x86_64 (slamd64) -e versão 10.2, basta - - ARCH=x86_64 VERSION=10.2 simplaret --update - -Buscando pacotes ----------------- - -Para buscar um pacote, esses comandos servem de exemplo: - - simplaret --search coreutils - -pacote para o Slack/390, - - ARCH=s390 simplaret --search x11 - -e para slackware 10.1 com pacotes adicionais em i686, - - ARCH=i686 VERSION=10.1 simplaret --search icecast - -Baixando um pacote ------------------- - -Para baixar um pacote: - - simplaret --get icecast - -O simplaret baixa o primeiro pacote na ordem de precedência dos repositórios. -Versões futuras deverão conter uma opção que force a obtenção do pacote de um -repositório específico. - -Baixando patches ----------------- - -Através do parâmetro de configuração PATCHES_DIR é possível especificar uma pasta -onde os patches de cada distribuição serão armazenados, organizados também por arquitetura. - -Por exemplo, patches do slackware 10.2 ficarão sempre em - - $PATCHES_DIR/i386/10.2/ - -Os patches na verdade são baixados através de um "simplaret --get" e armazenados na subpasta -de $STORAGE correspondente e apenas um link simbólico é mantido em $PATCHES_DIR/$ARCH/$VERSION. - -Para baixar os patches, use uma chamada do tipo - - ARCH=arquitetura VERSION=versao simplaret --get-patches - -E os patches dessa arquitetura e versão serão baixados. - -Apagando pacotes ----------------- - -O repositório de pacotes de uma arquitetura e versão pode ser apagado com o comando - - simplaret --purge - -Mas pra quê serve isso? ------------------------ - -Você pode estar se perguntando: quem utilizaria uma ferramenta que baixa pacotes de várias arquiteturas? - -O simplaret foi escrito tendo em mente um ambiente *86 onde várias jaulas de diferentes arquiteturas estão -instaladas. Suponha por exemplo uma máquina x86_64 que possua as seguintes jaulas: - - - slamd64 10.2 - - slackware 10.2 - - slackware 10.1 com pacotes adicionais em i686 - - uSlack (uClibc para i386) - -O condenado/a em questão que roda todas essas jaulas, pelos mais diversos motivos, pode ter uma grande dor -de cabeça para manter os pacotes em ordem de forma manual. Com o simplaret e eventualmente com o simplepkg, -a tarefa se torna trivial. - diff --git a/TODO b/TODO deleted file mode 100644 index 9178f6e..0000000 --- a/TODO +++ /dev/null @@ -1,5 +0,0 @@ -simplepkg todo list -------------------- - -TODO list at http://slack.sarava.org/wiki/Main/SimplePKG - diff --git a/common.sh b/common.sh deleted file mode 100644 index af31da3..0000000 --- a/common.sh +++ /dev/null @@ -1,180 +0,0 @@ -#!/bin/bash -# -# common.sh: common functions for simplepkg -# feedback: rhatto at riseup.net | gpl -# -# Uses some functions from pkgtools, which license is: -# -# Copyright 1999 Patrick Volkerding, Moorhead, Minnesota, USA -# Copyright 2001, 2002, 2003 Slackware Linux, Inc., Concord, California, USA -# All rights reserved. -# -# Redistribution and use of this script, with or without modification, is -# permitted provided that the following conditions are met: -# -# 1. Redistributions of this script must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED -# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -BASE_CONF="/etc/simplepkg" -CONF="$BASE_CONF/simplepkg.conf" -JAIL_LIST="$BASE_CONF/jailist" - -# pkgtool stuff -function package_name { - STRING=`basename $1 .tgz` - # Check for old style package name with one segment: - if [ "`echo $STRING | cut -f 1 -d -`" = "`echo $STRING | cut -f 2 -d -`" ]; then - echo $STRING - else # has more than one dash delimited segment - # Count number of segments: - INDEX=1 - while [ ! "`echo $STRING | cut -f $INDEX -d -`" = "" ]; do - INDEX=`expr $INDEX + 1` - done - INDEX=`expr $INDEX - 1` # don't include the null value - # If we don't have four segments, return the old-style (or out of spec) package name: - if [ "$INDEX" = "2" -o "$INDEX" = "3" ]; then - echo $STRING - else # we have four or more segments, so we'll consider this a new-style name: - NAME=`expr $INDEX - 3` - NAME="`echo $STRING | cut -f 1-$NAME -d -`" - echo $NAME - fi - fi -} - -function install_packages { - - if [[ "$SIMPLARET_CLEAN" == "1" ]]; then - ARCH=$ARCH VERSION=$VERSION $SIMPLARET --purge - elif [[ ! -z "$SIMPLARET_PURGE_WEEKS" ]] && [[ "$SIMPLARET_PURGE_WEEKS" != "0" ]]; then - ARCH=$ARCH VERSION=$VERSION $SIMPLARET --purge -w $SIMPLARET_PURGE_WEEKS - fi - - for pack in `cat $TEMPLATE | grep -v -e "^#" | cut -d : -f 1`; do - package_downloaded="0" - if [ "$SIMPLARET" == "simplaret" ]; then - extrafolder="$ARCH/$VERSION/" - else - unset extrafolder - fi - for file in `find $STORAGE/$extrafolder -name $pack*tgz`; do - if [[ "`package_name $file`" == "$pack" ]]; then - package_downloaded="1" - package_file="$file" - break - fi - done - if [[ "$package_downloaded" != "1" ]]; then - ARCH=$ARCH VERSION=$VERSION $SIMPLARET --get $pack -a - for file in `find $STORAGE/$extrafolder -name $pack*tgz`; do - if [[ "`package_name $file`" == "$pack" ]]; then - package_file="$file" - break - fi - done - fi - if [ -z "$package_file" ]; then - echo error: could not install package $pack - else - installed_packs="`ls /$JAIL_ROOT/$server/var/log/packages/$pack* 2> /dev/null`" - if [ ! -z "$installed_packs" ]; then - for installed in $installed_packs; do - if [[ "$pack" == "`package_name $installed.tgz`" ]]; then - echo "package $pack already installed in $JAIL_ROOT/$server ($installed)" - package_installed="1" - break - fi - if [[ "$package_installed" != "1" ]]; then - installpkg -root /$JAIL_ROOT/$server $package_file - unset package_installed - if [ ! -z "$SIMPLARET_DELETE_DURING" ] && [ "$SIMPLARET_DELETE_DURING" != "0" ]; then - SILENT=1 ARCH=$ARCH VERSION=$VERSION $SIMPLARET --purge - fi - break - fi - done - else - installpkg -root /$JAIL_ROOT/$server $package_file - if [ ! -z "$SIMPLARET_DELETE_DURING" ] && [ "$SIMPLARET_DELETE_DURING" != "0" ]; then - SILENT=1 ARCH=$ARCH VERSION=$VERSION $SIMPLARET --purge - fi - fi - fi - unset package_file - done - if [[ "$SIMPLARET_DELETE_DOWN" == "1" ]]; then - ARCH=$ARCH VERSION=$VERSION $SIMPLARET --purge - fi -} - -function remove_packages { - for pack in `cat $TEMPLATE | grep -v -e "^#" | cut -d : -f 1`; do - ROOT=/$JAIL_ROOT/$server removepkg $pack - done -} - -function eval_config { - if [ -f "$CONF" ]; then - source $CONF - else - echo $1 error: config file $CONFIG not found - exit 1 - fi - - if [ -z "$SIMPLARET" ]; then - SIMPLARET="simplaret" - fi - - if [ -z "$STORAGE" ]; then - if [ -d "/var/$SIMPLARET" ]; then - STORAGE="/var/$SIMPLARET" - else - echo error: please adjust value for STORAGE at $CONF - exit 1 - fi - fi - - if [ ! -z "$ROOT" ]; then - JAIL_ROOT="$ROOT" - elif [ -z "$JAIL_ROOT" ]; then - echo error: please adjust value for JAIL_ROOT at $CONF - exit 1 - fi - - if [ -z "$ARCH" ]; then - ARCH="$DEFAULT_ARCH" - fi - - if [ -z "$VERSION" ]; then - VERSION="$DEFAULT_VERSION" - fi - - if which $SIMPLARET &> /dev/null; then - if [[ "$SIMPLARET_UPDATE" == "1" ]]; then - if [[ "$2" == "-u" ]]; then - echo "updating package database..." - ARCH=$ARCH VERSION=$VERSION $SIMPLARET --update - fi - fi - else - echo "$SIMPLARET not found, please install it before run $0" - fi - - if [ -z "PATCHES_DIR" ]; then - echo error: please adjust a value for PATCHES_DIR at $CONF - fi -} - diff --git a/conf/repos.conf.new b/conf/repos.conf.new new file mode 100644 index 0000000..274e1c7 --- /dev/null +++ b/conf/repos.conf.new @@ -0,0 +1,9 @@ +# repositories definitions +#ROOT-i386="http://slackware.cs.utah.edu/" +ROOT-i386="http://slack.sarava.org/slackware/" +ROOT-x86_64="http://ftp.heanet.ie/pub/slamd64/" +REPOS-i386-10.2="slack.sarava.org%http://slack.sarava.org/packages/slackware/slackware-10.2/" +REPOS-i386-10.2="slack.sarava.org-noarch%http://slack.sarava.org/packages/noarch/" +REPOS-x86_64-10.2="slack.sarava.org%http://slack.sarava.org/packages/slamd64/slamd64-10.2/" +REPOS-x86_64-10.2="slack.sarava.org-noarch%http://slack.sarava.org/packages/noarch/" + diff --git a/conf/simplepkg.conf.new b/conf/simplepkg.conf.new new file mode 100644 index 0000000..2b9e165 --- /dev/null +++ b/conf/simplepkg.conf.new @@ -0,0 +1,14 @@ +# /etc/simplepkg/simplepkg.conf +JAIL_ROOT="/vservers" # where jails are placed +SIMPLARET="simplaret" # package grabber program (can be swaret if you have it installed) +SIMPLARET_CLEAN="1" # clean package cache before installation +SIMPLARET_DELETE_DOWN="1" # clean package cache after the installation +SIMPLARET_UPDATE="0" # issue an simplaret --update before install the jail +SIMPLARET_PURGE_WEEKS="3" # delete packages older than N weeks from the cache +SIMPLARET_DELETE_DURING="0" # delete each package rigth after its installation +PATCHES_DIR="/var/simplaret/patches" # where patches are placed +DEFAULT_ARCH="i386" +DEFAULT_VERSION="10.2" +STORAGE="/var/simplaret/packages" +PASSIVE_FTP="1" + diff --git a/createpkg b/createpkg deleted file mode 100644 index 0faa82d..0000000 --- a/createpkg +++ /dev/null @@ -1,182 +0,0 @@ -#!/bin/bash -# -# createpkg: package builder using http://slack.sarava.org/slackbuilds scripts -# feedback: rhatto at riseup.net | gpl -# -# createpkg is free software; you can redistribute it and/or modify it under the -# terms of the GNU General Public License as published by the Free Software -# Foundation; either version 2 of the License, or any later version. -# -# createpkg is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR -# A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., 59 Temple -# Place - Suite 330, Boston, MA 02111-1307, USA -# -# /etc/simplepkg/slackbuildrc parameters: -# -# SLACKBUILDS="/folder/to/place/slackbuilds", defaults to /var/slackbuilds -# SVN="svn://repository", defaults do svn://slack.sarava.org/slackbuilds -# SYNC="yes|no", whether to always update the repository -# - -COMMON="/usr/libexec/simplepkg/common.sh" -SLACKBUILDRC="/etc/slackbuildrc" - -if [ -f "$COMMON" ]; then - source $COMMON -else - echo "error: file $COMMON found, check your `basename $0` installation" - exit 1 -fi - -function safe_exit { - - # exit codes - case $1 in - 2) echo Could not create folder $2;; - 3) echo Could not update the repository $2 ;; - 4) usage ;; - 5) echo Script not found;; - *) exit 1 - esac - - exit $1 - -} - -function build_repo { - - BASEDIR="`dirname $SLACKBUILDS`" - mkdir -p $BASEDIR || safe_exit 2 $BASEDIR - cd $BASEDIR - svn checkout $SVN - cd $SLACKBUILDS - -} - -function usage { - - echo "usage: createpkg [--install] package-name" - echo " createpkg --search package-name" - echo " createpkg --sync" - -} - -function check_config { - - if [ -f "$SLACKBUILDRC" ]; then - source $SLACKBUILDRC - fi - - TMP=${TMP:=/tmp} - REPOS=${REPOS:=$TMP} - SLACKBUILDS=${SLACKBUILDS:=/var/slackbuilds} - SVN=${SVN:=svn://slack.sarava.org/slackbuilds} - SYNC=${SYNC:=no} - BASEDIR="`dirname $SLACKBUILDS`" - -} - -function solve_dep { - - # TODO: solve dep with version checking - - pack="$1" - for candidate in `ls /var/log/packages/$pack* 2> /dev/null`; do - candidate="`package_name $candidate`" - if [ "$pack" == "$candidate" ]; then - found="1" - break - fi - done - - if [ "$found" != "1" ]; then - createpkg --install $pack - fi - -} - -function check_repo { - - if [ ! -d "$SLACKBUILDS" ]; then - build_repo - fi - -} - -function sync_repo { - - cd $SLACKBUILDS - svn update || build_repo - -} - -function find_script { - - find $SLACKBUILDS | grep -v .svn | grep $1.SlackBuild - -} - -check_config -check_repo - -if [ -z "$1" ]; then - safe_exit 4 -elif [ "$1" == "--sync" ]; then - sync_repo - exit -elif [ "$1" == "--search" ]; then - find_script $2 - exit -elif [ "$1" == "--install" ]; then - PACKAGE="$2" - INSTALL="1" -else - PACKAGE="$1" -fi - -if [ "$SYNC" == "yes" ]; then - sync_repo -fi - -BUILD_SCRIPT="`find_script $PACKAGE`" - -if [ -z "$BUILD_SCRIPT" ]; then - safe_exit 5 -fi - -SCRIPT_BASE="`dirname $BUILD_SCRIPT`" - -if [ -f "$SCRIPT_BASE/$PACKAGE.slack-required" ]; then - SLACK_REQ="$SCRIPT_BASE/$PACKAGE.slack-required" -elif [ -f "$SCRIPT_BASE/slack-required" ]; then - SLACK_REQ="$SCRIPT_BASE/slack-required" -fi - -if [ ! -z "$SLACK_REQ" ]; then - - cat $SLACK_REQ | while read dep; do - dep="`echo $dep | sed -e 's/>=/equalorgreater/' -e 's/=/greater/' -e 's/=/equal/'`" - solve_dep $dep - done - -fi - -cd $SCRIPT_BASE -INTERACT=no ./`basename $BUILD_SCRIPT` - -VERSION="`grep -e '^VERSION=' $BUILD_SCRIPT | head -n 1 | sed -e "s/VERSION//g" -e 's/=//g' -e 's/-//g' | cut -d ":" -f 2 | cut -d "}" -f 1`" -BUILD="`grep -e '^BUILD=' $BUILD_SCRIPT | head -n 1 | sed -e "s/BUILD//g" -e 's/=//g' | cut -d ":" -f 2 | cut -d "}" -f 1`" -_ARCH="`grep -e '^ARCH' $BUILD_SCRIPT | head -n 1 | cut -d "=" -f 2 | sed -e 's/"//g'`" - -if [ "$_ARCH" == "noarch" ]; then - ARCH="noarch" -fi - -if [ "$INSTALL" == "1" ]; then - installpkg $REPOS/$PACKAGE-$VERSION-$ARCH-$BUILD.tgz -fi - diff --git a/doc/CHANGELOG b/doc/CHANGELOG new file mode 100644 index 0000000..847ec3b --- /dev/null +++ b/doc/CHANGELOG @@ -0,0 +1,56 @@ +simplepkg changelog +------------------- + +0.4.9pre2: re-organized the source repository + added createpkg + updated README and README.pt_BR + +0.4.8: simplaret: removed extra folder from slamd64 definition + and fixed a typo + +0.4.7: templatepkg bugfix on blank template lines and on package deletion + changed simplaret working dir in simplaret.conf.new + +0.4.6: small bugfix on jail-update that prevented template update + +0.4.5: vserver template update + +0.4.4: WARNING option on config file for simplaret + + SILENT env var, if a non-zero value, keeps simplaret + work silenty when purging and works like if WANRING is set + to not null. + + add SIMPLARET_DELETE_DURING config parameter: when set + to a non-zero value deletes each package rigth after its + installation + +0.4.3: openoffice.org template + +0.4.2: common.sh: fix on install_packages when handling + with similar package names + +0.4.1: templatepkg: fixed tagfiles and comment handling + +0.4: multi-plataform and version management + + now simplepkg supports jails with architectures and versions + others than the main system, read the docs for details. + + added simplaret: a small script for downloading packages + + jail-upgrade + + * arch checking via /etc/slackware-version on each jail + * supports multi-arch and multi-version repository + * integrated with simplaret + + common.sh: improved functions to support simplaret + +0.3.7-0.3.9: bugfix releases + +0.3.6: added "-u" option to eval_config to ask for a swaret --update + +0.3.5: "main" jail support for jail-update + +0.3.4: started changelog :) diff --git a/doc/COPYING b/doc/COPYING new file mode 100644 index 0000000..d60c31a --- /dev/null +++ b/doc/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/doc/README b/doc/README new file mode 100644 index 0000000..50b0e9d --- /dev/null +++ b/doc/README @@ -0,0 +1,258 @@ +Simplepkg: installation manager and metapackage system +------------------------------------------------------ + +Author: Silvio Rhatto +Licence: GPL + +Simplepkg is a non-intrusive package management system running on top of pkgtool. +It uses templates -- lists of installed packages, scripts and configuration files +-- allowing the creation of installation profiles that can be used do install a +complete and configured slackware system in another partition or to create chroot +environments. The same templating scheme extends slackware packaging system, adding +metapackages: a list of packages installed or removed with a single command. + +Documentation +------------- + + English documentation: README | http://slack.sarava.org/node/15 + Portuguese documentation: REAMDE.pt_BR | http://slack.sarava.org/node/12 + +Description +----------- + +All GNU/Linux distributions comes with a well developed packaging system. The question now +is how pratical is the way to install, configure and control any changes in a system. + +As an example, suppose you should keep a list of about 200 slackware machines, some +of them used as desktops, others as mail or webservers. If you lost some hardrives +or usually need to re-install or update some of those boxes. + +Using the slackware installation cd and configuring by hand all the time you got a crash +is a time loss activity and you'll never know if something remained missconfigured. An +alternative is to keep a complete backup of a machine or some parts of the tree, but for +a large number of different boxes this procedure costs a lots of resources. + +Simplepkg offers an alternative sollution for this and other problems related to installation +management, allowing you to keep templates of each machine and install a custom slackware +system with just one or a few commands. Creating and upgrading chroot and vservers is easy +with simplepkg. + +Architecture +------------ + +Simplepkg is a set of scripts wrote in the KISS philosophy. Its a pretty simple system, composed +by the following commands: + + - mkjail: build a slackware jail/installation in a folder + - metapkg: install or remove a metapackage + - templatepkg: create or update a package list of an installation template + - lspkg: show installed packages and its contents + - jail-upgrade: upgrade all or some of the jails/installations + - jail-update: update all configuration files of a template + - rebuildpkg: rebuild a package based on its /var/log/packages entry + - simplaret: package retrieval tool + - createpkg: donwload, compile and package creationg script based on http://slack.sarava.org/slackbuilds + +Simplepkg configs are placed at /etc/simplepkg. Templates are .template files containing an one-by-line +package list. A template can be something like this: + + aaa_base + aaa_elflibs + apache + bash + bin + coreutils + findutils + +Slackware's tagfile format can be used too as a template. + +Installation +------------ + +The latest version of simplepkg is locate at http://slack.sarava.org/packages/noarch/. +Install it with the usual way: + + installpkg simplepkg-VERSION-noarch-BUILD.tgz + +If you have a working swaret on your system, add this line on you swaret.conf: + + REPOS_ROOT=SlackMidiataticaNoarch%http://slack.sarava.org/packages/noarch + +and then issue those commands: + + swaret --update + swaret --install simplepkg + +Configuration +------------- + +As an example, we'll create a jail based on the packages installed in your slackware +system. Edit the config file /etc/simplepkg/simplepkg.conf: + + # /etc/simplepkg/simplepkg.conf + JAIL_ROOT="/vservers" # where jails are placed + SIMPLARET="simplaret" # package grabber program (can be swaret if you have it installed) + SIMPLARET_CLEAN="1" # clean package cache before installation + SIMPLARET_DELETE_DOWN="1" # clean package cache after the installation + SIMPLARET_UPDATE="0" # issue an simplaret --update before install the jail + SIMPLARET_PURGE_WEEKS="N" # delete packages older than N weeks from the cache + PATCHES_DIR="/storage/package/patches" # where patches are placed + DEFAULT_ARCH="i386" + DEFAULT=VERSION="10.2" + STORAGE="/storage/packages" # where simplepkg store packages + PASSIVE_FTP="1" + +You should also put in /etc/simplepkg/repos.conf all package repositories you use, like this: + + ROOT-i386="http://slack.sarava.org/packages/slackware" + REPOS-i386="slack-sarava%http://slack.sarava.org/packages/slackware/slackware-10.2/" + ROOT-x86_64-10.2="http://darkstar.ist.utl.pt/pub/slamd64/" + REPOS-x86_64-10.2="slamd-sarava%http://slack.sarava.org/packages/slamd64/slamd64-10.2/" + +Instead of simplaret you can use swaret to fetch packages and them your swaret.conf must +be configured to use the same place as STORAGE to the package cache. In this case you cant +keep installations and jails with multiple arquitetures and for that reason the use of +simplaret is recommended. + +Creating jails and replicating installations +-------------------------------------------- + + templatepkg my-slackare + mkjail jail my-slackware + +The previous commands creates a template called my-slackware from based on your installed +softwares listed in /var/log/packages and then creates a completely new slackware +tree with all those packages in the folder /vservers/jail (depending on the value of JAIL_ROOT from +your simplepkg.conf). + +If you want that some config files get copied or some scripts executed after install this jail, +place in the folder /etc/simplepkg/my-slackware.d all your config files (preserving the file +system hierarchy, i.e, /etc/simplepkg/my-slackware/etc/apache/httpd.conf) and the scripts at +/etc/simplepkg/my-slackware.s/. The template vserver, which comes in the simplepkg package, has +an example script to use with mkjail. + +You can specify an alternative destination for your jail with a command like + + ROOT=/mnt mkjail hda2 my-slackware + +This does exactly what you think: installs slackware in /mnt/hda2 with exactly the same packages +you have on your system, replacing the need of the slackware installer! + +In case no template specified, mkjail uses the one called /etc/simplepkg/default.template. + +If you keep your jails in JAIL_ROOT with the same name as the template you used to create it, its +possible to use the command jail-update to copy all modifications made in the files which their +counterparts are placed at /etc/simplepkg/jail-name.d. Then you can copy all configuration files +you edited to the template folder and leave a crontab entry to everyday seek for changes and update +the template. When you issue the command + + jail-update + +all jails listed in /etc/simplepkg/jaillist are updated. This command also updates the package list +of the template. + +To add or remove packages from a template, you can just edit by hand the template file or use the +command templatepkg with the -a (append) flag, which adds just the new installed packages in the +template file. + +If you want to create a template from a jail, use + + templatepkg jail /vservers/jail + +Metapackages +------------ + +Another use for the templates is the creation of metapackegs: new users have lots of difficulties +to track dependencies when installing a software. Using a template containing the name of all +packages needed by some program allow users to easily install it through the command + + metapkg --install program-name + +This seems like swaret or slapt-get, with the only difference in the way metapkg deals with +dependence resolution. Slapt-get support the slack-required file, wich comes or not with the +package. Swaret has its own tool for dependence matching. + +Simplepkg doesn't wish to substitute those two dependence checking modes, but offer an alternate +way to distribute packages where dependences are resolved without an specific tool or a change +in the package itself. + +A metapackage, i.e, all installed packages from a template, can be removed with + + metapkg --remove program-name + +Upgrading jails +--------------- + +Both the main installation (your root system) and your jails are upgraded with the command +jail-upgrade: just adjust simplepkg.conf's PATCHES_DIR to where you store slackware patches +(that can be rsync'ed everyday) and do a + + jail-upgrade + +This will upgrade your main system and all jails living in JAIL_ROOT. To specify another +folder, use + + ROOT=/otherroot jail-upgrade + +If you want to upgrade just one specific jail, + + jail-upgrade jail-name + +To use a patches folder other than PATCHES_DIR, e.g when you have jails with different +slackware versions, use + + PATCHES=/alternative/patches/folder jail-upgrade jail-name + +Different archs and versions +---------------------------- + +Simplepkg was idealized to permit a template to create jails from any architecture and version +of a slackware-like system. Upgrading tasks also are unified. This feature just works if you +use simplaret and not swaret as the package retrieval tool. + +As another example, to create an slack 10.1 installation (assuming your /etc/simplepkg/repos.conf with +the right configuration), just type + + VERSION=10.1 mkjail my-jail server-template + +Different archs can be used too. If you have a x86_64 system and wants to install a slack 10.2 +in a partition, try something like + + ARCH=i386 VERSION=10.2 ROOT=/mnt mkjail hda2 my-slackware + +Note that the templates are arch and version independent, as they just contain package names, +configuration files and scripts. For this reason, the commands templatepkg, metapkg, lspkg and +jail-update can be used normaly. + +To upgrade jails with othes archs and versions, jail-upgrade checks this information through +/etc/slackware-version for each jail and applies the correspondent patches grabed from +simplaret (see the proper documentation). + +By this way, doesn't matter which versions and archs each of your jails has, jail-upgrade remains +the same since your patches are sorted by arch an version, as explained in simplaret documentation +found at http://slack.sarava.org/node/17. + +Auxiliar applications: rebuildpkg and createpkg +----------------------------------------------- + +Simplepkg comes with an additional helper tool that recover installed packages which the original +.tgz file was lost. The command rebuildpkg rebuilds a package from their entry in /var/log/packages. +As an example, + + rebuildpkg coreutils + +rebuilds the coreutils package using the files, scripts and metainformations stored in +/var/log/packages/ and /var/log/scripts/. + +If you want to build you own packages using the scripts available from http://slack.sarava.org/slackbuilds, +use the createpkg script: + + createpkg package-name + +Source +------ + +Source code for simplepkg and its package builder can be fetched via subversion: + + svn checkout svn://slack.sarava.org/simplepkg + diff --git a/doc/README.pt_BR b/doc/README.pt_BR new file mode 100644 index 0000000..4e814de --- /dev/null +++ b/doc/README.pt_BR @@ -0,0 +1,254 @@ +Simplepkg: gerenciamento de instalações e metapacotes +----------------------------------------------------- + +Autor: Silvio Rhatto +Licença: GPL + +O simplepkg é um sistema de gerenciamento de pacotes que roda sobre o pkgtool. +Ele trabalha com templates -- listas com pacotes instalados, scripts e arquivos de configuração +-- permitindo criar perfis de instalação que podem ser então usados para instalar o sistema numa +outra partição, criar um chroot específico ou até trabalhar com o conceito de metapacotes: uma +lista de pacotes que pode ser instalada e removida com apenas um comando. + +Documentação +------------ + +A documentação mais atualizada do simplepkg está em http://slack.sarava.org/node/12 + +Descrição +--------- + +Todas as distribuições de GNU/Linux já tem algum sistema de empacotamento amadurecido. A questão +agora é a praticidade de instalar e controlar o que está instalado, tanto pacotes como arquivos +de configuração de uma máquina. + +Imagine por exemplo se você precisa manter uma lista de pacotes de 200 máquinas slackware, sendo +que algumas são usadas como desktop, outras como servidores web, alguma sendo o servidor de email +e assim por diante. Imagine agora que você perca o disco de algumas dessas máquinas ou que precise +cotidianamente reinstalar ou atualizar um sistema. + +Usar o cd de instalação do slackware e configurar na mão toda a vez que der um pau faria com que +você ficasse louco/a e desperdiçasse muito tempo, além do que sempre ocorre de esquecermos algum +detalhe ou pacote durante a configuração do sistema. Manter um backup completo de cada máquina, +por outro lado, pode ser muito custoso se o número delas for muito grande. + +O simplepkg permite que você mantenha um template para cada grupo de máquinas e com apenas um +comando instalar o template numa partição. Além do template, você precisa configurar o simplepkg +para obter pacotes de um repositório local ou remoto. + +Gerenciar instalações e metapacotes não é tudo o que o simplepkg faz. Ele pode ser usado até na +criação de vservers. + +Arquitetura +----------- + +O simplepkg é um conjunto de scripts escritos com a filosofia KISS em mente. Ele é um sistema muito +simples, composto pelos seguintes comandos: + + - mkjail: constrói uma jaula/instalação de slackware numa pasta + - metapkg: instala ou remove um metapacote + - templatepkg: criar ou adiciona pacotes a um template + - lspkg: lista pacotes instalados + - jail-upgrade: faz o upgrade nas jaulas + - rebuildpkg: reconstrói um pacote a partir de sua entrada no /var/log/packages + - simplaret: obtém pacotes de repositórios locais ou remotos + - createpkg: baixa, compila e empacota software de acordo com http://slack.sarava.org/slackbuilds + +A pasta de configuração e armazenamento de templates é a /etc/simplepkg. Templates são arquivos contendo +uma lista de pacotes, um pacote por linha e com a extensão .template. Como exemplo, um template poderia se +chamar minimo.template e conter a seguinte lista: + + aaa_base + aaa_elflibs + apache + bash + bin + coreutils + findutils + +Se você quiser também é possível usar um tagfile do slackware como template, sem nem precisar editá-lo. + +Instalando o simplepkg +---------------------- + +Para baixar o pacote do simplepkg, vá em http://slack.sarava.org/packages/noarch/. + + installpkg simplepkg-VERSAO-noarch-BUILD.tgz + +Alternativamente, se você está com o swaret instalado, adicione em seu swaret.conf a linha + + REPOS_ROOT=SlackMidiataticaNoarch%http://slack.sarava.org/packages/noarch + +e então digite + + swaret --update + swaret --install simplepkg + +Configurando o simplepkg +------------------------ + +Como exemplo, vamos criar uma jaula baseada nos pacotes instalados no seu slackware. Edite o +arquivo /etc/simplepkg/simplepkg.conf: + + # /etc/simplepkg/simplepkg.conf + JAIL_ROOT="/vservers" # local onde as jaulas serão criadas + SIMPLARET="simplaret" # programa que baixa os pacotes (pode ser o swaret se voce o tiver) + STORAGE="/var/simplaret" # local onde o simplepkg armazena seus pacotes + SIMPLARET_CLEAN="1" # apaga o cache de pacotes antes da instalação da jaula + SIMPLARET_DELETE_DOWN="1" # apaga o cache de pacotes após a instalação + SIMPLARET_UPDATE="0" # atualiza as listas de pacotes antes de iniciar a instalação da jaula + SIMPLARET_PURGE_WEEKS="N" # apaga os pacotes do cache mais velhos que N semanas antes de instalar + PATCHES_DIR="/var/simplaret/patches" # local os patches são armazenados + DEFAULT_ARCH="i386" + DEFAULT=VERSION="10.2" + STORAGE="/storage/packages" # where simplepkg store packages + PASSIVE_FTP="1" + +Para definir quais repositórios de pacotes você usará, edite o arquivo /etc/simplepkg/repos.conf, +colocando algo como + + ROOT-i386="http://slack.sarava.org/packages/slackware" + REPOS-i386="slack-sarava%http://slack.sarava.org/packages/slackware/slackware-10.2/" + ROOT-x86_64-10.2="http://darkstar.ist.utl.pt/pub/slamd64/" + REPOS-x86_64-10.2="slamd-sarava%http://slack.sarava.org/packages/slamd64/slamd64-10.2/" + +Para informações detalhadas sobre o simplaret, consulte seu artigo específico em http://slack.sarava.org/node/16 + +Se você quer utilizar o swaret em lugar do simplaret, o swaret.conf deve estar bem configurado para que ele +seja capaz de baixar e instalar todos os pacotes dos templates. Parâmetros como EXCLUDE podem ser um empecilho, +e se você os remover da sua instalação tenha muito cuidado ao atualizar o seu sistema via swaret --upgrade. +A desvantagem de usar o swaret é que você não terá como administrar jaulas e instalações de múltiplas arquiteturas. + +Criando jaulas e replicando instalações +--------------------------------------- + + templatepkg meu-slackware + mkjail jaula meu-slackware + +Isso cria o template meu-slackware a partir da sua lista de pacotes em /var/log/packages e cria uma nova árvore +com esses pacotes na pasta /vservers/jaula (dependendo de qual o valor da variável JAIL_ROOT do simplepkg.conf, é claro). + +Se você quiser que alguns arquivos de configuração e executar scripts após a instalação dessa jaula, basta colocarmos na +pasta /etc/simplepkg/meu-slackware.d/ os arquivos de configuração (dentro da hierarquia de pastas do sistema, isto é, +/etc/simplepkg/meu-slackware.d/etc/apache/httpd.conf) e os script em /etc/simplepkg/meu-slackware.s/. O template vserver, +que já vem no mkjail contém um exemplo de script. + +Você pode especificar também destinos alternativos para sua jaula, através de um comando do tipo + + ROOT=/mnt mkjail hda2 meu-slackware + +O comando acima faz exatamente o que você está pensando: replica sua instalação slackware em /mnt/hda2, dispensando +totalmente o programa de instalação do slackware! + +Caso nenhum template for especificado, o mkjail utiliza o template /etc/simplepkg/default.template. + +Se você manter uma jaula em JAIL_ROOT com o mesmo nome que um template, é possível ainda usar o script jail-update +para copiar todas as alterações de arquivos da jaula na pasta de arquivos do seu template (/etc/simplepkg/nome-da-jaula.d). +Assim, basta que você copie todos os arquivos de configuração que você editou para essa pasta e deixar o jail-update numa +crontab para que você tenha sempre um template atualizado e baseado nas jaulas / instalações que você tem rodando e que +estiverem listadas no arquivo /etc/simplepkg/jailist: + + jail-update + +Para adicionar ou remover pacotes de um template, basta editar o arquivo de template. Uma outra forma de adicionar +arquivos é usando o templatepkg com a opção -a, que adiciona apenas novos pacotes ao template. Se você quiser que o +templatepkg crie um template a partir de uma jaula, simplesmente use + + templatepkg jaula /vservers/jaula + +Metapacotes +----------- + +Outro uso dos templates é a criação de pacotes: imagine por exemplo a dificuldade de um usuário/a novo de slackware +para instalar o cinelerra e todas as suas dependências. Criando um template contendo o nome de todos os pacotes +necessários para rodar esse software permite que um usuário instale-o simplesmente com o comando + + metapkg --install cinelerra + +O comando sugere uma semelhança com o uso direto do swaret ou do slapt-get, com a única diferença residindo no +modo como cada um desses programas lida com as dependências de um pacote. Os slapt-get suporta o arquivo +slack-required, que pode ou não estar presente no pacote. Já o swaret possui uma ferramenta própria para a +criação de uma lista de dependências. + +O simplepkg não pretende substituir esses dois modos de checagem e sim propor uma alternativa de distribuição +de pacotes em que as dependências são resolvidas sem precisar de um repositório de dependências ou uma modificação +no próprio pacote, que é o caso do slack-required, um arquivo que na maioria das vezes não está presente. + +A remoção de um aplicativo e todas as suas dependências podem ser feitas simplesmente com o comando + + metapkg --remove cinelerra + +Upgrade de jaulas +----------------- + +O upgrade de jaulas que estejam em JAIL_ROOT pode ser efetuado com o comando jail-upgrade. Simplesmente coloque +os patches em PATCHES_DIR e dê o comando + + jail-upgrade + +Se você quiser atualizar apenas uma das jaulas que estão em JAIL_ROOT, use + + jail-upgrade nome-da-jaula + +Para especificar uma pasta contendo patches diferente de PATCHES_DIR (útil quando você possui jaulas com +diferentes versões do slackware), simplesmente use + + PATCHES=/local/dos/patches jail-upgrade nome-da-jaula + +De modo análogo ao mkjail, é possível indicar ao jail-upgrade uma outra pasta onde a jaula está armazenada: + + ROOT=/otherroot jail-upgrade + +Arquiteturas e versões diferentes +--------------------------------- + +O simplepkg foi idealizado para permitir que um mesmo template possa ser usado para criar jaulas de +arquiteturas e versões diferentes de sistemas padrão slackware. A atualização desses sistemas também +é unificada. Essa possibilidade só é permitida se você usa o simplaret e não o swaret como ferramenta +de obtenção de pacotes. + +Por exemplo, para criar uma instalação de slackware 10.1 (assumindo que suas definições de repositórios +do /etc/simplepkg/repos.conf contenham locais com slack 10.1), basta usar o comando + + VERSION=10.1 mkjail minha-jaula template-servidor + +Arquiteturas diferentes também podem ser usadas. Se você está num sistema x86_64 e quer instalar um +slack 10.2 numa partição, experimente + + ARCH=i386 VERSION=10.2 ROOT=/mnt mkjail hda2 meu-slackware + +Note que os templates independem de arquitetura e versão, já que eles só contém nomes de pacotes, +arquivos de configuração e scripts. Por isso, o templatepkg, o metapkg, o lspkg e o jail-update +funcionam normalmente. + +Para atualizar suas jaulas, o jail-upgrade checa antes qual a versão e arquitetura de cada uma +de suas jaulas através do /etc/slackware-version correspondente e a partir disso aplica os patches +da arquitetura e versão da mesma, usando para isso o simplaret (veja a documentação própria). + +Desse modo, mesmo que você tenha jaulas de versões e arquiteturas diversas, usar o comando "jail-upgrade" +faz a atualização sem problemas, desde que seus patches estejam organizados por arquitetura e versão, +conforme é detalhado na documentação do simplaret, em http://slack.sarava.org/node/16. + +Aplicativos auxiliares: rebuildpkg e createpkg +---------------------------------------------- + +O simplepkg acompanha ainda um aplicativo auxiliar que ajuda a recuperar pacotes instalados cujo tgz original +foi perdido. O comando rebuildpkg reconstrói um pacote a partir de uma entrada no /var/log/packages. O comando + + rebuildpkg coreutils + +reconstrói um pacote do coreutils usando os arquivos e as metainformações listadas no arquivo +do /var/log/packages/ correspondente ao coreutils. + +Se você quiser construir seus próprios pacotes baseados nos slackbuilds disponíveis em +http://slack.sarava.org/slackbuilds, basta utilizar o createpkg: + + createpkg nome-do-pacote + +Fonte +----- + +Se você quiser obter diretamente o código-fonte do simplepkg, baixe-o do repositório: + + svn checkout svn://slack.sarava.org/simplepkg + diff --git a/doc/README.simplaret b/doc/README.simplaret new file mode 100644 index 0000000..ce7efbd --- /dev/null +++ b/doc/README.simplaret @@ -0,0 +1,143 @@ +simplaret: simplepkg retrieval tool +----------------------------------- + +Simplaret is a simplepkg tool used to download packages from local and remote repositories. +With simplaret, one can grab packages for all archictectures and versions of slackware-like +distributions that follows the mirror guidelines, allowing an easy management all +jails and slackware installations in a machine, no matter wich arquiteture or version +each one has. + +It was inspired in swaret behavior but don't tries to get its complexity level, but +execute package download in a different way, where the local repository is organized +by archictecture and version. It can also search for packages. + +Documentation +------------- + +The always updated english documentation is hosted at http://slack.sarava.org/node/17 + +Downloading and installing +-------------------------- + +Simplaret comes with simplepkg, wich installation and configuration is detailed +at http://slack.sarava.org/node/15. Simplaret uses /etc/simplepkg/simplepkg.conf for +its definitions and /etc/simplepkg/repos.conf for repository information. + +Repository organization +----------------------- + +Simplaret local storage folder is defined through STORAGE parameter and is organized +in this manner: + + $STORAGE/arch/version/ + +Packages from contributed repositories (i.e, not from an official distro mirror) are +stored at + + $STORAGE/arch/version/repository-name/ + +This means, for example, that slack 10.2 packages are located in + + $STORAGE/i386/10.2/ + +And the slack.sarava.org's slamd64 packages can be stored in a place such as + + $STORAGE/x86_64/10.2/slack.sarava.org/ + +In the repository definition file (/etc/simplepkg/repos.conf), the entries must match +the following schema, something that remembers a swaret.conf: + + ROOT-i386="http://slack.sarava.org/slackware/" + ROOT-x86_64="http://ftp.heanet.ie/pub/slamd64/" + REPOS-i386-10.2="slack.sarava.org%http://slack.sarava.org/packages/slackware/slackware-10.2/" + REPOS-x86_64-10.2="slack.sarava.org%http://slack.sarava.org/packages/slamd64/slamd64-10.2/" + +Repositories defined as ROOT are those wich + + - Have packages from the official distro or + - Are organized by version according to the mirror guidelines + +Repositories defined as REPOS are those containing packages from a specific version or +non-oficial packages. + +When simplaret searches for a package, precedence is given first for ROOT definitions and then +for REPOS ones. REPOS definitions should also include a identification name, delimited from +the repository URL by the special sign %. + +Fetching the package list +------------------------- + +After configured, simplaret can fetch the package list with + + simplaret --update + +This updates the package list from arch defined in DEFAULT_ARCH and version from DEFAULT_VERSION. +To fetch package listings for x86_64 (slamd64) and version 10.2, use + + ARCH=x86_64 VERSION=10.2 simplaret --update + +Searching +--------- + +To search for a package, use the following commands as examples: + + simplaret --search coreutils + +for a Slack/390 package, + + ARCH=s390 simplaret --search x11 + +for slack 10.1 with contributed i686 packages, + + ARCH=i686 VERSION=10.1 simplaret --search icecast + +Downloading +----------- + +To download a package, + + simplaret --get icecast + +Simplaret downloads the first package found with the precedence explaned above. +Future versions should contain an option to explicit get a package from a +specific repository. + +Downloading patches +------------------- + +From the PATCHES_DIR parameter is possible to specify a folder where patches are +placed, sorted by arch and version. + +Patches for slack 10.2 are always located at + + $PATCHES_DIR/i386/10.2/ + +In reality, patches are downloaded with a "simplaret --get" and stored in the $STORAGE +subfolder for its arch and version and a symlink is created in $PATCHES_DIR/$ARCH/$VERSION. + +To grab all patches from an arch and version, use + + ARCH=architecture VERSION=version simplaret --get-patches + +Purging the cache +----------------- + +Simplaret cache from an arch and version can be purged with a + + simplaret --purge + +But why use that? +----------------- + +You may ask why someone wishes to use such tool. + +Simplaret was written with a *x86 environment in mind, where lots of jails with different archs +and versions are installed. Suppose a x86_64 with the following chroots installed: + + - slamd64 10.2 + - slackware 10.2 + - slackware 10.1 with additional i686 packages + - uSlack (i386 uClibc) + +Keep all this stuff update manually is really a headache. Simplaret just tries to make it trivial. + diff --git a/doc/README.simplaret.pt_BR b/doc/README.simplaret.pt_BR new file mode 100644 index 0000000..164294b --- /dev/null +++ b/doc/README.simplaret.pt_BR @@ -0,0 +1,148 @@ +simplaret: ferramenta para obtenção de pacotes +---------------------------------------------- + +O simplaret é a ferramenta do simplepkg utilizada para obter pacotes de repositórios locais +ou remotos. Com ele, você pode não só baixar pacotes do seu sistema slackware como também pode +baixar de qualquer versão ou arquitetura cujo repositório siga os mirror guidelines, permitindo +que você gerencie facilmente todas as suas jaulas e instalações de slackware, independentemente +da arquitetura ou versão que elas utilizem. + +Ele foi inspirado no comportamento do swaret mas não pretende de modo algum chegar no nível de +complexidade deste, mas sim executar a obtenção de pacotes de um modo diferente. Sua finalidade +é apenas baixar pacotes para que os aplicativos do simplepkg possam utilizá-lo posteriormente. +O simplaret ainda pode ser usado sozinho para procurar e baixar pacotes. + +Documentação +------------ + +A documentação atualizada do simplaret se encontra em http://slack.sarava.org/node/16 + +Obtendo e instalando +-------------------- + +O simplaret acompanha o simplepkg e por isso sua instalação e configuração é dada no artigo dosimplepkg. +Ele utiliza o mesmo arquivo de configuração do simplepkg, o /etc/simplepkg/simplepkg.conf e guarda as +definições de repositórios em /etc/simplepkg/repos.conf. + +Organização do repositório +-------------------------- + +O repositório de armazenamento local do simplaret é definido pelo parâmetro STORAGE e é organizado +da seguinte maneira: + + $STORAGE/arch/version/ + +Pacotes obtidos num repositório que não seja oficial da distribuição ficam em + + $STORAGE/arch/version/repository-name/ + +Isso quer dizer, por exemplo, que pacotes do slackware 10.2 ficariam em + + $STORAGE/i386/10.2/ + +e os pacotes obtidos a partir do repositório slamd64 do slack.sarava.org ficaria, por exemplo, em + + $STORAGE/x86_64/10.2/slack.sarava.org/ + +No arquivo de repositórios (/etc/simplepkg/repos.conf), as definições de repositório seguem o +seguinte esquema, semelhante ao formato de configuração do swaret: + + ROOT-i386="http://slack.sarava.org/slackware/" + ROOT-x86_64="http://ftp.heanet.ie/pub/slamd64/" + REPOS-i386-10.2="slack.sarava.org%http://slack.sarava.org/packages/slackware/slackware-10.2/" + REPOS-x86_64-10.2="slack.sarava.org%http://slack.sarava.org/packages/slamd64/slamd64-10.2/" + +Repositórios definidos como ROOT são aqueles que + + - Possuem pacotes da distribuição oficial ou + - Estão organizados por versão, de acordo com os mirror guidelines + +Já os repositórios definidos como REPOS são aqueles que contém pacotes para uma versão específica e/ou +que são não-oficiais. + +Quando o simplaret busca ou obtém um pacote, a precedência pelos repositórios é dada às definições de +ROOT e em seguinda às de REPOS. As definições REPOS ainda devem possuir, além da URL do repositório, um +nome para identificá-lo, sendo que esses dois campos são separados por um delimitador. + +Baixando as listas de pacotes +----------------------------- + +Após configurá-lo, é preciso atualizar a lista de pacotes: + + simplaret --update + +Isso atualiza a lista de pacotes da arquitetura definida em DEFAULT_ARCH e da versão DEFAULT_VERSION +apenas. Se você quiser forçar a atualização, por exemplo, para a arquitetura x86_64 (slamd64) +e versão 10.2, basta + + ARCH=x86_64 VERSION=10.2 simplaret --update + +Buscando pacotes +---------------- + +Para buscar um pacote, esses comandos servem de exemplo: + + simplaret --search coreutils + +pacote para o Slack/390, + + ARCH=s390 simplaret --search x11 + +e para slackware 10.1 com pacotes adicionais em i686, + + ARCH=i686 VERSION=10.1 simplaret --search icecast + +Baixando um pacote +------------------ + +Para baixar um pacote: + + simplaret --get icecast + +O simplaret baixa o primeiro pacote na ordem de precedência dos repositórios. +Versões futuras deverão conter uma opção que force a obtenção do pacote de um +repositório específico. + +Baixando patches +---------------- + +Através do parâmetro de configuração PATCHES_DIR é possível especificar uma pasta +onde os patches de cada distribuição serão armazenados, organizados também por arquitetura. + +Por exemplo, patches do slackware 10.2 ficarão sempre em + + $PATCHES_DIR/i386/10.2/ + +Os patches na verdade são baixados através de um "simplaret --get" e armazenados na subpasta +de $STORAGE correspondente e apenas um link simbólico é mantido em $PATCHES_DIR/$ARCH/$VERSION. + +Para baixar os patches, use uma chamada do tipo + + ARCH=arquitetura VERSION=versao simplaret --get-patches + +E os patches dessa arquitetura e versão serão baixados. + +Apagando pacotes +---------------- + +O repositório de pacotes de uma arquitetura e versão pode ser apagado com o comando + + simplaret --purge + +Mas pra quê serve isso? +----------------------- + +Você pode estar se perguntando: quem utilizaria uma ferramenta que baixa pacotes de várias arquiteturas? + +O simplaret foi escrito tendo em mente um ambiente *86 onde várias jaulas de diferentes arquiteturas estão +instaladas. Suponha por exemplo uma máquina x86_64 que possua as seguintes jaulas: + + - slamd64 10.2 + - slackware 10.2 + - slackware 10.1 com pacotes adicionais em i686 + - uSlack (uClibc para i386) + +O condenado/a em questão que roda todas essas jaulas, pelos mais diversos motivos, pode ter uma grande dor +de cabeça para manter os pacotes em ordem de forma manual. Com o simplaret e eventualmente com o simplepkg, +a tarefa se torna trivial. + diff --git a/doc/TODO b/doc/TODO new file mode 100644 index 0000000..9178f6e --- /dev/null +++ b/doc/TODO @@ -0,0 +1,5 @@ +simplepkg todo list +------------------- + +TODO list at http://slack.sarava.org/wiki/Main/SimplePKG + diff --git a/doinst.sh b/doinst.sh deleted file mode 100644 index d8bcadf..0000000 --- a/doinst.sh +++ /dev/null @@ -1,2 +0,0 @@ -( echo please edit /etc/simplepkg/simplepkg.conf.new and /etc/simplepkg/repos.conf.new ) -( echo and rename them to /etc/simplepkg/simplepkg.conf and /etc/simplepkg/repos.conf ) diff --git a/install/doinst.sh b/install/doinst.sh new file mode 100644 index 0000000..f205158 --- /dev/null +++ b/install/doinst.sh @@ -0,0 +1,2 @@ +( if [ ! -f "/etc/simplepkg/simplepkg.conf" ]; then mv /etc/simplepkg.conf.new /etc/simplepkg/simplepkg.conf; fi ) +( if [ ! -f "/etc/simplepkg/repos.conf" ]; then mv /etc/simplepkg/repos.conf.new /etc/simplepkg/repos.conf; fi ) diff --git a/install/slack-desc b/install/slack-desc new file mode 100644 index 0000000..c0f52f4 --- /dev/null +++ b/install/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' +# on the right side marks the last column you can put a character in. You must +# make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':'. + + |-----handy-ruler-------------------------------------------------------| +simplepkg: simplepkg (pkgtool templating system) +simplepkg: +simplepkg: simplepkg is a very small set of scripts intended to install slackware +simplepkg: chroot jails using a simple template system. it also implements +simplepkg: the concept of a "meta package", a template file where you +simplepkg: put a list of packages that can be installed or removed with the +simplepkg: command "metapkg". +simplepkg: +simplepkg: +simplepkg: +simplepkg: diff --git a/jail-update b/jail-update deleted file mode 100755 index f6635b5..0000000 --- a/jail-update +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash -# -# jail-update: update config files from a jail to a template -# feedback: rhatto@riseup.net | gpl -# -# Jail-update is free software; you can redistribute it and/or modify it under the -# terms of the GNU General Public License as published by the Free Software -# Foundation; either version 2 of the License, or any later version. -# -# Jail-update is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR -# A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., 59 Temple -# Place - Suite 330, Boston, MA 02111-1307, USA -# - -COMMON="/usr/libexec/simplepkg/common.sh" - -if [ -f "$COMMON" ]; then - source $COMMON -else - echo "error: file $COMMON found, check your `basename $0` installation" - exit 1 -fi - -if [ -f $JAIL_LIST ]; then - for jailpath in `cat $JAIL_LIST`; do - jail="`basename $jailpath`" - echo updating $jailpath... - if [ -d "$BASE_CONF/$jail.d" ] || [ -a "$BASE_CONF/$jail.template" ]; then - templatepkg -a $jail $jailpath - cd $BASE_CONF/$jail.d - for file in `find`; do - if [[ -f "$file" && -f "$jailpath/$file" ]]; then - if ! diff $file $jailpath/$file; then - echo updating $file - cp -f $jailpath/$file $file - fi - fi - done - fi - done -fi - -# main jail -if [ -a "$BASE_CONF/main.template" ]; then - echo updating main installation... - templatepkg -a main -fi -if [ -d "$BASE_CONF/main.d" ]; then - cd $BASE_CONF/main.d - for file in `find`; do - if [[ -f "$file" && -f "/$file" ]]; then - if ! diff $file /$file; then - echo updating $file - cp -f /$file $file - fi - fi - done -fi diff --git a/jail-upgrade b/jail-upgrade deleted file mode 100755 index b9567fd..0000000 --- a/jail-upgrade +++ /dev/null @@ -1,107 +0,0 @@ -#!/bin/bash -# -# jail-upgrade v0.5: upgrade packages in jails -# feedback: rhatto@riseup.net | GPL -# -# Jail-upgrade is free software; you can redistribute it and/or modify it under the -# terms of the GNU General Public License as published by the Free Software -# Foundation; either version 2 of the License, or any later version. -# -# Jail-upgrade is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR -# A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., 59 Temple -# Place - Suite 330, Boston, MA 02111-1307, USA -# - -COMMON="/usr/libexec/simplepkg/common.sh" - -function swaret_jail_upgrade { - - if [ ! -d "$PATCHES_DIR" ]; then - cd $PATCHES_DIR - for installed in `ls $1/var/log/packages/$pack* 2> /dev/null`; do - if [[ $pack == `package_name $installed.tgz` ]]; then - if [[ "`basename $installed`" != "`basename $file .tgz`" ]]; then - ROOT=$1 upgradepkg $file - fi - fi - done - fi -} - -function simplaret_jail_upgrade { - - echo upgrading jail $1... - - VERSION="`cat $1/etc/slackware-version | awk '{ print $2 }' | sed -e 's/.0$//'`" - ARCH="`cat $1/etc/slackware-version | awk '{ print $3 }' | sed -e 's/(//' -e 's/)//'`" - - if [ -z "$ARCH" ]; then - ARCH="i386" - fi - - if [ -d "$PATCHES_DIR/$ARCH/$VERSION" ]; then - cd $PATCHES_DIR/$ARCH/$VERSION - for file in `ls *tgz`; do - pack=`package_name $file` - for installed in `ls $1/var/log/packages/$pack* 2> /dev/null`; do - if [[ "$pack" == "`package_name $installed.tgz`" ]]; then - if [[ "`basename $installed`" != "`basename $file .tgz`" ]]; then - ROOT=$1 upgradepkg $file - fi - fi - done - done - else - echo error: cant upgrade for arch $ARCH and version $VERSION on $1: no such patch dir $PATCHES_DIR/$ARCH/$VERSION - fi - -} - -if [ -f "$COMMON" ]; then - source $COMMON - eval_config `basename $0` -else - echo "error: file $COMMON not found, check your `basename $0` installation" - exit 1 -fi - -if [ ! -z "$PATCHES" ]; then - if [ -d "$PATCHES" ]; then - PATCHES_DIR="$PATCHES" - else - echo "error: folder $PATCHES does not exist" - fi -fi - -if [ "$SIMPLARET" == "simplaret" ]; then - upgrade_method="simplaret_jail_upgrade" -elif [ "$SIMPLARET" == "swaret" ]; then - upgrade_method="swaret_jail_upgrade" -else - echo invalid value $SIMPLARET for SIMPLARET, please check your $CONF - exit 1 -fi - -if [ -z "$1" ]; then - if [ -d "/var/log/packages" ]; then - $upgrade_method / - fi - for vserver in `ls $JAIL_ROOT`; do - if [ -d "$JAIL_ROOT/$vserver/var/log/packages" ]; then - $upgrade_method $JAIL_ROOT/$vserver - fi - done -elif [ -d "$JAIL_ROOT/$1" ]; then - if [ -d "$JAIL_ROOT/$1/var/log/packages" ]; then - $upgrade_method $JAIL_ROOT/$1 - else - echo error: jail $JAIL_ROOT/$1 dont looks like a slackware system - fi -else - echo "error: jail $0 does not exist" - exit 1 -fi diff --git a/lib/common.sh b/lib/common.sh new file mode 100644 index 0000000..af31da3 --- /dev/null +++ b/lib/common.sh @@ -0,0 +1,180 @@ +#!/bin/bash +# +# common.sh: common functions for simplepkg +# feedback: rhatto at riseup.net | gpl +# +# Uses some functions from pkgtools, which license is: +# +# Copyright 1999 Patrick Volkerding, Moorhead, Minnesota, USA +# Copyright 2001, 2002, 2003 Slackware Linux, Inc., Concord, California, USA +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +BASE_CONF="/etc/simplepkg" +CONF="$BASE_CONF/simplepkg.conf" +JAIL_LIST="$BASE_CONF/jailist" + +# pkgtool stuff +function package_name { + STRING=`basename $1 .tgz` + # Check for old style package name with one segment: + if [ "`echo $STRING | cut -f 1 -d -`" = "`echo $STRING | cut -f 2 -d -`" ]; then + echo $STRING + else # has more than one dash delimited segment + # Count number of segments: + INDEX=1 + while [ ! "`echo $STRING | cut -f $INDEX -d -`" = "" ]; do + INDEX=`expr $INDEX + 1` + done + INDEX=`expr $INDEX - 1` # don't include the null value + # If we don't have four segments, return the old-style (or out of spec) package name: + if [ "$INDEX" = "2" -o "$INDEX" = "3" ]; then + echo $STRING + else # we have four or more segments, so we'll consider this a new-style name: + NAME=`expr $INDEX - 3` + NAME="`echo $STRING | cut -f 1-$NAME -d -`" + echo $NAME + fi + fi +} + +function install_packages { + + if [[ "$SIMPLARET_CLEAN" == "1" ]]; then + ARCH=$ARCH VERSION=$VERSION $SIMPLARET --purge + elif [[ ! -z "$SIMPLARET_PURGE_WEEKS" ]] && [[ "$SIMPLARET_PURGE_WEEKS" != "0" ]]; then + ARCH=$ARCH VERSION=$VERSION $SIMPLARET --purge -w $SIMPLARET_PURGE_WEEKS + fi + + for pack in `cat $TEMPLATE | grep -v -e "^#" | cut -d : -f 1`; do + package_downloaded="0" + if [ "$SIMPLARET" == "simplaret" ]; then + extrafolder="$ARCH/$VERSION/" + else + unset extrafolder + fi + for file in `find $STORAGE/$extrafolder -name $pack*tgz`; do + if [[ "`package_name $file`" == "$pack" ]]; then + package_downloaded="1" + package_file="$file" + break + fi + done + if [[ "$package_downloaded" != "1" ]]; then + ARCH=$ARCH VERSION=$VERSION $SIMPLARET --get $pack -a + for file in `find $STORAGE/$extrafolder -name $pack*tgz`; do + if [[ "`package_name $file`" == "$pack" ]]; then + package_file="$file" + break + fi + done + fi + if [ -z "$package_file" ]; then + echo error: could not install package $pack + else + installed_packs="`ls /$JAIL_ROOT/$server/var/log/packages/$pack* 2> /dev/null`" + if [ ! -z "$installed_packs" ]; then + for installed in $installed_packs; do + if [[ "$pack" == "`package_name $installed.tgz`" ]]; then + echo "package $pack already installed in $JAIL_ROOT/$server ($installed)" + package_installed="1" + break + fi + if [[ "$package_installed" != "1" ]]; then + installpkg -root /$JAIL_ROOT/$server $package_file + unset package_installed + if [ ! -z "$SIMPLARET_DELETE_DURING" ] && [ "$SIMPLARET_DELETE_DURING" != "0" ]; then + SILENT=1 ARCH=$ARCH VERSION=$VERSION $SIMPLARET --purge + fi + break + fi + done + else + installpkg -root /$JAIL_ROOT/$server $package_file + if [ ! -z "$SIMPLARET_DELETE_DURING" ] && [ "$SIMPLARET_DELETE_DURING" != "0" ]; then + SILENT=1 ARCH=$ARCH VERSION=$VERSION $SIMPLARET --purge + fi + fi + fi + unset package_file + done + if [[ "$SIMPLARET_DELETE_DOWN" == "1" ]]; then + ARCH=$ARCH VERSION=$VERSION $SIMPLARET --purge + fi +} + +function remove_packages { + for pack in `cat $TEMPLATE | grep -v -e "^#" | cut -d : -f 1`; do + ROOT=/$JAIL_ROOT/$server removepkg $pack + done +} + +function eval_config { + if [ -f "$CONF" ]; then + source $CONF + else + echo $1 error: config file $CONFIG not found + exit 1 + fi + + if [ -z "$SIMPLARET" ]; then + SIMPLARET="simplaret" + fi + + if [ -z "$STORAGE" ]; then + if [ -d "/var/$SIMPLARET" ]; then + STORAGE="/var/$SIMPLARET" + else + echo error: please adjust value for STORAGE at $CONF + exit 1 + fi + fi + + if [ ! -z "$ROOT" ]; then + JAIL_ROOT="$ROOT" + elif [ -z "$JAIL_ROOT" ]; then + echo error: please adjust value for JAIL_ROOT at $CONF + exit 1 + fi + + if [ -z "$ARCH" ]; then + ARCH="$DEFAULT_ARCH" + fi + + if [ -z "$VERSION" ]; then + VERSION="$DEFAULT_VERSION" + fi + + if which $SIMPLARET &> /dev/null; then + if [[ "$SIMPLARET_UPDATE" == "1" ]]; then + if [[ "$2" == "-u" ]]; then + echo "updating package database..." + ARCH=$ARCH VERSION=$VERSION $SIMPLARET --update + fi + fi + else + echo "$SIMPLARET not found, please install it before run $0" + fi + + if [ -z "PATCHES_DIR" ]; then + echo error: please adjust a value for PATCHES_DIR at $CONF + fi +} + diff --git a/lspkg b/lspkg deleted file mode 100755 index 0eb5e77..0000000 --- a/lspkg +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/bash -# -# lspkg v0.2: view installed and contents of -# slackware packages -# -# feedback: rhatto at riseup.net | gpl -# -# Lspkg is free software; you can redistribute it and/or modify it under the -# terms of the GNU General Public License as published by the Free Software -# Foundation; either version 2 of the License, or any later version. -# -# Lspkg is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR -# A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., 59 Temple -# Place - Suite 330, Boston, MA 02111-1307, USA -# -# -# -v, --view: view installed package contents -# -p, --print: print the contents of a package file -# -r, --remove: remove matching packages -# -s, --search: search a file under installed packages -# -# todo: -# -# -d, --description: show matching packages' descriptions -# -h, --help: show usage -# - -function usage { - echo "usage: $0 [-v|-d|-s|-p expression]" - exit 1 -} - -if [[ "$1" = "-v" ]]; then - if [[ ! -z "$2" ]]; then - if $(ls /var/log/packages/$2* &> /dev/null); then - for file in $(ls /var/log/packages/$2*); do - less $file - done - else echo $2: package not found on /var/log/packages - fi - else - usage - fi -elif [[ "$1" = "-p" ]]; then - if [ -f $2 ]; then - tar ztvf $2 - else echo $2: file not found - fi -elif [[ "$1" == "-r" ]]; then - if [ ! -z "$2" ]; then - if `ls /var/log/packages/$1* &> /dev/null`; then - removepkg /var/log/packages/$1* - fi - fi -elif [[ "$1" == "-s" ]]; then - if [[ ! -z "$2" ]]; then - grep $2 /var/log/packages/* - fi -else - if `ls /var/log/packages/$1* &> /dev/null`; then - ls /var/log/packages/$1* - else echo $1: package not found on /var/log/packages - fi -fi diff --git a/metapkg b/metapkg deleted file mode 100755 index e83ee4d..0000000 --- a/metapkg +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash -# -# metapkg v0.1: install or remove a pkgtool metapackage -# -# feedback: rhatto at riseup.net | GPL -# -# Metapkg is free software; you can redistribute it and/or modify it under the -# terms of the GNU General Public License as published by the Free Software -# Foundation; either version 2 of the License, or any later version. -# -# Metapkg is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR -# A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., 59 Temple -# Place - Suite 330, Boston, MA 02111-1307, USA -# -# A metapackage is a file containing a list of packages. -# This script just installs all the packages in a metapackage. -# Remeber that mkjail template == metapkg metapackage. -# - -COMMON="/usr/libexec/simplepkg/common.sh" -ROOT="/" - -function usage { - echo "usage: [ROOT=/otherroot] `basename $0` --option [metapackage]" - echo "options: --install, --remove" - exit 1 -} - -if [ -f "$COMMON" ]; then - source $COMMON -else - echo "error: file $COMMON found, check your `basename $0` installation" - exit 1 -fi - -if [ -z "$2" ]; then - usage -else - eval_config `basename $0` -u -fi - -if [ ! -f "$BASE_CONF/$2.template" ]; then - echo error: template $2 not found - exit 1 -else - TEMPLATE="$BASE_CONF/$2.template" - unset server -fi - -if [[ "$1" == "--install" ]]; then - install_packages -elif [[ "$1" == "--remove" ]]; then - remove_packages -else - usage -fi diff --git a/mkjail b/mkjail deleted file mode 100755 index d0d24a0..0000000 --- a/mkjail +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/bash -# -# mkjail v0.4: chroot jail maker -# -# feedback: rhatto at riseup.net | GPL -# -# Mkjail is free software; you can redistribute it and/or modify it under the -# terms of the GNU General Public License as published by the Free Software -# Foundation; either version 2 of the License, or any later version. -# -# Mkjail is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR -# A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., 59 Temple -# Place - Suite 330, Boston, MA 02111-1307, USA -# -# Under the config file, adjust this to where your things live, for example: -# -# JAIL_ROOT="/vservers" # default folder where jails lives -# STORAGE="/var/simplaret" # place where simplaret host its packages -# SIMPLARET_CLEAN="1" # delete downloaded packages before installation -# SIMPLARET_DELETE_DOWN="1" # delete donwloaded packages after installation -# SIMPLARET_DELETE_DURING="1" # delete each package rigth after its installation -# SIMPLARET_UPDATE="0" # simplaret --update before get the packages -# SIMPLARET_PURGE_WEEKS="N" # purge cached packages older than N weeks -# PATCHES_DIR=/var/simplaret/patches" # where your patches lives -# -# todo: - list of packages that could not be installed -# - use swaret just for network mirrors -# - installation order -# - optionally execute chroot-upgrade after installation -# - -COMMON="/usr/libexec/simplepkg/common.sh" - -function usage { - echo "usage: [ROOT=/otherroot] `basename $0` [template]" - exit 1 -} - -if [ -f "$COMMON" ]; then - source $COMMON -else - echo "error: file $COMMON found, check your `basename $0` installation" - exit 1 -fi - -if [ -z "$1" ]; then - usage -else - server="$1" - eval_config `basename $0` -u -fi - -if [[ ! -z "$2" && -f "$BASE_CONF/$2.template" ]]; then - TEMPLATE="$BASE_CONF/$2.template" -elif [[ ! -z "$2" && ! -f "$BASE_CONF/$2.template" ]]; then - echo template $2 not found, using default template - TEMPLATE="$BASE_CONF/default.template" -elif [[ -z "$2" && -f "$BASE_CONF/default.template" ]]; then - TEMPLATE="$BASE_CONF/default.template" - echo using default template -else - echo $0 error: no templates found - echo please create a template using templatepkg - exit 1 -fi - -if [ ! -d "$JAIL_ROOT/$server" ]; then - mkdir -p $JAIL_ROOT/$server -else - if [ ! -z "`ls $JAIL_ROOT/$server | grep -v 'lost+found'`" ]; then - echo error: folder $JAIL_ROOT/$server already exists and seens to be not empty - echo probably the jail $1 already exists - exit 1 - fi -fi - -echo "instaling packages into $JAIL_ROOT/$server using $TEMPLATE..." -install_packages - -TEMPLATE="`echo $TEMPLATE | sed -e 's/\.template$//'`" -echo "copying template files..." -if [ -d "$TEMPLATE.d" ]; then - rsync -av $TEMPLATE.d/ $JAIL_ROOT/$server/ -fi - -echo "executing template scripts..." -if [ -d "$TEMPLATE.s" ]; then - for script in `ls $TEMPLATE.s/`; do - if [ -x "$TEMPLATE.s/$script" ]; then - exec $TEMPLATE.s/$script $JAIL_ROOT $server - fi - done -fi - -echo "$JAIL_ROOT/$server" >> $JAIL_LIST -echo "done creating $server jail" diff --git a/rebuildpkg b/rebuildpkg deleted file mode 100755 index 43c76cd..0000000 --- a/rebuildpkg +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/bash -# -# rebuildpkg: build a package from a /var/log/packages entry -# -# feedback: rhatto at riseup.net | gpl -# -# Rebuildpkg is free software; you can redistribute it and/or modify it under the -# terms of the GNU General Public License as published by the Free Software -# Foundation; either version 2 of the License, or any later version. -# -# Rebuildpkg is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR -# A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., 59 Temple -# Place - Suite 330, Boston, MA 02111-1307, USA -# - -COMMON="/usr/libexec/simplepkg/common.sh" -TMP="/tmp" - -function usage { - echo "usage: ROOT=/otherroot `basename $0` " -} - -if [ -f "$COMMON" ]; then - source $COMMON -else - echo "error: file $COMMON found, check your `basename $0` installation" - exit 1 -fi - -if [ -z "$1" ]; then - usage - exit 1 -fi - -pack="$1" - -for file in `find $ROOT/var/log/packages -name $pack*`; do - if [[ "`package_name $file.tgz`" == "$pack" ]]; then - package_file="$file" - break - fi -done - -if [ -z "$package_file" ]; then - echo error: package $pack does not exist -fi - -if [ -d "$TMP/package-$pack" ]; then - rm -rf $TMP/package-$pack -fi - -mkdir $TMP/package-$pack -cd $TMP/package-$pack - -for file in `grep -v -e "^PACKAGE NAME:" -e "^UNCOMPRESSED PACKAGE SIZE:" \ - -e "^COMPRESSED PACKAGE SIZE:" -e "^PACKAGE LOCATION:" \ - -e "^PACKAGE DESCRIPTION:" -e "^$pack:" -e "^FILE LIST:" $package_file`; do - - if [ -d /$file ]; then - mkdir -p $TMP/package-$pack/$file - elif [ -f /$file ]; then - cp /$file $TMP/package-$pack/$file - else echo file /$file was not found, please add it manually, exploding and making the package again - fi - -done - -mkdir $TMP/package-$pack/install -grep "^$pack:" $package_file > $TMP/package-$pack/install/slack-desc - -package_name="`grep "PACKAGE NAME:" $package_file | awk '{ print $3 }'`" - -if [ -f "$ROOT/var/log/scripts/$package_name" ]; then - cp $ROOT/var/log/scripts/$package_name $TMP/package-$pack/install/doinst.sh -fi - -makepkg $package_name.tgz -mv $package_name.tgz $TMP/ -echo "done: package rebuilt and stored at $TMP/$package_name.tgz" diff --git a/repos.conf.new b/repos.conf.new deleted file mode 100644 index 274e1c7..0000000 --- a/repos.conf.new +++ /dev/null @@ -1,9 +0,0 @@ -# repositories definitions -#ROOT-i386="http://slackware.cs.utah.edu/" -ROOT-i386="http://slack.sarava.org/slackware/" -ROOT-x86_64="http://ftp.heanet.ie/pub/slamd64/" -REPOS-i386-10.2="slack.sarava.org%http://slack.sarava.org/packages/slackware/slackware-10.2/" -REPOS-i386-10.2="slack.sarava.org-noarch%http://slack.sarava.org/packages/noarch/" -REPOS-x86_64-10.2="slack.sarava.org%http://slack.sarava.org/packages/slamd64/slamd64-10.2/" -REPOS-x86_64-10.2="slack.sarava.org-noarch%http://slack.sarava.org/packages/noarch/" - diff --git a/simplaret b/simplaret deleted file mode 100755 index ed98402..0000000 --- a/simplaret +++ /dev/null @@ -1,482 +0,0 @@ -#!/bin/bash -# -# simplaret v0.1.1: simplepkg's package grabber -# feedback: rhatto at riseup.net | gpl -# -# Simplaret is free software; you can redistribute it and/or modify it under the -# terms of the GNU General Public License as published by the Free Software -# Foundation; either version 2 of the License, or any later version. -# -# Simplaret is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR -# A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., 59 Temple -# Place - Suite 330, Boston, MA 02111-1307, USA -# -# config file simplepkg.conf: -# -# DEFAULT_ARCH="i386" -# DEFAULT=VERSION="10.2" -# STORAGE="/storage/packages" -# PASSIVE_FTP="1" -# -# config file repos.conf: -# -# ROOT-i386="http://slack.sarava.org/packages/slackware" -# REPOS-i386-10.2="slack.sarava.org%http://slack.sarava.org/packages/slackware/slackware-10.2/" -# ROOT-x86_64="http://darkstar.ist.utl.pt/pub/slamd64/" -# REPOS-x86_64-10.2="slack.sarava.org%http://slack.sarava.org/packages/slamd64/slamd64-10.2/" -# -# usage: -# -# --update: baixa lista de pacotes de cada repositorio -# --search: busca -# --get [-a]: baixa um unico pacote -# --get-pacthes: baixa os patches e faz o checksum / gpg -# --purge [-w N]: remove o cache -# -# precedence: -# -# - checa antes o repositorio raiz, caso o pacote nao seja encontrado segue na ordem das -# definicoes REPOS do arquivo de configuracao -# - -SIMPLARET_CONF="/etc/simplepkg/simplepkg.conf" -REPOS_CONF="/etc/simplepkg/repos.conf" -COMMON="/usr/libexec/simplepkg/common.sh" - -function simplaret_usage { - - echo "usage: [ARCH=otherarch] [VERSION=otherversion] `basename $0`