diff --git a/Makefile b/Makefile index 643a166..8f1f8c5 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ DESC = Base system directories and files ARCHIVE := SRCDIR := $(PWD)/SRC/snap-base PATCHDIR := $(PWD)/SRC/patches -VERSION := 0.0alpha1-0 +VERSION := 0.0alpha1-1 include /usr/share/snap/Makefile.snaplinux diff --git a/SNAP/usher b/SNAP/usher index 37c5e3e..46b3c88 100755 --- a/SNAP/usher +++ b/SNAP/usher @@ -7,31 +7,34 @@ case $1 in 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 + 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}/var/log/btmp ]; then + install -v -m 600 /dev/null $(DESTDIR)/var/log/btmp + fi + if [ ! -f ${TARGET}/var/log/lastlog ]; then + install -v -m 664 /dev/null $(DESTDIR)/var/log/lastlog + fi + if [ ! -f ${TARGET}/var/log/wtmp ]; then + install -v -m 664 /dev/null $(DESTDIR)/var/log/wtmp fi ;; prerm) diff --git a/SRC/snap-base/Makefile b/SRC/snap-base/Makefile index 86b9a18..d4563f8 100644 --- a/SRC/snap-base/Makefile +++ b/SRC/snap-base/Makefile @@ -1,4 +1,4 @@ -install: base usr var lib snap +install: base usr etc var lib snap base: @install -v -d -m 0755 -o root -g root \ @@ -9,6 +9,23 @@ base: $(DESTDIR)/root && \ install -v -d -m 1777 $(DESTDIR)/tmp $(DESTDIR)/var/tmp +etc: base + @ln -sv /proc/mounts $(DESTDIR)/etc/mtab + +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 bashrc $(DESTDIR)/usr/share/snap-base/bashrc && \ + install -v -m 0644 group $(DESTDIR)/usr/share/snap-base/group && \ + install -v -m 0644 passwd $(DESTDIR)/usr/share/snap-base/passwd && \ + install -v -m 0644 profile $(DESTDIR)/usr/share/snap-base/profile && \ + install -v -m 0644 snap.conf \ + $(DESTDIR)/usr/share/snap-base/snap.conf && \ + install -v -m 0644 snap_version $(DESTDIR)/etc/snap_version + usr: base @install -v -d -m 0755 -o root -g root \ $(DESTDIR)/usr/{,local/}{bin,include,lib,sbin,src} && \ @@ -27,11 +44,3 @@ var: base 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/bashrc similarity index 100% rename from SRC/snap-base/usr/share/snap-base/bashrc rename to SRC/snap-base/bashrc diff --git a/SRC/snap-base/usr/share/snap-base/group b/SRC/snap-base/group similarity index 100% rename from SRC/snap-base/usr/share/snap-base/group rename to SRC/snap-base/group diff --git a/SRC/snap-base/usr/share/snap-base/passwd b/SRC/snap-base/passwd similarity index 100% rename from SRC/snap-base/usr/share/snap-base/passwd rename to SRC/snap-base/passwd diff --git a/SRC/snap-base/usr/share/snap-base/profile b/SRC/snap-base/profile similarity index 100% rename from SRC/snap-base/usr/share/snap-base/profile rename to SRC/snap-base/profile diff --git a/SRC/snap-base/snap.conf b/SRC/snap-base/snap.conf new file mode 100644 index 0000000..ce6a9c3 --- /dev/null +++ b/SRC/snap-base/snap.conf @@ -0,0 +1,2 @@ +[sources] +default = http://packages.snaplinux.org/ core dev main diff --git a/SRC/snap-base/usr/share/snap-base/snap_version b/SRC/snap-base/snap_version similarity index 100% rename from SRC/snap-base/usr/share/snap-base/snap_version rename to SRC/snap-base/snap_version diff --git a/SRC/snap-base/usr/share/snap-base/snap.conf b/SRC/snap-base/usr/share/snap-base/snap.conf deleted file mode 100644 index d50a921..0000000 --- a/SRC/snap-base/usr/share/snap-base/snap.conf +++ /dev/null @@ -1,2 +0,0 @@ -[sources] -default = http://packages.snaplinux.org/ core dev util