commit 186426b518a15f92b99e34b000ae1441c4243e85 Author: Jay Larson Date: Mon Apr 24 14:10:33 2017 -0500 First check in diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..643a166 --- /dev/null +++ b/Makefile @@ -0,0 +1,36 @@ +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation here: +# (http://www.gnu.org/licenses/gpl-2.0.html) +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +DEPENDS = +ARCH = x86_64 +URL = +DESC = Base system directories and files + +ARCHIVE := +SRCDIR := $(PWD)/SRC/snap-base +PATCHDIR := $(PWD)/SRC/patches +VERSION := 0.0alpha1-0 + +include /usr/share/snap/Makefile.snaplinux + +$(ROOT): $(SRCDIR)/Makefile + @if [ -d $(ROOT) ]; then \ + touch $(ROOT); \ + else \ + mkdir -v $(ROOT); \ + fi + + @cd $(SRCDIR) && make install DESTDIR=$(ROOT) + +clean: + @rm -rvf $(ROOT) \ + $(SNAPINFO) \ + $(MANIFEST) \ + $(FILES) diff --git a/SNAP/README b/SNAP/README new file mode 100644 index 0000000..19a3ff1 --- /dev/null +++ b/SNAP/README @@ -0,0 +1,3 @@ +This is the directory where the manifest, snapinfo, and files.tar.gz +files will be created. It is also where the usher file should be +placed if it is required by the package. diff --git a/SNAP/usher b/SNAP/usher new file mode 100755 index 0000000..37c5e3e --- /dev/null +++ b/SNAP/usher @@ -0,0 +1,43 @@ +#!/bin/bash + +set -e + +case $1 in + preinst) + exit 0 + ;; + postinst) + if [[ ${TARGET} ]]; then + if [ ! -f ${TARGET}/etc/bashrc ]; then + install -m 0644 ${TARGET}/usr/share/snap-base/bashrc \ + ${TARGET}/etc/bashrc + fi + if [ ! -f ${TARGET}/etc/group ]; then + install -m 0644 ${TARGET}/usr/share/snap-base/group \ + ${TARGET}/etc/group + fi + if [ ! -f ${TARGET}/etc/passwd ]; then + install -m 0644 ${TARGET}/usr/share/snap-base/passwd \ + ${TARGET}/etc/passwd + fi + if [ ! -f ${TARGET}/etc/profile ]; then + install -m 0644 ${TARGET}/usr/share/snap-base/profile \ + ${TARGET}/etc/profile + fi + if [ ! -f ${TARGET}/etc/snap.conf ]; then + install -m 0644 ${TARGET}/usr/share/snap-base/snap.conf \ + ${TARGET}/etc/snap.conf + fi + if [ ! -f ${TARGET}/etc/snap_version ]; then + install -m 0644 ${TARGET}/usr/share/snap-base/snap_version \ + ${TARGET}/etc/snap_version + fi + fi + ;; + prerm) + exit 0 + ;; + postrm) + exit 0 + ;; +esac diff --git a/SRC/patches/README b/SRC/patches/README new file mode 100644 index 0000000..253cdcd --- /dev/null +++ b/SRC/patches/README @@ -0,0 +1,2 @@ +Place any patch files here and preface each with a number indicating +the order of execution. Patch files are expected to use a .patch extension. diff --git a/SRC/snap-base/Makefile b/SRC/snap-base/Makefile new file mode 100644 index 0000000..86b9a18 --- /dev/null +++ b/SRC/snap-base/Makefile @@ -0,0 +1,37 @@ +install: base usr var lib snap + +base: + @install -v -d -m 0755 -o root -g root \ + $(DESTDIR)/{bin,boot,dev,etc,home,lib,media,mnt,opt,proc} && \ + install -v -d -m 0755 -o root -g root \ + $(DESTDIR)/{run,sbin,srv,usr,var} && \ + install -v -d -m 0750 -o root -g root \ + $(DESTDIR)/root && \ + install -v -d -m 1777 $(DESTDIR)/tmp $(DESTDIR)/var/tmp + +usr: base + @install -v -d -m 0755 -o root -g root \ + $(DESTDIR)/usr/{,local/}{bin,include,lib,sbin,src} && \ + install -v -d -m 0755 -o root -g root \ + $(DESTDIR)/usr/{,local/}share/{color,dict,doc,info,locale} && \ + install -v -d -m 0755 -o root -g root \ + $(DESTDIR)/usr/{,local/}share/{man,misc,terminfo,zoneinfo} && \ + install -v -d -m 0755 -o root -g root \ + $(DESTDIR)/usr/{libexec,{,local/}share/man/man{1..8}} + +var: base + @install -v -d -m 0755 -o root -g root \ + $(DESTDIR)/var/{log,mail,spool} && \ + install -v -d -m 0755 -o root -g root \ + $(DESTDIR)/var/{opt,cache,lib/{color,misc,locate},local} && \ + ln -sv /run $(DESTDIR)/var/run && \ + ln -sv /run/lock $(DESTDIR)/var/lock + +lib: usr + @ln -sv lib $(DESTDIR)/lib64 && \ + ln -sv lib $(DESTDIR)/usr/lib64 + +snap: usr + install -v -d -m 0755 $(DESTDIR)/usr/share/snap-base && \ + install -v -m 0644 usr/share/snap-base/* $(DESTDIR)/usr/share/snap-base + diff --git a/SRC/snap-base/usr/share/snap-base/bashrc b/SRC/snap-base/usr/share/snap-base/bashrc new file mode 100644 index 0000000..6ae6414 --- /dev/null +++ b/SRC/snap-base/usr/share/snap-base/bashrc @@ -0,0 +1,18 @@ +# Setup for /bin/ls and /bin/grep to support color +if [ -f "/etc/dircolors" ] ; then + eval $(dircolors -b /etc/dircolors) +fi + +if [ -f "$HOME/.dircolors" ] ; then + eval $(dircolors -b $HOME/.dircolors) +fi + +# Prompt +if [ "`id -u`" -eq 0 ]; then + export PS1='\u@\h:\w# ' +else + export PS1='\u@\h:\w$ ' +fi + +alias ls='ls --color=auto' +alias grep='grep --color=auto' diff --git a/SRC/snap-base/usr/share/snap-base/group b/SRC/snap-base/usr/share/snap-base/group new file mode 100644 index 0000000..eb6372e --- /dev/null +++ b/SRC/snap-base/usr/share/snap-base/group @@ -0,0 +1,22 @@ +root:x:0: +bin:x:1:daemon +sys:x:2: +kmem:x:3: +tape:x:4: +tty:x:5: +daemon:x:6: +floppy:x:7: +disk:x:8: +lp:x:9: +dialout:x:10: +audio:x:11: +video:x:12: +utmp:x:13: +usb:x:14: +cdrom:x:15: +adm:x:16: +messagebus:x:18: +input:x:24: +mail:x:34: +nogroup:x:99: +users:x:100: diff --git a/SRC/snap-base/usr/share/snap-base/passwd b/SRC/snap-base/usr/share/snap-base/passwd new file mode 100644 index 0000000..757a665 --- /dev/null +++ b/SRC/snap-base/usr/share/snap-base/passwd @@ -0,0 +1,5 @@ +root:x:0:0:root:/root:/bin/bash +bin:x:1:1:bin:/dev/null:/bin/false +daemon:x:6:6:Daemon User:/dev/null:/bin/false +messagebus:x:18:18:D-Bus Message Daemon User:/var/run/dbus:/bin/false +nobody:x:99:99:Unprivileged User:/dev/null:/bin/false diff --git a/SRC/snap-base/usr/share/snap-base/profile b/SRC/snap-base/usr/share/snap-base/profile new file mode 100644 index 0000000..711295f --- /dev/null +++ b/SRC/snap-base/usr/share/snap-base/profile @@ -0,0 +1,25 @@ +# /etc/profile: system-wide .profile file for the Bourne shell (sh(1)) +# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...). + +alias reset='echo -e "\033c"' + +if [ "`id -u`" -eq 0 ]; then + PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" +else + PATH="/usr/local/bin:/usr/bin:/bin" +fi +export PATH + +if [ "$PS1" ]; then + if [ "$BASH" ] && [ "$BASH" != "/bin/sh" ]; then + if [ -f /etc/bashrc ]; then + . /etc/bashrc + fi + else + if [ "`id -u`" -eq 0 ]; then + PS1='# ' + else + PS1='$ ' + fi + fi +fi diff --git a/SRC/snap-base/usr/share/snap-base/snap.conf b/SRC/snap-base/usr/share/snap-base/snap.conf new file mode 100644 index 0000000..d50a921 --- /dev/null +++ b/SRC/snap-base/usr/share/snap-base/snap.conf @@ -0,0 +1,2 @@ +[sources] +default = http://packages.snaplinux.org/ core dev util diff --git a/SRC/snap-base/usr/share/snap-base/snap_version b/SRC/snap-base/usr/share/snap-base/snap_version new file mode 100644 index 0000000..60826bd --- /dev/null +++ b/SRC/snap-base/usr/share/snap-base/snap_version @@ -0,0 +1 @@ +0.0alpha1