├── .gitignore ├── Makefile ├── README ├── blacklist ├── blacklist.Alpha ├── blacklist.PowerPC ├── blacklist.SPARC └── blacklist.x86 ├── compilers ├── c++ ├── cc ├── g++ ├── gcc ├── ld └── make ├── configure ├── doc ├── COPYING-2.0 ├── CREDITS ├── gpl.html └── module-example │ ├── BUILD │ ├── CONFIGURE │ ├── CONFLICTS │ ├── DEPENDS │ ├── DETAILS │ ├── POST_BUILD │ ├── POST_INSTALL │ ├── POST_REMOVE │ ├── PRE_BUILD │ ├── PRE_REMOVE │ ├── README │ ├── init.d │ ├── README │ ├── ntp │ ├── pure-ftpd │ └── sshd │ ├── pam.d │ ├── README │ ├── chfn │ ├── chsh │ ├── ftp │ ├── gdm │ ├── passwd │ ├── samba │ ├── shadow │ └── su │ ├── profile.d │ └── example.rc │ ├── services │ └── xinetd.d │ ├── README │ ├── exim │ ├── proftpd │ └── pure-ftpd ├── etc ├── config └── dialogrc ├── install ├── libs ├── README ├── aliases.lunar ├── build.lunar ├── check.lunar ├── config.lunar ├── depends.lunar ├── download.lunar ├── edit.lunar ├── files.lunar ├── init.lunar ├── kernel.lunar ├── locking.lunar ├── logging.lunar ├── main.lunar ├── messages.lunar ├── misc.lunar ├── modules.lunar ├── moonbase.lunar ├── optimize.lunar ├── plugins.lunar ├── prune.lunar ├── queue.lunar ├── recovery.lunar ├── sizes.lunar ├── sources.lunar ├── temp.lunar ├── tracking.lunar ├── uniqid.lunar ├── updatelog.lunar ├── useradd.lunar └── view.lunar ├── man ├── lcrash.8 ├── lfirsttime.8 ├── lget.8 ├── lin.8 ├── lrm.8 ├── lunar.8 ├── lvu.1 └── moonbase.5 ├── menu ├── alias.menu ├── download.menu ├── integrity.menu ├── license.menu └── mirrors.menu ├── mirrors ├── GNOME ├── GNU ├── KDE ├── KERNEL ├── LRESORT ├── NVIDIA ├── SFORGE ├── XFREE86 └── XORG ├── misc ├── bootstrap ├── excluded ├── init-functions ├── protected ├── solo ├── sustained └── unset.sh ├── plugins ├── build-zpatches.plugin ├── check-find.plugin ├── check-ldd.plugin ├── check-md5sum.plugin ├── check-symlinks.plugin ├── configd.plugin ├── download-file.plugin ├── download-generic.plugin ├── optimize-wrappers.plugin ├── postbuild-generic.plugin ├── postbuild-sanity.plugin ├── unpack-generic.plugin ├── verify-md5.plugin ├── verify-sha1.plugin └── verify-sha256.plugin └── prog ├── lget ├── lin ├── lrm ├── lsh ├── lunar ├── lvis └── lvu /.gitignore: -------------------------------------------------------------------------------- 1 | *.bz2 2 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | 2 | VERSION = 48 3 | 4 | bin_PROGS = prog/lvu prog/lvis prog/lsh 5 | sbin_PROGS = prog/lin prog/lrm prog/lunar prog/lget 6 | 7 | plug_LIBS = $(shell ls -1 plugins/*) 8 | core_LIBS = $(shell ls -1 libs/*) 9 | menu_LIBS = $(shell ls -1 menu/*) 10 | 11 | etc = etc/config etc/dialogrc 12 | mirrors = $(shell ls -1 mirrors/*) 13 | blacklist = $(shell ls -1 blacklist/*) 14 | compilers = $(shell ls -1 compilers/*) 15 | mans = $(shell ls -1 man/*) 16 | 17 | all: 18 | 19 | .PHONY: 20 | install: .PHONY 21 | install -d $(DESTDIR)/etc/lunar 22 | for F in $(etc) ; do \ 23 | install -m0644 $$F $(DESTDIR)/etc/lunar/ ; \ 24 | done 25 | install -d $(DESTDIR)/etc/lunar/local/depends 26 | install -d $(DESTDIR)/var/lib/lunar/menu 27 | for F in $(menu_LIBS) ; do \ 28 | install -m0644 $$F $(DESTDIR)/var/lib/lunar/menu/ ; \ 29 | done 30 | install -d $(DESTDIR)/var/lib/lunar/functions 31 | for F in $(core_LIBS) ; do \ 32 | install -m0644 $$F $(DESTDIR)/var/lib/lunar/functions/ ; \ 33 | done 34 | install -d $(DESTDIR)/var/lib/lunar/plugins 35 | for F in $(plug_LIBS) ; do \ 36 | install -m0644 $$F $(DESTDIR)/var/lib/lunar/plugins/ ; \ 37 | done 38 | install -d $(DESTDIR)/bin 39 | for F in $(bin_PROGS) ; do \ 40 | install -m0755 $$F $(DESTDIR)/bin/ ; \ 41 | done 42 | install -d $(DESTDIR)/sbin 43 | for F in $(sbin_PROGS) ; do \ 44 | install -m0755 $$F $(DESTDIR)/sbin/ ; \ 45 | done 46 | install -d $(DESTDIR)/etc/lunar/mirrors 47 | for F in $(mirrors) ; do \ 48 | install -m0644 $$F $(DESTDIR)/etc/lunar/mirrors/ ; \ 49 | done 50 | install -d $(DESTDIR)/var/state/lunar 51 | for F in $(blacklist) ; do \ 52 | install -m0644 $$F $(DESTDIR)/var/state/lunar/ ; \ 53 | done 54 | install -d $(DESTDIR)/var/lib/lunar/compilers ; \ 55 | for F in $(compilers) ; do \ 56 | install -m0755 $$F $(DESTDIR)/var/lib/lunar/compilers/ ; \ 57 | done 58 | install -d $(DESTDIR)/var/lib/lunar 59 | install -m0755 misc/bootstrap $(DESTDIR)/var/lib/lunar/ 60 | install -m0644 misc/excluded $(DESTDIR)/var/lib/lunar/ 61 | install -m0644 misc/protected $(DESTDIR)/var/lib/lunar/ 62 | install -m0644 misc/solo $(DESTDIR)/var/lib/lunar/ 63 | install -m0644 misc/sustained $(DESTDIR)/var/lib/lunar/ 64 | install -m0755 misc/unset.sh $(DESTDIR)/var/lib/lunar/ 65 | install -d $(DESTDIR)/lib/lsb 66 | install -m0644 misc/init-functions $(DESTDIR)/lib/lsb/ 67 | install -d $(DESTDIR)/var/log/lunar/compile 68 | install -d $(DESTDIR)/var/log/lunar/install 69 | install -d $(DESTDIR)/var/log/lunar/md5sum 70 | install -d $(DESTDIR)/var/log/lunar/queue 71 | install -d $(DESTDIR)/var/cache/lunar 72 | install -d $(DESTDIR)/var/spool/lunar 73 | for F in $(mans) ; do \ 74 | EXT=`echo $$F | sed 's/.*[.]//'` ; \ 75 | install -d $(DESTDIR)/usr/share/man/man$$EXT ; \ 76 | install -m0644 $$F $(DESTDIR)/usr/share/man/man$$EXT/ ; \ 77 | done 78 | # easy way out for the docs: 79 | install -d $(DESTDIR)/usr/share/doc/lunar 80 | cp -av doc $(DESTDIR)/usr/share/doc/lunar/ 81 | 82 | tag: 83 | git tag v$(VERSION) 84 | 85 | dist: 86 | git archive --format=tar --prefix="lunar-$(VERSION)/" v$(VERSION) | bzip2 > lunar-$(VERSION).tar.bz2 87 | 88 | tell: 89 | @echo "lunar-$(VERSION).tar.bz2" 90 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | this is the Lunar Development module! 2 | -------------------------------------------------------------------------------- /blacklist/blacklist.Alpha: -------------------------------------------------------------------------------- 1 | binutils-sparc64 2 | bin86 3 | egcs64 4 | grub 5 | lilo 6 | nasm 7 | silo 8 | sparc-utils 9 | uClibc 10 | uml 11 | yaboot 12 | memtest86+ 13 | -------------------------------------------------------------------------------- /blacklist/blacklist.PowerPC: -------------------------------------------------------------------------------- 1 | aboot 2 | binutils-sparc64 3 | bin86 4 | egcs64 5 | e3 6 | grub 7 | lilo 8 | nasm 9 | silo 10 | sparc-utils 11 | uClibc 12 | uml 13 | memtest86+ 14 | -------------------------------------------------------------------------------- /blacklist/blacklist.SPARC: -------------------------------------------------------------------------------- 1 | bin86 2 | e3 3 | grub 4 | lilo 5 | nasm 6 | uClibc 7 | uml 8 | yaboot 9 | memtest86+ 10 | -------------------------------------------------------------------------------- /blacklist/blacklist.x86: -------------------------------------------------------------------------------- 1 | aboot 2 | binutils-sparc64 3 | egcs64 4 | silo 5 | sparc-utils 6 | yaboot 7 | -------------------------------------------------------------------------------- /compilers/c++: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | PROG=$(PATH=${PATH//\/var\/lib\/lunar\/compilers/} type -p ${0##*/}) 4 | 5 | if [[ -n "$LUNAR_DEBUG" ]]; then 6 | echo "++ $CXX_EXT $PROG $@" >&2 7 | fi 8 | 9 | exec $CXX_EXT $PROG "$@" 10 | -------------------------------------------------------------------------------- /compilers/cc: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | PROG=$(PATH=${PATH//\/var\/lib\/lunar\/compilers/} type -p ${0##*/}) 4 | 5 | if [[ -n "$LUNAR_DEBUG" ]]; then 6 | echo "++ $CC_EXT $PROG $@" >&2 7 | fi 8 | 9 | exec $CC_EXT $PROG "$@" 10 | -------------------------------------------------------------------------------- /compilers/g++: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | PROG=$(PATH=${PATH//\/var\/lib\/lunar\/compilers/} type -p ${0##*/}) 4 | 5 | if [[ -n "$LUNAR_DEBUG" ]]; then 6 | echo "++ $CXX_EXT $PROG $@" >&2 7 | fi 8 | 9 | exec $CXX_EXT $PROG "$@" 10 | -------------------------------------------------------------------------------- /compilers/gcc: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | PROG=$(PATH=${PATH//\/var\/lib\/lunar\/compilers/} type -p ${0##*/}) 4 | 5 | if [[ -n "$LUNAR_DEBUG" ]]; then 6 | echo "++ $CC_EXT $PROG $@" >&2 7 | fi 8 | 9 | exec $CC_EXT $PROG "$@" 10 | -------------------------------------------------------------------------------- /compilers/ld: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | PROG=$(PATH=${PATH//\/var\/lib\/lunar\/compilers/} type -p ${0##*/}) 4 | 5 | if [[ -n "$LUNAR_DEBUG" ]]; then 6 | echo "++ $PROG $@" >&2 7 | fi 8 | 9 | exec $PROG "$@" 10 | -------------------------------------------------------------------------------- /compilers/make: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | PROG=$(PATH=${PATH//\/var\/lib\/lunar\/compilers/} type -p ${0##*/}) 4 | 5 | if [[ -n "$LUNAR_DEBUG" ]]; then 6 | echo "++ $MAKE_EXT $PROG ${MAKES:+-j$MAKES} $@" >&2 7 | fi 8 | 9 | exec $MAKE_EXT $PROG ${MAKES:+-j$MAKES} "$@" 10 | -------------------------------------------------------------------------------- /configure: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "Here, have a cookie!" 4 | 5 | -------------------------------------------------------------------------------- /doc/CREDITS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunar-linux/lunar/19816bf6ac99449c06c9478cdb8cc1425b5bae8b/doc/CREDITS -------------------------------------------------------------------------------- /doc/module-example/BUILD: -------------------------------------------------------------------------------- 1 | ( 2 | 3 | if module_installed Linux-PAM; then 4 | WITH_PAM="--with-pam" 5 | fi 6 | 7 | set -x 8 | 9 | ./configure --sysconfdir=/etc \ 10 | --prefix=/usr \ 11 | --mandir=/usr/share/man \ 12 | --localstatedir=/var \ 13 | --with-everything \ 14 | $WITH_PAM \ 15 | $OPTS && 16 | 17 | set +x 18 | 19 | make && 20 | prepare_install && 21 | make install 22 | 23 | ) > $C_FIFO 2>&1 && ( 24 | 25 | 26 | if [ ! -f /etc/ftplockout ] 27 | then cp pam/ftplockout /etc 28 | fi 29 | 30 | if ! [ -e /etc/init.d/pure-ftpd ]; then 31 | cp $SCRIPT_DIRECTORY/pure-ftpd /etc/init.d 32 | fi 33 | 34 | case $FTPD_BOOT in 35 | y|Y) chkconfig --add pure-ftpd 36 | ;; 37 | 38 | *) true 39 | ;; 40 | esac 41 | 42 | ) 43 | -------------------------------------------------------------------------------- /doc/module-example/CONFIGURE: -------------------------------------------------------------------------------- 1 | # 2 | # CONFIGURE example 3 | # 4 | 5 | # showstopper example: this is for the gcc3 module, which can possibly 6 | # ruin your box. This example shows a neat way of bailing out elegantly: 7 | # WARNING_SIGN=${MESSAGE_COLOR}"Caution, installation of gcc3 can severly damage a working stable system. Installation on a mission critial box is not recomended at this point." 8 | # message $WARNING_SIGN 9 | # 10 | # query "Are you sure you want to install?" n 11 | 12 | 13 | # complex example showing the ability of lunar to store and re-use 14 | # previous configuration settings: 15 | # if ! grep -q CONFIGURED $MODULE_CONFIG; then 16 | # 17 | # if query "Do you want to disable banner? " y 18 | # then OPTS=$OPTS" --without-banner" 19 | # fi 20 | # 21 | # if query "Do you want to enable large file support? " y 22 | # then OPTS=$OPTS" --with-largefile" 23 | # fi 24 | # 25 | # echo 'CONFIGURED="y"' >> $MODULE_CONFIG 26 | # echo 'OPTS='\"$OPTS\" >> $MODULE_CONFIG 27 | # fi 28 | 29 | 30 | -------------------------------------------------------------------------------- /doc/module-example/CONFLICTS: -------------------------------------------------------------------------------- 1 | # 2 | # CONFLICTS example 3 | # 4 | 5 | # single conflicts: 6 | # conflicts moduleA 7 | 8 | # multiple: 9 | # conflicts moduleA && 10 | # conflicts moduleB 11 | 12 | -------------------------------------------------------------------------------- /doc/module-example/DEPENDS: -------------------------------------------------------------------------------- 1 | # 2 | # DEPENDS example 3 | # 4 | 5 | # always end the line with && except for the last one! 6 | 7 | # single depends: 8 | # depends moduleA 9 | 10 | # single optional depends: 11 | # optional_depends "moduleA" "" "" "For blabla support" 12 | 13 | # optional depends that use configure switches: 14 | # optional_depends "moduleC" \ 15 | # "--with-configure-option" \ 16 | # "--without-configure-option" \ 17 | # "for blabla support" 18 | 19 | # multiple depends: 20 | # depends moduleA && 21 | # depends moduleB 22 | 23 | # or everything: 24 | # depends moduleA && 25 | # depends moduleB && 26 | # optional_depends "moduleC" \ 27 | # "--with-configure-option" \ 28 | # "--without-configure-option" \ 29 | # "for blabla support" && 30 | # optional_depends "moduleD" "" "" "For blabla support" 31 | 32 | -------------------------------------------------------------------------------- /doc/module-example/DETAILS: -------------------------------------------------------------------------------- 1 | # 2 | # DETAILS example 3 | # 4 | 5 | # This demonstrates how to put in every possible parameter in a DETAILS 6 | # file. Note that not everything is required, but a minimum is: 7 | 8 | # MODULE name of the module, identical to the name if the 9 | # directory it resides in 10 | # VERSION current version number of the package 11 | # SOURCE the name of the source file 12 | # SOURCE_DIRECTORY the name of where the source will unpack 13 | # SOURCE_URL[0] the name of source file 14 | # WEBSITE the main website of the package 15 | # ENTERED the date (format yyyymmdd) when it was added 16 | # UPDATED tha date (format yyyymmdd) when a recompile 17 | # was needed 18 | # SHORT a one line description 19 | 20 | # and of course the long description that looks like this: 21 | # cat << EOF 22 | # blablablabla 23 | # .... 24 | # EOF 25 | 26 | 27 | # here's an example with some comments and additions: 28 | # MODULE=pure-ftpd 29 | # VERSION=1.0.12 30 | # SOURCE=$MODULE-$VERSION.tar.gz 31 | # SOURCE_DIRECTORY=$BUILD_DIRECTORY/$MODULE-$VERSION 32 | # SOURCE_URL[0]=http://telia.dl.sourceforge.net/pureftpd/$SOURCE 33 | # WEB_SITE=http://www.pureftpd.org 34 | # ENTERED=20010922 35 | # UPDATED=20020609 36 | # MAINTAINER=maintaner@moongroup.com 37 | # SHORT="An efficient, lightweight, and secure FTP server" 38 | # cat << EOF 39 | # Pure FTP Server is a fast, production quality, standards- 40 | # conformant FTP server based on Troll-FTPd. It has no known 41 | # buffer overflows, is trivial to set up, and is especially 42 | # designed for modern kernels. Features include PAM support, 43 | # IPv6, chroot()ed home directories, virtual domains, built-in 44 | # 'ls', FXP protocol, anti-warez system, bandwidth throttling, 45 | # bounded ports for passive downloads, an LDAP backend, XML 46 | # output, and more. 47 | # EOF 48 | -------------------------------------------------------------------------------- /doc/module-example/POST_BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunar-linux/lunar/19816bf6ac99449c06c9478cdb8cc1425b5bae8b/doc/module-example/POST_BUILD -------------------------------------------------------------------------------- /doc/module-example/POST_INSTALL: -------------------------------------------------------------------------------- 1 | 2 | if [ -x /etc/init.d/pure-ftpd.sh ]; then 3 | rm /etc/init.d/pure-ftpd.sh 4 | fi 5 | 6 | if [ -e "/etc/rc?.d/*pure-ftpd*" ]; then 7 | rm -f /etc/rc?.d/*pure-ftpd* 8 | fi 9 | 10 | 11 | -------------------------------------------------------------------------------- /doc/module-example/POST_REMOVE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunar-linux/lunar/19816bf6ac99449c06c9478cdb8cc1425b5bae8b/doc/module-example/POST_REMOVE -------------------------------------------------------------------------------- /doc/module-example/PRE_BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunar-linux/lunar/19816bf6ac99449c06c9478cdb8cc1425b5bae8b/doc/module-example/PRE_BUILD -------------------------------------------------------------------------------- /doc/module-example/PRE_REMOVE: -------------------------------------------------------------------------------- 1 | if [ -x /etc/init.d/pure-ftpd ]; then 2 | chkconfig --del pure-ftpd 3 | fi 4 | -------------------------------------------------------------------------------- /doc/module-example/README: -------------------------------------------------------------------------------- 1 | 2 | README for the skeleton module 3 | 4 | -- 5 | NOTE: all files have been disabled by putting '#' comments in them, 6 | if you wish to use the examples in this directory, please remove the 7 | comments and modify it carefully so the module does exactly what you 8 | think it does. 9 | 10 | -- 11 | This skeleton module was compiled from various modules in the moonbase 12 | and gives a wide range of what is possible when you write modules. I 13 | tried to include virtually every possible scheme but apart from the 14 | BUILD files most stuff is pretty straightforward. 15 | 16 | If you have any additions or comments on this file please notice us 17 | by dropping a mail in the lunar mailinglist. Anything is greatly 18 | appreciated! 19 | 20 | -- 21 | Here's a brief explanation of the files in here: 22 | 23 | * DETAILS 24 | 25 | Required for any module. This file contains the data needed to obtain, 26 | describe and update a package. In here vital information like download 27 | URL's, version numbers and package description is put. 28 | 29 | * DEPENDS 30 | 31 | This file lists packages that need to be installed before you can install 32 | this package. It doesn not necessary have to be a library, but can also 33 | be include files or anything that you would need to compile, install 34 | and run the module. 35 | 36 | In here you can als list optional depends, being packages that do not 37 | necessary have to be installed, for instance packages that add extra 38 | features (e.g. fonts, plugins etc.). 39 | 40 | * CONFLICTS 41 | 42 | Modules listed in here must not be present when installing this module. 43 | Use this to separate your module from incompatible other ones. For instance 44 | the BitchX module is incompatible with the gtk version gtkBitchX, so 45 | these 2 modules have eachother listed in their CONFLICTS file. Another 46 | good example is conflicting daemons like sendmail vs. exim, cron vs. 47 | hc-cron etc. 48 | 49 | * BUILD 50 | 51 | This script will configure, make and install the package. You can virtually 52 | control everything in here, like adding patches (kernel), changing build 53 | options (xfree86) or asking the user for configuration options (sendmail). 54 | This script does not have to exist for programs that ./configure && make && 55 | make install (lin will automatically --prefix=/usr for you), but a lot of 56 | modules need adjusting. 57 | 58 | * CONFIGURE 59 | 60 | This file serves as an alternative way to customize the configuring of the 61 | package. 62 | 63 | * PRE_BUILD 64 | 65 | This file is used if you need to apply patches or modifications before 66 | the package is built. 67 | 68 | * POST_BUILD 69 | 70 | Use this file if you need to tweak the compiles sources before it is 71 | installed. 72 | 73 | * POST_INSTALL 74 | 75 | When you need to additionally tweak things after installation, this is 76 | the place. Actions in this file are not logged in the install log, so 77 | you can e.g. create machine dependant configuration options that need 78 | to be kept in case of module removal. 79 | 80 | This is also the place to install and run daemons, reconfigure LILO etc.. 81 | 82 | * PRE_REMOVE 83 | 84 | This script will be called before a module is lrm'ed. You can use it to 85 | back up configuration, stop daemons or similar stuff. 86 | 87 | * POST_REMOVE 88 | 89 | Use this file to clean stuff up after removing a module, or place 90 | configuration files in a backup location, etc.. 91 | 92 | * other files and directories 93 | 94 | Nothing withholds you from putting much more stuff in your module directory, 95 | think of patches, small scripts, init.d scripts, xinetd or pam.d configuration 96 | files, or funky ascii art to make your module install look nice. 97 | 98 | As a general rule you must try to keep the module as small as possible 99 | however. For instance, if you were to put a 100K patch in the module 100 | directory, every lunar update requires that people download those 101 | 100K, whether they use your patch or not. If you must, try to provide 102 | the patch or extra source code in a way that we can put it on our source 103 | mirror, or insert it as a secondary source URL in case someone has 104 | already provided it on the internet. This will save us from a lot of 105 | frustration. 106 | 107 | Some contents of subdirs are automatically handled, here's a list: 108 | 109 | - pam.d - for pam settings 110 | - xinetd.d - for xinetd service definitions 111 | - init.d - for init.d startup scripts 112 | - profile.d - for bash shell settings 113 | - plugin.d - for lunar code plugins 114 | - skel - for /etc/skel/ files 115 | 116 | 117 | The file 'services' can be used to add tcp/ip or udp service port 118 | definitions automatically in coherence with xinetd.d to the 119 | /etc/services global file 120 | 121 | 122 | 123 | -- 124 | sofar 20020725 125 | -------------------------------------------------------------------------------- /doc/module-example/init.d/README: -------------------------------------------------------------------------------- 1 | 2 | This directory contains some init.d scripts that need to be installed 3 | if you want to run a daemon at startup. Please make your init scripts 4 | work with chkconfig, so they can be easily installed and removed! 5 | 6 | -------------------------------------------------------------------------------- /doc/module-example/init.d/ntp: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # ntp.sh 4 | # chkconfig: 2345 31 88 5 | # description: NTP is used to synchronize computer clocks 6 | # on a connected network or via GPS/phone/etc. 7 | 8 | if ! [ -d /etc/config.d ]; then 9 | mkdir -p /etc/config.d 10 | fi 11 | 12 | case "$1" in 13 | 'start') 14 | if pgrep ntpd 15 | then 16 | echo "ntp daemon already running. ntp start aborted" 17 | exit 0 18 | fi 19 | if [ -f /etc/config.d/ntp.conf -a -x /usr/sbin/ntpd ] 20 | then 21 | /usr/sbin/ntpd -c /etc/config.d/ntp.conf -g 22 | fi 23 | ;; 24 | 'stop') 25 | pkill ntpd 26 | ;; 27 | *) 28 | echo "Usage: $0 { start | stop }" 29 | ;; 30 | esac 31 | -------------------------------------------------------------------------------- /doc/module-example/init.d/pure-ftpd: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Startup script for the pure-ftpd FTP Server 4 | # 5 | # chkconfig: 2345 85 15 6 | # description: Pure-FTPd is an FTP server daemon based upon Troll-FTPd 7 | # processname: pure-ftpd 8 | # pidfile: /var/run/pure-ftpd.pid 9 | 10 | PURE_PID=/var/run/pure-ftpd.pid 11 | 12 | case $1 in 13 | start|restart) echo "$1ing pure-ftpd, ftp daemon.." 14 | [ -e "$PURE_PID" ] && kill `cat $PURE_PID` 15 | pure-ftpd -b -B 16 | ;; 17 | 18 | stop) echo "$1ping pure-ftpd." 19 | [ -e "$PURE_PID" ] && kill `cat $PURE_PID` 20 | ;; 21 | 22 | *) echo "Usage: $0 {start|stop|restart}" 23 | ;; 24 | esac 25 | -------------------------------------------------------------------------------- /doc/module-example/init.d/sshd: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # ssh Secure Shell Daemon 4 | # 5 | # chkconfig: 2345 80 30 6 | # description: SSH daemon 7 | # processname: master 8 | # pidfile: /var/run/sendmail.pid 9 | # config: /etc/mail/sendmail.cf 10 | 11 | if [ -e "/var/run/sshd.pid" ]; then 12 | SPID=`cat /var/run/sshd.pid` 13 | fi 14 | 15 | case $1 in 16 | start) echo "$1ing sshd." 17 | sshd 18 | ;; 19 | stop) echo "$1ping sshd." 20 | if [ -e "/var/run/sshd.pid" ]; then 21 | kill -n 15 $SPID 22 | fi 23 | ;; 24 | restart) $0 stop && $0 start 25 | ;; 26 | *) echo "Usage: $0 {start|stop|restart}" 27 | ;; 28 | esac 29 | 30 | -------------------------------------------------------------------------------- /doc/module-example/pam.d/README: -------------------------------------------------------------------------------- 1 | 2 | The pam.d directory can contain PAM config files. They will automatically 3 | be installed in /etc/pam.d if you provide them in a module. 4 | 5 | -------------------------------------------------------------------------------- /doc/module-example/pam.d/chfn: -------------------------------------------------------------------------------- 1 | # 2 | # The PAM configuration file for the `chfn' service 3 | # 4 | auth required pam_unix.so nullok 5 | account required pam_unix.so 6 | session required pam_unix.so 7 | password required pam_cracklib.so retry=3 type=Lunar 8 | -------------------------------------------------------------------------------- /doc/module-example/pam.d/chsh: -------------------------------------------------------------------------------- 1 | # 2 | # The PAM configuration file for the `chsh' service 3 | # 4 | auth required pam_unix.so nullok 5 | account required pam_unix.so 6 | session required pam_unix.so 7 | password required pam_cracklib.so retry=3 type=Lunar 8 | password required pam_unix.so shadow md5 use_authtok 9 | -------------------------------------------------------------------------------- /doc/module-example/pam.d/ftp: -------------------------------------------------------------------------------- 1 | # 2 | # The PAM configuration file for the `ftp' service 3 | # 4 | auth requisite pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed 5 | auth sufficient pam_ftp.so 6 | auth required pam_unix.so shadow nullok use_first_pass 7 | auth requisite pam_shells.so 8 | account required pam_unix.so 9 | session required pam_unix.so 10 | session required pam_limits.so 11 | -------------------------------------------------------------------------------- /doc/module-example/pam.d/gdm: -------------------------------------------------------------------------------- 1 | # 2 | # The PAM configuration file for the `gdm' service 3 | # 4 | auth required pam_unix.so 5 | account required pam_unix.so 6 | session required pam_unix.so 7 | -------------------------------------------------------------------------------- /doc/module-example/pam.d/passwd: -------------------------------------------------------------------------------- 1 | # 2 | # The PAM configuration file for the `passwd' service 3 | # 4 | password requisite pam_cracklib.so retry=3 type=Lunar 5 | password required pam_unix.so shadow md5 use_authtok 6 | -------------------------------------------------------------------------------- /doc/module-example/pam.d/samba: -------------------------------------------------------------------------------- 1 | # 2 | # The PAM configuration file for the `samba' service 3 | # 4 | auth required pam_unix.so 5 | account required pam_unix.so 6 | -------------------------------------------------------------------------------- /doc/module-example/pam.d/shadow: -------------------------------------------------------------------------------- 1 | # 2 | # The PAM configuration file for the `shadow' service 3 | # 4 | auth sufficient pam_rootok.so 5 | auth required pam_unix_auth.so 6 | account required pam_unix.so 7 | password required pam_permit.so 8 | -------------------------------------------------------------------------------- /doc/module-example/pam.d/su: -------------------------------------------------------------------------------- 1 | # 2 | # The PAM configuration file for the `su' service 3 | # 4 | # auth required pam_wheel.so 5 | auth sufficient pam_rootok.so 6 | auth required pam_unix.so 7 | account required pam_unix.so 8 | session required pam_unix.so 9 | -------------------------------------------------------------------------------- /doc/module-example/profile.d/example.rc: -------------------------------------------------------------------------------- 1 | 2 | # Example.rc 3 | 4 | # put any custom bash settings in here you wish to add to shell 5 | # variables: 6 | 7 | # PATH=${PATH}:/opt/lunar/mypackage/bin 8 | 9 | # export MYVAR=value 10 | 11 | -------------------------------------------------------------------------------- /doc/module-example/services: -------------------------------------------------------------------------------- 1 | # 2 | # services example 3 | # 4 | 5 | # lines in this file will be AUTOMATICALLY appended to /etc/services, e.g.: 6 | # ftp-data 20/tcp 7 | # ftp 21/tcp 8 | 9 | -------------------------------------------------------------------------------- /doc/module-example/xinetd.d/README: -------------------------------------------------------------------------------- 1 | 2 | xinetd.d has a config file for every service it runs (and port it 3 | should listen on of course). these config scripts look like the one 4 | in this directory. They weill automatically be installed into the 5 | /etc/xinetd.d/ for you if you provide them in here. 6 | 7 | -------------------------------------------------------------------------------- /doc/module-example/xinetd.d/exim: -------------------------------------------------------------------------------- 1 | service smtp 2 | { 3 | socket_type = stream 4 | protocol = tcp 5 | wait = no 6 | user = mail 7 | group = mail 8 | server = /usr/sbin/exim 9 | server_args = -bs 10 | per_source = 8 11 | log_type = FILE /var/log/xinetd/exim 12 | log_on_success = PID HOST USERID EXIT DURATION 13 | log_on_failure = USERID ATTEMPT 14 | 15 | } 16 | -------------------------------------------------------------------------------- /doc/module-example/xinetd.d/proftpd: -------------------------------------------------------------------------------- 1 | service ftp 2 | { 3 | socket_type = stream 4 | protocol = tcp 5 | wait = no 6 | user = root 7 | server = /usr/sbin/proftpd 8 | server_args = 9 | per_source = 8 10 | log_type = FILE /var/log/xinetd/proftpd 11 | log_on_success = PID HOST USERID EXIT DURATION 12 | log_on_failure = USERID ATTEMPT 13 | } 14 | -------------------------------------------------------------------------------- /doc/module-example/xinetd.d/pure-ftpd: -------------------------------------------------------------------------------- 1 | service ftp 2 | { 3 | socket_type = stream 4 | protocol = tcp 5 | wait = no 6 | user = root 7 | disable = no 8 | server = /usr/sbin/pure-ftpd 9 | server_args = -b 10 | per_source = 8 11 | log_type = FILE /var/log/xinetd/pure-ftpd 12 | log_on_success = PID HOST USERID EXIT DURATION 13 | log_on_failure = USERID ATTEMPT 14 | } 15 | -------------------------------------------------------------------------------- /etc/config: -------------------------------------------------------------------------------- 1 | export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11/bin 2 | 3 | export DIALOGRC=/etc/lunar/dialogrc 4 | 5 | CONFIG_CACHE=/etc/lunar/local 6 | LOCAL_CONFIG=/etc/lunar/local/config 7 | DEPENDS_CONFIG=/etc/lunar/local/depends 8 | LOCAL_EXCLUDED=/etc/lunar/local/excluded 9 | MIRRORS=/etc/lunar/mirrors 10 | 11 | LUNAR_MODULES="lunar" 12 | 13 | BUILD_DIRECTORY=/usr/src 14 | DOCUMENT_DIRECTORY=/usr/share/doc 15 | 16 | DEFAULT_PREFIX=/usr 17 | 18 | OBSOLETE_LIB_DIR=/usr/lib/lunar/OBSOLETE 19 | OBSOLETE_LD_CONF=/etc/ld.so.conf.d/obsolete-libs.conf 20 | 21 | BOOTSTRAP=/var/lib/lunar/bootstrap 22 | EXCLUDED=/var/lib/lunar/excluded 23 | MOONBASE=/var/lib/lunar/moonbase 24 | PROTECTED=/var/lib/lunar/protected 25 | SOLO=/var/lib/lunar/solo 26 | FUNCTIONS=/var/lib/lunar/functions 27 | MENUS=/var/lib/lunar/menu 28 | SUSTAINED=/var/lib/lunar/sustained 29 | PLUGIN_DIR=/var/lib/lunar/plugins 30 | 31 | SOUND_DIRECTORY=/var/lib/lunar/sound 32 | SOUND_THEME=startrek 33 | 34 | ACTIVITY_LOG=/var/log/lunar/activity 35 | INSTALL_LOGS=/var/log/lunar/install 36 | COMPILE_LOGS=/var/log/lunar/compile 37 | MD5SUM_LOGS=/var/log/lunar/md5sum 38 | INSTALL_QUEUE=/var/log/lunar/queue/install 39 | REMOVE_QUEUE=/var/log/lunar/queue/remove 40 | COMPRESS_METHOD=xz 41 | 42 | DEPENDS_STATUS=/var/state/lunar/depends 43 | DEPENDS_STATUS_BACKUP=/var/state/lunar/depends.backup 44 | DEPENDS_CACHE=/var/state/lunar/depends.cache 45 | MODULE_STATUS=/var/state/lunar/packages 46 | MODULE_STATUS_BACKUP=/var/state/lunar/packages.backup 47 | MODULE_INDEX=/var/state/lunar/module.index 48 | REPLACEMENT_INDEX=/var/state/lunar/replacement.index 49 | 50 | INSTALL_CACHE=/var/cache/lunar 51 | SOURCE_CACHE=${SOURCE_CACHE:-/var/spool/lunar} 52 | 53 | STRIP_BINARIES="--strip-all" 54 | STRIP_SHARED="--strip-unneeded" 55 | STRIP_STATIC="--strip-debug" 56 | 57 | # Override the following variables in /etc/lunar/local/config 58 | # Or by exporting them before installing or removing. 59 | 60 | ARCHIVE=${ARCHIVE:-on} 61 | AUTOFIX=${AUTOFIX:-on} 62 | AUTOPRUNE=${AUTOPRUNE:-on} 63 | CHECK_FREE_SPACE=${CHECK_FREE_SPACE:-on} 64 | REQUIRED_FREE_SPACE=${REQUIRED_FREE_SPACE:-2G} 65 | KEEP_OBSOLETE_LIBS=${KEEP_OBSOLETE_LIBS:-on} 66 | MAIL_REPORTS=${MAIL_REPORTS:-off} 67 | MOONBASE_ACT_LOG=${MOONBASE_ACT_LOG:-on} 68 | PRESERVE=${PRESERVE:-on} 69 | REAP=${REAP:-on} 70 | ADMIN=${ADMIN:-root} 71 | SOUND=${SOUND:-off} 72 | SUSTAIN=${SUSTAIN:-on} 73 | VIEW_REPORTS=${VIEW_REPORTS:-off} 74 | VOYEUR=${VOYEUR:-on} 75 | GARBAGE=${GARBAGE:-on} 76 | PROMPT_DELAY=${PROMPT_DELAY:-150} 77 | PROBE_EXPIRED=${PROBE_EXPIRED:-on} 78 | LUNAR_PRIORITY="+10" 79 | TMPFS_BUILD=${TMPFS_BUILD:-off} 80 | 81 | LDD_CHECK=${LDD_CHECK:-on} 82 | FIND_CHECK=${FIND_CHECK:-on} 83 | MD5SUM_CHECK=${MD5SUM_CHECK:-on} 84 | SYM_CHECK=${SYM_CHECK:-off} 85 | 86 | GNU_URL=https://ftpmirror.gnu.org 87 | KDE_URL=https://download.kde.org 88 | GNOME_URL=https://download.gnome.org 89 | KERNEL_URL=https://cdn.kernel.org 90 | SFORGE_URL=https://downloads.sourceforge.net/sourceforge 91 | XFREE86_URL=http://ftp.xfree86.org/pub/XFree86 92 | XORG_URL=https://www.x.org/releases 93 | LRESORT_URL=http://download.lunar-linux.org/lunar/cache 94 | NVIDIA_URL=https://download.nvidia.com/XFree86 95 | 96 | MOONBASE_URL[0]=http://lunar-linux.org/lunar/ 97 | MOONBASE_URL[1]=http://download.lunar-linux.org/lunar/ 98 | 99 | PATCH_URL=http://download.lunar-linux.org/lunar/patches/ 100 | MIRROR_URL=http://download.lunar-linux.org/lunar/mirrors/ 101 | 102 | TRACKED="/bin /boot /etc /lib /sbin /usr /var /opt/lunar" 103 | 104 | TMPDIR=${TMPDIR:-/tmp} 105 | 106 | DEFAULT="\e[0m" 107 | BOLD="\e[1m" 108 | BLACK="\e[30m" 109 | RED="\e[31m" 110 | GREEN="\e[32m" 111 | YELLOW="\e[33m" 112 | BLUE="\e[34m" 113 | VIOLET="\e[35m" 114 | CYAN="\e[36m" 115 | WHITE="\e[37m" 116 | 117 | MODULE_COLOR="${WHITE}${BOLD}\e[40m" 118 | VERSION_COLOR="${WHITE}${BOLD}\e[40m" 119 | QUERY_COLOR="${YELLOW}${BOLD}" 120 | LRM_COLOR="${YELLOW}${BOLD}" 121 | CHECK_COLOR="${CYAN}" 122 | RESURRECT_COLOR="${GREEN}${BOLD}" 123 | FILE_COLOR="${GREEN}${BOLD}" 124 | SYMLINK_COLOR="${CYAN}${BOLD}" 125 | PROBLEM_COLOR="${RED}${BOLD}" 126 | MESSAGE_COLOR="${CYAN}" 127 | DEFAULT_COLOR="${DEFAULT}" 128 | 129 | TAB_ENTER_IFS=$'\t\n' 130 | ENTER_IFS=$'\n' 131 | STANDARD_IFS=$' \t\n' 132 | 133 | -------------------------------------------------------------------------------- /etc/dialogrc: -------------------------------------------------------------------------------- 1 | # 2 | # Run-time configuration file for dialog 3 | # 4 | # Automatically generated by "dialog --create-rc " 5 | # 6 | # 7 | # Types of values: 8 | # 9 | # Number - 10 | # String - "string" 11 | # Boolean - 12 | # Attribute - (foreground,background,highlight?) 13 | # 14 | 15 | 16 | # Shadow dialog boxes? This also turns on color. 17 | use_shadow = ON 18 | 19 | # Turn color support ON or OFF 20 | use_colors = ON 21 | 22 | # Screen color 23 | screen_color = (CYAN,BLUE,ON) 24 | 25 | # Shadow color 26 | shadow_color = (BLACK,BLACK,OFF) 27 | 28 | # Dialog box color 29 | dialog_color = (BLACK,WHITE,OFF) 30 | 31 | # Dialog box title color 32 | title_color = (BLUE,WHITE,ON) 33 | 34 | # Dialog box border color 35 | border_color = (BLACK,WHITE,OFF) 36 | 37 | # Active button color 38 | button_active_color = (WHITE,BLUE,ON) 39 | 40 | # Inactive button color 41 | button_inactive_color = (BLACK,WHITE,OFF) 42 | 43 | # Active button key color 44 | button_key_active_color = (WHITE,BLUE,ON) 45 | 46 | # Inactive button key color 47 | button_key_inactive_color = (RED,WHITE,OFF) 48 | 49 | # Active button label color 50 | button_label_active_color = (YELLOW,BLUE,ON) 51 | 52 | # Inactive button label color 53 | button_label_inactive_color = (BLACK,WHITE,ON) 54 | 55 | # Input box color 56 | inputbox_color = (BLACK,CYAN,OFF) 57 | 58 | # Input box border color 59 | inputbox_border_color = (WHITE,WHITE,OFF) 60 | 61 | # Search box color 62 | searchbox_color = (BLACK,CYAN,OFF) 63 | 64 | # Search box title color 65 | searchbox_title_color = (BLUE,WHITE,ON) 66 | 67 | # Search box border color 68 | searchbox_border_color = (WHITE,WHITE,OFF) 69 | 70 | # File position indicator color 71 | position_indicator_color = (BLUE,WHITE,ON) 72 | 73 | # Menu box color 74 | menubox_color = (WHITE,WHITE,OFF) 75 | 76 | # Menu box border color 77 | menubox_border_color = (WHITE,WHITE,OFF) 78 | 79 | # Item color 80 | item_color = (BLACK,WHITE,OFF) 81 | 82 | # Selected item color 83 | item_selected_color = (WHITE,BLUE,ON) 84 | 85 | # Tag color 86 | tag_color = (BLUE,WHITE,ON) 87 | 88 | # Selected tag color 89 | tag_selected_color = (YELLOW,BLUE,ON) 90 | 91 | # Tag key color 92 | tag_key_color = (YELLOW,WHITE,ON) 93 | 94 | # Selected tag key color 95 | tag_key_selected_color = (WHITE,BLUE,ON) 96 | 97 | # Check box color 98 | check_color = (BLACK,WHITE,OFF) 99 | 100 | # Selected check box color 101 | check_selected_color = (WHITE,BLUE,ON) 102 | 103 | # Up arrow color 104 | uarrow_color = (GREEN,WHITE,ON) 105 | 106 | # Down arrow color 107 | darrow_color = (GREEN,WHITE,ON) 108 | 109 | # Item help-text color 110 | itemhelp_color = (WHITE,BLACK,OFF) 111 | 112 | -------------------------------------------------------------------------------- /install: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "x$1" = "x" ] ; then 4 | make install 5 | else 6 | make DESTDIR=$1 install 7 | fi 8 | 9 | -------------------------------------------------------------------------------- /libs/README: -------------------------------------------------------------------------------- 1 | There are some functions in this directory. These functions are called by 2 | subroutines. This place is defined in /etc/lunar/config, via FUNCTIONS variable. 3 | -------------------------------------------------------------------------------- /libs/aliases.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################ 3 | # # 4 | # aliases.lunar - Lunar alias code # 5 | # # 6 | ############################################################ 7 | # # 8 | # Copyright 2004 by Auke Kok under GPLv2under GPLv2 # 9 | # # 10 | ############################################################ 11 | 12 | # translate %ALIAS if needed to a module name that is installed 13 | # and add it to the dependency chain if needed 14 | expand_alias() { 15 | # If param doesn't start with "%", or if NEVER_ASK 16 | # is set, just echo the param and return immediately 17 | if [[ "${1:0:1}" != "%" ]]; then 18 | echo $1 19 | return 20 | fi 21 | 22 | local TARGET TARGETS TARGETBYNUM N CHOICE CACHED_ALIAS 23 | # lookup in cache 24 | CACHED_ALIAS=$(get_local_config LUNAR_ALIAS_${1:1}) 25 | if [[ -n "$CACHED_ALIAS" ]]; then 26 | echo $CACHED_ALIAS 27 | return 28 | fi 29 | 30 | if [[ -n "$NEVER_ASK" ]]; then 31 | # there's no stored value for the alias and we mustn't ask for one... 32 | echo $1 33 | return 34 | fi 35 | 36 | debug_msg "expand_alias($@)" 37 | # try to figure out where the aliases file is: 38 | if [[ -z "$ALIASES" ]] || [[ ! -f "$ALIASES" ]]; then 39 | if [ -f "$MOONBASE/aliases" ] ; then 40 | ALIASES="$MOONBASE/aliases" 41 | else 42 | ALIASES="/var/lib/lunar/aliases" 43 | fi 44 | fi 45 | 46 | TARGETS=$(awk -F: -v mod=$1 '$1 == mod {print $2}' "$ALIASES") 47 | 48 | # propose one and let the user pick it from a list: 49 | debug_msg "expand_alias: starting selection loop" 50 | error_message "${MODULE_COLOR}$MODULE${DEFAULT_COLOR}${MESSAGE_COLOR} depends on ${DEFAULT_COLOR}${QUERY_COLOR}\"${1:1}\"${DEFAULT_COLOR}${MESSAGE_COLOR} which is an alias${DEFAULT_COLOR}" 51 | while true ; do 52 | error_message "${MESSAGE_COLOR}Please select a substitute ! Enter the number or the name of the module" 53 | error_message "Press [ENTER] to select choice #1 (the recommended choice).${DEFAULT_COLOR}" 54 | ((N=0)) 55 | for TARGET in $TARGETS ; do 56 | ((N++)) 57 | TARGETBYNUM[$N]=$TARGET 58 | if module_installed $TARGET ; then 59 | error_message " ${QUERY_COLOR}$N${MESSAGE_COLOR} - ${DEFAULT_COLOR}${MODULE_COLOR}$TARGET${DEFAULT_COLOR} ${LRM_COLOR}(Installed)${DEFAULT_COLOR}" 60 | else 61 | error_message " ${QUERY_COLOR}$N${MESSAGE_COLOR} - ${DEFAULT_COLOR}${MODULE_COLOR}$TARGET${DEFAULT_COLOR} ${MESSAGE_COLOR}(Not installed)${DEFAULT_COLOR}" 62 | fi 63 | done 64 | echo -n -e "${MESSAGE_COLOR}Choice> ${DEFAULT_COLOR}" >&2 65 | read -t $PROMPT_DELAY CHOICE 66 | # test directly first 67 | if [[ " $TARGETS " =~ " $CHOICE " ]] ; then 68 | verbose_msg "Stored alias mapping $1 -> $CHOICE" 69 | set_local_config `echo LUNAR_ALIAS_${1:1}` $CHOICE 70 | echo $TARGET 71 | return 72 | # then the number, resolving the default 73 | elif [[ -n "${TARGETBYNUM[${CHOICE:=1}]}" ]] ; then 74 | verbose_msg "Stored alias mapping $1 -> ${TARGETBYNUM[$CHOICE]}" 75 | set_local_config `echo LUNAR_ALIAS_${1:1}` ${TARGETBYNUM[$CHOICE]} 76 | echo ${TARGETBYNUM[$CHOICE]} 77 | return 78 | fi 79 | error_message "${MESSAGE_COLOR}Sorry, I can't do anything with \"${DEFAULT_COLOR}${QUERY_COLOR}$CHOICE${DEFAULT_COLOR}${MESSAGE_COLOR}\", please try again${DEFAULT_COLOR}" 80 | done 81 | } 82 | -------------------------------------------------------------------------------- /libs/check.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################ 3 | # # 4 | # check/lunar - module sanity checking functions # 5 | # # 6 | ############################################################ 7 | # # 8 | # Copyright 2005 Auke Kok under GPLv2 # 9 | # # 10 | ############################################################ 11 | 12 | 13 | run_checks() { 14 | debug_msg "run_checks ($@)" 15 | verbose_msg "Running sanity checks for module \"$1\"" 16 | ( 17 | run_details $1 18 | plugin_call MODULE_CHECK $1 19 | if [ $? == 2 ]; then 20 | return 0 21 | fi 22 | return 1 23 | ) 24 | } 25 | 26 | 27 | # rework_module : re-create depends database for a module 28 | rework_module() { 29 | local MODULE 30 | debug_msg "rework_module ($@)" 31 | 32 | # we declare these local to override the systems default ones: 33 | optional_depends() { 34 | local DEP 35 | debug_msg " optional_depends ($@)" 36 | DEP=$(NEVER_ASK=1 DEPS_ONLY= expand_alias $1) 37 | if module_exiled $DEP ; then 38 | echo "$MODULE:$DEP:off:optional:$2:$3" 39 | else 40 | # check for the current depend selection 41 | if grep -q "^$MODULE:$DEP:on:" "$DEPENDS_STATUS_BACKUP" ; then 42 | echo "$MODULE:$DEP:on:optional:$2:$3" 43 | elif grep -q "^$MODULE:$DEP:off:" "$DEPENDS_STATUS_BACKUP" ; then 44 | echo "$MODULE:$DEP:off:optional:$2:$3" 45 | fi 46 | # if we don't know the answer we leave it open for the user to decide 47 | fi 48 | } 49 | 50 | depends() { 51 | local DEP 52 | debug_msg " depends ($@)" 53 | DEP=$(NEVER_ASK=1 DEPS_ONLY= expand_alias $1) 54 | echo "$MODULE:$DEP:on:required:$2:$3" 55 | } 56 | 57 | run_depends() { 58 | debug_msg " run_depends ($@)" 59 | ( 60 | if run_details $1 &> /dev/null ; then 61 | if has_module_file $MODULE DEPENDS ; then 62 | run_module_file $MODULE DEPENDS | grep -v '%' 63 | fi 64 | fi 65 | ) 66 | } 67 | 68 | # here starts the real work: 69 | MODULE=$1 70 | 71 | # remove whatever depends was residing in the depends state file and 72 | # append the new output: 73 | lock_file $DEPENDS_STATUS_BACKUP && 74 | lock_file $DEPENDS_STATUS && 75 | ( 76 | grep -v "^$MODULE:" "$DEPENDS_STATUS_BACKUP" > $DEPENDS_STATUS 77 | run_depends $MODULE >> $DEPENDS_STATUS 78 | cp $DEPENDS_STATUS $DEPENDS_STATUS_BACKUP 79 | ) 80 | unlock_file $DEPENDS_STATUS 81 | unlock_file $DEPENDS_STATUS_BACKUP 82 | } 83 | 84 | 85 | # fix_depends : single pass to fix depends database 86 | fix_depends () { 87 | local LIST 88 | debug_msg "fix_depends ($@)" 89 | 90 | if [ -n "$1" ] ; then 91 | LIST="$@" 92 | else 93 | LIST=$(list_installed | grep -F -v -x moonbase) 94 | fi 95 | 96 | for MODULE in $LIST ; do 97 | rework_module $MODULE 98 | done 99 | } 100 | 101 | 102 | run_fix() { 103 | local MODULES MODULE KEEP_OBSOLETE 104 | debug_msg "run_fix ($@)" 105 | KEEP_OBSOLETE=1 106 | MODULES=$* 107 | 108 | if [ -z "$MODULES" ] ; then 109 | MODULES=$(list_installed | grep -F -v -x moonbase) 110 | unset KEEP_OBSOLETE 111 | fi 112 | 113 | if [[ -n "$FIXDEPENDS" ]] ; then 114 | for MODULE in $MODULES ; do 115 | fix_depends $MODULE 116 | done 117 | return 118 | fi 119 | 120 | # discover BROKEN modules and note them if we plan on fixing them 121 | if [[ ! -n "$NOFIX" ]] ; then 122 | for MODULE in $MODULES ; do 123 | if ! run_checks $MODULE ; then 124 | BROKEN_MODULES=( ${BROKEN_MODULES[@]} $MODULE ) 125 | fi 126 | done 127 | else 128 | for MODULE in $MODULES ; do 129 | run_checks $MODULE 130 | done 131 | fi 132 | 133 | # if we were called with --fixdepends then we may skip the rest 134 | if [ -n "$FIXDEPENDS" ] ; then 135 | return 136 | fi 137 | 138 | export TMP_LIN_SUCCESS=$(temp_create "successful") 139 | export TMP_LIN_FAIL=$(temp_create "failed") 140 | 141 | if [[ ! -n "$NOFIX" ]] ; then 142 | for MODULE in $(sort_by_dependency ${BROKEN_MODULES[@]}) ; do 143 | if module_installed $MODULE && ! module_held $MODULE ; then 144 | if ! run_checks $MODULE ; then 145 | NEVER_ASK=1 DEPS_ONLY= satisfy_depends && 146 | NEVER_ASK=1 DEPS_ONLY= FIX= satisfy_depends && 147 | 148 | if ! run_checks $MODULE ; then 149 | verbose_msg "Attempting to recompile \"$MODULE\"" 150 | if ! FIX= lin --compile $MODULE ; then 151 | verbose_msg "Attempt to recompile \"$MODULE\" FAILED" 152 | continue 153 | elif ! run_checks $MODULE ; then 154 | verbose_msg "Attempt to recompile \"$MODULE\" succeeded but \"$MODULE\" still is broken!" 155 | KEEP_OBSOLETE=1 156 | continue 157 | fi 158 | fi 159 | fi 160 | fi 161 | done 162 | 163 | # Only remove OBSOLETE if `lunar fix` pass all checks 164 | # not perfect but it will have to do for now 165 | if [ ! -n "$KEEP_OBSOLETE" ]; then 166 | remove_obsolete_libraries 167 | fi 168 | 169 | display_update_log fix 170 | else 171 | display_update_log nofix 172 | fi 173 | 174 | temp_destroy $TMP_LIN_SUCCESS 175 | temp_destroy $TMP_LIN_FAIL 176 | } 177 | -------------------------------------------------------------------------------- /libs/config.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################ 3 | # # 4 | # This code is written for Lunar Linux, see # 5 | # http://lunar-linux.org # 6 | # # 7 | ############################################################ 8 | # # 9 | # $FUNCTIONS/config # 10 | # set_config, get_config, unset_config # 11 | # set_local_config, get_local_config, unset_local_config # 12 | # set_module_config, get_module_config, unset_module_config# 13 | # # 14 | ############################################################ 15 | # # 16 | # Copyrighted Auke Kok 2004 under GPLv2 # 17 | # # 18 | ############################################################ 19 | 20 | 21 | set_config() { 22 | local LINE NEW FILE VAR 23 | debug_msg "set_config ($@)" 24 | 25 | FILE=$1 26 | VAR=$(trim "$2") 27 | LINE=$(grep -w "$VAR=.*" "$FILE") 28 | 29 | shift 2 30 | if [ "$FILE" == "$LOCAL_CONFIG" ] ; then 31 | NEW="$(printf "%16s" "$VAR")=\"$@\"" 32 | else 33 | NEW="$VAR=\"$@\"" 34 | fi 35 | 36 | # on-demand creation 37 | if [ ! -f $FILE ] ; then 38 | touch $FILE 39 | fi 40 | 41 | lock_file $FILE && 42 | if [ -n "$LINE" ] ; then 43 | sedit "/^\s*$VAR=/d" $FILE 44 | fi 45 | echo "$NEW" >> $FILE 46 | unlock_file $FILE 47 | } 48 | 49 | 50 | unset_config() { 51 | debug_msg "unset_config ($@)" 52 | 53 | # on-demand creation 54 | if [ ! -f $1 ] ; then 55 | touch $1 56 | fi 57 | 58 | lock_file $1 && 59 | if [ -n "$2" ] ; then 60 | # make sure we escape those ':' characters: 61 | sedit "/^[ ]*$2=/d" $1 62 | fi 63 | unlock_file $1 64 | } 65 | 66 | 67 | get_config() { 68 | if [[ -f $1 ]] ; then 69 | grep -w "$2=.*" "$1" | cut -d= -f2- | sed -e 's/^"//' -e 's/"$//' 70 | fi 71 | } 72 | 73 | 74 | set_local_config() { 75 | debug_msg "set_local_config ($@)" 76 | local VAR 77 | VAR=$1 78 | shift 79 | set_config "$LOCAL_CONFIG" "$VAR" "$@" 80 | } 81 | 82 | 83 | unset_local_config() { 84 | debug_msg "unset_local_config ($@)" 85 | unset_config "$LOCAL_CONFIG" "$1" 86 | } 87 | 88 | 89 | get_local_config() { 90 | get_config "$LOCAL_CONFIG" "$1" 91 | } 92 | 93 | 94 | set_module_config() { 95 | debug_msg "set_module_config ($@)" 96 | if [ -n "$MODULE" ] ; then 97 | set_config "$DEPENDS_CONFIG/$MODULE" "$1" "$2" 98 | fi 99 | } 100 | 101 | 102 | unset_module_config() { 103 | debug_msg "unset_module_config ($@)" 104 | if [ -n "$MODULE" ] ; then 105 | unset_config "$DEPENDS_CONFIG/$MODULE" "$1" 106 | fi 107 | } 108 | 109 | 110 | get_module_config() { 111 | debug_msg "get_module_config ($@)" 112 | if [ -n "$MODULE" ] ; then 113 | get_config "$DEPENDS_CONFIG/$MODULE" "$1" 114 | fi 115 | } 116 | 117 | 118 | get_other_module_config() { 119 | debug_msg "get_other_module_config ($@)" 120 | if [ -n "$1" ] ; then 121 | get_config "$DEPENDS_CONFIG/$1" "$2" 122 | fi 123 | } 124 | 125 | # function : trim 126 | # usage : trim 127 | # purpose : remove leading and trailing whitespaces from a string 128 | trim() { 129 | local str="$*" 130 | 131 | str="${str#"${str%%[![:space:]]*}"}" 132 | str="${str%"${str##*[![:space:]]}"}" 133 | 134 | printf "%s" "$str" 135 | } 136 | -------------------------------------------------------------------------------- /libs/edit.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # # 3 | # edit.lunar - functions to edit files # 4 | # # 5 | #################################################################### 6 | # # 7 | # Parts copyright Jason Johnston 2002 under GPLv2 # 8 | # # 9 | # Parts copyright Auke Kok 2002 under GPLv2 # 10 | # # 11 | #################################################################### 12 | 13 | 14 | # function : patch_it 15 | # usage : patch_it patch_file patch_level 16 | # purpose : calls "patch -px < $filename", where filename may be a variety 17 | # of formats 18 | patch_it () { 19 | local PATCH TARCMD GZCMD TMPFILE1 TMPFILE2 20 | verbose_msg "patch_it \"$1\" \"$2\""; 21 | 22 | # get patch from $SOURCE_CACHE automatically 23 | if [ ! -f "$1" -a -f "$SOURCE_CACHE/$1" ] ; then 24 | PATCH="$SOURCE_CACHE/$1" 25 | else 26 | PATCH="$1" 27 | fi 28 | 29 | if [[ $PATCH =~ '.tar' ]] ; then 30 | TARCMD="tar x -O" 31 | else 32 | TARCMD="cat" 33 | fi 34 | 35 | case "$PATCH" in 36 | *.bz2) GZCMD=bzcat ;; 37 | *.gz) GZCMD=zcat ;; 38 | *.xz|*.lzma) GZCMD=xzcat ;; 39 | *) GZCMD=cat ;; 40 | esac 41 | 42 | TMPFILE1=$(temp_create "patch_1") 43 | TMPFILE2=$(temp_create "patch_2") 44 | 45 | if $GZCMD "$PATCH" > $TMPFILE1 ; then 46 | # uncompress OK 47 | if cat "$TMPFILE1" | $TARCMD > $TMPFILE2 ; then 48 | # untar OK 49 | if patch -N -p$2 < $TMPFILE2 ; then 50 | # patch cmd is OK 51 | temp_destroy $TMPFILE1 52 | temp_destroy $TMPFILE2 53 | return 0 54 | fi 55 | fi 56 | fi 57 | 58 | message "${PROBLEM_COLOR}! Broken patch file ${DEFAULT_COLOR}${FILE_COLOR}$PATCH${DEFAULT_COLOR}" 59 | 60 | temp_destroy $TMPFILE1 61 | temp_destroy $TMPFILE2 62 | return 255 63 | } 64 | 65 | 66 | # function : sedit 67 | # usage : sedit sed-statement file [file [file] ...] 68 | # purpose : edit [files] with a sed function 69 | sedit () { 70 | local SEDIT 71 | debug_msg "sedit ($@)" 72 | SEDIT=$1 73 | shift 74 | for FILE in $@ ; do 75 | verbose_msg "Editing \"$FILE\"" 76 | sed -i "$SEDIT" "$FILE" 77 | done 78 | } 79 | 80 | 81 | # function : edit_file 82 | # usage : edit_file FILENAME 83 | # purpose : to edit a file 84 | edit_file() { 85 | debug_msg "edit_file ($@)" 86 | ${EDITOR:-nano} $1 87 | } 88 | -------------------------------------------------------------------------------- /libs/files.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################ 3 | # # 4 | # files.lunar - Functions for module related file # 5 | # operations # 6 | # # 7 | ############################################################ 8 | # # 9 | # Copyright 2022 by Stefan Wold under GPLv2 # 10 | # # 11 | ############################################################ 12 | 13 | handle_config_files() { 14 | debug_msg "handle_config_files ($@)" 15 | 16 | if [[ "$1" =~ ^/etc ]]; then 17 | # we can safely delete symlinks without md5sum checks 18 | if [ -L "$1" ]; then 19 | return 0 20 | fi 21 | 22 | debug_msg "considering config file \"$1\"" 23 | 24 | TARGET_MD5=$(md5sum "$1" | cut -d " " -f 1-1) 25 | OLD_MD5=$(grep -w "$1\$" "$MD5_LOG" | cut -d " " -f 1-1) 26 | 27 | if [ -z "$TARGET_MD5" ]; then 28 | verbose_msg "Skipping removal of \"$1\" due to problem with md5sum" 29 | return 1 30 | fi 31 | 32 | if [ -z "$OLD_MD5" ]; then 33 | verbose_msg "Skipping removal of \"$1\" due to missing original md5sum" 34 | return 1 35 | fi 36 | 37 | if [ "$TARGET_MD5" == "$OLD_MD5" ]; then 38 | debug_msg "removing \"$1\"" 39 | return 0 40 | fi 41 | 42 | if [ "$TARGET_MD5" != "$OLD_MD5" ]; then 43 | verbose_msg "Skipping removal of \"$1\" due to md5sum mismatch" 44 | if [ "$PRESERVE" == "on" ]; then 45 | debug_msg "PRESERVE=on, keeping \"$1\"" 46 | return 1 47 | else 48 | debug_msg "PRESERVE=off, archiving \"$1\"" 49 | mv $1 $1.$(date +%Y%m%d%H%M) 50 | return 1 51 | fi 52 | fi 53 | fi 54 | return 0 55 | } 56 | 57 | remove_something() { 58 | debug_msg "remove_something ($@)" 59 | if [ -z "$1" ]; then 60 | verbose_msg "remove_something: Nothing to remove!" 61 | return 1 62 | fi 63 | 64 | if ! [ -e "$1" ] && ! [ -L "$1" ]; then 65 | verbose_msg "remove_something: no such file \"$1\"!" 66 | return 1 67 | fi 68 | 69 | if [ -d "$1" ] && ! [ -L "$1" ]; then 70 | if rmdir "$1" 2>/dev/null; then 71 | debug_msg "ok : rmdir \"$1\"" 72 | else 73 | debug_msg "failed: rmdir \"$1\"" 74 | fi 75 | else 76 | if rm -f "$1" 2>/dev/null; then 77 | debug_msg "ok : rm -f \"$1\"" 78 | else 79 | # this might be problematic so verbose_msg: 80 | verbose_msg "failed: rm -f \"$1\"" 81 | fi 82 | fi 83 | } 84 | 85 | process_directories() { 86 | debug_msg "process_directories ($@)" 87 | 88 | if [ -z "$1" ]; then 89 | debug_msg "process_directories: No args, exiting" 90 | return 1 91 | fi 92 | 93 | sort -r "$1" | while read LINE; do 94 | remove_something "$LINE" 95 | done 96 | } 97 | 98 | # function : save_modifed_configs 99 | # usage : save_modifed_configs 100 | # purpose : remove unchanged configs or generate a list of configs to keep (later used in cleanup) 101 | save_modified_configs() { 102 | local install_log module version changed_configs 103 | 104 | module=$1 105 | version=$2 106 | 107 | install_log=$INSTALL_LOGS/$module-$version 108 | MD5_LOG=$MD5SUM_LOGS/$module-$version 109 | 110 | # TODO: include proper etc file handling (predefined list using DETAILS) 111 | while read TARGET; do 112 | if handle_config_files "$TARGET"; then 113 | remove_something "$TARGET" 114 | elif [ "$PRESERVE" == "on" ]; then 115 | changed_configs+=" ^$TARGET\$" 116 | fi 117 | done < <(grep "^/etc" "$install_log" | grep -v -f "$PROTECTED") 118 | 119 | if [ -n "$changed_configs" ]; then 120 | verbose_msg "setting ETC_CHANGED_CONFIGS ($changed_configs)" 121 | set_module_config "ETC_CHANGED_CONFIGS" "$(trim $changed_configs)" 122 | fi 123 | } 124 | 125 | # function : cleanup_old_module_files 126 | # usage : cleanup_old_module_files 127 | # purpose : cleanup alien files after a module update 128 | cleanup_old_module_files() { 129 | local old_inst_log new_inst_log tmp_dir_list sed_pattern changed_configs tmp_changed_configs 130 | debug_msg "cleanup_old_module_files ($@)" 131 | verbose_msg "removing old files" 132 | 133 | regex_pattern="/^\/(usr\/)?lib(32|64)/s;\/lib(32|64);\/lib;g" 134 | 135 | old_inst_log=$1 136 | new_inst_log=$2 137 | 138 | tmp_dir_list=$(temp_create "${MODULE}.cleanup.dir_list") 139 | changed_configs=$(get_module_config "ETC_CHANGED_CONFIGS") 140 | tmp_changed_configs=$(temp_create "$MODULE.changed.configs") 141 | 142 | if [ -n "$changed_configs" ]; then 143 | printf "%s\n" $changed_configs > $tmp_changed_configs 144 | fi 145 | 146 | verbose_msg "changed configs read from $tmp_changed_configs ($changed_configs)" 147 | 148 | if [ -s "$old_inst_log" -a -s "$new_inst_log" ]; then 149 | comm -23 <(sed -r "$regex_pattern" $old_inst_log | sort -u) <(sed -r "$regex_pattern" $new_inst_log | sort -u) | \ 150 | grep -v -f "$tmp_changed_configs" | \ 151 | while read TARGET; do 152 | if [ -e "$TARGET" ] || [ -L "$TARGET" ]; then 153 | if [ -d "$TARGET" ]; then 154 | echo "$TARGET" >> $tmp_dir_list 155 | else 156 | remove_something "$TARGET" 157 | fi 158 | fi 159 | done 160 | process_directories $tmp_dir_list 161 | fi 162 | 163 | ldconfig 164 | temp_destroy $tmp_dir_list 165 | temp_destroy $tmp_changed_configs 166 | unset_module_config "ETC_CHANGED_CONFIGS" 167 | delete_old_install_log 168 | } 169 | -------------------------------------------------------------------------------- /libs/init.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # # 3 | # init.lunar - Lunar subroutines # 4 | # # 5 | ############################################################ 6 | # # 7 | # this WAS the subroutines of a source based Linux distro, # 8 | # calls Sorcerer GNU/Linux, or SGL. SGL is no longer # 9 | # available with GPL license. Since this script was taken # 10 | # before licensing scheme change, no legal problems I # 11 | # guess. # 12 | # # 13 | # the code is re-written for Lunar. The previous Copyright # 14 | # notices are kept; just in case some code is left :=) # 15 | # Kagan Kongar , 20020519 # 16 | # # 17 | ############################################################ 18 | # # 19 | # Copyright 2001 by Kyle Sallee # 20 | # # 21 | # Parts Copyrighted Hendrik Visage 2002 under GPLv2 # 22 | # # 23 | # Parts Copyrighted Kagan Kongar 2002 under GPLv2 # 24 | # # 25 | ############################################################ 26 | 27 | 28 | # function : enviro_check 29 | # usage : enviro_check 30 | # purpose : check if the shell is proper 31 | enviro_check() { 32 | debug_msg "enviro_check ($@)" 33 | if [ -z $LUNAR_INSTALL ]; then 34 | if [ -z "$SHELL" ] || [ "$(getent passwd $USER | cut -d: -f3)" != "0" ] ; then 35 | message "${PROBLEM_COLOR}WARNING:${DEFAULT_COLOR}${MESSAGE_COLOR}" \ 36 | "You are not running a fully initialized root shell, consider" 37 | message "running a proper root shell with 'su -'" \ 38 | "${DEFAULT_COLOR}" 39 | fi 40 | fi 41 | } 42 | 43 | # function : root_check 44 | # usage : root_check 45 | # purpose : check if the user is root 46 | root_check() { 47 | debug_msg "root_check ($@)" 48 | if [ "$UID" != "0" ] ; then 49 | message "${PROBLEM_COLOR}ERROR:${DEFAULT_COLOR}${MESSAGE_COLOR}" \ 50 | "User must have root privileges to run this program" \ 51 | "${DEFAULT_COLOR}" 52 | exit 1 53 | fi 54 | } 55 | 56 | 57 | # function : set_priority 58 | # usage : set_priority 59 | # purpose : force niceness on lunar's processes 60 | set_priority() { 61 | debug_msg "set_priority ($@)" 62 | LUNAR_PRIORITY=${LUNAR_PRIORITY:-"+10"} 63 | renice "$LUNAR_PRIORITY" -p $$ 2> /dev/null >/dev/null 64 | } 65 | -------------------------------------------------------------------------------- /libs/kernel.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################ 3 | # # 4 | # kernel.lunar functions for managing kernel installation # 5 | # and bootloaders # 6 | # # 7 | ############################################################ 8 | # # 9 | # Parts Copyright Terry Chan 2002 GPLv2 # 10 | # Parts Copyright Niki Guldbrand 2003 GPLv2 # 11 | # Parts Copyright FW Systems llc 2003 GPLv2 # 12 | # Parts Copyright Auke Kok 2005 GPLv2 # 13 | # Parts Copyright Stefan Wold 2010 GPLv2 # 14 | # # 15 | ############################################################ 16 | 17 | 18 | # Description : This function makes backups of the kernels and modules 19 | # Arg 1 : Filename of the kernel to backup (With or without full path) 20 | # With the format $VERSION_$EXTRAVERSION 21 | backup_mods_krnl() { 22 | local ARCH=$(arch) 23 | debug_msg "backup_mods_krnl ($@)" 24 | 25 | devoke_installwatch 26 | 27 | if [ -f /boot/vmlinuz-$1-$ARCH ]; then 28 | verbose_msg "copying vmlinuz-$1.$ARCH" 29 | cp -p /boot/vmlinuz-$1-$ARCH{,.old} 30 | fi 31 | if [ -d /lib/modules/$1 ]; then 32 | rm -rf /lib/modules/$1.old 33 | cp -a /lib/modules/$1{,.old} 34 | fi 35 | if [ -f /boot/config-${1}-$ARCH.gz ]; then 36 | verbose_msg "copying config-$1.$ARCH.gz" 37 | cp -p /boot/config-${1}-$ARCH{,.old}.gz 38 | fi 39 | if [ -f /boot/System.map-${1}-$ARCH ]; then 40 | verbose_msg "copying System.map-$1-$ARCH" 41 | cp -p /boot/System.map-${1}-$ARCH{,.old} 42 | fi 43 | 44 | invoke_installwatch 45 | } 46 | 47 | 48 | update_bootloader() { 49 | plugin_call KERNEL_UPDATEBOOTLOADER $1 $2 50 | } 51 | 52 | 53 | # function: kernel_config_exists 54 | # usage: kernel_config_exists 55 | # purpose: Verify that a readable kernel config is available 56 | # returns: Config file path, (0) if successful, (1) if config not found 57 | kernel_config_exists() { 58 | if [ -e /proc/config.gz ]; then 59 | echo "/proc/config.gz" 60 | elif [ -e /lib/modules/$(uname -r)/source/.config ]; then 61 | echo "/lib/modules/$(uname -r)/source/.config" 62 | elif [ -e /boot/config-$(uname -r)-$(arch).gz ]; then 63 | echo "/boot/config-$(uname -r)-$(arch).gz" 64 | elif [ -e /usr/src/linux/.config ]; then 65 | echo "/usr/src/linux/.config" 66 | elif [ -e $CONFIG_CACHE/.config.current ]; then 67 | echo "$CONFIG_CACHE/.config.current" 68 | elif [ -e $CONFIG_CACHE/.config.2.6.stable ]; then 69 | echo "$CONFIG_CACHE/.config.2.6.stable" 70 | else 71 | return 1 72 | fi 73 | return 0 74 | } 75 | 76 | # function: kernel_option_present 77 | # usage: kernel_option_present config_option 78 | # purpose: Check if a kernel option is configured 79 | # returns: (0) if option is found and enabled, (1) if option is not found or disabled, (255) if kernel config not found 80 | kernel_option_present() { 81 | local KERNEL_CONFIG KERNEL_OPTION KERNEL_VALUE CAT 82 | KERNEL_CONFIG=$(kernel_config_exists) || return 255 83 | KERNEL_OPTION=$1 84 | KERNEL_VALUE=$2 85 | 86 | case $KERNEL_CONFIG in 87 | *.gz) 88 | CAT=zcat 89 | ;; 90 | *) 91 | CAT=cat 92 | ;; 93 | esac 94 | 95 | if [ -n "$KERNEL_VALUE" ]; then 96 | if $CAT "$KERNEL_CONFIG" | grep -Eq "^$KERNEL_OPTION=\"$KERNEL_VALUE\""; then 97 | return 0 98 | fi 99 | else 100 | if $CAT "$KERNEL_CONFIG" | grep -Eq "^$KERNEL_OPTION=(y|m)$"; then 101 | return 0 102 | fi 103 | fi 104 | 105 | return 1 106 | } 107 | -------------------------------------------------------------------------------- /libs/locking.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # # 3 | # This code is written for Lunar Linux, see # 4 | # http://lunar-linux.org # 5 | # # 6 | ############################################################ 7 | # # 8 | # $FUNCTIONS/locking # 9 | # includes lock_file and unlock_file functions # 10 | # # 11 | # 20020526 # 12 | # # 13 | ############################################################ 14 | # # 15 | # Copyrighted Kagan Kongar 2002 under GPLv2 # 16 | # # 17 | ############################################################ 18 | 19 | # function: lock_file 20 | # usage : lock_file 21 | # purpose : locks a file or wait until. Better use as lock_file && || etc 22 | function lock_file() { 23 | local TEMPFILE LOCKFILE STALE_PID 24 | debug_msg "lock_file ($@)" 25 | function file_lock() { 26 | #locking is disabled if ln or rm not found!! 27 | [ -x "/bin/ln" ] || return 0 28 | [ -x "/bin/rm" ] || return 0 29 | 30 | TEMPFILE="$1.$$" 31 | LOCKFILE="$1.lock" 32 | 33 | # test permission 34 | if ! echo $$ > $TEMPFILE 2>/dev/null; then 35 | message "${PROBLEM_COLOR}You don't have permission to access" \ 36 | "$TEMPFILE ${DEFAULT_COLOR}" 37 | exit 1 38 | fi 39 | 40 | # file exists? 41 | if [ ! -f "$1" ]; then 42 | touch "$1" 43 | fi 44 | 45 | # set lockfile 46 | if ln $TEMPFILE $LOCKFILE 2>/dev/null ; then 47 | rm -f $TEMPFILE 48 | return 0 49 | # failed due to other lock? 50 | elif [ ! -f "$LOCKFILE" ]; then 51 | return 1 52 | fi 53 | # stale lock? 54 | STALE_PID=`< $LOCKFILE` 55 | if [ "$STALE_PID" -le "0" ]; then 56 | return 1 57 | fi 58 | if kill -0 $STALE_PID 2>/dev/null; then 59 | rm -f $TEMPFILE 60 | return 1 61 | fi 62 | # yes, stale 63 | rm -f $LOCKFILE 2>/dev/null && 64 | echo "Removed stale lock file of process $STALE_PID" 65 | if ln $TEMPFILE $LOCKFILE 2>/dev/null; then 66 | rm -f $TEMPFILE 67 | return 0 68 | fi 69 | rm -f $TEMPFILE 70 | return 1 71 | } 72 | 73 | while ! file_lock $1; do 74 | message "${MESSAGE_COLOR}Waiting to lock the file $1${DEFAULT_COLOR}" 75 | sleep 1 76 | done 77 | return 0 78 | } 79 | 80 | 81 | # function: unlock_file 82 | # usage : unlock_file 83 | # purpose : unlocks a file 84 | function unlock_file() { 85 | debug_msg "unlock_file ($@)" 86 | #unlocking is disabled if rm not found!! 87 | [ -x "/bin/rm" ] || return 0 88 | rm -f $1.lock 2>/dev/null && return 0 89 | return 1 90 | } 91 | 92 | 93 | lin_locked() { 94 | debug_msg "lin_locked ($@)" 95 | [ -f /var/lock/installing.$1 ] && 96 | ps `cat "/var/lock/installing.$1"` | 97 | grep -q "lin" 98 | } 99 | 100 | 101 | solo_locked() { 102 | debug_msg "solo_locked ($@)" 103 | for SOLO_MODULE in `cat "$SOLO"` ; do 104 | if lin_locked $SOLO_MODULE ; then 105 | message "${PROBLEM_COLOR}lining${DEFAULT_COLOR}${MESSAGE_COLOR} of other modules is disabled during a lin ${MODULE_COLOR}$SOLO_MODULE${DEFAULT_COLOR}" 106 | return 107 | fi 108 | done 109 | false 110 | } 111 | 112 | 113 | current_locked() { 114 | debug_msg "current_locked ($@)" 115 | if lin_locked $MODULE; then 116 | message "${QUERY_COLOR}Detected lin lock file: ${FILE_COLOR}$linING${DEFAULT_COLOR}" 117 | message "${MESSAGE_COLOR}Now waiting for ${MODULE_COLOR}${MODULE}${DEFAULT_COLOR}${MESSAGE_COLOR} to finish installing or for the lock to clear.${DEFAULT_COLOR}" 118 | 119 | while lin_locked $MODULE; do sleep 2; done 120 | false 121 | else 122 | false 123 | fi 124 | } 125 | -------------------------------------------------------------------------------- /libs/logging.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # # 3 | # This code is written for Lunar Linux, see # 4 | # http://lunar-linux.org # 5 | # # 6 | ############################################################ 7 | # # 8 | # $FUNCTIONS/logging.lunar # 9 | # # 10 | ############################################################ 11 | 12 | 13 | start_logging () { 14 | debug_msg "start_logging ($@)" 15 | export C_LOG=$(temp_create "${MODULE}.compile-log") 16 | export C_FIFO=$(temp_create "${MODULE}.compile-fifo") 17 | 18 | # just remaking this as FIFO 19 | rm -f $C_FIFO 20 | mknod $C_FIFO p 21 | echo "++ Mark Compile start : \"$MODULE\" \"$VERSION\" \"$(date -Ru)\"" > $C_LOG 22 | activate_voyeur 23 | } 24 | 25 | 26 | stop_logging() { 27 | debug_msg "stop_logging ($@)" 28 | # Make sure the FIFO gets closed 29 | echo > $C_FIFO 30 | echo "++ Mark Compile stop : \"$MODULE\" \"$VERSION\" \"$(date -Ru)\"" >> $C_LOG 31 | message "${MESSAGE_COLOR}Creating" \ 32 | "${FILE_COLOR}$COMPILE_LOGS/$MODULE-$VERSION.${COMPRESS_METHOD}" \ 33 | "${DEFAULT_COLOR}" 34 | 35 | ${COMPRESS_METHOD/bz2/bzip2} -9f $COMPRESS_METHOD_ARGS < $C_LOG > $COMPILE_LOGS/$MODULE-$VERSION.${COMPRESS_METHOD} 36 | temp_destroy $C_LOG 37 | temp_destroy $C_FIFO 38 | } 39 | 40 | 41 | progress() { 42 | local OLDLOG OLDSZ S PC 43 | OLDLOG=$(ls -1d $COMPILE_LOGS/$MODULE-*.{xz,bz2} 2>&- | head -n 1) 44 | STIME=$(date +%s) 45 | if [[ -f $OLDLOG ]]; then 46 | X="############################################################" 47 | Y=" " 48 | OLDSZ=$(xzbz -dc $OLDLOG | wc -c) 49 | OLDTIMES=($(xzbz -dc $OLDLOG | grep 'Mark Compile ' | cut -d \" -f6 | while read TIME ; do date +%s -d "$TIME" ; done)) 50 | CTIME=$((${OLDTIMES[1]} - ${OLDTIMES[0]})) 51 | echo "Last compile time: $((CTIME / 60))m$((CTIME % 60))s" 52 | while true ; do 53 | read -t 2 LINE 54 | STATUS=$? 55 | if [ $STATUS -gt 128 ]; then 56 | sleep 2 57 | continue 58 | elif [ $STATUS -eq 1 ]; then 59 | echo -ne "\r [${X:0:60}] (100%)\n" 60 | exit 61 | fi 62 | (( S += ${#LINE} )) 63 | if [[ $S -gt OLDSZ ]]; then 64 | # never print 100% - subtract 1 :) 65 | S=$((OLDSZ - 1)) 66 | fi 67 | PC=$((S * 100 / OLDSZ)) 68 | L=$((S * 60 / OLDSZ)) 69 | CTIME=$(($(date +%s) - $STIME)) 70 | echo -ne "\r [${X:0:$L}${Y:0:$((60 - L))}] ($PC%) $((CTIME / 60))m$((CTIME % 60))s \r" 71 | done 72 | else 73 | SPINNER="/-\|" 74 | # spinerrrrrr!!!! 75 | while true ; do 76 | read -t 2 LINE 77 | STATUS=$? 78 | if [ $STATUS -gt 128 ]; then 79 | sleep 2 80 | continue 81 | elif [ $STATUS -eq 1 ]; then 82 | echo -ne "\r [#]\n" 83 | exit 84 | fi 85 | ((C++)) 86 | if [[ $C -gt $((${#SPINNER} - 1)) ]]; then 87 | C=0 88 | fi 89 | CTIME=$(($(date +%s) - $STIME)) 90 | echo -en "\r [${SPINNER:$C:1}] $((CTIME / 60))m$((CTIME % 60))s \r" 91 | done 92 | fi 93 | } 94 | 95 | 96 | activate_voyeur() { 97 | debug_msg "activate_voyeur ($@)" 98 | if [ -z "$SILENT" ] ; then 99 | case $VOYEUR in 100 | on) ( tee -a $C_LOG < $C_FIFO ; rm -f "$C_FIFO" ) & ;; 101 | p*) ( tee -a $C_LOG < $C_FIFO | progress ; rm -f "$C_FIFO" ) & ;; 102 | *) ( tee -a $C_LOG < $C_FIFO >/dev/null ; rm -f "$C_FIFO" ) & ;; 103 | esac 104 | else 105 | ( tee -a $C_LOG < $C_FIFO >/dev/null ; rm -f "$C_FIFO" ) & 106 | fi 107 | } 108 | 109 | 110 | activity_log() { 111 | debug_msg "activity_log ($@)" 112 | lock_file $ACTIVITY_LOG && 113 | echo -e "$(date -u +%Y%m%d-%T)\t$1\t$2\t$3\t$4\t$5" >> $ACTIVITY_LOG 114 | unlock_file $ACTIVITY_LOG 115 | } 116 | -------------------------------------------------------------------------------- /libs/moonbase.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # # 3 | # moonbase.lunar - get moonbase from the net # 4 | # # 5 | ############################################################ 6 | # # 7 | # Copyrighted Auke Kok 2002 under GPLv2 # 8 | # # 9 | ############################################################ 10 | 11 | 12 | get_moonbase () { 13 | ( 14 | debug_msg "get_moonbase ($@)" 15 | if $(module_held "moonbase") ; then 16 | verbose_msg "Skipping compile and install for held module \"moonbase\"" 17 | return 18 | fi 19 | 20 | SYSTEM_MOONBASE=/var/lib/lunar/moonbase 21 | 22 | # prevent using stale copies of moonbase. You can still override moonbase's 23 | # URL with `lunar set MOONBASE_URL[0] http://..... 24 | unset LRESORT_URL FRESORT_URL 25 | 26 | # the following overrides run_details: 27 | run_details() { 28 | debug_msg " run_details ($@)" 29 | MODULE=moonbase 30 | VERSION=`date -u +%Y%m%d.%H` 31 | SOURCE=$MODULE.tar.bz2 32 | SOURCE_URL_FULL=$MOONBASE_URL/$SOURCE 33 | PARTIAL=off 34 | CLEAR_CACHE=on 35 | } 36 | 37 | # make sure we set these values up front to be sure 38 | run_details moonbase 39 | rm -f $TMPDIR/$SOURCE 40 | 41 | if [ ! -d "$SYSTEM_MOONBASE" ] ; then 42 | mkdir -p $SYSTEM_MOONBASE 43 | fi 44 | 45 | if [ ! -d "$SYSTEM_MOONBASE/zlocal" ] ; then 46 | mkdir -p $SYSTEM_MOONBASE/zlocal 47 | fi 48 | 49 | if [ "$SYSTEM_MOONBASE" == "$MOONBASE" ]; then 50 | push_uniq_id 51 | if ! download_module $MODULE ; then 52 | OUTCOME=failed 53 | INFO="Could not download a fresh moonbase" 54 | else 55 | message "${MESSAGE_COLOR}Preparing to install ${FILE_COLOR}${SOURCE}" \ 56 | "${DEFAULT_COLOR}${MESSAGE_COLOR}...${DEFAULT_COLOR}" && 57 | mv $SYSTEM_MOONBASE/zlocal/ /var/lib/lunar/.zlocal-backup && 58 | rm -rf $SYSTEM_MOONBASE && 59 | TMP_MODULE_INDEX=$(temp_create "temp.module.index") && 60 | cp $MODULE_INDEX $TMP_MODULE_INDEX && 61 | lrm moonbase && 62 | mkdir $SYSTEM_MOONBASE && 63 | mv /var/lib/lunar/.zlocal-backup $SYSTEM_MOONBASE/zlocal && 64 | message "${MESSAGE_COLOR}Extracting ${FILE_COLOR}${SOURCE}" \ 65 | "${DEFAULT_COLOR}${MESSAGE_COLOR}...${DEFAULT_COLOR}" && 66 | bzcat $SOURCE_CACHE/$SOURCE | tar xv -C /var/lib/lunar | \ 67 | sed "s:^:/var/lib/lunar/:g" > $INSTALL_LOGS/$MODULE-$VERSION && 68 | echo $INSTALL_LOGS/$MODULE-$VERSION >> $INSTALL_LOGS/$MODULE-$VERSION && 69 | echo "$MD5SUM_LOGS/$MODULE-$VERSION" >> $INSTALL_LOGS/$MODULE-$VERSION && 70 | message "${MESSAGE_COLOR}Created ${FILE_COLOR}$INSTALL_LOGS/$MODULE-$VERSION" \ 71 | "${DEFAULT_COLOR}${MESSAGE_COLOR}${DEFAULT_COLOR}" && 72 | # create an md5sum log 73 | create_md5sum_log && 74 | 75 | add_module $MODULE installed $VERSION $(du -ks $SYSTEM_MOONBASE | cut -f1)KB && 76 | OUTCOME=success || OUTCOME=failed 77 | fi 78 | fi 79 | 80 | if [ "$OUTCOME" != "failed" ] ; then 81 | # get ready to regenerate the module index cache file 82 | create_module_index && 83 | create_depends_cache && 84 | update_depends && 85 | update_plugins && 86 | display_moonbase_changes && 87 | temp_destroy $TMP_MODULE_INDEX && 88 | OUTCOME=success || OUTCOME=failed 89 | fi 90 | 91 | if [ "$MOONBASE_ACT_LOG" == "on" ]; then 92 | activity_log "lin" "moonbase" "$VERSION" "$OUTCOME" "$INFO" 93 | fi 94 | 95 | if [ "$OUTCOME" == "failed" ] ; then 96 | return 1 97 | fi 98 | ) 99 | } 100 | -------------------------------------------------------------------------------- /libs/optimize.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################ 3 | # # 4 | # optimize.lunar - Lunar general optimization code # 5 | # # 6 | ############################################################ 7 | # # 8 | # Copyright 2006 by Auke Kok under GPLv2 # 9 | # # 10 | ############################################################ 11 | 12 | 13 | bad_flags() 14 | { 15 | debug_msg "bad_flags ($@)" 16 | verbose_msg "bad_flags \"$@\"" 17 | 18 | # maintain some degree of backward compatibility here 19 | if [[ "$1" == "ALL" ]]; then 20 | unset CFLAGS CXXFLAGS CPPFLAGS LDFLAGS 21 | elif [[ "$1" == "compiler" ]]; then 22 | unset CFLAGS CXXFLAGS CPPFLAGS 23 | elif [[ "$1" == "linker" ]]; then 24 | unset LDFLAGS 25 | else 26 | for BAD_FLAG in "$@" ; do 27 | CFLAGS="${CFLAGS//$BAD_FLAG/}" 28 | CXXFLAGS="${CXXFLAGS//$BAD_FLAG/}" 29 | CPPFLAGS="${CPPFLAGS//$BAD_FLAG/}" 30 | LDFLAGS="${LDFLAGS//$BAD_FLAG/}" 31 | done 32 | fi 33 | 34 | verbose_msg "CFLAGS=\"$CFLAGS\"" 35 | verbose_msg "CXXFLAGS=\"$CXXFLAGS\"" 36 | verbose_msg "CPPFLAGS=\"$CPPFLAGS\"" 37 | verbose_msg "LDFLAGS=\"$LDFLAGS\"" 38 | } 39 | 40 | 41 | optimize_menu() 42 | {( 43 | export IFS=$'\t\n' 44 | while true; do 45 | if [ -z "$(plugin_call OPTIMIZE_MENU)" ]; then 46 | $DIALOG --msgbox "There are no configurable compontents. Please update your moonbase!" 6 60 47 | return 48 | fi 49 | PLUGIN=`$DIALOG --cancel-label "Close" --default-item "$PLUGIN" --menu "Select a component for which to configure optimizations" 0 0 0 $(plugin_call OPTIMIZE_MENU)` 50 | if [ $? != 0 ]; then 51 | return 52 | fi 53 | 54 | plugin_call OPTIMIZE_MENU $PLUGIN 55 | done 56 | )} 57 | 58 | 59 | # because we pretty much need to know our $BUILD string 60 | # everywhere this code is separate and guides all other 61 | # parts of lunar where related things are done. Here we 62 | # autodetect the most important part but leave it open 63 | # to the user to override it 64 | 65 | # PLATFORM - translated uname -m / arch 66 | PLATFORM=$(uname -m | sed 's/i[3456]86/x86/') 67 | # BUILD - 68 | case $PLATFORM in 69 | x86|x86_64) 70 | BUILD=$(uname -m)-pc-linux-gnu ;; 71 | *) 72 | BUILD=$(uname -m | sed 's/.*/\L&/g')-linux-gnu ;; 73 | esac 74 | -------------------------------------------------------------------------------- /libs/plugins.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################ 3 | # # 4 | # plugins.lunar - Lunar plugin code # 5 | # # 6 | ############################################################ 7 | # # 8 | # Copyright 2005 by Auke Kok under GPLv2 # 9 | # # 10 | ############################################################ 11 | 12 | # 13 | # plugin handler return status convention: 14 | # 15 | # when a handler is called, it should use the following return codes 16 | # 17 | # 0 - OK AND HALT, do not process other plugins 18 | # 1 - FAIL, stop executing plugins and report an error 19 | # 2 - OK AND CONTINUE or CONTINUE, run other plugins 20 | # 21 | 22 | plugin_register() { 23 | # first arg: plugin type 24 | # second arg: function hook name 25 | # Defined plugin types: 26 | # 1 - SOURCE_DOWNLOAD download some source code 27 | # 2 - SOURCE_NEEDREFRESH source exists but needs refresh 28 | # 3 - SOURCE_VERIFY perform integrity verification on a file 29 | # 4 - SOURCE_UNPACK unpack a certain file to $(PWD) 30 | # 5 - MODULE_CHECK integrity checking on installed modules 31 | # 6 - KERNEL_UPDATEBOOTLOADER automate bootloader maintenance 32 | # 7 - BUILD_CONFIGURE called before running CONFIGURE 33 | # 8 - BUILD_PRE_BUILD ,, ,, ,, PRE_BUILD 34 | # 9 - BUILD_BUILD ,, ,, ,, BUILD 35 | # 10 - BUILD_INSTALL ,, ,, ,, INSTALL 36 | # 11 - BUILD_POST_BUILD ,, ,, ,, POST_BUILD 37 | # 12 - BUILD_POST_INSTALL called after running POST_INSTALL 38 | # 13 - BUILD_PRE_REMOVE called before running PRE_REMOVE 39 | # 14 - BUILD_POST_REMOVE ,, ,, ,, POST_REMOVE 40 | # 15 - OPTIMIZE_MENU Display optimization menu's 41 | LUNAR_PLUGINS=(${LUNAR_PLUGINS[@]} "$1:$2") 42 | ((LUNAR_PLUGIN_COUNT++)) 43 | debug_msg "Registered plugin #$LUNAR_PLUGIN_COUNT, $1 -> $2()" 44 | } 45 | 46 | 47 | plugin_call() { 48 | local REQUESTED_TYPE COUNT THIS_TYPE THIS_HANDLER RETVAL 49 | debug_msg "plugin_call($@)" 50 | # scan available plugins for plugin_type $1 and pass args to it 51 | REQUESTED_TYPE=$1 52 | shift 53 | for ((COUNT=0; COUNT < $LUNAR_PLUGIN_COUNT; COUNT++)); do 54 | THIS_TYPE=${LUNAR_PLUGINS[$COUNT]%%:*} 55 | THIS_HANDLER=${LUNAR_PLUGINS[$COUNT]#*:} 56 | if [ "$REQUESTED_TYPE" == "$THIS_TYPE" ]; then 57 | # we have identified a valid plugin for this type 58 | $THIS_HANDLER $@ 59 | RETVAL=$? 60 | if [ $RETVAL -eq 2 ]; then 61 | continue 62 | else 63 | debug_msg "plugin $THIS_HANDLER returned \"$RETVAL\"" 64 | return $RETVAL 65 | fi 66 | fi 67 | done 68 | debug_msg "Finished running all plugins for type \"$REQUESTED_TYPE\"" 69 | return 2 70 | } 71 | 72 | 73 | update_plugin() { 74 | local SECTION PLUGIN 75 | debug_msg "update_plugin($@)" 76 | # update plugins of all modules or a specific one 77 | # 78 | # $1 - module name 79 | # $2 - forced removal of plugin 80 | # 81 | # scan module for plugins, and add/delete them as needed 82 | if SECTION=$(find_section $1); then 83 | if [ -d $MOONBASE/$SECTION/$1/plugin.d ]; then 84 | if [ "$2" == "install" ] ; then 85 | for PLUGIN in $MOONBASE/$SECTION/$1/plugin.d/*.plugin; do 86 | debug_msg "Installed \"$(basename $PLUGIN)\"" 87 | install -m644 $PLUGIN $PLUGIN_DIR/ 88 | done 89 | 90 | # Force a reload in the parent lin process, 91 | # this is required if a module dependency adds a plugin 92 | if [ "$MAIN_PPID" != "$PPID" ]; then 93 | case "$(ps -o comm= -p $PPID)" in 94 | lin) 95 | kill -USR1 $PPID 96 | ;; 97 | esac 98 | else 99 | kill -USR1 $$ 100 | fi 101 | elif [ "$2" == "remove" ] || ! module_installed $1 ; then 102 | for PLUGIN in $MOONBASE/$SECTION/$1/plugin.d/*.plugin; do 103 | debug_msg "Removed \"$(basename $PLUGIN)\"" 104 | rm -f $PLUGIN_DIR/$(basename $PLUGIN) 105 | done 106 | else 107 | for PLUGIN in $MOONBASE/$SECTION/$1/plugin.d/*.plugin; do 108 | debug_msg "Installed \"$(basename $PLUGIN)\"" 109 | install -m644 $PLUGIN $PLUGIN_DIR/ 110 | done 111 | fi 112 | reload_plugins 113 | fi 114 | fi 115 | } 116 | 117 | 118 | update_plugins() { 119 | local MODULE 120 | debug_msg "update_plugins($@)" 121 | # find all plugins in moonbase and run update_plugin() on them 122 | verbose_msg "Updating plugins" 123 | find $MOONBASE -wholename "*/plugin.d/*.plugin" | while read PLUGIN ; do 124 | local baseplugin 125 | pluginbase=${PLUGIN%/plugin.d/*} 126 | update_plugin ${pluginbase##*/} 127 | done 128 | } 129 | 130 | 131 | reload_plugins() { 132 | local ITERATOR 133 | debug_msg "reload_plugins($@, TRAP=$TRAP)" 134 | verbose_msg "reload_plugins(TRAP=$TRAP)" 135 | 136 | # Unload current plugins 137 | unset LUNAR_PLUGINS 138 | 139 | for ITERATOR in $PLUGIN_DIR/*.plugin; do 140 | . $ITERATOR 141 | done 142 | } 143 | -------------------------------------------------------------------------------- /libs/prune.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # # 3 | # prune.lunar - Lunar prune code # 4 | # # 5 | ############################################################ 6 | # # 7 | # Copyright 2003 by Auke Kok under GPLv2under GPLv2 # 8 | # # 9 | ############################################################ 10 | 11 | 12 | # function : prune 13 | # usage : prune 14 | # purpose : prune all old logs, source copy's, install caches 15 | prune() { 16 | local TMP_SPOOL_KEEP TMP_CACHE_KEEP MODULE SOURCE VERSION FILE LOGS 17 | debug_msg "prune ($@)" 18 | 19 | if [ -z "$BUILD" ] ; then 20 | eval $(grep BUILD= /etc/lunar/local/optimizations) 21 | fi 22 | 23 | TMP_SPOOL_KEEP=$(temp_create "spool-keep") 24 | TMP_CACHE_KEEP=$(temp_create "cache-keep") 25 | 26 | message "${MESSAGE_COLOR}Generating keep lists...${DEFAULT_COLOR}" 27 | for MODULE in $(list_installed) ; do 28 | # spool: 29 | if [ ! "$MODULE" == "moonbase" ]; then 30 | for SOURCE in $(sources $MODULE) ; do 31 | echo $SOURCE >> $TMP_SPOOL_KEEP 32 | done 33 | # cache: 34 | VERSION=$(installed_version $MODULE) 35 | 36 | echo "$MODULE-$VERSION-$BUILD.tar.xz" >> $TMP_CACHE_KEEP 37 | echo "$MODULE-$VERSION-$BUILD.tar.bz2" >> $TMP_CACHE_KEEP 38 | fi 39 | done 40 | echo "README" >> $TMP_SPOOL_KEEP 41 | echo "cpan" >> $TMP_SPOOL_KEEP 42 | 43 | verbose_msg "finding stale source files" 44 | for FILE in $(ls -1 $SOURCE_CACHE); do 45 | if ! grep -q "$FILE" "$TMP_SPOOL_KEEP" ; then 46 | message "Removing stale source: $SOURCE_CACHE/$FILE" 47 | rm -f $SOURCE_CACHE/$FILE 48 | fi 49 | done 50 | temp_destroy $TMP_SPOOL_KEEP 51 | 52 | verbose_msg "finding stale install caches" 53 | for FILE in $(ls -1 $INSTALL_CACHE); do 54 | if ! grep -q "$FILE" "$TMP_CACHE_KEEP" ; then 55 | message "Removing stale install cache: $INSTALL_CACHE/$FILE" 56 | rm -f $INSTALL_CACHE/$FILE 57 | fi 58 | done 59 | temp_destroy $TMP_CACHE_KEEP 60 | 61 | # the log files are easy: 62 | LOGS=$(cat "$MODULE_STATUS" | cut -d: -f1,4 --output-delimiter="-") 63 | 64 | verbose_msg "finding stale install logs" 65 | for FILE in $(ls -1 $INSTALL_LOGS) ; do 66 | if ! grep -q "$FILE" <<< $LOGS; then 67 | message "Removing stale log: $INSTALL_LOGS/$FILE" 68 | rm $INSTALL_LOGS/$FILE 69 | fi 70 | done 71 | 72 | verbose_msg "finding stale compile logs" 73 | for FILE in $(ls -1 $COMPILE_LOGS) ; do 74 | local file_base 75 | file_base=${FILE%.xz} 76 | file_base=${file_base%.bz2} # compile logs can be either 77 | if ! grep -q "$file_base" <<< $LOGS; then 78 | message "Removing stale log: $COMPILE_LOGS/$FILE" 79 | rm $COMPILE_LOGS/$FILE 80 | fi 81 | done 82 | 83 | verbose_msg "finding stale md5sum logs" 84 | for FILE in $(ls -1 $MD5SUM_LOGS) ; do 85 | if ! grep -q "$FILE" <<< $LOGS; then 86 | message "Removing stale log: $MD5SUM_LOGS/$FILE" 87 | rm $MD5SUM_LOGS/$FILE 88 | fi 89 | done 90 | } 91 | -------------------------------------------------------------------------------- /libs/queue.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # # 3 | # This code is written for Lunar Linux, see # 4 | # http://lunar-linux.org # 5 | # # 6 | ############################################################ 7 | # # 8 | # $FUNCTIONS/queue # 9 | # includes add_queue and remove_queue # 10 | # # 11 | # 20020527 # 12 | # # 13 | ############################################################ 14 | # # 15 | # Copyrighted Kagan Kongar 2002 under GPLv2 # 16 | # # 17 | ############################################################ 18 | 19 | # Definition: 20 | # a queue is a multielement data structure from which elements 21 | # can be removed only in the same order in which they are inserted; 22 | # that is, it follows a FIFO constraint. 23 | 24 | # function: add_queue 25 | # usage : add_queue 26 | # purpose : adds an item to the end of a queue 27 | 28 | add_queue() { 29 | debug_msg "add_queue ($@)" 30 | in_queue() { 31 | debug_msg " in_queue ($@)" 32 | grep -q "^"$2"\$" "$1" && return 0 || return 1 33 | } 34 | 35 | [ "$#" -ne 2 ] && return 1 36 | 37 | [ -f "$1" ] || touch $1 2>/dev/null || return 1 38 | 39 | lock_file $1 && 40 | ! in_queue $1 $2 && echo "$2" >> $1 41 | unlock_file $1 42 | } 43 | 44 | # function: remove_queue 45 | # usage : remove_queue |name| 46 | # purpose : removes an item from a queue OR pops the first element from a queue 47 | 48 | remove_queue() { 49 | debug_msg "remove_queue ($@)" 50 | 51 | [ -f "$1" ] || return 1 52 | 53 | if [ -n "$2" ]; 54 | then 55 | TMP_QUEUE="$TMPDIR/lunar_remove_queue.$$" 56 | rm -f $TMP_QUEUE 2>/dev/null 57 | lock_file $1 && 58 | cat "$1" | grep -v "^"$2"\$" > $TMP_QUEUE 59 | cat "$TMP_QUEUE" > $1 60 | unlock_file $1 61 | rm -f $TMP_QUEUE 2>/dev/null 62 | else 63 | lock_file $1 && 64 | echo `cat "$1" | sed 1!d` && 65 | cat "$1" | sed "1d" > $1 && 66 | unlock_file $1 67 | fi 68 | } 69 | 70 | 71 | push_install_queue() { 72 | debug_msg "push_install_queue ($@)" 73 | remove_queue $REMOVE_QUEUE "$1" 74 | remove_queue $INSTALL_QUEUE "$1" 75 | ! module_installed "$1" && 76 | add_queue $INSTALL_QUEUE "$1" 77 | } 78 | 79 | 80 | push_remove_queue() { 81 | debug_msg "push_remove_queue ($@)" 82 | remove_queue $INSTALL_QUEUE "$1" 83 | remove_queue $REMOVE_QUEUE "$1" 84 | module_installed "$1" && 85 | add_queue $REMOVE_QUEUE "$1" 86 | } 87 | -------------------------------------------------------------------------------- /libs/recovery.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # # 3 | # This code is written for Lunar Linux, see # 4 | # http://lunar-linux.org # 5 | # # 6 | ############################################################ 7 | # # 8 | # $FUNCTIONS/recovery # 9 | # includes rebuild_status_files, replace_status_file, # 10 | # check_status_files # 11 | # 20020528 # 12 | # # 13 | ############################################################ 14 | # # 15 | # Copyrighted Kagan Kongar 2002 under GPLv2 # 16 | # # 17 | ############################################################ 18 | 19 | # function : rebuild_status_files 20 | # usage : rebuild_status_files 21 | # purpose : rebuild the accidentally deleted status files 22 | rebuild_status_files() { 23 | debug_msg "rebuild_status_files ($@)" 24 | 25 | if ! query \ 26 | "Do you want to re-construct the status files from install logs?" y; then 27 | message "${PROBLEM_COLOR}Unable to continue without status files" \ 28 | "${DEFAULT_COLOR}" 29 | exit 1 30 | fi 31 | 32 | if ! [ -d "$INSTALL_LOGS" ]; then 33 | message "${PROBLEM_COLOR}Unable to continue without install logs " \ 34 | "${DEFAULT_COLOR}" 35 | exit 1 36 | fi 37 | 38 | message "${MESSAGE_COLOR}Re-creating status files." \ 39 | "${DEFAULT_COLOR}" 40 | 41 | LOG_FILES=$(ls -rt $INSTALL_LOGS) 42 | for MODULE_NAME in $LOG_FILES; do 43 | COUNTS=3 44 | REAL_NAME=$MODULE_NAME 45 | unset SECTION 46 | while [ "$COUNTS" -gt "0" ]; do 47 | REAL_NAME=$(echo $REAL_NAME | cut -d "-" -f -"$COUNTS") 48 | SECTION=$(find_section $REAL_NAME) 49 | if [ -n "$SECTION" ]; then 50 | ((COUNTS++)) 51 | VERSION=$(echo $MODULE_NAME | cut -d "-" -f "$COUNTS"-) 52 | SIZE=$(find_module_size $REAL_NAME $VERSION) 53 | DATE=$(ls -l $INSTALL_LOGS/$REAL_NAME-$VERSION --time-style=+%Y%m%d | awk '{print $6}') 54 | # adjusted add_module code that echos the DATE field ;^) 55 | lock_file $MODULE_STATUS && 56 | lock_file $MODULE_STATUS_BACKUP && 57 | { 58 | OLD_STATE=$(get_module_state $REAL_NAME "installed") 59 | grep -v "^$REAL_NAME:" "$MODULE_STATUS" > $MODULE_STATUS_BACKUP 60 | if [ -n "$OLD_STATE" ]; then 61 | OLD_STATE="+$OLD_STATE" 62 | fi 63 | echo "$REAL_NAME:$DATE:installed$OLD_STATE:$VERSION:$SIZE" >> $MODULE_STATUS_BACKUP && 64 | cp $MODULE_STATUS_BACKUP $MODULE_STATUS 65 | } 66 | unlock_file $MODULE_STATUS_BACKUP && 67 | unlock_file $MODULE_STATUS && 68 | 69 | message "Added: $REAL_NAME-$VERSION ($SIZE) ($DATE)" 70 | break 71 | fi 72 | ((COUNTS--)) 73 | done 74 | done 75 | 76 | message "${MESSAGE_COLOR}Success!!${DEFAULT_COLOR}\n" 77 | } 78 | 79 | 80 | # function : replace_status_file 81 | # usage : replace_status_file 82 | # purpose : cp $MODULE_STATUS_BACKUP $MODULE_STATUS via query 83 | replace_status_file() { 84 | debug_msg "replace_status_file ($@)" 85 | 86 | if ! [ -f "$MODULE_STATUS_BACKUP" ]; then rebuild_status_files; return; fi 87 | message "${PROBLEM_COLOR}Unable to find MODULE_STATUS file" \ 88 | "${MODULE_COLOR}$MODULE_STATUS" \ 89 | "${DEFAULT_COLOR}" 90 | 91 | if query "Do you want to use the backup?" y; then 92 | if ! [ -f "$MODULE_STATUS_BACKUP" ]; then rebuild_status_files; fi 93 | if `cp $MODULE_STATUS_BACKUP $MODULE_STATUS`; then 94 | message "${MESSAGE_COLOR}Success!!" \ 95 | "${DEFAULT_COLOR}" 96 | else 97 | message "${PROBLEM_COLOR}Unsuccessful :=( No more operation!!" \ 98 | "${DEFAULT_COLOR}" 99 | exit 1 100 | fi 101 | else 102 | message "${PROBLEM_COLOR}Unable to continue without that :=("\ 103 | "No more operation!!" \ 104 | "${DEFAULT_COLOR}" 105 | exit 1 106 | fi 107 | } 108 | 109 | # function : check_status_files 110 | # usage : check_status_files 111 | # purpose : checks the avail of MODULE_STATUS and MODULE_STATUS_BACKUP files 112 | check_status_files() { 113 | debug_msg "check_status_files ($@)" 114 | if ! [ -f "$MODULE_STATUS" ]; then replace_status_file; fi 115 | if ! [ -f "$MODULE_STATUS" ]; then echo "Unknown error!!!"; exit; fi 116 | if ! [ -f "$MODULE_STATUS_BACKUP" ]; then 117 | message "${PROBLEM_COLOR}Unable to find MODULE_STATUS_BACKUP file" \ 118 | "${MODULE_COLOR}$MODULE_STATUS_BACKUP" \ 119 | "${DEFAULT_COLOR}" 120 | if `cp $MODULE_STATUS $MODULE_STATUS_BACKUP`; then 121 | message "${MESSAGE_COLOR}MODULE_STATUS is successfully copied" \ 122 | "to MODULE_STATUS_BACKUP" \ 123 | "${DEFAULT_COLOR}" 124 | else 125 | message "${PROBLEM_COLOR}Unsuccessful while copying" \ 126 | "MODULE_STATUS to MODULE_STATUS_BACKUP :=( " \ 127 | "No more operation!!" \ 128 | "${DEFAULT_COLOR}" 129 | exit 1 130 | fi 131 | fi 132 | } 133 | -------------------------------------------------------------------------------- /libs/sizes.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # # 3 | # This code is written for Lunar Linux, see # 4 | # http://lunar-linux.org # 5 | # # 6 | ############################################################ 7 | # # 8 | # $FUNCTIONS/sizes # 9 | # includes find_module_size # 10 | # # 11 | # 20020527 # 12 | # # 13 | ############################################################ 14 | # # 15 | # Copyrighted Kagan Kongar 2002 under GPLv2 # 16 | # # 17 | ############################################################ 18 | 19 | # function: find_module_size 20 | # usage : find_module_size |version| 21 | # purpose : finds the installed size of module in KB 22 | find_module_size() { 23 | local VERSION LINE SIZE0 SIZE 24 | #this functions checks the modules file if there is already size entry 25 | module_size() 26 | { 27 | local SIZE 28 | unset SIZE 29 | [ -e "$MODULE_STATUS" ] && 30 | SIZE=$(sed -n "s/^$1:.*://p" "$MODULE_STATUS") 31 | [ -n "$SIZE" ] && echo ${SIZE} || false 32 | } 33 | 34 | [ -z "$1" ] && return 35 | 36 | [ -n "$2" ] && VERSION=$2 || VERSION=`installed_version $1` 37 | [ -z "$VERSION" ] && 38 | message "${PROBLEM_COLOR}$1 is not installed${DEFAULT_COLOR}" && 39 | return 40 | 41 | # yes, there is a size entry 42 | module_size $1 $VERSION && return 43 | 44 | # no :( lets dig through logs 45 | [ -e "$INSTALL_LOGS/$1-$VERSION" ] && 46 | while read LINE 47 | do 48 | [ -f "$LINE" ] && 49 | SIZE0=`du "$LINE" | 50 | cut -f 1-1` && 51 | SIZE=$((SIZE0+SIZE)) 52 | done <$INSTALL_LOGS/$1-$VERSION && 53 | echo ${SIZE}KB || 54 | message "${PROBLEM_COLOR}Install log for $1 is not found${DEFAULT_COLOR}" 55 | } 56 | -------------------------------------------------------------------------------- /libs/sources.lunar: -------------------------------------------------------------------------------- 1 | #/bin/bash 2 | ############################################################ 3 | # # 4 | # This code is written for Lunar Linux, see # 5 | # http://lunar-linux.org # 6 | # # 7 | ############################################################ 8 | # # 9 | # $FUNCTIONS/sources # 10 | # includes sources, md5_verify_source, verify_sources # 11 | # verify_source # 12 | # # 13 | # 20020604 # 14 | # # 15 | ############################################################ 16 | # # 17 | # Copyrighted Kagan Kongar 2002 under GPLv2 # 18 | # # 19 | ############################################################ 20 | 21 | 22 | verify_source() { 23 | local VERIFIED SOURCE_FILE 24 | debug_msg "verify_source ($@)" 25 | VERIFIED="true" 26 | for SOURCE_FILE in $@ ; do 27 | if [ ! -f $SOURCE_CACHE/$1 ] ; then 28 | message "${PROBLEM_COLOR}Missing ${FILE_COLOR}${1}${DEFAULT_COLOR}" 29 | message "${PROBLEM_COLOR}Lunar Install aborting.${DEFAULT_COLOR}" 30 | activity_log "lin" "$MODULE" "$VERSION" "failed" "because it was missing source: $1" 31 | return 1 32 | fi 33 | done 34 | } 35 | 36 | 37 | # function : sources 38 | # usage : sources 39 | # purpose : displays the sources needed for a given module 40 | sources() { 41 | ( 42 | debug_msg "sources ($@)" 43 | MAX_SOURCES=${MAX_SOURCES:-100} 44 | 45 | if ! run_details $1 ; then 46 | return 1 47 | fi 48 | 49 | for (( CNT=1; CNT<=$MAX_SOURCES; CNT++ )) ; do 50 | TEMP=SOURCE$((CNT)) 51 | TEMP=${TEMP/%SOURCE1/SOURCE} 52 | 53 | eval SRC=\$${TEMP} 54 | 55 | [ -z "$SRC" ] && break 56 | 57 | echo $SRC 58 | done 59 | ) 60 | } 61 | 62 | 63 | erase() { 64 | debug_msg "erase ($@)" 65 | if [ "$PARTIAL" == "off" ]; then 66 | debug_msg "erase: deleting \"$1\"" 67 | rm -f $1 68 | fi 69 | } 70 | 71 | 72 | unpack() { 73 | local FILENAME 74 | debug_msg "unpack ($@)" 75 | 76 | FILENAME=$SOURCE_CACHE/$1 77 | verbose_msg "Unpacking \"$FILENAME\" in \"$(pwd)\"" 78 | plugin_call SOURCE_UNPACK $SOURCE_CACHE/$1 79 | 80 | if [ "$?" != 0 ] ; then 81 | message "${PROBLEM_COLOR}! Error while unpacking ${FILE_COLOR}$SOURCE_CACHE/$1${DEFAULT_COLOR}${PROBLEM_COLOR}${DEFAULT_COLOR}" 82 | return 1 83 | fi 84 | } 85 | 86 | 87 | # usage: verify_all_sources $MODULE 88 | # check all sources regarding verification method 89 | verify_all_sources() { 90 | ( 91 | debug_msg "verify_all_sources ($@)" 92 | MAX_SOURCES=${MAX_SOURCES:-100} 93 | 94 | if ! run_details $1 ; then 95 | return 1 96 | fi 97 | 98 | if [ -n "$WANT_VERSION" ] ; then 99 | message "${PROBLEM_COLOR}WARNING:${DEFAULT_COLOR}${MESSAGE_COLOR} Integrity checking is disabled when using \"--want\"!${DEFAULT_COLOR}" 100 | return 0 101 | fi 102 | 103 | for (( C=1 ; C<=$MAX_SOURCES ; C++ )) ; do 104 | TEMP=SOURCE$((C)) 105 | TEMP=${TEMP/%SOURCE1/SOURCE} 106 | eval SRC=\$${TEMP} 107 | 108 | [ -z "$SRC" ] && break 109 | 110 | # it needs to exist prior before we can check it: 111 | if ! verify_source $SRC ; then 112 | return 1 113 | fi 114 | eval VFYS=\${${TEMP}_VFY[@]} 115 | 116 | # cumulate result: 117 | unset RESULT 118 | if [ -n "$VFYS" ] ; then 119 | # we need to check ALL args for validity... if one fails we should not 120 | # trust the source 121 | for VFY in $VFYS ; do 122 | plugin_call SOURCE_VERIFY $SRC $VFY 123 | if [ $? == 1 ]; then 124 | RESULT=1 125 | fi 126 | done 127 | # so what if? 128 | if [ "$RESULT" == "1" ] ; then 129 | # remove? 130 | MODULE=$1 131 | message "${MESSAGE_COLOR}You should remove ${DEFAULT_COLOR}${FILE_COLOR}$SRC${DEFAULT_COLOR}${MESSAGE_COLOR} !${DEFAULT_COLOR}" 132 | 133 | if query "Remove \"$SOURCE_CACHE/$SRC\" ? " y ; then 134 | rm -f $SOURCE_CACHE/$SRC 135 | fi 136 | fi 137 | fi 138 | done 139 | 140 | # result? 141 | if [ -n "$RESULT" ] ; then 142 | return 1 143 | fi 144 | 145 | # if we removed something we better make sure we break: 146 | if ! verify_source $(sources $1) ; then 147 | return 1 148 | fi 149 | ) 150 | } 151 | 152 | 153 | rm_source_dir() { 154 | local DEAD_DIR 155 | debug_msg "rm_source_dir ($@)" 156 | 157 | if [ "$KEEP_SOURCE" == "on" ] ; then 158 | return 0 159 | fi 160 | 161 | cd $BUILD_DIRECTORY 162 | DEAD_DIR=$1 163 | DEAD_DIR=${DEAD_DIR:-$SOURCE_DIRECTORY} 164 | 165 | verbose_msg "destroying building dir \"$DEAD_DIR\"" 166 | if grep -q $DEAD_DIR /proc/mounts 167 | then 168 | umount $DEAD_DIR 169 | fi 170 | rm -rf $DEAD_DIR 2> /dev/null 171 | } 172 | 173 | 174 | mk_source_dir() { 175 | local NEW_DIR 176 | debug_msg "mk_source_dir ($@)" 177 | 178 | # yes this sounds weird but it might happen: no dir $BUILD_DIRECTORY on 179 | # clean boxes! 180 | if [ ! -e "$BUILD_DIRECTORY" ] ; then 181 | mkdir -p "$BUILD_DIRECTORY" 182 | fi 183 | cd "$BUILD_DIRECTORY" 184 | NEW_DIR=$1 185 | NEW_DIR=${NEW_DIR:-$SOURCE_DIRECTORY} 186 | 187 | verbose_msg "creating building dir \"$NEW_DIR\"" 188 | if [ -d $NEW_DIR ] ; then 189 | verbose_msg "Removing old source directory first!" 190 | rm_source_dir $NEW_DIR 191 | fi 192 | mkdir -p $NEW_DIR 193 | if [ ${KEEP_SOURCE:-off} != on -a ${TMPFS_BUILD:-off} == on ] 194 | then 195 | if grep $NEW_DIR /proc/mounts > /dev/null 196 | then 197 | umount $NEW_DIR 198 | fi 199 | mount -t tmpfs tmpfs $NEW_DIR 200 | fi 201 | } 202 | 203 | 204 | validate_source_dir() { 205 | debug_msg "validate_source_dir ($@)" 206 | 207 | verbose_msg "validating \"$SOURCE_DIRECTORY\"" 208 | if [[ -n $SOURCE_DIRECTORY && 209 | $SOURCE_DIRECTORY != $BUILD_DIRECTORY && 210 | $SOURCE_DIRECTORY =~ $BUILD_DIRECTORY ]]; then 211 | true 212 | else 213 | message "\$SOURCE_DIRECTORY and \$BUILD_DIRECTORY must not be the same." 214 | message "\$SOURCE_DIRECTORY must not be empty." 215 | message "\$SOURCE_DIRECTORY must be a subdirectory of \$BUILD_DIRECTORY" 216 | false 217 | fi 218 | } 219 | -------------------------------------------------------------------------------- /libs/temp.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # # 3 | # temp.lunar - lunar temp code handling # 4 | # # 5 | #################################################################### 6 | # # 7 | # Copyright 2003 - Auke Kok under GPLv2 # 8 | # # 9 | #################################################################### 10 | # # 11 | # temp.lunar contains uniform temporary file name creation and # 12 | # tracking. All lunar tools MUST use these functions if they wish # 13 | # to perform temporary file operations # 14 | # # 15 | # functions: temp_create, temp_destroy # 16 | # # 17 | #################################################################### 18 | 19 | 20 | temp_create() { 21 | local TMPFILE 22 | debug_msg "temp_create ($@)" 23 | TMPFILE="$@" 24 | if TMPFILE=$(mktemp -p "$TMPDIR" -t lunar.`basename $0`.$TMPFILE.$$.XXXXXXXXXX ) ; then 25 | echo $TMPFILE 26 | else 27 | message "${PROBLEM_COLOR}ERROR:${DEFAULT_COLOR}" \ 28 | "Cannot create temp file${DEFAULT_COLOR}" 29 | exit 1 30 | fi 31 | } 32 | 33 | 34 | temp_destroy() { 35 | debug_msg "temp_destroy ($@)" 36 | if [ -e "$1" ] ; then 37 | rm -f "$1" 38 | fi 39 | } 40 | -------------------------------------------------------------------------------- /libs/tracking.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # # 3 | # subroutines - Lunar subroutines # 4 | # # 5 | ############################################################ 6 | # # 7 | # this WAS the subroutines of a source based Linux distro, # 8 | # calls Sorcerer GNU/Linux, or SGL. SGL is no longer # 9 | # available with GPL license. Since this script was taken # 10 | # before licensing scheme change, no legal problems I # 11 | # guess. # 12 | # # 13 | # the code is re-written for Lunar. The previous Copyright # 14 | # notices are kept; just in case some code is left :=) # 15 | # Kagan Kongar , 20020519 # 16 | # # 17 | ############################################################ 18 | # # 19 | # Copyright 2001 by Kyle Sallee # 20 | # # 21 | # Parts Copyrighted Hendrik Visage 2002 under GPLv2 # 22 | # # 23 | # Parts Copyrighted Kagan Kongar 2002 under GPLv2 # 24 | # # 25 | ############################################################ 26 | 27 | 28 | # function : invoke_installwatch 29 | # usage : invoke_installwatch 30 | # purpose : start logging all disk accesses with installwatch 31 | invoke_installwatch() { 32 | debug_msg "invoke_installwatch ($@)" 33 | if [ -e /usr/lib/installwatch.so ] ; then 34 | export LD_PRELOAD=/usr/lib/installwatch.so 35 | fi 36 | } 37 | 38 | 39 | # function : devoke_installwatch 40 | # usage : devoke_installwatch 41 | # purpose : stop logging all disk accesses with installwatch 42 | devoke_installwatch() { 43 | debug_msg "devoke_installwatch ($@)" 44 | unset LD_PRELOAD 45 | } 46 | 47 | 48 | # function : parse_iw 49 | # usage : parse_iw 50 | # purpose : remove unwanted accesses from the installwatch file 51 | parse_iw() { 52 | local OMIT_IN 53 | debug_msg "parse_iw ($@)" 54 | OMIT_IN=" rename\| symlink\| unlink\| fchmod\| access" 55 | 56 | grep -v "$OMIT_IN" "$INSTALLWATCHFILE" | cut -f3 | grep -v "^$SOURCE_DIRECTORY" | grep -v -f "$EXCLUDED" 57 | cat "$INSTALLWATCHFILE" | cut -f4 | grep -v "^$SOURCE_DIRECTORY" | grep -v -f "$EXCLUDED" | grep "^/" 58 | } 59 | 60 | 61 | # function : create_install_log 62 | # usage : create_install_log 63 | # purpose : create an install log 64 | create_install_log() { 65 | local TMP_INST_LOG INST_LOG IFS MISOWNED_SYMLINKS 66 | debug_msg "create_install_log ($@)" 67 | 68 | TMP_INST_LOG=$(temp_create "install-log") 69 | INST_LOG="$INSTALL_LOGS/$MODULE-$VERSION" 70 | rm -f $INST_LOG &> /dev/null 71 | 72 | message "${MESSAGE_COLOR}Creating ${FILE_COLOR}${INST_LOG}${DEFAULT_COLOR}" 73 | 74 | export IFS="$TAB_ENTER_IFS" 75 | 76 | parse_iw | sort | uniq | filter "$LOCAL_EXCLUDED" | custom_filters | exists > $TMP_INST_LOG 77 | echo "$INSTALL_LOGS/$MODULE-$VERSION" >> $TMP_INST_LOG 78 | echo "$COMPILE_LOGS/$MODULE-$VERSION.${COMPRESS_METHOD}" >> $TMP_INST_LOG 79 | echo "$MD5SUM_LOGS/$MODULE-$VERSION" >> $TMP_INST_LOG 80 | 81 | install -m644 $TMP_INST_LOG $INST_LOG 82 | 83 | temp_destroy $TMP_INST_LOG 84 | } 85 | 86 | 87 | create_md5sum_log() { 88 | local FILE 89 | debug_msg "create_md5sum_log ($@)" 90 | 91 | rm -f $MD5SUM_LOGS/$MODULE-$VERSION &> /dev/null 92 | message "${MESSAGE_COLOR}Creating ${FILE_COLOR}$MD5SUM_LOGS/$MODULE-$VERSION${DEFAULT_COLOR}" 93 | 94 | IFS=$'\n' files < $INSTALL_LOGS/$MODULE-$VERSION | xargs -d '\n' md5sum >> $MD5SUM_LOGS/$MODULE-$VERSION 95 | } 96 | 97 | create_install_cache() { 98 | debug_msg "create_install_cache($@)" 99 | 100 | if [ "$ARCHIVE" == "off" ] ; then 101 | return 102 | fi 103 | 104 | message "${MESSAGE_COLOR}Creating ${FILE_COLOR}$INSTALL_CACHE/$MODULE-$VERSION-$BUILD.tar.${COMPRESS_METHOD}${DEFAULT_COLOR}" 105 | tar cP --no-recursion -T $INSTALL_LOGS/$MODULE-$VERSION | ${COMPRESS_METHOD/bz2/bzip2} $COMPRESS_METHOD_ARGS > "$INSTALL_CACHE/$MODULE-$VERSION-$BUILD.tar.${COMPRESS_METHOD}" 106 | 107 | } 108 | 109 | save_old_install_log() { 110 | local old_version 111 | debug_msg "save_old_install_log ($@)" 112 | 113 | export TMP_OLD_INST_LOG=$(temp_create "${MODULE}.oldinstlog") 114 | if module_installed $MODULE; then 115 | old_version=$(installed_version $MODULE) 116 | debug_msg "creating old install log for $MODULE-$old_version ($TMP_OLD_INST_LOG)" 117 | cp "$INSTALL_LOGS/$MODULE-$old_version" $TMP_OLD_INST_LOG 118 | fi 119 | } 120 | 121 | delete_old_install_log() { 122 | debug_msg "delete_old_install_log ($@)" 123 | 124 | if [ -f $TMP_OLD_INST_LOG ]; then 125 | temp_destroy $TMP_OLD_INST_LOG 126 | fi 127 | } 128 | 129 | finish_install() { 130 | debug_msg "finish_install ($@)" 131 | 132 | create_install_log && 133 | create_md5sum_log && 134 | create_install_cache && 135 | 136 | # TODO: clean up DESTDIR_BUILD feature toggle 137 | if [[ "${DESTDIR_BUILD:-off}" == "on" ]]; then 138 | cleanup_old_module_files "$TMP_OLD_INST_LOG" "$INSTALL_LOGS/$MODULE-$VERSION" 139 | fi && 140 | 141 | add_module $MODULE installed $VERSION $(find_module_size $MODULE $VERSION) 142 | verbose_msg "module size is $(find_module_size $MODULE $VERSION)" 143 | } 144 | -------------------------------------------------------------------------------- /libs/uniqid.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # # 3 | # uniqid.lunar - Make a unique id for tracking clients # 4 | # # 5 | ############################################################ 6 | # # 7 | # Copyright Fw systems LLC Under eitherGPL v2 or BSD Lic. # 8 | # # 9 | # Parts Copyrighted Stefan Wold 2013 under GPLv2 # 10 | # # 11 | ############################################################ 12 | 13 | 14 | push_uniq_id() { 15 | debug_msg "push_uniq_id ($@)" 16 | if [ -z "$UNIQID" ]; then 17 | create_uniq_id 18 | fi 19 | 20 | verbose_msg "registering \"$UNIQID\" with server" 21 | wget -t 1 -T 5 -q -O - "lunar-linux.org/cgi-bin/houston?loc=$UNIQID" 22 | 23 | } 24 | 25 | 26 | create_uniq_id() { 27 | local OS HASH IFACE 28 | debug_msg "create_uniq_id ($@)" 29 | if [ -n "$UNIQID" ]; then 30 | return 31 | fi 32 | 33 | IFACE=$(ip route | awk '/^default/ {print $5}') 34 | UNIQID=$(ip addr show $IFACE | awk '/link\/ether/ {print $2}' |\ 35 | tr 'A-Z' 'a-z' | md5sum | awk '{print $1}') 36 | 37 | export UNIQID 38 | 39 | verbose_msg "id(\"$IFACE\")=\"$UNIQID\"" 40 | 41 | set_local_config "UNIQID" "$UNIQID" 42 | 43 | } 44 | -------------------------------------------------------------------------------- /libs/updatelog.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # # 3 | # This code is written for Lunar Linux, see # 4 | # http://lunar-linux.org # 5 | # # 6 | ############################################################ 7 | # # 8 | # $FUNCTIONS/updatelog # 9 | # includes display_update_log # 10 | # 20020711 # 11 | # # 12 | ############################################################ 13 | # # 14 | # Copyrighted Jason Jackson 2002 under GPLv2 # 15 | # # 16 | ############################################################ 17 | 18 | 19 | # function : display_update_log 20 | # usage : display_update_log update|rebuild 21 | # purpose : display a log describing update successes, failures, and summaries 22 | display_update_log() { 23 | debug_msg "display_update_log ($@)" 24 | rm -f /var/log/lunar/update 25 | { 26 | if [ -e "$TMP_LIN_SUCCESS" -a -e "$TMP_LIN_FAIL" ] ; then 27 | display_success_info $1 28 | fi 29 | } | tee /var/log/lunar/update 30 | } 31 | 32 | 33 | # function : display_success_info 34 | # usage : display_success_info update|rebuild 35 | # purpose : display a list of update successes and failures 36 | display_success_info() { 37 | local NUMSUCCESS NUMFAILURES 38 | debug_msg "display_success_info ($@)" 39 | 40 | NUMSUCCESS=$(wc -l "$TMP_LIN_SUCCESS" | cut -d" " -f1) 41 | NUMFAILURES=$(wc -l "$TMP_LIN_FAIL" | cut -d" " -f1) 42 | 43 | message 44 | message "${MESSAGE_COLOR}Lunar $1 completed at `date`${DEFAULT_COLOR}" 45 | message "Successful : $NUMSUCCESS" 46 | message "Failed : $NUMFAILURES" 47 | message 48 | 49 | if [ "$NUMSUCCESS" -gt "0" ]; then 50 | message "${MESSAGE_COLOR}Successfully updated modules:${DEFAULT_COLOR}" 51 | cat "$TMP_LIN_SUCCESS" 52 | message 53 | fi 54 | 55 | if [ "$NUMFAILURES" -gt "0" ]; then 56 | message "${MESSAGE_COLOR}Failed updated modules:${DEFAULT_COLOR}" 57 | cat "$TMP_LIN_FAIL" 58 | message 59 | fi 60 | 61 | } 62 | 63 | # function : display_moonbase_changes 64 | # usage : display_moonbase_changes 65 | # purpose : display a list of modules added or removed during this update 66 | display_moonbase_changes() { 67 | local MODULE_CHANGES NEW_MODULES DEL_MODULES MOV_MODULES M 68 | debug_msg "display_moonbase_changes ($@)" 69 | 70 | if [ -e "$MODULE_INDEX" ] && [ -e "$TMP_MODULE_INDEX" ]; then 71 | MODULE_CHANGES=$(temp_create "module-changes") 72 | diff -U0 $TMP_MODULE_INDEX $MODULE_INDEX | grep -v -e '^@@' -e '^---' -e '^+++' > $MODULE_CHANGES 73 | 74 | MODULES=$(cat "$MODULE_CHANGES" | cut -d: -f1 | sed 's:^[+-]::' | sort -t : | uniq) 75 | for M in $MODULES; do 76 | IN=$(grep "^-$M:" "$MODULE_CHANGES") 77 | OUT=$(grep "^+$M:" "$MODULE_CHANGES") 78 | if [ -z "$IN" -a -n "$OUT" ] ; then 79 | # new module: 80 | NEW_MODULES="$NEW_MODULES $M" 81 | elif [ -n "$IN" -a -z "$OUT" ] ; then 82 | # removed module: 83 | DEL_MODULES="$DEL_MODULES $M" 84 | else 85 | # moved module 86 | MOV_MODULES="$MOV_MODULES $M" 87 | fi 88 | done 89 | 90 | if [ -n "$NEW_MODULES" ]; then 91 | message "${MESSAGE_COLOR}New modules:${DEFAULT_COLOR}" 92 | for M in $NEW_MODULES; do 93 | message " $M" 94 | done 95 | message 96 | fi 97 | 98 | if [ -n "$DEL_MODULES" ]; then 99 | message "${MESSAGE_COLOR}Removed modules:${DEFAULT_COLOR}" 100 | for M in $DEL_MODULES; do 101 | message " $M" 102 | done 103 | message 104 | fi 105 | 106 | if [ -n "$MOV_MODULES" ]; then 107 | message "${MESSAGE_COLOR}Moved modules:${DEFAULT_COLOR}" 108 | for M in $MOV_MODULES; do 109 | INS=$(grep "^[-]$M:" "$MODULE_CHANGES" | cut -d: -f2) 110 | OUTS=$(grep "^[+]$M:" "$MODULE_CHANGES" | cut -d: -f2) 111 | message " $M: $INS -> $OUTS" 112 | done 113 | message 114 | fi 115 | temp_destroy $MODULE_CHANGES 116 | fi 117 | } 118 | -------------------------------------------------------------------------------- /libs/useradd.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # # 3 | # This code is written for Lunar Linux, see # 4 | # http://lunar-linux.org # 5 | # # 6 | ############################################################ 7 | # # 8 | # $FUNCTIONS/uid.lunar # 9 | # includes add_priv_user add_priv_group # 10 | # 20030306 # 11 | # # 12 | ############################################################ 13 | # # 14 | # Copyrighted Auke Kok 2006 under GPLv2 # 15 | # # 16 | ############################################################ 17 | 18 | 19 | # function: add_priv_group 20 | # usage : add_priv_group groupname [addgroupopts [addgroupopts]...] 21 | # info : adds groupname and passes addgroupopts to 'addgroup' 22 | function add_priv_group() { 23 | local GROUPNAME 24 | debug_msg "function add_priv_group ($@)" 25 | 26 | if [ -n "$INSTALLWATCHFILE" ] ; then 27 | devoke_installwatch 28 | fi 29 | GROUPNAME=$1 30 | 31 | if [ -z "$GROUPNAME" ] ; then 32 | message "${PROBLEM_COLOR}!add_priv_user: no groupname specified${DEFAULT_COLOR}" 33 | return 1 34 | fi 35 | 36 | if grep -q "^$GROUPNAME:" /etc/group ; then 37 | verbose_msg "group \"$GROUPNAME\" already exists, not creating" 38 | else 39 | # add the group: 40 | for (( N=0 ; N<100 ; N++)) ; do 41 | if [ -z "$(cat /etc/group | cut -d: -f3 | grep "^$N$" )" ] ; then 42 | break 43 | fi 44 | done 45 | if [ "$N" == "100" ] ; then 46 | message "${PROBLEM_COLOR}!add_priv_user: no more group id's left under gid=100, bailing out!${DEFAULT_COLOR}" 47 | return 1 48 | fi 49 | verbose_msg "creating group \"$GROUPNAME\" with id=\"$N\"" 50 | groupadd -g $N $GROUPNAME 51 | fi 52 | 53 | if [ -n "$INSTALLWATCHFILE" ] ; then 54 | invoke_installwatch 55 | fi 56 | } 57 | 58 | 59 | # function: add_priv_user 60 | # usage : add_priv_user username:groupname [adduseropts [adduseropts]...] 61 | # info : adds username:groupname and passes adduseropts to 'adduser' 62 | function add_priv_user() { 63 | local USERNAME GROUPNAME 64 | debug_msg "function add_priv_user ($@)" 65 | 66 | if [ -n "$INSTALLWATCHFILE" ] ; then 67 | devoke_installwatch 68 | fi 69 | USERNAME=$(echo $1 | cut -d: -f1) 70 | GROUPNAME=$(echo $1 | cut -d: -f2) 71 | 72 | if [ -z "$USERNAME" ] ; then 73 | message "${PROBLEM_COLOR}!add_priv_user: no username specified${DEFAULT_COLOR}" 74 | return 1 75 | fi 76 | 77 | if [ -z "$GROUPNAME" ] ; then 78 | message "${PROBLEM_COLOR}!add_priv_user: no groupname specified${DEFAULT_COLOR}" 79 | return 1 80 | fi 81 | 82 | if id $USERNAME &> /dev/null ; then 83 | verbose_msg "user \"$USERNAME\" already exists, not creating or modifying" 84 | else 85 | if grep -q "^$GROUPNAME:" /etc/group ; then 86 | verbose_msg "group \"$GROUPNAME\" already exists, not creating" 87 | else 88 | if ! add_priv_group $GROUPNAME ; then 89 | return 1 90 | fi 91 | fi 92 | 93 | # add the user: 94 | for (( N=0 ; N<100 ; N++)) ; do 95 | if [ -z "$(cat /etc/passwd | cut -d: -f3 | grep "^$N$" )" ] ; then 96 | break 97 | fi 98 | done 99 | if [ "$N" == "100" ] ; then 100 | message "${PROBLEM_COLOR}!add_priv_user: no more user id's left under uid=100, bailing out!${DEFAULT_COLOR}" 101 | return 1 102 | fi 103 | 104 | shift 105 | 106 | verbose_msg "creating user \"$USERNAME\" (opts=\"-u $N -g $GROUPNAME $@\")" 107 | useradd -u $N -g $GROUPNAME $USERNAME $@ 108 | 109 | fi 110 | 111 | if [ -n "$INSTALLWATCHFILE" ] ; then 112 | invoke_installwatch 113 | fi 114 | } 115 | -------------------------------------------------------------------------------- /libs/view.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # # 3 | # display.lunar - functions to view files # 4 | # # 5 | #################################################################### 6 | 7 | 8 | # function : view_file 9 | # usage : view_file FILENAME 10 | # purpose : to view a file 11 | view_file() { 12 | debug_msg "view_file ($@)" 13 | if [ -n "$1" ] ; then 14 | # show a file $1 15 | case $(file -b $1 | cut -d' ' -f1) in 16 | bzip2) bzcat $1 | ${PAGER:-less} ;; 17 | gzip) zcat $1 | ${PAGER:-less} ;; 18 | XZ) xzcat $1 | ${PAGER:-less} ;; 19 | *) 20 | # default fallback 21 | ${PAGER:-less} "$1" ;; 22 | esac 23 | else 24 | cat - | ${PAGER:-less} 25 | fi 26 | } 27 | -------------------------------------------------------------------------------- /man/lcrash.8: -------------------------------------------------------------------------------- 1 | .TH "lcrash" "8" "October 2014" "Lunar Linux" "Lunar Crash Recovery" 2 | .SH "NAME" 3 | .LP 4 | \fBlcrash\fR \- Lunar Crash Recovery manual 5 | .SH "OVERVIEW" 6 | .LP 7 | This manual page was written to give some pointers on how to recover 8 | from a "lunar update" crash, or an otherwise broken set of lunar 9 | tools. 10 | .SH "DO NOT PANIC" 11 | .LP 12 | These are the suggested steps after your system has been able to 13 | successfully boot back into a \fBLunar Linux\fR bash command prompt 14 | but you are not able to do a "lunar update" because of a 15 | crash/abort/power failure/whatever occuring in the middle of a "lunar 16 | update" and it did not finish installing the lunar commands and 17 | Moonbase. All of these instructions should be run as "root". 18 | 19 | \fB1. Update lunar coretools: \fRUsing a web browser or wget, download 20 | a copy of http://www.lunar-linux.org/lunar/lunar/lunar-XX.tar.bz2 21 | where XX is the latest version. If you use wget please do these steps: 22 | .IP 23 | cd /var/spool/lunar 24 | .IP 25 | wget http://www.lunar-linux.org/lunar/lunar/lunar-XX.tar.bz2 26 | .LP 27 | If you use a web browser then go to the location mentioned above and 28 | download lunar.tar.bz2 and save it to the /var/spool/lunar directory. 29 | .LP 30 | \fB2. Manually unpack Lunar: \fRNow unpack the tar.bz2 file with these commands: 31 | .IP 32 | cd / 33 | .IP 34 | tar xf /var/spool/lunar/lunar-XX.tar.bz2 35 | .IP 36 | cd lunar-XX ; make install 37 | .LP 38 | Now your system should be able to run a \fBlunar update\fR. This 39 | process will update the base scripts and the package collection 40 | (Moonbase). 41 | .LP 42 | 43 | .SH "LIFESAVERS" 44 | .LP 45 | Below are some useful addresses 46 | .P 47 | 48 | \fBWebsite: \fRhttp://www.lunar\-linux.org/ 49 | .P 50 | 51 | \fBMaillist: \fRhttp://lists.lunar\-linux.org/mailman/listinfo/lunar 52 | .P 53 | 54 | \fBIRC: \fRirc.libera.chat #lunar 55 | 56 | .SH "NOTES" 57 | .LP 58 | This is a work in progress. Expect frequent updates. 59 | .SH "SEE ALSO" 60 | .LP 61 | lunar(8), moonbase(5), lin(8), lvu(1), lget(8), lrm(8) 62 | .SH "DISCLAIMER" 63 | .LP 64 | The information and examples given here are for illustrative purposes. Use at 65 | your own risk. Every attempt has been made to insure that the content of this 66 | document was accurate when written. If you find inaccuracies, please send me 67 | clarifications. 68 | .SH "COPYRIGHT" 69 | .LP 70 | This document is Copyrighted Terry Chan 2002-2003. It may be 71 | reproduced and distributed in whole or in part, in any medium physical 72 | or electronic, as long as this copyright notice is retained on all 73 | copies. 74 | .SH "AUTHOR" 75 | .LP 76 | Terry Chan 77 | -------------------------------------------------------------------------------- /man/lget.8: -------------------------------------------------------------------------------- 1 | .TH LGET 8 "October 2014" "Lunar Linux" LUNAR 2 | .SH NAME 3 | lget \- downloads module source files 4 | .SH SYNOPSIS 5 | .B lget 6 | module_1 module_2 module_3 7 | .PP 8 | .B lget -h|--help 9 | .PP 10 | .B lget -a|--all 11 | .PP 12 | .B lget -d|--debug|-f|--from|-u|--url|-v|--verbose|-w|--want 13 | module_1 module_2 14 | .SH COPYRIGHT 15 | .if n lget(8) is Copyright (C) 2002-2003 Terry Chan with portions copyrighted by previous authors 2001-2002 16 | .if t lget(8) is Copyright \(co 2002-2003 Terry Chan with portions copyrighted by previous authors 2001-2002 17 | .SH "EXAMPLE" 18 | To download emacs type: 19 | .IP 20 | .B lget 21 | emacs 22 | .SH "DESCRIPTION" 23 | .I lget 24 | is part of the 25 | .SM Lunar 26 | source-code package management suite. It is a command-line tool 27 | for automatically downloading a modules associated source files. 28 | .SH "OPTIONS" 29 | .TP 30 | .B lget 31 | module_1 32 | .PP 33 | This automatically downloads the specified module sources. 34 | .TP 35 | .B lget -a|--all 36 | .PP 37 | Download the source code for every single module in moonbase (about 2.5G as of 08/08/2003). 38 | This is useful if you have a fast link or want to start your own Lunar source code mirror. 39 | .TP 40 | .B lget -d|--debug 41 | .PP 42 | Enables debug messages, very useful when emailing a bug report. 43 | .TP 44 | .B lget -f|--from path/dir 45 | .PP 46 | This specifies a different 47 | .I /var/spool/lunar 48 | directory. This is the default location for downloaded sources. 49 | .TP 50 | .B lget -h|--help 51 | .PP 52 | Outputs short help. 53 | .TP 54 | .B lget -u|--url URL module_1 55 | .PP 56 | This tries to download the specified module from a different location. This is 57 | useful if the original link is down. 58 | .TP 59 | .B lget -w|--want version 60 | .PP 61 | Attempt to download version version of the module by substituting the current 62 | version of the module with the wanted version. May fail if the package requires 63 | more than one file download, or other reasons. 64 | .TP 65 | .B lget -4|--ipv4 66 | .PP 67 | Download sources using ipv4. 68 | .TP 69 | .B lget -6|--ipv6 70 | .PP 71 | Download sources using ipv6. 72 | .TP 73 | .B lget -v|--verbose 74 | .PP 75 | Increases the level of message output 76 | .SH "FILES" 77 | .TP 78 | .I /etc/lunar/config & /etc/lunar/local/config 79 | .IP 80 | These files store the settings for default locations. Its best to leave 81 | these alone as they are in quite good places by default. See lin(8) for more 82 | details about these files. 83 | .IP 84 | .TP 85 | .I /var/lib/lunar/functions/*.lunar 86 | .IP 87 | Contains functions used by 88 | .B lget 89 | .SH ADVANCED USAGE 90 | Specifing a different download location for linux 91 | .IP 92 | lget 93 | .B --url http://ftp.mirror.ac.uk/sites/ftp.kernel.org/linux/kernel/2.4/linux-2.4.20.tar.bz2 linux 94 | .SH "NOTES" 95 | Do not include 96 | .SM version 97 | or 98 | .SM section 99 | when specifying a package. To get complete listing of installed software 100 | packages and versions type 101 | .B lvu installed 102 | .SH "AUTHOR" 103 | Thomas Stewart 104 | .PP 105 | Converted to Lunar by Terry Chan 03/23/2002 106 | .PP 107 | Updated by Terry Chan 08/08/2003 108 | .PP 109 | Updated by Stefan Wold 10/11/2014 110 | .SH "REPORTING BUGS" 111 | Report bugs to 112 | .SH "SEE ALSO" 113 | lunar(8), lin(8), lvu(1), lrm(8) 114 | .SH "WARRANTY" 115 | This is free software with ABSOLUTELY NO WARRANTY 116 | -------------------------------------------------------------------------------- /man/lin.8: -------------------------------------------------------------------------------- 1 | .TH "LIN" "8" "October 2014" "Lunar Linux" "LUNAR" 2 | .SH "NAME" 3 | lin \- Lunar install software modules 4 | .SH "SYNOPSIS" 5 | .B lin 6 | [options] [package1[/version]] ... [package2[/version]] ... 7 | .SH "COPYRIGHT" 8 | .if n lin(8) is Copyright (C) 2002-2003 Terry Chan with portions copyrighted by previous authors 2001\-2002 9 | .if t lin(8) is Copyright \(co 2002-2003 Terry Chan with portions copyrighted by previous authors 2001\-2002 10 | .SH "EXAMPLE" 11 | To install emacs type: 12 | .IP 13 | .B lin emacs 14 | .SH "DESCRIPTION" 15 | .I lin 16 | is part of the 17 | .B Lunar 18 | source\-code package management suite. It is a command\-line tool for automatically retrieving, unpacking, compiling, installing, and tracking software installations. 19 | .SH "OPTIONS" 20 | .TP 21 | .B "\-c, \-\-compile" 22 | Compiles module even if there is a compile cache in /var/cache/lunar. 23 | .TP 24 | .B "-d, --debug" 25 | Enables debug messages, very useful when emailing a bug report. 26 | .TP 27 | .B "\-\-deps" 28 | Configures the modules and determines their dependencies, but they are not 29 | compiled or installed. 30 | .TP 31 | .B "\-g, \-\-download" 32 | Configures the modules, determines their dependencies and download the sources, 33 | but they are not compiled or installed. 34 | .TP 35 | .B "-f, \-\-from" directory 36 | Specify an alternate directory to search for source code tarballs. An alternative 37 | to /var/spool/lunar. 38 | .TP 39 | .B "\-h, \-\-help" 40 | Outputs short help. 41 | .TP 42 | .B "\-p, \-\-probe" 43 | Only lin if the module was not previously installed. 44 | .TP 45 | .B "\-r, \-\-reconfigure" 46 | Select new configuration and dependencies for modules. 47 | .TP 48 | .B "\-\-opts (configure flags)" 49 | Add arbitrary options to the configure stage of the module. The options are saved for future upgrades but will be erased by using "-r". 50 | .TP 51 | .B "\-R, \-\-resurrect" 52 | Reinstalls a module which has been removed but still has the compiled version available. 53 | .TP 54 | .B "\-w, \-\-want (version number)" 55 | Try to install a different version than the current one in moonbase. Integrity checking is turned off. Success not guaranteed. 56 | .TP 57 | .B "\-s, \-\-silent" 58 | Decreases the level of message output. 59 | .TP 60 | .B "\-v, \-\-verbose" 61 | Increases the level of message output. 62 | .TP 63 | .B \-4, \-\-ipv4 64 | Download sources using ipv4. 65 | .TP 66 | .B \-6, \-\-ipv6 67 | Download sources using ipv6. 68 | .SH "FILES" 69 | All files can be edited by hand, but its easier to edit them with 70 | .B lunar. 71 | .TP 72 | .I /etc/lunar/config 73 | .IP 74 | Configuration options. 75 | .TP 76 | .I /etc/lunar/mirrors 77 | .IP 78 | Mirror information. 79 | .TP 80 | .I /etc/lunar/local/* 81 | .IP 82 | Local settings. 83 | .TP 84 | .I /etc/lunar/local/config 85 | .IP 86 | Various local settings and compiler optimization parameters (select with lunar). 87 | .TP 88 | .I /etc/lunar/local/depends/* 89 | .IP 90 | Dependency and configuration information for modules. 91 | .TP 92 | .I /var/lib/lunar/functions/*.lunar 93 | .IP 94 | Contains functions used by 95 | .B lin. 96 | .I 97 | .SH "ENVIRONMENT" 98 | .PP 99 | The following settings can be altered in 100 | .I /etc/lunar/local/config 101 | It is easier, faster and less error prone to edit them with 102 | .B lunar. 103 | .IP GNU_URL 104 | The GNU Mirror (default: ftp.gnu.org). 105 | .IP KERNEL_URL 106 | The kernel mirror (default: ftp.kernel.org). 107 | .IP XFREE86_URL 108 | The xfree86 mirror (default: ftp.xfree86.org). 109 | .IP GNOME_URL 110 | The GNOME mirror (default: ftp.gnome.org). 111 | .IP KDE_URL 112 | The KDE mirror (default: ftp.kde.org). 113 | .IP SFORGE_URL 114 | The Sourceforge mirror. (default: none). 115 | .IP PATCH_URL 116 | The default patch mirror. (default: download.lunar\-linux.org/lunar/patches). 117 | .IP LRESORT_URL 118 | The default lunar mirror. If all else fails go here! (default: download.lunar\-linux.org/lunar/cache) 119 | .IP MOONBASE_URL 120 | The lunar moonbase mirrors. (default: download.lunar\-linux.org/lunar/). 121 | .IP color 122 | If set to yes lin outputs nice colour. Green for messages, gray for compiling, yellow for questions, and red for errors. 123 | .IP PROMPT_DELAY 124 | The delay in seconds that 125 | .B lin 126 | pauses when waiting for responses from you. 127 | .IP MAIL_REPORTS 128 | If set to yes, installation logs will be mailed to the admin upon a successful compile. Compile logs will be mailed instead upon a failed compilation. 129 | .IP ADMIN'S_EMAIL 130 | The mailbox where the reports will be mailed. The admin's email address. 131 | .IP PRESERVE 132 | When set to yes, configuration files that have been edited will not get deleted when the module is re\-installed 133 | .IP SOUND 134 | If set to yes then sounds will be enabled if the 135 | .I lunar\-sound 136 | module is installed 137 | .IP SUSTAIN 138 | When set to yes this disallows removing of modules that would cause terrible malfunctions. eg glibc, gcc, bash, to name some obvious ones. 139 | .IP VIEW_REPORTS 140 | If set to yes then you will be prompted whether to view reports before and after installation. 141 | .IP VOYEUR 142 | If set to yes then compiler output will be displayed in real time. 143 | .IP REAP 144 | Deletes files when removing. 145 | .IP AUTOFIX 146 | If set to yes whenever a library is updated all packages that depend on that library will be rebuilt. See FIND_CHECK, MD5SUM_CHECK, LDD_CHECK, SYM_CHECK for autofix settings. 147 | .IP FIND_CHECK MD5SUM_CHECK LDD_CHECK SYM_CHECK 148 | See the \-f options above for explanations of these. 149 | .SH "ADVANCED USAGE" 150 | .PP 151 | Using source code tarballs from an alternate location. 152 | .IP 153 | lin 154 | .B \-\-from 155 | /root/spool/lunar 156 | emacs 157 | Unless the 158 | .B \-from 159 | option is specified lin will always check the 160 | .I /var/spool/lunar 161 | directory first to see if the package exists. If the package does not 162 | exist it downloads the package via the Internet. 163 | .SH "AUTHOR" 164 | Kyle Sallee 165 | .PP 166 | Updated Thomas Stewart 01/15/2002 167 | .PP 168 | Converted to Lunar by Terry Chan 03/23/2002 169 | .PP 170 | Updated by Chuck Mead 07/17/2003 171 | .PP 172 | Updated by Terry Chan 08/08/2003 173 | .PP 174 | Updated by Stefan Wold 10/11/2014 175 | .SH "REPORTING BUGS" 176 | Report bugs to 177 | .SH "SEE ALSO" 178 | lunar(8), lrm(8), lvu(1), lget(8), moonbase(5) 179 | .SH "WARRANTY" 180 | This is free software with ABSOLUTELY NO WARRANTY 181 | -------------------------------------------------------------------------------- /man/lrm.8: -------------------------------------------------------------------------------- 1 | .TH LRM 8 "August 2003" "Lunar\-Linux" LUNAR 2 | .SH NAME 3 | lrm \- removes Lunar software modules 4 | .SH SYNOPSIS 5 | .B lrm 6 | [options] [module1] ... [module2] ... 7 | .PP 8 | .B lrm 9 | -h|--help 10 | .PP 11 | .B lrm 12 | -d|--debug|-k|--keepconfig|-n|--nosustain|-p|--purge|-u|--upgrade| 13 | -v|--verbose 14 | .PP 15 | .B lrm 16 | -D|--downgrade 17 | .PP 18 | .SH COPYRIGHT 19 | .if n lrm(8) is Copyright (C) 2002-2003 Terry Chan with portions copyrighted by previous authors 2001-2002 20 | .if t lrm(8) is Copyright \(co 2002-2003 Terry Chan with portions copyrighted by previous authors 2001-2002 21 | .SH "EXAMPLE" 22 | To uninstall emacs type: 23 | .IP 24 | .B lrm 25 | emacs 26 | .SH "DESCRIPTION" 27 | .I lrm 28 | is part of the 29 | .SM Lunar\-Linux 30 | source-code package management suite. It is a command-line tool 31 | for automatically uninstalling a module and its associated 32 | files. 33 | .SH "OPTIONS" 34 | .TP 35 | .B "-d, --debug" 36 | enables debug messages, very useful when emailing a bug report 37 | .TP 38 | .B "-D, --downgrade" 39 | downgrade is an option for removing the selected module and restoring 40 | a previously installed version 41 | .TP 42 | .B "-h, --help" 43 | outputs short help 44 | .TP 45 | .B "-k, --keepconfig" 46 | remove module(s) but keep dependencies and config info 47 | .TP 48 | .B "-n, --nosustain" 49 | emoves module(s) even if they are sustained 50 | .TP 51 | .B "-u, --upgrade" 52 | perform an upgrade-removal. This skips running of pre/post-removal scripts 53 | and implies -n and -k 54 | .TP 55 | .B "-v, --verbose" 56 | increases the level of message output 57 | .TP 58 | .B "-p, --purge" 59 | remove all modules that require "module" through dependencies 60 | .SH "FILES" 61 | .TP 62 | .I /var/lib/lunar/excluded 63 | .IP 64 | List of files that are excluded during a lin or lrm. 65 | .TP 66 | .I /var/lib/lunar/protected 67 | .IP 68 | Contains a list of files that will not be removed. 69 | .TP 70 | .I /var/lib/lunar/solo 71 | .IP 72 | List of solo modules. 73 | .TP 74 | .I /var/lib/lunar/sustained 75 | .IP 76 | List of modules that are essential to system, and lrm of these modules is not permitted. 77 | Installing and upgrading is fine. 78 | .TP 79 | .I /var/lib/lunar/functions/*.lunar 80 | .IP 81 | Contains functions used by 82 | .B lrm 83 | .SH ADVANCED USAGE 84 | Rolling back to a previous version of a package 85 | .IP 86 | lrm 87 | .B --downgrade 88 | glibc 2.2.3 89 | .SH "NOTES" 90 | Do not include 91 | .SM version 92 | or 93 | .SM section 94 | when specifying a package. To get complete listing of installed software 95 | packages and versions type 96 | .B lvu installed 97 | .SH "NOTES" 98 | Downgrade will only rollback to versions that were previously installed. 99 | It will not download older versions from the Internet. 100 | .SH "AUTHOR" 101 | Kyle Sallee 102 | .PP 103 | Updated Thomas Stewart 01/15/2002 104 | .PP 105 | Converted to Lunar by Terry Chan 03/23/2002 106 | .PP 107 | Updated by Auke Kok 09/21/2004 108 | .SH "REPORTING BUGS" 109 | Report bugs to 110 | .SH "SEE ALSO" 111 | lunar(8), lin(8), lvu(1), lget(8) 112 | .SH "WARRANTY" 113 | This is free software with ABSOLUTELY NO WARRANTY 114 | -------------------------------------------------------------------------------- /man/lunar.8: -------------------------------------------------------------------------------- 1 | .TH "LUNAR" "8" "August 2003" "Lunar-Linux.org" "Lunar" 2 | .SH "NAME" 3 | lunar \- menu\-driven software package management utility 4 | .SH "SYNTAX" 5 | .B lunar 6 | -d|--debug|-h|--help|-v|--verbose 7 | .PP 8 | .B lunar 9 | [prune|renew|update|rebuild|optimize|fix|nofix|fixdepends|resurrect|install|remove|hold|unhold|exile|unexile|enforce|unenforce] 10 | .SH "COPYRIGHT" 11 | .if n lunar(8) is Copyright (C) 2002-2003 Terry Chan with portions copyrighted by previous authors 2001\-2002 12 | .if t lunar(8) is Copyright \(co 2002-2003 Terry Chan with portions copyrighted by previous authors 2001\-2002 13 | .SH "DESCRIPTION" 14 | .I lunar 15 | is an easy\-to\-use menu\-driven (dialog\-based) interface to the 16 | .I Lunar 17 | source\-based package management system. 18 | .SH "OPTIONS" 19 | .I lunar 20 | without options will start the menu\-driven package management utility. 21 | .PP 22 | .B "-d, --debug" 23 | enables debug messages, very useful when emailing a bug report 24 | .TP 25 | .B "-h, --help" 26 | outputs short help 27 | .TP 28 | .B "-v, --verbose" 29 | increases the level of message output 30 | .TP 31 | .I prune 32 | .IP 33 | Removes all old source code and old backups. Since the number of sources on the system grows steadily on a running system, you will need to clean some of the kept copies of sources and compile caches. The source code from previous versions are kept so that the packages can be rolled back to older versions. This does not delete sources that are up to date, 34 | but not installed. 35 | .PP 36 | .I renew 37 | .IP 38 | Update all packages without fetching a fresh moonbase first. Does not run prune or autofix. 39 | .PP 40 | .I update 41 | .IP 42 | Fetches a new moonbase, updates all packages and runs (optionally) a prune and autofix. 43 | .PP 44 | .I rebuild 45 | .IP 46 | automatically rebuilds all installed software packages. This option is non\-interactive and does not start up the menu\-driven interface. It is suitable for use in cron jobs and is useful for rebuilding distributed binaries from source. 47 | .PP 48 | .I optimize 49 | .IP 50 | jump straight into the compiler optimizations menu. 51 | .PP 52 | .I fix 53 | .IP 54 | Check and fix all modules and internal state of lunar. Four methods are available. The methods can be toggled using lunar\->Option\->Integrity Checking. A fix is automatically issued afer a 55 | .B lunar update. 56 | .IP 57 | .I "Find Check" 58 | .IP 59 | Discovers missing binary executables, libraries and header files. 60 | .IP 61 | .I MD5 Sum 62 | .IP 63 | Discovers modified executables and libraries. 64 | .IP 65 | .I Ldd Check 66 | .IP 67 | Discovers Broken executables and libraries. 68 | .IP 69 | .I Sym Check 70 | .IP 71 | Discovers mis\-owned symbolic links to files. 72 | .TP 73 | .I nofix 74 | .IP 75 | Check but do not fix modules and internal state. 76 | .PP 77 | .I fixdepends 78 | .IP 79 | Check and fix the dependency database of lunar. 80 | Reconstructs the depends database without recompiling modules. This might help if your depends database is missing or corrupted. 81 | .PP 82 | .I resurrect 83 | .IP 84 | Reinstalls a module which has been removed but still has the compiled version available. 85 | .PP 86 | .I install 87 | .IP 88 | Installs a module. 89 | .PP 90 | .I remove 91 | .IP 92 | Removes a module. 93 | .PP 94 | .I hold 95 | .IP 96 | Places a module on hold so it cannot be built/rebuilt. 97 | .PP 98 | .I unhold 99 | .IP 100 | Removes a module from hold status so it can be built/rebuilt. 101 | .PP 102 | .I exile 103 | .IP 104 | Prevents a module from being installed or resurrected. Perhaps because you've installed a customized module. 105 | .PP 106 | .I unexile 107 | .IP 108 | Removes a module from exiled status. 109 | .PP 110 | .I enforce 111 | .IP 112 | Automatically select yes for optional dependency to this module. 113 | .PP 114 | .I unenforce 115 | .IP 116 | Removes a module from enforce list. 117 | .PP 118 | .SH "REQUIREMENTS" 119 | .I lunar 120 | requires a connection to the Internet 121 | .PP 122 | .I Bash 123 | version 2 or higher 124 | .PP 125 | .I Dialog 126 | version 0.9a or higher 127 | .PP 128 | .I Linux 129 | kernel version 2.4.x or higher. 130 | .SH "NOTES" 131 | Options on the 132 | .I Package Menu 133 | add or remove software packages to/from installation and removal queues. The actual installation and/or removal of the packages will not be performed until either 134 | .I Foreground Execution 135 | or 136 | .I Background Execution 137 | are selected from the main menu. 138 | .SH "OPERATION" 139 | .I Navigating the Menus 140 | .PP 141 | To return to a previous menu press 142 | .I 143 | or use the 144 | .I Cancel button 145 | .PP 146 | To exit the program from the main menu press 147 | .I 148 | or use the 149 | .I Cancel button 150 | .PP 151 | To toggle between buttons press 152 | .I 153 | .PP 154 | To select whichever button is highlighted press 155 | .I 156 | .PP 157 | To select/deselect items from a checklist press 158 | .I 159 | .SH "AUTHOR" 160 | Kyle Sallee 161 | .PP 162 | Updated Thomas Stewart 01/15/2002 163 | .PP 164 | Converted to Lunar by Terry Chan 03/23/2002 165 | .PP 166 | Updated by Chuck Mead 07/17/2003 167 | .PP 168 | Updated by Terry Chan 08/08/2003 169 | .SH "REPORTING BUGS" 170 | Report bugs to 171 | .SH "SEE ALSO" 172 | moonbase(5), lin(8), lvu(1), lget(8), lrm(8), lcrash(8) 173 | .SH "WARRANTY" 174 | This is free software with ABSOLUTELY NO WARRANTY 175 | 176 | 177 | -------------------------------------------------------------------------------- /man/moonbase.5: -------------------------------------------------------------------------------- 1 | .TH MOONBASE "5" "June 2009" "Lunar Linux" LUNAR 2 | .SH NAME 3 | moonbase \- the software catalog for the Lunar-Linux distribution 4 | .SH COPYRIGHT 5 | .if n moonbase(5) is Copyright (C) 2002-2003 Terry Chan with portions copyrighted by previous authors 2001-2002 6 | .if t moonbase(5) is Copyright \(co 2002-2003 Terry Chan with portions copyrighted by previous authors 2001-2002 7 | .SH "DESCRIPTION" 8 | The software catalog is a list of software modules (simply referred to 9 | as "modules") divided into sections. Each module contains one 10 | or more description files. Description files contain such information as 11 | module name, version, URL, directory information, etc. Other description files provide unpacking, compilation, installation, and tracking instructions. One section in the 12 | software catalog of particular interest is PROFILES. Profiles are 13 | groups of modules. With profiles you can automatically install predefined or 14 | custom-built module sets using a single command. 15 | .SH "SUMMARY" 16 | The moonbase is found under /var/lib/lunar. The top level of directories 17 | are the section names. The directories under the section names are the 18 | modules. Each module directory will have a BASH description file called 19 | DETAILS and optionally contain one or more of the following description files: 20 | CONFIGURE, DEPENDS, CONFLICTS, PRE_BUILD, BUILD, POST_BUILD, POST_INSTALL, POST_REMOVE. 21 | If a description file does not exist in the module directory then a set of default 22 | description instructions are used. The default instructions for each description 23 | file can be found in /var/lib/lunar/functions/*.lunar. 24 | .SH "DETAILS" 25 | \fBPROFILES\fR 26 | .PP 27 | Each profile contains a simplified DETAILS file: profile name, version, and 28 | description. Profiles are effectively just a DEPEND file with a list of 29 | modules to be installed. 30 | .PP 31 | \fBDESCRIPTION FILES\fR 32 | .PP 33 | A typical source code installation might look like this (assume the 34 | application is called foo): 35 | .IP 36 | step 1) find the URL and download the tarball 37 | .IP 38 | step 2) tar xvfz foo-1.00.tar.gz 39 | .IP 40 | step 3) cd foo 41 | .IP 42 | step 4) less README (perhaps you skip this step?) 43 | .IP 44 | step 5) less INSTALL (... and this one?) 45 | .IP 46 | step 6) ./configure 47 | .IP 48 | step 7) make 49 | .IP 50 | step 8) make install 51 | .PP 52 | .PP 53 | Here is a breakdown of the description files and how they relate to the above 54 | installation procedure: 55 | .PP 56 | \fBDETAILS\fR 57 | .IP 58 | This file is required and describes the URL for step 1. It also contains version information, 59 | module name, source name, source directory, and a description of the module. 60 | .PP 61 | \fBCONFIGURE\fR 62 | .IP 63 | The configure script. 64 | .PP 65 | \fBDEPENDS\fR 66 | .IP 67 | This file contains a list of other modules upon which the module depends. 68 | If dependencies are turned on then the modules listed are installed in order 69 | prior to installing module. 70 | .PP 71 | .PP 72 | \fBCONFLICTS\fR 73 | .IP 74 | Contains a list of modules that conflict with this module. Use sparingly. A good example of a reasonable 75 | use is when you have two modules in the moonbase that are the same but one is patched. eg apache and apache-mod_ssl 76 | .PP 77 | \fBPRE_BUILD\fR 78 | .IP 79 | This describes the unpacking process as performed in step 2. The default PRE_BUILD will work for 80 | tarballs with gzip or bzip2 compression. 81 | .PP 82 | \fBBUILD\fR 83 | .IP 84 | This describes the compilation and installation processes as performed in steps 6-8. If the 85 | software module compiles and installs using these 3 steps then the default 86 | BUILD can be used. 87 | .PP 88 | \fBPOST_BUILD\fR 89 | .IP 90 | The default POST_BUILD simply calls the software tracking script. 91 | .PP 92 | \fBPOST_INSTALL\fR 93 | .IP 94 | There is no default POST_INSTALL. If no POST_INSTALL is present in the 95 | module directory then no operations are performed in this step. Normally 96 | used to start daemons or extra cleanup or install default configuration files, 97 | after the module is ready to execute. 98 | .PP 99 | \fBPOST_REMOVE\fR 100 | .IP 101 | This is called, if present, after removing the module. See lrm(8). 102 | .PP 103 | .SH "NOTES" 104 | The best way to learn the software catalog is to examine some of the 105 | description files yourself. Most software catalog entries are simple. For 106 | example try looking under /var/lib/lunar/moonbase/editors/emacs. 107 | If however you want to look at a very unusual, but much more complex example look at 108 | /var/lib/lunar/moonbase/xorg7. To understand how the software 109 | catalog works, it is also important to look at /var/lib/lunar/functions/*.lunar and 110 | examine the functions default_pre_build, default_build, and default_post_build. 111 | .SH "AUTHOR" 112 | Kyle Sallee 113 | .PP 114 | Updated Thomas Stewart 01/15/2002 115 | .PP 116 | Converted to Lunar by Terry Chan 03/23/2002 117 | .PP 118 | Updated by Terry Chan 5/22/2002 119 | .PP 120 | Updated by Terry Chan 8/08/2003 121 | .PP 122 | Updated by Stefan Wold 6/07/2009 123 | .PP 124 | .SH "REPORTING BUGS" 125 | .PP 126 | Report bugs to 127 | .SH "SEE ALSO" 128 | lunar(8), lin(8), lrm(8), lvu(1), lget(8) 129 | .PP 130 | .SH "WARRANTY" 131 | .PP 132 | This is free software with ABSOLUTELY NO WARRANTY 133 | 134 | -------------------------------------------------------------------------------- /menu/alias.menu: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | ############################################################ 3 | # # 4 | # This code is written for Lunar Linux, see # 5 | # http://lunar-linux.org # 6 | # # 7 | ############################################################ 8 | # # 9 | # Copyright 2007 (c) GPLv2 - Auke Kok # 10 | # # 11 | ############################################################ 12 | 13 | alias_menu_list_aliases() { 14 | cut -d: -f1 "$MOONBASE/aliases" | while read -r A; do 15 | echo "${A:1}" 16 | CHOICE=$(get_local_config "LUNAR_ALIAS_${A:1}") 17 | if [ -n "$CHOICE" ]; then 18 | echo "$CHOICE" 19 | else 20 | echo "[unset]" 21 | fi 22 | done 23 | } 24 | 25 | alias_menu_list_alias_choices() { 26 | echo "None" 27 | echo "None" 28 | if [ -z "$(get_local_config "LUNAR_ALIAS_$1")" ]; then 29 | echo "on" 30 | else 31 | echo "off" 32 | fi 33 | IFS=$STANDARD_IFS 34 | grep "^%$1:" "$MOONBASE/aliases" | cut -d: -f2 | while read -r C; do 35 | echo "$C" 36 | echo "$C" 37 | if [ "$(get_local_config "LUNAR_ALIAS_$1")" == "$C" ]; then 38 | echo "on" 39 | else 40 | echo "off" 41 | fi 42 | done 43 | } 44 | 45 | select_aliases() { 46 | local CHOICE 47 | export IFS=$ENTER_IFS 48 | 49 | while true; do 50 | DEFAULT="$CHOICE" 51 | CHOICE=$($DIALOG --title "Select Lunar Aliases" \ 52 | --ok-label "Select" \ 53 | --cancel-label "Close" \ 54 | --default-item "$DEFAULT" \ 55 | --menu "" 0 0 0 \ 56 | "$(alias_menu_list_aliases)") || return 57 | 58 | # modify an alias 59 | DEFAULT=$(get_local_config "LUNAR_ALIAS_$CHOICE") 60 | if [ -z "$DEFAULT" ]; then 61 | DEFAULT="None" 62 | fi 63 | if ACHOICE=$($DIALOG --title "Select Lunar Aliases" \ 64 | --ok-label "Select" \ 65 | --cancel-label "Close" \ 66 | --default-item "$DEFAULT" \ 67 | --radiolist "" 0 0 0 \ 68 | "$(alias_menu_list_alias_choices "$CHOICE")"); then 69 | if [ "$ACHOICE" != "None" ]; then 70 | set_local_config "LUNAR_ALIAS_$CHOICE" "$ACHOICE" 71 | else 72 | unset_local_config "LUNAR_ALIAS_$CHOICE" 73 | fi 74 | fi 75 | done 76 | } 77 | -------------------------------------------------------------------------------- /menu/integrity.menu: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | ############################################################ 3 | # # 4 | # This code is written for Lunar Linux, see # 5 | # http://lunar-linux.org # 6 | # # 7 | ############################################################ 8 | # # 9 | # $MENUS/integrity # 10 | # includes menu for lunar fix integrity checking options # 11 | # # 12 | # 20020714 # 13 | # # 14 | ############################################################ 15 | # # 16 | # Portions Copyrighted Kyle Sallee under GPL # 17 | # Copyrighted Kagan Kongar 2002 under GPLv2 # 18 | # # 19 | ############################################################ 20 | 21 | integrity_menu() { 22 | INT_TITLE="Integrity Checking Selection Menu" 23 | INT_HELP="Please select the tests which lunar fix should execute." 24 | FIND_HELP="Discover missing binary executables, libraries, and header files" 25 | LDD_HELP="Discover broken binary executables, and libraries" 26 | SYM_HELP="Discover misowned symbolic links to files" 27 | MD5SUM_HELP="Discover modified binary executables, and libraries" 28 | 29 | if INT_CHECKS=$($DIALOG --title "$INT_TITLE" \ 30 | --no-cancel \ 31 | --item-help \ 32 | --separate-output \ 33 | --checklist \ 34 | "$INT_HELP" \ 35 | 0 0 0 \ 36 | "FIND_CHECK" "" "$FIND_CHECK" "$FIND_HELP" \ 37 | "MD5SUM_CHECK" "" "$MD5SUM_CHECK" "$MD5SUM_HELP" \ 38 | "LDD_CHECK" "" "$LDD_CHECK" "$LDD_HELP" \ 39 | "SYM_CHECK" "" "$SYM_CHECK" "$SYM_HELP"); then 40 | FIND_CHECK=off 41 | MD5SUM_CHECK=off 42 | LDD_CHECK=off 43 | SYM_CHECK=off 44 | 45 | for CHECK in $INT_CHECKS; do 46 | case $CHECK in 47 | FIND_CHECK) FIND_CHECK=on ;; 48 | MD5SUM_CHECK) MD5SUM_CHECK=on ;; 49 | LDD_CHECK) LDD_CHECK=on ;; 50 | SYM_CHECK) SYM_CHECK=on ;; 51 | esac 52 | done 53 | 54 | set_local_config "FIND_CHECK" "$FIND_CHECK" 55 | set_local_config "LDD_CHECK" "$LDD_CHECK" 56 | set_local_config "MD5SUM_CHECK" "$MD5SUM_CHECK" 57 | set_local_config "SYM_CHECK" "$SYM_CHECK" 58 | fi 59 | } 60 | -------------------------------------------------------------------------------- /menu/license.menu: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | ############################################################ 3 | # # 4 | # This code is written for Lunar Linux, see # 5 | # http://lunar-linux.org # 6 | # # 7 | ############################################################ 8 | # # 9 | # $MENUS/license # 10 | # includes menu for setting the accepted/rejected licenses # 11 | # # 12 | # 20051105 # 13 | # # 14 | ############################################################ 15 | # # 16 | # Copyrighted Auke Kok 2005 under GPLv2 # 17 | # # 18 | ############################################################ 19 | 20 | set_accepted_licenses() { 21 | PROMPT="Please select acceptable licenses 22 | 23 | Lunar by default only accept osi-approved licenses. You will 24 | need to tell lunar to explicitly accept or reject licenses if 25 | you wish to change this behaviour. 26 | 27 | You have several ways of doing so: 28 | o Enter \"all\" in this field to accept every license. 29 | o Enter \"osi\" to accept any known osi approved license. 30 | o Or enter any specific license name in here to accept it. 31 | o Enter licenses in the REJECTED_LICENSES and leave this 32 | field empty to reject only those licenses. 33 | 34 | Currently known osi licenses: gpl gpl2 lgpl gfdl bsd mpl cc apache 35 | artistic qpl." 36 | 37 | ACCEPTED_LICENSES=$($DIALOG --title "Select accepted licenses" \ 38 | --ok-label "Commit" --inputbox \ 39 | "$PROMPT" 0 0 "$ACCEPTED_LICENSES") 40 | 41 | set_local_config ACCEPTED_LICENSES "$ACCEPTED_LICENSES" 42 | } 43 | 44 | set_rejected_licenses() { 45 | PROMPT="Please select rejected licenses 46 | 47 | Lunar by default only accepts osi-approved licenses. You will 48 | need to tell lunar to explicitly accept or reject licenses if 49 | you wish to change this behaviour. 50 | 51 | You have several ways of doing so: 52 | o use the ACCEPTED_LICENSES field to accept only specific licenses 53 | o enter any license name in here to reject it - however \"osi\" 54 | or \"all\" does not work in this field - you must use the exact 55 | name. 56 | 57 | Remember that if you leave ACCEPTED_LICENSES empty, all licenses will 58 | be accepted that do not match the REJECTED_LICENSES list." 59 | 60 | REJECTED_LICENSES=$($DIALOG --title "Select rejected licenses" \ 61 | --ok-label "Commit" --inputbox \ 62 | "$PROMPT" 0 0 "$REJECTED_LICENSES") 63 | 64 | set_local_config REJECTED_LICENSES "$REJECTED_LICENSES" 65 | } 66 | -------------------------------------------------------------------------------- /menu/mirrors.menu: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | ############################################################ 3 | # # 4 | # This code is written for Lunar Linux, see # 5 | # http://lunar-linux.org # 6 | # # 7 | ############################################################ 8 | # # 9 | # $MENUS/mirror # 10 | # includes menu for software mirrors selection in lunar # 11 | # # 12 | # 20020712 # 13 | # # 14 | ############################################################ 15 | # # 16 | # Portions Copyrighted Kyle Sallee under GPL # 17 | # Copyrighted Kagan Kongar 2002 under GPLv2 # 18 | # # 19 | ############################################################ 20 | 21 | mirror_list() { 22 | sort -r "$MIRRORS/$1" | tr -s "\t" | tr "\t" "\n" | tac 23 | } 24 | 25 | select_mirror() { 26 | DEFAULT_URL=${1}_URL 27 | $DIALOG --title "Select Mirror Please" \ 28 | --ok-label "Select" \ 29 | --default-item "${!DEFAULT_URL}" \ 30 | --menu \ 31 | "" \ 32 | 0 80 10 \ 33 | $(mirror_list "$1") 34 | } 35 | 36 | mirror_menu() { 37 | G_HELP="Select mirror for downloading GNU sources." 38 | K_HELP="Select mirror for downloading KDE sources." 39 | N_HELP="Select mirror for downloading GNOME sources." 40 | L_HELP="Select mirror for downloading kernel related sources." 41 | SF_HELP="Select mirror for downloading SourceForge sources." 42 | LR_HELP="Select the mirror for a last resort download place." 43 | X_HELP="Select mirror for downloading XFree86 related sources." 44 | XORG_HELP="Select mirror for downloading XOrg related sources." 45 | N_HELP="Select mirror for downloading NVIDIA drivers." 46 | 47 | while COMMAND=$($DIALOG --title "Mirror Menu" \ 48 | --ok-label "Select" \ 49 | --cancel-label "Exit" \ 50 | --item-help \ 51 | --menu "" 0 0 0 \ 52 | "GNOME" "" "$N_HELP" \ 53 | "GNU" "" "$G_HELP" \ 54 | "KDE" "" "$K_HELP" \ 55 | "KERNEL" "" "$L_HELP" \ 56 | "SFORGE" "" "$SF_HELP" \ 57 | "LRESORT" "" "$LR_HELP" \ 58 | "NVIDIA" "" "$N_HELP" \ 59 | "XFREE86" "" "$X_HELP" \ 60 | "XORG" "" "$XORG_HELP") 61 | do 62 | 63 | case $COMMAND in 64 | GNOME) MIRROR=" GNOME_URL" ;; 65 | GNU) MIRROR=" GNU_URL" ;; 66 | KDE) MIRROR=" KDE_URL" ;; 67 | KERNEL) MIRROR=" KERNEL_URL" ;; 68 | XFREE86) MIRROR=" XFREE86_URL" ;; 69 | XORG) MIRROR=" XORG_URL" ;; 70 | NVIDIA) MIRROR=" NVIDIA_URL" ;; 71 | SFORGE) MIRROR=" SFORGE_URL" ;; 72 | LRESORT) MIRROR=" LRESORT_URL" ;; 73 | esac 74 | 75 | if MIRROR_URL=$(select_mirror "$COMMAND"); then 76 | if [ "$MIRROR_URL" == "Custom" ]; then 77 | MIRROR_URL=$($DIALOG --inputbox "Please enter the URL." 0 0) 78 | fi 79 | 80 | if [ -n "$MIRROR_URL" ]; then 81 | set_local_config "$MIRROR" "$MIRROR_URL" && 82 | $DIALOG --msgbox "$MIRROR=$MIRROR_URL saved in $LOCAL_CONFIG" 8 60 83 | export "${MIRROR// /}"="$MIRROR_URL" 84 | fi 85 | fi 86 | done 87 | } 88 | -------------------------------------------------------------------------------- /mirrors/GNOME: -------------------------------------------------------------------------------- 1 | Custom Mirror Custom 2 | Master Site FTP ftp://ftp.gnome.org/pub/GNOME/ 3 | Master Site HTTP https://ftp.gnome.org/pub/GNOME/ 4 | Australia http://mirror.aarnet.edu.au/pub/GNOME/ 5 | Australia http://planetmirror.com/pub/gnome/ 6 | Belgium http://ftp.belnet.be/mirror/ftp.gnome.org/ 7 | China https://mirrors.ustc.edu.cn/gnome/ 8 | France ftp://fr.rpmfind.net/linux/gnome.org/ 9 | France ftp://fr2.rpmfind.net/linux/gnome.org/ 10 | Italy http://ftp.unina.it/pub/linux/GNOME/ 11 | Norway ftp://ftp.no.gnome.org/pub/GNOME/ 12 | Poland ftp://sunsite.icm.edu.pl/pub/Linux/GNOME/ 13 | Spain ftp://ftp.dit.upm.es/pub/GNOME/ 14 | Sweden ftp://ftp.dataplus.se/pub/GNOME/ 15 | Sweden ftp://ftp.acc.umu.se/pub/GNOME/ 16 | United Kingdom http://ftp.linux.org.uk/mirrors/ftp.gnome.org/ 17 | US ftp://ftp.cse.buffalo.edu/pub/Gnome/ 18 | US or Canada http://archive.progeny.com/GNOME/ 19 | US or Canada http://ftp.rpmfind.net/linux/gnome.org/ 20 | -------------------------------------------------------------------------------- /mirrors/KDE: -------------------------------------------------------------------------------- 1 | 2 | 3 | Australia, KDDI R&D Laboratories https://ftp.kddlabs.co.jp/pub/X11/kde 4 | Australia, KDDI R&D Laboratories ftp://ftp.kddlabs.co.jp/pub/X11/kde 5 | Australia, UberGlobal https://kde.mirror.uber.com.au 6 | Austria, Easyname https://mirror.easyname.at/kde 7 | Austria, Easyname ftp://mirror.easyname.at/kde 8 | Austria, Klaus-Uwe Mitterer https://mirror.klaus-uwe.me/kde/ftp 9 | Austria, Klaus-Uwe Mitterer ftp://mirror.klaus-uwe.me/kde/ftp 10 | Belgium, Cu.be Solutions https://kde.cu.be 11 | Brazil, NB Telecom https://mirror.nbtelecom.com.br/KDE/kdeftp 12 | Brazil, Universidade de Sao Paulo https://linorg.usp.br/kde/downloads 13 | Brazil, Universidade Federal do Parana https://kde.c3sl.ufpr.br 14 | Brazil, Universidade Federal do Parana ftp://kde.c3sl.ufpr.br/kde 15 | Canada, Dalhousie University https://mirror.its.dal.ca/kde 16 | Canada, Dalhousie University ftp://mirror.its.dal.ca/kde 17 | Canada, Waterloo University https://mirror.csclub.uwaterloo.ca/kde 18 | China, University of Science and Technology https://mirrors.ustc.edu.cn/kde 19 | "Custom Mirror" Custom 20 | Czech Republic, Karneval https://mirror.karneval.cz/pub/kde 21 | Czech Republic, Karneval ftp://mirror.karneval.cz/pub/kde 22 | Czech Republic, Masaryk University https://ftp.fi.muni.cz/pub/kde 23 | Czech Republic, Masaryk University ftp://ftp.fi.muni.cz/pub/kde 24 | Czech Republic, MaxCDN https://mirror.oss.maxcdn.com/kde 25 | Czech Republic, MaxCDN ftp://mirror.oss.maxcdn.com/kde 26 | Denmark, Dotsrc.org https://mirrors.dotsrc.org/kde 27 | Denmark, Dotsrc.org ftp://mirrors.dotsrc.org/kde 28 | Finland, Funet ftp://ftp.funet.fi/pub/mirrors/ftp.kde.org/pub/kde 29 | Finland, Funet https://ftp.funet.fi/pub/mirrors/ftp.kde.org/pub/kde 30 | France, freenux.org https://kde-mirror.freenux.org 31 | France, Ircam https://mirrors.ircam.fr/pub/KDE 32 | France, Ircam ftp://mirrors.ircam.fr/pub/KDE 33 | France, LIP6 https://www-ftp.lip6.fr/pub/X11/kde 34 | France, LIP6 ftp://ftp.lip6.fr/pub/X11/kde 35 | France, rpmfind https://fr2.rpmfind.net/linux/KDE 36 | France, rpmfind ftp://fr2.rpmfind.net/linux/KDE 37 | Germany, GWDG https://ftp5.gwdg.de/pub/linux/kde 38 | Germany, GWDG ftp://ftp5.gwdg.de/pub/linux/kde 39 | Germany, Hochschule Esslingen https://ftp-stud.fht-esslingen.de/Mirrors/ftp.kde.org/pub/kde 40 | Germany, Hochschule Esslingen ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/ftp.kde.org/pub/kde 41 | Germany, mirror.ga https://kde.alpha.mirror.ga 42 | Germany, mirror.ga ftp://alpha.mirror.ga/kde 43 | Germany, mirror.ga https://kde.beta.mirror.ga 44 | Germany, mirror.ga ftp://beta.mirror.ga/kde 45 | Germany, Hochschule Esslingen https://mirror.hs-esslingen.de/Mirrors/ftp.kde.org/pub/kde/ 46 | Germany, Hochschule Esslingen ftp://mirror.hs-esslingen.de/pub/Mirrors/ftp.kde.org/pub/kde/ 47 | Germany, NetCologne GmbH https://mirror.netcologne.de/kde 48 | Germany, NetCologne GmbH ftp://mirror.netcologne.de/kde 49 | Germany, SunSITE Central Europe https://vesta.informatik.rwth-aachen.de/ftp/pub/mirror/kde 50 | Germany, SunSITE Central Europe ftp://vesta.informatik.rwth-aachen.de/pub/mirror/kde 51 | Germany, Wuerzburg University https://ftp.rz.uni-wuerzburg.de/pub/unix/kde 52 | Germany, Wuerzburg University ftp://ftp.rz.uni-wuerzburg.de/pub/unix/kde 53 | Greece, University of Crete https://ftp.cc.uoc.gr/mirrors/kde/ 54 | Greece, University of Crete ftp://ftp.cc.uoc.gr/mirrors/kde/ 55 | Iceland, RHnet https://ftp.rhnet.is/pub/kde 56 | Iceland, RHnet ftp://ftp.rhnet.is/pub/kde 57 | Ireland, HEAnet https://ftp.heanet.ie/mirrors/ftp.kde.org 58 | Ireland, HEAnet ftp://ftp.heanet.ie/mirrors/ftp.kde.org 59 | Italy, BA mirror https://ba.mirror.garr.it/mirrors/KDE/ 60 | Italy, CT mirror https://ct.mirror.garr.it/mirrors/KDE/ 61 | "Master Site" https://download.kde.org 62 | Netherlands, NLUUG https://ftp.nluug.nl/pub/windowing/kde 63 | Netherlands, NLUUG ftp://ftp.nluug.nl/pub/windowing/kde 64 | Netherlands, SURFnet https://ftp.surfnet.nl/windowing/kde 65 | Netherlands, SURFnet ftp://ftp.surfnet.nl/pub/windowing/kde 66 | Oman, Sultan Qaboos University ftp://mirror.squ.edu.om/kde 67 | Oman, Sultan Qaboos University https://mirror.squ.edu.om/kde 68 | Poland, ICM UW https://ftp.icm.edu.pl/pub/unix/kde 69 | Poland, ICM UW ftp://ftp.icm.edu.pl/pub/unix/kde 70 | Poland, PBone https://ftp.pbone.net/pub/kde 71 | Poland, PBone ftp://ftp.pbone.net/pub/kde 72 | Poland, PIOTRKOSOFT.net https://piotrkosoft.net/pub/mirrors/ftp.kde.org 73 | Poland, PIOTRKOSOFT.net ftp://ftp.piotrkosoft.net/pub/mirrors/ftp.kde.org 74 | Portugal, Porto University https://mirrors.fe.up.pt/pub/kde 75 | Portugal, Porto University ftp://mirrors.fe.up.pt/pub/kde 76 | Republic of Korea, Advanced Institute of Science and Technology ftp://ftp.kaist.ac.kr/kde 77 | Republic of Korea, Advanced Institute of Science and Technology https://ftp.kaist.ac.kr/kde 78 | Republic of Korea, NeowizGames ftp://ftp.neowiz.com/X/KDE 79 | Republic of Korea, NeowizGames https://ftp.neowiz.com/X/KDE 80 | Romania, RoEduNet https://ftp.iasi.roedu.net/pub/mirrors/ftp.kde.org 81 | South Africa, Internet Solutions ftp://ftp.is.co.za/mirror/ftp.kde.org 82 | South Africa, Internet Solutions https://ftp.is.co.za/mirror/ftp.kde.org/ 83 | Sweden, Academic Computer Club - Umea University https://ftp.acc.umu.se/mirror/kde.org/ftp/ 84 | Taiwan, Providence University ftp://ftp.cs.pu.edu.tw/pub/kde 85 | Taiwan, Providence University https://ftp.cs.pu.edu.tw/pub/kde 86 | Ukraine, ip-connect https://kde.ip-connect.vn.ua 87 | Ukraine, ip-connect ftp://kde.ip-connect.vn.ua/mirror/kde 88 | United Kingdom, AnlX https://kde.mirror.anlx.net 89 | United Kingdom, AnlX ftp://kde.mirror.anlx.net 90 | United Kingdom, UK Mirror Service https://www.mirrorservice.org/sites/ftp.kde.org/pub/kde 91 | United Kingdom, UK Mirror Service ftp://ftp.mirrorservice.org/sites/ftp.kde.org/pub/kde 92 | USA, Columbia University https://mirror.cc.columbia.edu/pub/software/kde 93 | USA, Columbia University ftp://mirror.cc.columbia.edu/pub/software/kde/ 94 | USA, Go-Parts https://mirrors-usa.go-parts.com/kde 95 | USA, Go-Parts ftp://mirrors-usa.go-parts.com/kde 96 | USA, Hoobly https://kde.mirrors.hoobly.com 97 | USA, Indiana University https://ftp.ussg.iu.edu/kde 98 | USA, Indiana University ftp://ftp.ussg.iu.edu/pub/kde 99 | USA, MirrorCatalogs https://kde.mirrorcatalogs.com 100 | USA, MirrorCatalogs ftp://kde.mirrorcatalogs.com/kde 101 | USA, MIT https://mirrors.mit.edu/kde 102 | USA, MIT ftp://mirrors.mit.edu/kde 103 | USA, TDS https://kde.mirrors.tds.net/pub/kde 104 | USA, TDS ftp://kde.mirrors.tds.net/pub/kde 105 | Viet Nam, Freedif.org https://mirror.freedif.org/KDE/ftp/ 106 | Viet Nam, VinaHost https://mirror.vinahost.vn/kde/ 107 | 108 | -------------------------------------------------------------------------------- /mirrors/KERNEL: -------------------------------------------------------------------------------- 1 | AUTO (Auto-Geo) https://cdn.kernel.org/ 2 | "Custom Mirror" Custom 3 | "Master Site" https://www.kernel.org/ 4 | -------------------------------------------------------------------------------- /mirrors/LRESORT: -------------------------------------------------------------------------------- 1 | Custom Custom 2 | Mirror site - TX-US http://tx-us.lunar-linux.org/lunar/cache/ 3 | Mirror site - SE http://jkp-se.lunar-linux.org/lunar/cache/ 4 | Mirror site - SE http://vxj-se.lunar-linux.org/lunar/cache/ 5 | Mirror site - SE http://su-se.lunar-linux.org/lunar/cache/ 6 | Mirror site - BE http://be.lunar-linux.org/lunar/cache/ 7 | Mirror site - DE http://de.lunar-linux.org/lunar/cache/ 8 | Mirror site - DE http://fr-de.lunar-linux.org/lunar/cache/ 9 | Master site - NL http://lunar-linux.org/lunar/cache/ 10 | -------------------------------------------------------------------------------- /mirrors/NVIDIA: -------------------------------------------------------------------------------- 1 | MASTER https://download.nvidia.com/XFree86 2 | China https://cn.download.nvidia.com/XFree86 3 | Custom Mirror Custom 4 | France https://fr.download.nvidia.com/XFree86 5 | Germany https://de.download.nvidia.com/XFree86 6 | India https://in.download.nvidia.com/XFree86 7 | Italy https://it.download.nvidia.com/XFree86 8 | Japan https://jp.download.nvidia.com/XFree86 9 | Poland https://pl.download.nvidia.com/XFree86 10 | Russian Federation https://ru.download.nvidia.com/XFree86 11 | Spain https://es.download.nvidia.com/XFree86 12 | Singapore https://sg.download.nvidia.com/XFree86 13 | South Korea https://kr.download.nvidia.com/XFree86 14 | Taiwan https://tw.download.nvidia.com/XFree86 15 | United Kingdom https://uk.download.nvidia.com/XFree86 16 | United States https://us.download.nvidia.com/XFree86 17 | -------------------------------------------------------------------------------- /mirrors/SFORGE: -------------------------------------------------------------------------------- 1 | AUTO (Auto-GEO) https://downloads.sourceforge.net/sourceforge 2 | Sydney (AU) http://optusnet.dl.sourceforge.net/sourceforge 3 | flow (AU) http://flow.dl.sourceforge.net/sourceforge 4 | Brussels (BE) http://belnet.dl.sourceforge.net/sourceforge 5 | Curitiba (BR) http://ufpr.dl.sourceforge.net/sourceforge 6 | Bern (CH) http://puzzle.dl.sourceforge.net/sourceforge 7 | Lausanne (CH) http://switch.dl.sourceforge.net/sourceforge 8 | cesnet (CZ) http://cesnet.dl.sourceforge.net/sourceforge 9 | Berlin (DE) http://dfn.dl.sourceforge.net/sourceforge 10 | Duesseldorf (DE) http://mesh.dl.sourceforge.net/sourceforge 11 | Paris (FR) http://ovh.dl.sourceforge.net/sourceforge 12 | Dublin (IE) http://heanet.dl.sourceforge.net/sourceforge 13 | Ishikawa (JP) http://jaist.dl.sourceforge.net/sourceforge 14 | Amsterdam (NL) http://surfnet.dl.sourceforge.net/sourceforge 15 | citkit (RU) http://citkit.dl.sourceforge.net/sourceforge 16 | Tainan (TW) http://nchc.dl.sourceforge.net/sourceforge 17 | nvhv (TW) http://nvhv.dl.sourceforge.net/sourceforge 18 | Kent (UK) http://kent.dl.sourceforge.net/sourceforge 19 | San Jose CA (US) http://internap.dl.sourceforge.net/sourceforge 20 | Seattle WA (US) http://superb-west.dl.sourceforge.net/sourceforge 21 | McLean VA (US) http://superb-east.dl.sourceforge.net/sourceforge 22 | Phoenix AZ (US) http://easynews.dl.sourceforge.net/sourceforge 23 | United States http://aleron.dl.sourceforge.net/sourceforge 24 | United States http://telia.dl.sourceforge.net/sourceforge 25 | United States http://twtelecom.dl.sourceforge.net/sourceforge 26 | United States http://unc.dl.sourceforge.net/sourceforge 27 | Minneapolis MN (US) http://umn.dl.sourceforge.net/sourceforge 28 | United States http://west.dl.sourceforge.net/sourceforge 29 | OSDN (US) http://osdn.dl.sourceforge.net/sourceforge 30 | voxel (US) http://voxel.dl.sourceforge.net/sourceforge 31 | cogent (US) http://cogent.dl.sourceforge.net/sourceforge 32 | -------------------------------------------------------------------------------- /mirrors/XFREE86: -------------------------------------------------------------------------------- 1 | "Master Site" ftp://ftp.xfree86.org/pub/XFree86/ 2 | "Custom Mirror" Custom 3 | Korea ftp://ftp.kreonet.re.kr/pub/Linux/xfree86/ 4 | Japan ftp://ftp.netlab.is.tsukuba.ac.jp/pub/XFree86/ 5 | Japan ftp://ftp.iij.ad.jp/pub/X/XFree86/ 6 | Japan ftp://kddlabs.co.jp/X/XFree86/ 7 | Australia and New Zeland http://www.planetmirror.com/pub/XFree86/ 8 | Australia and New Zeland ftp://ftp.planetmirror.com/pub/XFree86/ 9 | Australia and New Zeland ftp://mirror.aarnet.edu.au/pub/XFree86/ 10 | Australia and New Zeland ftp://x.physics.usyd.edu.au/pub/XFree86/ 11 | Costa Rica ftp://xfree.ulatina.ac.cr/ 12 | Austria ftp://gd.tuwien.Ac.at/hci/X11/XFree86/ 13 | Czech Republic ftp://ftp.fee.vutbr.cz/pub/XFree86/ 14 | Denmark ftp://mirror.inet.tele.dk/mirrors/ftp.xfree86.org/pub/XFree86/ 15 | Finland ftp://ftp.funet.fi/pub/X11/XFree86/ 16 | France ftp://ftp.free.fr/pub/XFree86/ 17 | France ftp://ftp.lip6.fr/pub/X11/XFree86/ 18 | France ftp://ftp.ovh.net/mirrors/ 19 | Germany ftp://ftp.cs.tu-berlin.de/pub/X/XFree86/ 20 | Germany ftp://ftp.gwdg.de/pub/xfree86/XFree86/ 21 | Germany ftp://ftp.mpi-sb.mpg.de/pub/X/mirror/ftp.xfree86.org/XFree86/ 22 | Germany ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/ftp.xfree86.org/ 23 | Germany ftp://ftp.uni-erlangen.de/pub/Linux/MIRROR.xfree86/ 24 | Germany ftp://ftp.uni-stuttgart.de/pub/X11/Xfree86/ 25 | Germany http://ftp-stud.fht-esslingen.de/pub/Mirrors/ftp.xfree86.org/XFree86/ 26 | Italy ftp://ftp.unina.it/pub/XFree86/ 27 | Ireland ftp://ftp.esat.net/pub/X11/XFree86/ 28 | Netherlands ftp://ftp.nl.uu.net/pub/XFree86/ 29 | Netherlands ftp://dl.xs4all.nl/pub2/mirror/XFree/ 30 | Norway ftp://sunsite.uio.no/pub/XFree86/ 31 | Poland ftp://sunsite.icm.edu.pl/pub/X11/XFree86/ 32 | Poland ftp://ftp.task.gda.pl/pub/XFree86/ 33 | Spain ftp://ftp.cica.es/pub/XFree86/ 34 | Spain ftp://ftp.cica.es/mirrors/XFree86/ 35 | United Kingdom ftp://sunsite.doc.ic.ac.uk/packages/XFree86/ 36 | United States ftp://ftp.calderasystems.com/pub/mirrors/xfree86/ 37 | United States ftp://carroll.cac.psu.edu/pub/XFree86/ 38 | United States ftp://ftp.cs.umn.edu/pub/XFree86/ 39 | United States ftp://download.sourceforge.net/pub/mirrors/XFree86/ 40 | United States ftp://ftp.freesoftware.com/pub/XFree86/ 41 | United States ftp://ftp.infomagic.com/pub/mirrors/XFree86/ 42 | United States ftp://mirror.sftw.com/pub/XFree86/ 43 | United States ftp://phyppro1.phy.bnl.gov/pub/XFree86/ 44 | United States ftp://ftp.rge.com/pub/X/XFree86/ 45 | -------------------------------------------------------------------------------- /mirrors/XORG: -------------------------------------------------------------------------------- 1 | "Master Site" ftp://ftp.x.org/pub/ 2 | "Custom Mirror" Custom 3 | Australia ftp://mirror.isp.net.au/pub/x.org/ 4 | Belgium ftp://x.mirrors.skynet.be/pub/x.org/ 5 | Belgium http://x.mirrors.skynet.be/pub/x.org/ 6 | Brazilia ftp://ftp.unicamp.br/pub/X11/releases/ 7 | China https://mirrors.ustc.edu.cn/Xorg/pub/ 8 | France ftp://mirror.cict.fr/x.org/ 9 | France http://mirror.cict.fr/x.org/ 10 | Germany ftp://ftp.gwdg.de/pub/x11/x.org/pub/ 11 | Germany ftp://ftp.portal-to-web.de/pub/mirrors/x.org/ 12 | Germany http://www.portal-to-web.de/pub/mirrors/x.org/ 13 | Germany ftp://ftp.fu-berlin.de/unix/X11/FTP.X.ORG/pub/ 14 | Greece ftp://ftp.ntua.gr/pub/X11/ 15 | HongKong ftp://ftp.cs.cuhk.edu.hk/pub/X11/ 16 | Italy http://mi.mirror.garr.it/mirrors/x.org/ 17 | Italy ftp://mi.mirror.garr.it/mirrors/x.org/ 18 | Japan ftp://sunsite.sut.ac.jp/pub/archives/X11/ 19 | Japan ftp://ftp.nara.wide.ad.jp/pub/X11/x.org/ 20 | Japan http://ftp.nara.wide.ad.jp/pub/X11/x.org/ 21 | Japan ftp://ftp.u-aizu.ac.jp/pub/x11/x.org/ 22 | Japan http://ftp.yz.yamagata-u.ac.jp/pub/X11/x.org/ 23 | Japan ftp://ftp.yz.yamagata-u.ac.jp/pub/X11/x.org/ 24 | Korea ftp://ftp.kreonet.re.kr/pub/X11/ftp.x.org/ 25 | Netherlands http://x-org.mirror.intouch.nl/ 26 | Netherlands ftp://xorg.mirror.intouch.nl/mirrors/xorg/ 27 | Poland ftp://sunsite.icm.edu.pl/pub/X11/x.org/ 28 | Poland ftp://ftp.task.gda.pl/mirror/ftp.x.org/ 29 | Poland http://ftp.pl.debian.org/mirror/ftp.x.org/pub/ 30 | Russia ftp://xorg.freshsoft.ru/ftp.x.org/ 31 | Russia http://xorg.freshsoft.ru/ftp.x.org/ 32 | Russia http://ftp.chg.ru/pub/X11/x.org/ 33 | Russia ftp://ftp.chg.ru/pub/X11/x.org/ 34 | Spain ftp://ftp.cica.es/pub/X/ 35 | Spain ftp://ftp.sunet.se/pub/X11/ 36 | South Afrika ftp://ftp.is.co.za/pub/x.org/ 37 | Switzerland http://xorg.mirror.solnet.ch/ 38 | Switzerland ftp://ftp.solnet.ch/mirror/x.org/ 39 | Switzerland ftp://mirror.switch.ch/mirror/X11/ 40 | Switzerland http://mirror.switch.ch/ftp/mirror/X11/ 41 | Taiwan http://x.cs.pu.edu.tw/ 42 | United Kingdom http://www.mirror.ac.uk/mirror/ftp.x.org/ 43 | United Kingdom http://www.mirrorservice.org/sites/ftp.x.org/ 44 | United Kingdom ftp://ftp.mirrorservice.org/sites/ftp.x.org/ 45 | United States ftp://mirror.sg.depaul.edu/pub/x.org/ 46 | United States http://mirror.sg.depaul.edu/pub/x.org/ 47 | United States http://x.paracoda.com/ 48 | United States http://x.hostingzero.com/ 49 | -------------------------------------------------------------------------------- /misc/bootstrap: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################ 3 | # # 4 | # bootstrap - Lunar initialization code # 5 | # # 6 | ############################################################ 7 | # # 8 | # Copyright 2012 by Peter de Ridder under GPLv2 # 9 | # # 10 | ############################################################ 11 | 12 | # check if /etc/lunar/config is loaded 13 | if [ -z "$BOOTSTRAP" ]; then 14 | . /etc/lunar/config 15 | fi 16 | 17 | for FUNCTION in $FUNCTIONS/*.lunar; do 18 | . $FUNCTION 19 | done 20 | 21 | if [ -s "$LOCAL_CONFIG" ]; then 22 | . $LOCAL_CONFIG 23 | fi 24 | 25 | # validate and correct config variables from $LOCAL_CONFIG 26 | for DIR_VAR in CONFIG_CACHE DEPENDS_CONFIG BUILD_DIRECTORY DOCUMENT_DIRECTORY DEFAULT_PREFIX MOONBASE FUNCTIONS MENUS PLUGIN_DIR SOUND_DIRECTORY INSTALL_LOGS COMPILE_LOGS MD5SUM_LOGS INSTALL_CACHE SOURCE_CACHE TMPDIR; do 27 | # dir configuration values shouldn't end with a / 28 | eval $DIR_VAR=\${$DIR_VAR/%\\/} 29 | done 30 | 31 | sound $SOUND 32 | color $COLOR 33 | 34 | for LUNAR_PLUGIN in $PLUGIN_DIR/*.plugin; do 35 | . $LUNAR_PLUGIN 36 | done 37 | -------------------------------------------------------------------------------- /misc/excluded: -------------------------------------------------------------------------------- 1 | ^/dev/ 2 | ^/home/ 3 | ^/proc/ 4 | ^/root/ 5 | ^/tmp/ 6 | ^/usr/lib/gio/modules/giomodule.cache 7 | ^/usr/share/icons/hicolor/icon-theme.cache 8 | ^/usr/share/mime/mime.cache 9 | ^/usr/src/ 10 | ^/var/cache/ccache/ 11 | ^/var/lock/ 12 | ^/var/log/ 13 | ^/var/run/ 14 | ^/var/state/lunar/ 15 | ^/var/tmp/ 16 | -------------------------------------------------------------------------------- /misc/protected: -------------------------------------------------------------------------------- 1 | ^\(/usr\)\?/bin/awk$ 2 | ^\(/usr\)\?/bin/basename$ 3 | ^\(/usr\)\?/bin/bash$ 4 | ^\(/usr\)\?/bin/cat$ 5 | ^\(/usr\)\?/bin/chmod$ 6 | ^\(/usr\)\?/bin/cp$ 7 | ^\(/usr\)\?/bin/cut$ 8 | ^\(/usr\)\?/bin/date$ 9 | ^\(/usr\)\?/bin/dirname$ 10 | ^\(/usr\)\?/bin/fgrep$ 11 | ^\(/usr\)\?/bin/file$ 12 | ^\(/usr\)\?/bin/grep$ 13 | ^\(/usr\)\?/bin/install$ 14 | ^\(/usr\)\?/bin/login$ 15 | ^\(/usr\)\?/bin/make$ 16 | ^\(/usr\)\?/bin/md5sum$ 17 | ^\(/usr\)\?/bin/mkdir$ 18 | ^\(/usr\)\?/bin/mknod$ 19 | ^\(/usr\)\?/bin/mv$ 20 | ^\(/usr\)\?/bin/ranlib$ 21 | ^\(/usr\)\?/bin/rm$ 22 | ^\(/usr\)\?/bin/rmdir$ 23 | ^\(/usr\)\?/bin/sed$ 24 | ^\(/usr\)\?/bin/sh$ 25 | ^\(/usr\)\?/bin/sha1sum$ 26 | ^\(/usr\)\?/bin/sleep$ 27 | ^\(/usr\)\?/bin/sort$ 28 | ^\(/usr\)\?/bin/su$ 29 | ^\(/usr\)\?/bin/tail$ 30 | ^\(/usr\)\?/bin/tee$ 31 | ^\(/usr\)\?/bin/tr$ 32 | ^\(/usr\)\?/bin/uname$ 33 | ^/boot/ 34 | ^/boot/grub/menu.1st$ 35 | ^/etc/aliases$ 36 | ^/etc/audit$ 37 | ^/etc/bonobo-activation/ 38 | ^/etc/config.d/ospmd.conf$ 39 | ^/etc/courier/ 40 | ^/etc/cups/ 41 | ^/etc/exim.conf$ 42 | ^/etc/exports$ 43 | ^/etc/fstab$ 44 | ^/etc/group$ 45 | ^/etc/group-$ 46 | ^/etc/hostname$ 47 | ^/etc/httpd/ 48 | ^/etc/httpd/ 49 | ^/etc/httpsd/ 50 | ^/etc/inittab$ 51 | ^/etc/ld.so.cache$ 52 | ^/etc/ld.so.conf$ 53 | ^/etc/lilo.conf$ 54 | ^/etc/localtime$ 55 | ^/etc/lunar/local/ 56 | ^/etc/modules$ 57 | ^/etc/modules.conf$ 58 | ^/etc/mtab$ 59 | ^/etc/named.conf$ 60 | ^/etc/nsswitch.conf$ 61 | ^/etc/passwd$ 62 | ^/etc/passwd-$ 63 | ^/etc/postfix/ 64 | ^/etc/ppp/ 65 | ^/etc/printcap$ 66 | ^/etc/procmailrc$ 67 | ^/etc/proftpd.conf$ 68 | ^/etc/protocols$ 69 | ^/etc/pureftpd.passwd$ 70 | ^/etc/pureftpd.pdb$ 71 | ^/etc/resolv.conf$ 72 | ^/etc/rndc.conf$ 73 | ^/etc/rndc.key$ 74 | ^/etc/samba/ 75 | ^/etc/security/ 76 | ^/etc/services$ 77 | ^/etc/sgml/catalog$ 78 | ^/etc/shadow$ 79 | ^/etc/shadow-$ 80 | ^/etc/snort$ 81 | ^/etc/snort.conf$ 82 | ^/etc/squid/ 83 | ^/etc/ssh/ 84 | ^/etc/ssl/ 85 | ^/etc/ssl/certs/ 86 | ^/etc/sudoers$ 87 | ^/etc/sysctl.conf$ 88 | ^/etc/syslog.conf$ 89 | ^/etc/webmin/ 90 | ^/etc/X11/ 91 | ^/etc/X11/fs/config$ 92 | ^/etc/X11/XF86Config$ 93 | ^/etc/X11/XftConfig$ 94 | ^/etc/X11/XftConfig.gdkxftsaved$ 95 | ^/etc/X11/xinit/xinitrc$ 96 | ^/etc/xinetd.conf$ 97 | ^/etc/xml/catalog$ 98 | ^/etc/xml/docbook$ 99 | ^/etc/yp.conf$ 100 | /fonts.dir$ 101 | ^\(/usr\)\?/lib\(32\|64\)$ 102 | ^\(/usr\)\?/lib\(32\)\?/ld-linux.so.2$ 103 | ^\(/usr\)\?/lib\(64\)\?/ld-linux-x86-64.so.2$ 104 | ^\(/usr\)\?/lib\(32\|64\)\?/libc.so.6$ 105 | ^\(/usr\)\?/lib\(32\|64\)\?/libdl.so.2$ 106 | ^\(/usr\)\?/lib\(32\|64\)\?/libm.so.6$ 107 | ^\(/usr\)\?/lib\(32\|64\)\?/librt.so.1$ 108 | ^\(/usr\)\?/lib\(32\|64\)\?/libpthread.so.0$ 109 | ^\(/usr\)\?/lib\(32\|64\)\?/libnss_files.so.2$ 110 | ^\(/usr\)\?/lib\(32\|64\)\?/libutil.so.1$ 111 | ^\(/usr\)\?/lib\(32\|64\)\?/libnsl.so.1$ 112 | ^\(/usr\)\?/lib\(32\|64\)\?/libcrypt.so.1$ 113 | ^\(/usr\)\?/lib\(32\|64\)\?/libstdc++.so 114 | ^\(/usr\)\?/lib\(32\|64\)\?/modules/ 115 | /perllocal.pod$ 116 | ^/usr/include/bits/syscall.h$ 117 | ^/usr/include/gnu/stubs.h$ 118 | ^/usr/lib\(32\|64\)\?/installwatch.so$ 119 | ^/usr/lib\(32\|64\)\?/libgcc_s.so.1$ 120 | ^/usr/lib\(32\|64\)\?/sasl/smtpd.conf$ 121 | ^/usr/lib\(32\|64\)\?/libgudev-1.0.so 122 | ^/usr/share/httpd/ 123 | ^/usr/share/httpsd/ 124 | ^/usr/share/info/dir$ 125 | ^/usr/X11R6/lib/X11/app-defaults$ 126 | ^/usr/X11R6/lib/X11/xinit/xinitrc$ 127 | ^/var/lib/lunar/excluded$ 128 | ^/var/lib/lunar/protected$ 129 | ^/var/lib/mysql/ 130 | ^/var/lock$ 131 | ^/var/mailman/Mailman/mm_cfg.py$ 132 | ^/var/mailman/archives$ 133 | ^/var/mailman/data$ 134 | ^/var/mailman/lists$ 135 | ^/var/mailman/qfiles$ 136 | ^/var/named/ 137 | ^/var/nis/ 138 | ^/var/run$ 139 | ^/var/spool/ 140 | ^/var/state/ 141 | ^/var/state/dhcpd.leases$ 142 | ^/var/state/dhcpd.leases~$ 143 | ^/var/yp/ 144 | -------------------------------------------------------------------------------- /misc/solo: -------------------------------------------------------------------------------- 1 | bash 2 | binutils 3 | gcc 4 | gcc2 5 | glibc 6 | lunar 7 | moonbase 8 | -------------------------------------------------------------------------------- /misc/sustained: -------------------------------------------------------------------------------- 1 | acl 2 | attr 3 | bash 4 | binutils 5 | bzip2 6 | coreutils 7 | cracklib 8 | dialog 9 | diffutils 10 | e2fsprogs 11 | file 12 | findutils 13 | gawk 14 | gcc 15 | gettext 16 | glib-2 17 | glibc 18 | gmp 19 | grep 20 | gzip 21 | installwatch 22 | iproute2 23 | kmod 24 | less 25 | libcap 26 | libffi 27 | libmpc 28 | lunar 29 | make 30 | mpfr 31 | nano 32 | ncurses 33 | patch 34 | procps 35 | readline 36 | sed 37 | shadow 38 | tar 39 | util-linux 40 | util-linux-crypto 41 | wget 42 | xz 43 | zlib 44 | -------------------------------------------------------------------------------- /misc/unset.sh: -------------------------------------------------------------------------------- 1 | unset ACTIVITY_LOG 2 | unset ADDON 3 | unset ADMIN 4 | unset ARCHIVE 5 | unset AUTOFIX 6 | unset AUTOPRUNE 7 | unset BLACK 8 | unset BLUE 9 | unset BOLD 10 | unset BOOST_LOCK 11 | unset BOPT 12 | unset BUILD 13 | unset CHECK_COLOR 14 | unset COLOR 15 | unset COMPILE_LOGS 16 | unset CONFIG_CACHE 17 | unset COPT 18 | unset CPU 19 | unset CYAN 20 | unset DEFAULT 21 | unset DEFAULT_COLOR 22 | unset DEPENDS_CONFIG 23 | unset DEPENDS_STATUS 24 | unset DEPENDS_STATUS_BACKUP 25 | unset DIALOGRC 26 | unset EXCLUDED 27 | unset EXHAUSTIVE 28 | unset FILE 29 | unset FILE_COLOR 30 | unset FIND_CHECK 31 | unset FPM 32 | unset FTP_ACTIVE 33 | unset FUNCTIONS 34 | unset GARBAGE 35 | unset GNOME_URL 36 | unset GNU_URL 37 | unset GREEN 38 | unset INSTALL_CACHE 39 | unset INSTALL_LOGS 40 | unset INSTALL_QUEUE 41 | unset KDE_URL 42 | unset KERNEL_URL 43 | unset LDD_CHECK 44 | unset LDF 45 | unset LINES 46 | unset LOCAL_CONFIG 47 | unset LOCAL_EXCLUDED 48 | unset LRESORT_URL 49 | unset LRM_COLOR 50 | unset LUNAR_MODULE 51 | unset LUNAR_MODULES 52 | unset LUNAR_PRIORITY 53 | unset MAKES 54 | unset MAX_SOURCES 55 | unset MD5SUM_CHECK 56 | unset MD5SUM_LOGS 57 | unset MENUS 58 | unset MESSAGE_COLOR 59 | unset MIRRORS 60 | unset MODULE_COLOR 61 | unset MODULE_INDEX 62 | unset MODULE_STATUS 63 | unset MODULE_STATUS_BACKUP 64 | unset MOONBASE 65 | unset MOONBASE_URL 66 | unset OBSOLETE_LIB_DIR 67 | unset PATCH_URL 68 | unset PLATFORM 69 | unset PRESERVE 70 | unset PROBLEM_COLOR 71 | unset PROMPT_DELAY 72 | unset PROTECTED 73 | unset PWD 74 | unset QUERY_COLOR 75 | unset REAP 76 | unset RED 77 | unset REMOVE_QUEUE 78 | unset RESURRECT_COLOR 79 | unset SFORGE_URL 80 | unset SHELL 81 | unset SOLO 82 | unset SOUND 83 | unset SOUND_THEME 84 | unset SOURCE_CACHE 85 | unset SPD 86 | unset SUBROUTINES 87 | unset SUSTAIN 88 | unset SUSTAINED 89 | unset SYM_CHECK 90 | unset SYMLINK_COLOR 91 | unset TRACKED 92 | unset UNIQID 93 | unset USE_CACHE 94 | unset VERSION_COLOR 95 | unset VIEW_REPORTS 96 | unset VIOLET 97 | unset VOYEUR 98 | unset WHITE 99 | unset XFREE86_URL 100 | unset XORG_URL 101 | unset XTRA 102 | unset YELLOW 103 | -------------------------------------------------------------------------------- /plugins/build-zpatches.plugin: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################# 3 | # # 4 | # build-zpatches.plugin - build handling of custom # 5 | # patches that need to be applied # 6 | # to a module without editing # 7 | # DETAILS/BUILD files # 8 | # # 9 | ############################################################# 10 | # # 11 | # Copyright 2007-2018 by Stefan Wold under GPLv2 # 12 | # # 13 | ############################################################# 14 | 15 | plugin_zpatches_apply() { 16 | local PATCHDIRS FPATCH PATCH TARCMD GZCMD TMPFILE1 TMPFILE2 17 | if [[ -d $MOONBASE/zlocal/_patches/$MODULE || -d $SCRIPT_DIRECTORY/patch.d ]]; then 18 | cd $SOURCE_DIRECTORY 19 | 20 | if [ -d $SCRIPT_DIRECTORY/patch.d ]; then 21 | PATCHDIRS+=" $SCRIPT_DIRECTORY/patch.d" 22 | fi 23 | 24 | if [ -d $MOONBASE/zlocal/_patches/$MODULE ]; then 25 | PATCHDIRS+=" $MOONBASE/zlocal/_patches/$MODULE" 26 | fi 27 | 28 | # Check for version based patch dir 29 | if [ -d $MOONBASE/zlocal/_patches/$MODULE/$VERSION ]; then 30 | PATCHDIRS+=" $MOONBASE/zlocal/_patches/$MODULE/$VERSION" 31 | fi 32 | # Now find all patches and apply them 33 | # We also sort them so it possible to apply patch order 34 | # by prefixing a patch with 01, 02, 03 etc 35 | # ignore hidden files 36 | find $PATCHDIRS -maxdepth 1 -type f -name '[^\.]*' | sed 's;[^/]*$;& &;' | sort -t ' ' -k 2 | while read FPATCH PATCH; do 37 | verbose_msg "Applying $PATCH for $MODULE" 38 | 39 | if [[ -n $(echo $PATCH | grep '\.tar') ]]; then 40 | TARCMD="tar x -O" 41 | else 42 | TARCMD="cat" 43 | fi 44 | 45 | if [[ -n $(echo $PATCH | grep '\.bz2$') ]]; then 46 | GZCMD="bzcat" 47 | elif [[ -n $(echo $PATCH | grep '\.gz$') ]]; then 48 | GZCMD="zcat" 49 | elif [[ -n $(echo $PATCH | grep '\.xz$') ]]; then 50 | GZCMD="xzcat" 51 | else 52 | GZCMD="cat" 53 | fi 54 | 55 | TMPFILE1=$(temp_create "zpatch_1") 56 | TMPFILE2=$(temp_create "zpatch_2") 57 | 58 | if $GZCMD "$FPATCH" >$TMPFILE1; then 59 | # uncompress OK 60 | if cat "$TMPFILE1" | $TARCMD >$TMPFILE2; then 61 | # untar OK 62 | # Trying -p1 first or else we try -p0 63 | # An error will be visible if -p1 fail which is normal 64 | # Only return error if both -p1 and -p0 fail 65 | patch -N -p1 -t <$TMPFILE2 || patch -N -p0 -t <$TMPFILE2 66 | if [ $? -ne 0 ]; then 67 | message "${PROBLEM_COLOR}ERROR: Failed to apply ${PATCH} for ${MODULE}${DEFAULT_COLOR}" 68 | temp_destroy $TMPFILE1 69 | temp_destroy $TMPFILE2 70 | return 1 71 | else 72 | temp_destroy $TMPFILE1 73 | temp_destroy $TMPFILE2 74 | fi 75 | fi 76 | fi 77 | done 78 | if [ $? != 0 ]; then 79 | exit 1 80 | else 81 | return 2 82 | fi 83 | else 84 | # No patchdir for that module found just continue 85 | return 2 86 | fi 87 | } 88 | 89 | plugin_register BUILD_BUILD plugin_zpatches_apply 90 | -------------------------------------------------------------------------------- /plugins/check-find.plugin: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################# 3 | # # 4 | # check-find.plugin - plugin that performs file presence # 5 | # checking of installed modules # 6 | # # 7 | ############################################################# 8 | # # 9 | # Copyright 2005 by Auke Kok under GPLv2 # 10 | # # 11 | ############################################################# 12 | 13 | plugin_module_check_find() { 14 | local MODULE VERSION I_LOG FIND_STATUS IFS_OLD IFS LOG ITEM 15 | if [ "$FIND_CHECK" == "off" ]; then 16 | return 2 17 | fi 18 | debug_msg "plugin_module_check_find ($@)" 19 | 20 | MODULE=$1 21 | VERSION=$(installed_version $MODULE) 22 | I_LOG=$INSTALL_LOGS/$MODULE-$VERSION 23 | FIND_STATUS=2 24 | 25 | if [ -e "$I_LOG" ]; then 26 | IFS_OLD="$IFS" 27 | export IFS=$'\n' 28 | 29 | LOG=$(grep -E "/(bin|games|include|lib(32|64)?|sbin)/" $I_LOG | grep -E -v "/(doc|etc|fonts|man|var)/") 30 | 31 | for ITEM in $LOG; do 32 | if [ ! -e "$ITEM" ]; then 33 | ( 34 | export IFS="$IFS_OLD" 35 | message "${FILE_COLOR}${ITEM}${DEFAULT_COLOR} of ${MODULE_COLOR}${MODULE}${PROBLEM_COLOR} is missing.${DEFAULT_COLOR}" 36 | ) 37 | FIND_STATUS=1 38 | fi 39 | done 40 | else 41 | message "${MODULE_COLOR}${MODULE}${PROBLEM_COLOR} is missing an install log.${DEFAULT_COLOR}" 42 | FIND_STATUS=1 43 | fi 44 | return $FIND_STATUS 45 | } 46 | 47 | plugin_register MODULE_CHECK plugin_module_check_find 48 | -------------------------------------------------------------------------------- /plugins/check-ldd.plugin: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################# 3 | # # 4 | # check-ldd.plugin - plugin that performs ldd checking # 5 | # # 6 | ############################################################# 7 | # # 8 | # Copyright 2005 by Auke Kok under GPLv2 # 9 | # # 10 | # Copyright 2020 by Stefan Wold under GPLv2 # 11 | # # 12 | ############################################################# 13 | 14 | plugin_module_check_ldd() { 15 | local MODULE VERSION I_LOG LDD_STATUS IFS_OLD IFS NEW_LD LOG FILE 16 | if [ "$LDD_CHECK" == "off" ]; then 17 | return 2 18 | fi 19 | debug_msg "plugin_module_check_ldd ($@)" 20 | 21 | MODULE=$1 22 | VERSION=$(installed_version $MODULE) 23 | I_LOG=$INSTALL_LOGS/$MODULE-$VERSION 24 | LDD_STATUS=2 25 | 26 | if [ -e "$I_LOG" ]; then 27 | IFS_OLD="$IFS" 28 | export IFS=$'\n' 29 | 30 | # fast-construct per-module LD path including all /lib/ like directories 31 | NEW_LD=$(grep -E "/lib(32|64)?/" $I_LOG | files | sed 's/\(.*\)\/\([^\/]*\)$/\1/g' | sort -u | tr '\n' ':') 32 | LOG=$(grep -E "/(bin|games|lib(32|64)?|sbin|libexec)/" $I_LOG | grep -E -v "/(doc|fonts|include|locale|man|modules|var|share|pkgconfig)/") 33 | 34 | for FILE in $LOG; do 35 | if [ -f "$FILE" ] && [ ! -h "$FILE" ] && file -b "$FILE" | grep -q "ELF" && LD_LIBRARY_PATH=$NEW_LD ldd "$FILE" 2>&1 | grep -E -q "(not found|lunar/OBSOLETE/)"; then 36 | ( 37 | export IFS="$IFS_OLD" 38 | message "${FILE_COLOR}${FILE}${DEFAULT_COLOR} of ${MODULE_COLOR}${MODULE} ${PROBLEM_COLOR}is broken. ${DEFAULT_COLOR}" 39 | LD_LIBRARY_PATH=$NEW_LD ldd "$FILE" 2>&1 | grep -E "(not found|lunar/OBSOLETE/)" 40 | ) 41 | LDD_STATUS=1 42 | fi 43 | done 44 | fi 45 | return $LDD_STATUS 46 | } 47 | 48 | plugin_register MODULE_CHECK plugin_module_check_ldd 49 | -------------------------------------------------------------------------------- /plugins/check-md5sum.plugin: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################# 3 | # # 4 | # check-md5sum.plugin - plugin that performs integrity # 5 | # checking of installed modules # 6 | # # 7 | ############################################################# 8 | # # 9 | # Copyright 2005 by Auke Kok under GPLv2 # 10 | # # 11 | ############################################################# 12 | 13 | plugin_module_check_md5sum() { 14 | local MODULE VERSION MD5_LOG MD5SUM_STATUS IFS LINE FILE 15 | # return CONTINUE if we're disabled 16 | if [ "$MD5SUM_CHECK" == "off" ]; then 17 | return 2 18 | fi 19 | debug_msg "plugin_module_check_md5sum ($@)" 20 | 21 | MODULE=$1 22 | VERSION=$(installed_version $MODULE) 23 | MD5_LOG="$MD5SUM_LOGS/$MODULE-$VERSION" 24 | # by default, do not return OK but CONTINUE 25 | MD5SUM_STATUS=2 26 | 27 | if [ -e "$MD5_LOG" ]; then 28 | export IFS=$'\t\n' 29 | 30 | grep -E "/(bin|games|include|lib(32|64)?|sbin)/" $MD5_LOG | 31 | grep -E -v "/(doc|etc|fonts|man|var)/" | 32 | while read LINE; do 33 | if ! echo $LINE | md5sum --check --status; then 34 | FILE=$(echo $LINE | awk '{ print $2 }') 35 | if [ -f "$FILE" ] && [ ! -h "$FILE" ] && file -b "$FILE" | 36 | grep -E -q "executable|shared object|current ar archive|C?? source, ASCII text"; then 37 | message "${FILE_COLOR}$FILE${DEFAULT_COLOR} of ${MODULE_COLOR}$MODULE${PROBLEM_COLOR} has wrong md5sum.${DEFAULT_COLOR}" 38 | MD5SUM_STATUS=1 39 | fi 40 | fi 41 | done 42 | else 43 | message "${MODULE_COLOR}$MODULE${PROBLEM_COLOR} is missing a md5sum log.${DEFAULT_COLOR}" 44 | fi 45 | return $MD5SUM_STATUS 46 | } 47 | 48 | plugin_register MODULE_CHECK plugin_module_check_md5sum 49 | -------------------------------------------------------------------------------- /plugins/check-symlinks.plugin: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################# 3 | # # 4 | # check-symlinks.plugin - plugin that performs symlink # 5 | # checking of installed modules # 6 | # # 7 | ############################################################# 8 | # # 9 | # Copyright 2005 by Auke Kok under GPLv2 # 10 | # # 11 | ############################################################# 12 | 13 | plugin_module_check_symlinks() { 14 | local MODULE VERSION I_LOG IFS_OLD IFS ITEM TRAGET 15 | # return CONTINUE if we're disabled 16 | if [ "$SYM_CHECK" == "off" ]; then 17 | return 2 18 | fi 19 | debug_msg "plugin_module_check_symlinks ($@)" 20 | 21 | MODULE=$1 22 | VERSION=$(installed_version $MODULE) 23 | I_LOG=$INSTALL_LOGS/$MODULE-$VERSION 24 | 25 | if [ -e "$I_LOG" ]; then 26 | IFS_OLD="$IFS" 27 | export IFS=$'\n' 28 | 29 | cat "$I_LOG" | while read ITEM; do 30 | if [ -h "$ITEM" ] && [ -f "$ITEM" ]; then 31 | TARGET=$(basename $(ls -la "$ITEM" | cut -d '>' -f2 | cut -c 2-)) 32 | if ! grep -q "$TARGET" "$I_LOG"; then 33 | ( 34 | export IFS="$IFS_OLD" 35 | F_TMP=$(temp_create "$MODULE.remove-line") 36 | cp $I_LOG $F_TMP 37 | grep -v "$ITEM" "$F_TMP" >$I_LOG 38 | temp_destroy $F_TMP 39 | message "Symbolic link: ${SYMLINK_COLOR}${ITEM}${DEFAULT_COLOR} is owned by ${MODULE_COLOR}${MODULE}${DEFAULT_COLOR}" 40 | message "Target of symbolic link is ${FILE_COLOR}${TARGET}${DEFAULT_COLOR}" 41 | message "${FILE_COLOR}${TARGET}${DEFAULT_COLOR} is owned by $(grep "^$TARGET$" $INSTALL_LOGS/* | cut -d: -f1)" 42 | message "Removed: ${SYMLINK_COLOR}${ITEM}${DEFAULT_COLOR} from ${I_LOG}" 43 | ) 44 | fi 45 | fi 46 | done 47 | fi 48 | # always return CONTINUE 49 | return 2 50 | } 51 | 52 | plugin_register MODULE_CHECK plugin_module_check_symlinks 53 | -------------------------------------------------------------------------------- /plugins/configd.plugin: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ###################################################### 3 | # # 4 | # configd.plugin - handling of /etc/config.d files # 5 | # # 6 | ###################################################### 7 | # # 8 | # Copyright 2010 by Stefan Wold under GPLv2 # 9 | # # 10 | ###################################################### 11 | 12 | plugin_configd_post_build() { 13 | local FILE 14 | 15 | debug_msg "plugin_configd_post_build ($@)" 16 | 17 | if [ -d $SCRIPT_DIRECTORY/config.d ]; then 18 | verbose_msg "Handling 'config.d' files" 19 | invoke_installwatch 20 | 21 | [ -d /etc/config.d ] || mkdir -p /etc/config.d 22 | 23 | for FILE in $SCRIPT_DIRECTORY/config.d/*; do 24 | if [ ! -f /etc/config.d/${FILE##*/} ]; then 25 | verbose_msg "Installing ${FILE##*/} into /etc/config.d" 26 | /usr/bin/install -g 0 -o 0 -m 0644 $FILE /etc/config.d/ 27 | fi 28 | done 29 | devoke_installwatch 30 | fi 31 | 32 | return 2 33 | } 34 | 35 | plugin_register BUILD_POST_BUILD plugin_configd_post_build 36 | -------------------------------------------------------------------------------- /plugins/download-file.plugin: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################# 3 | # # 4 | # download-file.plugin - plugin that downloads file:// urls # 5 | # # 6 | ############################################################# 7 | # # 8 | # Copyright 2005 by Auke Kok under GPLv2 # 9 | # # 10 | ############################################################# 11 | 12 | plugin_source_download_file() { 13 | local FILE 14 | 15 | # check if we can handle this type of URL: 16 | if [ ${1:0:7} != "file://" ]; then 17 | return 2 18 | fi 19 | debug_msg "plugin_source_download_file ($@)" 20 | 21 | FILE=${1:7} 22 | if [[ $4 == old ]]; then 23 | FILE="${FILE%/}/$2" 24 | fi 25 | 26 | cp "$FILE" "$3/$2" 27 | } 28 | 29 | plugin_register SOURCE_DOWNLOAD plugin_source_download_file 30 | -------------------------------------------------------------------------------- /plugins/download-generic.plugin: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################ 3 | # # 4 | # download-generic.plugin - download http/ftp urls # 5 | # # 6 | ############################################################ 7 | # # 8 | # Copyright 2005 by Auke Kok under GPLv2 # 9 | # # 10 | ############################################################ 11 | 12 | plugin_source_download_generic() { 13 | local URL TMP_FILE 14 | # check if we can handle this type of URL: 15 | if [ ${1:0:7} != "http://" -a ${1:0:8} != "https://" -a ${1:0:6} != "ftp://" ]; then 16 | return 2 17 | fi 18 | debug_msg "plugin_source_download_generic ($@)" 19 | 20 | URL=$1 21 | if [[ $4 == old ]]; then 22 | URL="${URL%/}/$2" 23 | fi 24 | 25 | # this is what the download will be stored as initially: 26 | TMP_FILE=$TMPDIR/$2 27 | 28 | if [ "$FTP_ACTIVE" == "on" -o "$FTP_PASSIVE" == "off" ]; then 29 | WGET_OPTS+=" --no-passive-ftp" 30 | fi 31 | 32 | if [ "$CONTINUE" == "off" ]; then 33 | erase $TMP_FILE 34 | else 35 | WGET_OPTS+=" --continue" 36 | fi 37 | 38 | if [ "$USE_CACHE" == "off" ]; then 39 | WGET_OPTS+=" --cache=off" 40 | else 41 | WGET_OPTS+=" --cache=on" 42 | fi 43 | 44 | if [ -n "$DOWNLOAD_RATE" ]; then 45 | WGET_OPTS+=" --limit-rate=${DOWNLOAD_RATE}" 46 | fi 47 | 48 | if [ ${1:0:8} == "https://" ]; then 49 | WGET_OPTS+=" --no-check-certificate" 50 | fi 51 | 52 | if [ "$USE_IPV46" == "6" ]; then 53 | WGET_OPTS+=" -6" 54 | elif [ "$USE_IPV46" == "4" ]; then 55 | WGET_OPTS+=" -4" 56 | fi 57 | 58 | WGET_OPTS+=" --tries=${NUM_RETRY:-5}" 59 | 60 | [ -n "$http_proxy" ] && export http_proxy=$http_proxy 61 | [ -n "$ftp_proxy" ] && export ftp_proxy=$ftp_proxy 62 | [ -n "$no_proxy" ] && export no_proxy=$no_proxy 63 | 64 | verbose_msg "calling \"wget $WGET_OPTS \"$URL\" --output-document $TMP_FILE\"" 65 | if erase $TMP_FILE && wget --progress=bar:force $WGET_OPTS "$URL" --output-document "$TMP_FILE"; then 66 | # looks like it worked 67 | if testpack $TMP_FILE; then 68 | if [ "$TMP_FILE" != "$3/$2" ]; then 69 | install -m644 $TMP_FILE "$3/$2" 70 | rm $TMP_FILE 71 | fi 72 | verbose_msg "download of \"$2\" successful" 73 | else 74 | rm -f $TMP_FILE 75 | return 2 76 | fi 77 | else 78 | # don't report errors against cache misses 79 | if [ "$URL" != "$LRESORT_URL/$2" ]; then 80 | activity_log "lget" "$MODULE" "$VERSION" "failed" "broken URL: \"$URL\"" 81 | fi 82 | return 2 83 | fi 84 | } 85 | 86 | plugin_register SOURCE_DOWNLOAD plugin_source_download_generic 87 | -------------------------------------------------------------------------------- /plugins/optimize-wrappers.plugin: -------------------------------------------------------------------------------- 1 | # 2 | # wrappers linker optimizations plugin 3 | # 4 | 5 | plugin_wrappers_optimize() { 6 | if [[ -z "$USE_WRAPPERS" ]]; then 7 | if [ -f /etc/lunar/local/optimizations.WRAPPERS ]; then 8 | . /etc/lunar/local/optimizations.WRAPPERS 9 | fi 10 | fi 11 | 12 | if [ "${USE_WRAPPERS:-yes}" == "yes" ]; then 13 | verbose_msg "Enabled wrapper script usage" 14 | export PATH=/var/lib/lunar/compilers/:${PATH} 15 | fi 16 | return 2 17 | } 18 | 19 | plugin_wrappers_optimize_menu() { 20 | local IFS TITLE RESULT 21 | # The main code calls this function WITHOUT $1 to find out which 22 | # compiler optimization plugins exist. It then returns the version 23 | # number which will be saved in $LUNAR_COMPILER as the user's 24 | # choice for COMPILERS 25 | if [ -z "$1" ]; then 26 | echo "WRAPPERS" 27 | echo "Compiler wrappers" 28 | return 2 29 | elif [ "$1" != "WRAPPERS" ]; then 30 | # we don't display anything when the user selected a 31 | # different menu 32 | return 2 33 | fi 34 | 35 | # load previous optimizations 36 | if [ -e /etc/lunar/local/optimizations.WRAPPERS ]; then 37 | . /etc/lunar/local/optimizations.WRAPPERS 38 | else 39 | USE_WRAPPERS="yes" 40 | fi 41 | 42 | save_optimizations() { 43 | debug_msg "save_optimizations($@)" 44 | cat >/etc/lunar/local/optimizations.WRAPPERS <>/etc/services 20 | done <$SCRIPT_DIRECTORY/services 21 | fi 22 | return 2 23 | } 24 | 25 | gather_docs() { 26 | local DOC_DIR FILE 27 | # function : gather_docs 28 | # usage : gather_docs LIST OF FILES 29 | # purpose : Installs extra documentation that came with the 30 | # module's source package into the module's 31 | # document directory (defined as Lunar's base 32 | # document directory plus the module name). 33 | debug_msg "gather_docs ($@)" 34 | 35 | DOC_DIR=${DOCUMENT_DIRECTORY}/${MODULE} 36 | if [ -d "$SOURCE_DIRECTORY" ]; then 37 | mkdir -p $DOC_DIR 38 | # For each parameter that is an existing file 39 | for FILE in ${@}; do 40 | if [ -e "${FILE}" -a -f "${FILE}" ]; then 41 | # copy it over to the doc directory creating directories as needed 42 | verbose_msg "Installing extra documentation to: ${DOC_DIR}/${FILE}" 43 | install -D -m 644 "${FILE}" "${DOC_DIR}/${FILE}" 44 | elif [ -d "${FILE}" ]; then 45 | # copy the directory to the docdir 46 | verbose_msg "Installing extra documentation to: ${DOC_DIR}/${FILE}" 47 | cp -a "${FILE}" ${DOC_DIR}/ 48 | fi 49 | done 50 | # do not return 2 here: this function is called directly and 51 | # must return true (0) here 52 | return 0 53 | fi 54 | return 2 55 | } 56 | 57 | plugin_postbuild_gather_docs() { 58 | local DOC_DIR DEFAULT_DOCS 59 | # pre-conditions : user must have $GARBAGE="on" to have any 60 | # of this actually happen. 61 | debug_msg "plugin_postbuild_gather_docs ($@)" 62 | 63 | DOC_DIR=${DOCUMENT_DIRECTORY}/${MODULE} 64 | 65 | # This is the list of default extra documentation that is to be 66 | # installed automatically if the user has $GARBAGE=on. Any other 67 | # docs are left up to the module writer to get installed. 68 | DEFAULT_DOCS="README* INSTALL* FAQ* CHAN* doc* DOC* *doc \ 69 | *sample* conf SETUP NEWS Change* manual* Manual*" 70 | 71 | if [ -d "$SOURCE_DIRECTORY" ]; then 72 | cd $SOURCE_DIRECTORY 73 | 74 | # Bail if the user doesn't want to install any extra documentation 75 | if [ "$GARBAGE" != "on" ]; then 76 | return 2 77 | fi 78 | invoke_installwatch 79 | mkdir -p $DOC_DIR 80 | # No parameters were passed in, install the default docs 81 | for FILE in ${DEFAULT_DOCS}; do 82 | # copy all of the default docs (prune Makefiles) 83 | if [ -s "$FILE" -a ! -f "${FILE}/Makefile" ]; then 84 | verbose_msg "Installing default documentation to: ${DOC_DIR}/${FILE}" 85 | cp -a "$FILE" $DOC_DIR 2>/dev/null 86 | fi 87 | done 88 | devoke_installwatch 89 | fi 90 | return 2 91 | } 92 | 93 | plugin_archive_module() { 94 | debug_msg "plugin_archive_module($@)" 95 | # keep a record of the module scripts used for every install 96 | if [ ! -e /var/state/lunar/module_history ]; then 97 | mkdir -p /var/state/lunar/module_history 98 | fi 99 | tar -cJ --exclude=.svn -C $MOONBASE/$SECTION -f /var/state/lunar/module_history/$MODULE-$VERSION-$(date -u +%Y%m%d).tar.xz $MODULE 100 | return 2 101 | } 102 | 103 | plugin_register BUILD_POST_BUILD plugin_services_post_build 104 | plugin_register BUILD_POST_BUILD plugin_postbuild_gather_docs 105 | plugin_register BUILD_POST_BUILD plugin_archive_module 106 | -------------------------------------------------------------------------------- /plugins/postbuild-sanity.plugin: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################# 3 | # # 4 | # postbuild-sanity.plugin - postbuild running of sanity # 5 | # checks on installed files # 6 | # # 7 | ############################################################# 8 | # # 9 | # Copyright 2012 by Auke Kok under GPLv2 # 10 | # # 11 | ############################################################# 12 | 13 | plugin_sanity_post_build() { 14 | # Don't check the Filesystem Hierarchy Standard 15 | if [ "$1" == fhs ]; then 16 | return 2 17 | fi 18 | 19 | ( 20 | local IFS TESTS PATTERN SEVERITY REASON 21 | 22 | IFS=$'\n' 23 | 24 | TESTS=( 25 | "^/opt/:E:Installs files in /opt" 26 | "^/bin:N:Installs files in /bin" 27 | "^/sbin:N:Installs files in /sbin" 28 | "^/lib:N:Installs files in /lib" 29 | "^/share:E:Installs files in /share" 30 | "^/include:E:Installs files in /include" 31 | "^/usr/doc:E:Installs files in /usr/doc" 32 | "^/usr/etc:E:Installs files in /usr/etc" 33 | "^/usr/local:E:Installs files in /usr/local" 34 | "^/usr/var:E:Installs files in /usr/var" 35 | "^/home:E:Installs files in /home" 36 | "^/root:E:Installs files in /root" 37 | ) 38 | 39 | for TEST in ${TESTS[@]}; do 40 | PATTERN=$(echo $TEST | cut -d: -f1) 41 | 42 | parse_iw | grep -q $PATTERN 43 | if [ $? == 0 ]; then 44 | SEVERITY=$(echo $TEST | cut -d: -f2) 45 | REASON=$(echo $TEST | cut -d: -f3) 46 | 47 | case $SEVERITY in 48 | N) 49 | message "${PROBLEM_COLOR}NOTICE:${DEFAULT_COLOR}${MESSAGE_COLOR} Package installs files in incorrect locations!${DEFAULT_COLOR}" 50 | parse_iw | sort | uniq | grep $PATTERN 51 | continue 52 | ;; 53 | W) 54 | message "${PROBLEM_COLOR}WARNING:${DEFAULT_COLOR}${MESSAGE_COLOR} Package installs files in incorrect locations!${DEFAULT_COLOR}" 55 | parse_iw | sort | uniq | grep $PATTERN 56 | export SILENT="" 57 | query "Ignore this warning" "y" 58 | if [ $? != 0 ]; then 59 | return 1 60 | fi 61 | continue 62 | ;; 63 | E) 64 | message "${PROBLEM_COLOR}ERROR:${DEFAULT_COLOR}${MESSAGE_COLOR} Package installs files in incorrect locations!${DEFAULT_COLOR}" 65 | parse_iw | sort | uniq | grep $PATTERN 66 | return 1 67 | ;; 68 | esac 69 | fi 70 | done 71 | 72 | # return 2, on success for other plugins 73 | return 2 74 | ) 75 | } 76 | 77 | plugin_register BUILD_POST_BUILD plugin_sanity_post_build 78 | -------------------------------------------------------------------------------- /plugins/unpack-generic.plugin: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################# 3 | # # 4 | # unpack-generic.plugin - generic plugin that unpacks # 5 | # sources # 6 | # # 7 | ############################################################# 8 | # # 9 | # Copyright 2005 by Auke Kok under GPLv2 # 10 | # # 11 | ############################################################# 12 | 13 | plugin_unpack_generic() { 14 | case $1 in 15 | *tar.bz2 | *tbz2 | *.tar.gz | *.tgz | *.tar.Z | *.tar.xz | *.txz | *.tar) 16 | debug_msg "Unpacking tar file \"$1\"" 17 | tar xf $1 --no-same-owner --no-same-permissions || return 1 18 | ;; 19 | *.zip) 20 | debug_msg "Unpacking zip file \"$1\"" 21 | unzip -q $1 || return 1 22 | ;; 23 | *.bz2) 24 | debug_msg "Unpacking bz2 file \"$1\"" 25 | cp $1 . || return 1 26 | bunzip2 $1 || return 1 27 | ;; 28 | *.gz) 29 | debug_msg "Unpacking gz file \"$1\"" 30 | cp $1 . || return 1 31 | gunzip $1 || return 1 32 | ;; 33 | *) 34 | # fallback: we don't know what to do! 35 | return 2 36 | ;; 37 | esac 38 | # return success! 39 | return 0 40 | } 41 | 42 | plugin_register SOURCE_UNPACK plugin_unpack_generic 43 | -------------------------------------------------------------------------------- /plugins/verify-md5.plugin: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################# 3 | # # 4 | # verify-md5.plugin - plugin that performs md5check # 5 | # # 6 | ############################################################# 7 | # # 8 | # Copyright 2005 by Auke Kok under GPLv2 # 9 | # # 10 | ############################################################# 11 | 12 | plugin_source_verify_md5() { 13 | local TMP_MD5 14 | # check if we can handle this type of VFY: 15 | if [ "${2:0:4}" != "md5:" ]; then 16 | return 2 17 | fi 18 | debug_msg "plugin_source_verify_md5 ($@)" 19 | TMP_MD5=$(md5sum "$SOURCE_CACHE/$1" | cut -d " " -f 1-1) 20 | if [ "${2:4}" != "$TMP_MD5" ]; then 21 | message "${PROBLEM_COLOR}! md5sum check failed for ${DEFAULT_COLOR}${FILE_COLOR}$1${DEFAULT_COLOR}" 22 | verbose_msg "offending md5sum: $TMP_MD5" 23 | verbose_msg "should be md5sum: ${2:4}" 24 | return 1 25 | else 26 | # always return 'continue' plugin value 27 | return 2 28 | fi 29 | } 30 | 31 | plugin_register SOURCE_VERIFY plugin_source_verify_md5 32 | -------------------------------------------------------------------------------- /plugins/verify-sha1.plugin: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################# 3 | # # 4 | # verify-sha1.plugin - plugin that performs sha1check # 5 | # # 6 | ############################################################# 7 | # # 8 | # Copyright 2005 by Auke Kok under GPLv2 # 9 | # # 10 | ############################################################# 11 | 12 | plugin_source_verify_sha1() { 13 | local TMP_MD5 14 | # check if we can handle this type of VFY: 15 | if [ "${2:0:5}" != "sha1:" ]; then 16 | return 2 17 | fi 18 | debug_msg "plugin_source_verify_sha1 ($@)" 19 | TMP_MD5=$(sha1sum $SOURCE_CACHE/$1 | cut -d " " -f 1-1) 20 | if [ "${2:5}" != "$TMP_MD5" ]; then 21 | message "${PROBLEM_COLOR}! sha1sum check failed for ${DEFAULT_COLOR}${FILE_COLOR}$1${DEFAULT_COLOR}" 22 | verbose_msg "offending sha1sum: $TMP_MD5" 23 | verbose_msg "should be sha1sum: ${2:5}" 24 | return 1 25 | else 26 | # always return 'continue' plugin value 27 | return 2 28 | fi 29 | } 30 | 31 | plugin_register SOURCE_VERIFY plugin_source_verify_sha1 32 | -------------------------------------------------------------------------------- /plugins/verify-sha256.plugin: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################# 3 | # # 4 | # verify-sha256.plugin - plugin that performs sha256check # 5 | # # 6 | ############################################################# 7 | # # 8 | # Copyright 2005 by Auke Kok under GPLv2 # 9 | # Copyright 2009 by Stefan Wold under GPLv2 # 10 | # # 11 | ############################################################# 12 | 13 | plugin_source_verify_sha256() { 14 | local TMP_SHA 15 | # check if we can handle this type of VFY: 16 | if [ "${2:0:7}" != "sha256:" ]; then 17 | return 2 18 | fi 19 | debug_msg "plugin_source_verify_sha256 ($@)" 20 | TMP_SHA=$(sha256sum $SOURCE_CACHE/$1 | cut -d " " -f 1-1) 21 | if [ "${2:7}" != "$TMP_SHA" ]; then 22 | message "${PROBLEM_COLOR}! sha256sum check failed for ${DEFAULT_COLOR}${FILE_COLOR}$1${DEFAULT_COLOR}" 23 | verbose_msg "offending sha256sum: $TMP_SHA" 24 | verbose_msg "should be sha256sum: ${2:7}" 25 | return 1 26 | else 27 | # always return 'continue' plugin value 28 | return 2 29 | fi 30 | } 31 | 32 | plugin_register SOURCE_VERIFY plugin_source_verify_sha256 33 | -------------------------------------------------------------------------------- /prog/lget: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################ 3 | # # 4 | # lget - get sources from the net # 5 | # # 6 | ############################################################ 7 | # leach is part of the sorcery spell management utility # 8 | # Copyright 2001 by Kyle Sallee # 9 | ############################################################ 10 | # # 11 | # this WAS the leach script of a source based Linux distro,# 12 | # calls Sorcerer GNU/Linux, or SGL. SGL is no longer # 13 | # available with GPL license. Since this script was taken # 14 | # before licensing scheme change, no legal problems I # 15 | # guess. # 16 | # # 17 | # the code is re-written for Lunar. The previous Copyright # 18 | # notices are kept; just in case some code is left :=) # 19 | # Kagan Kongar , 20020519 # 20 | # # 21 | ############################################################ 22 | # # 23 | # Parts Copyrighted Jason Johnston 2002 under GPLv2 # 24 | # # 25 | # Parts Copyrighted Kagan Kongar 2002 under GPLv2 # 26 | # # 27 | ############################################################ 28 | 29 | help() { 30 | 31 | cat < 0)); then 13 | eval "$@" 14 | else 15 | export PS1="\[\033[0;31m\][lunar] \u@\h \w \\$ \[\033[0m\]" 16 | message "\n ${PROBLEM_COLOR}Warning:${DEFAULT_COLOR}${MESSAGE_COLOR}" \ 17 | "lsh is potentially hazardous to your system.${DEFAULT_COLOR}\n" 18 | bash --rcfile $BOOTSTRAP 19 | fi 20 | -------------------------------------------------------------------------------- /prog/lvis: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################ 3 | # Copyright 2001 by Kyle Sallee # 4 | ############################################################ 5 | # lvis is front-end to lin to activate voyeurism in a # 6 | # separate xterm if possible. # 7 | ############################################################ 8 | process_parameters() { 9 | while [ -n "$1" ]; do 10 | if echo "" $1 | grep -q "^ -"; then 11 | case $1 in 12 | --from) 13 | export SOURCE_CACHE="$2" 14 | shift 2 15 | ;; 16 | --url) 17 | export BASE_URL="$2" 18 | shift 2 19 | ;; 20 | -n | --nofix) 21 | NO_lget="$1" 22 | NO_LVU="$1" 23 | shift 1 24 | ;; 25 | --silent) 26 | NO_lget="$1" 27 | NO_LVU="$1" 28 | shift 1 29 | ;; 30 | --deps) 31 | NO_lget="$1" 32 | shift 1 33 | ;; 34 | -f | --fix) 35 | NO_lget="$1" 36 | shift 1 37 | ;; 38 | --help) 39 | HELP="$1" 40 | shift 1 41 | ;; 42 | -s) 43 | NO_lget="$1" 44 | shift 1 45 | ;; 46 | *) shift 1 ;; 47 | esac 48 | else 49 | shift 50 | fi 51 | done 52 | } 53 | strip_parameters() { 54 | while [ -n "$1" ]; do 55 | if echo "" $1 | grep -q "^ -"; then 56 | case $1 in 57 | --from) shift 2 ;; 58 | --url) shift 2 ;; 59 | *) shift 1 ;; 60 | esac 61 | else 62 | echo $1 63 | shift 64 | fi 65 | done 66 | } 67 | process_parameters $* 68 | MODULES=$(strip_parameters $*) 69 | 70 | if [ -z "$*" ] || 71 | [ -n "$HELP" ]; then 72 | lin 73 | exit 1 74 | fi 75 | 76 | if [ -n "$DISPLAY" ]; then 77 | if [ -z "$NO_LVU" ]; then 78 | xterm -bg black \ 79 | -fg white \ 80 | $XTERM_OPTIONS \ 81 | -T "lvu voyeur 5 $MODULES" \ 82 | -e /bin/sh -c "lvu voyeur 5 $MODULES" & 83 | fi 84 | 85 | if [ -z "$NO_lget" ]; then 86 | xterm -bg black \ 87 | -fg white \ 88 | $XTERM_OPTIONS \ 89 | -T "lget $MODULES" \ 90 | -e /bin/sh -c "lget $MODULES" & 91 | fi 92 | fi 93 | lin $@ 94 | --------------------------------------------------------------------------------