diff --git a/Makefile b/Makefile index 08923bd..f4dd55c 100644 --- a/Makefile +++ b/Makefile @@ -8,12 +8,12 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -DEPENDS = +DEPENDS = tzdata ARCH = x86_64 URL = https://www.gnu.org/software/libc/ DESC = The GNU C Library is used as the C library in the GNU system and in \ GNU/Linux systems, as well as many other systems that use Linux as the kernel. -SNAPVER = sr0 +SNAPVER = sr2 ARCHIVE := $(PWD)/SRC/$(shell ls SRC|egrep '(bz2|gz|tar|xz)$$'|tail -1) TYPE := $(shell file -ib $(ARCHIVE)|cut -d';' -f1|tr -d '\n') @@ -22,13 +22,6 @@ PATCHDIR := $(PWD)/SRC/patches BUILDDIR := $(PWD)/BUILD VERSION := $(shell echo $(SRCDIR)|egrep -o '\-[0-9].*'|sed 's/^-//')$(SNAPVER) -MAKE = make -MAKEINST = make install -SNAPHACKS = install -d -m 755 $(ROOT)/etc/ld.so.conf.d && \ - install -d -m 755 $(ROOT)/var/cache/nscd && \ - install -m 644 SNAP/ld.so.conf $(ROOT)/etc/ld.so.conf && \ - install -m 644 SNAP/nsswitch.conf $(ROOT)/etc/nsswitch.conf - include /usr/share/snap/Makefile.snaplinux $(SRCDIR)/configure: $(ARCHIVE) @@ -47,12 +40,13 @@ $(SRCDIR)/configure: $(ARCHIVE) @touch $(SRCDIR)/configure $(BUILDDIR)/config.log: $(SRCDIR)/configure + @cd $(SRCDIR) && \ + for patch in `find $(PATCHDIR) -name \*.patch|sort`; do \ + patch --verbose -Np0 -i $$patch; \ + done @if [ ! -d $(BUILDDIR) ]; then \ mkdir -v $(BUILDDIR); \ fi - @if [ -f $(PATCHDIR)/*.patch ]; then \ - cd $(SRCDIR) && cat $(PATCHDIR)/*.patch|patch --verbose -Np1; \ - fi @cd $(BUILDDIR); \ ../$(SRCDIR)/configure \ --prefix=/usr \ @@ -63,8 +57,7 @@ $(BUILDDIR)/config.log: $(SRCDIR)/configure --target=x86_64-snap-linux-gnu $(BUILDDIR)/elf/ldd: $(BUILDDIR)/config.log - @cd $(BUILDDIR); \ - $(MAKE) + @cd $(BUILDDIR) && make $(ROOT): $(BUILDDIR)/elf/ldd @if [ -d $(ROOT) ]; then \ @@ -73,14 +66,15 @@ $(ROOT): $(BUILDDIR)/elf/ldd mkdir -v $(ROOT); \ fi - @cd $(BUILDDIR); \ - $(MAKEINST) DESTDIR=$(ROOT) - - @$(SNAPHACKS) + @cd $(BUILDDIR) && make install DESTDIR=$(ROOT) && \ + install -d -m 755 $(ROOT)/etc/ld.so.conf.d && \ + install -d -m 755 $(ROOT)/var/cache/nscd && \ + install -m 644 $(PWD)/SNAP/ld.so.conf $(ROOT)/etc/ld.so.conf && \ + install -m 644 $(PWD)/SNAP/nsswitch.conf $(ROOT)/etc/nsswitch.conf && \ + rm -v $(ROOT)/usr/share/info/dir test: $(ROOT) - @cd $(SRCDIR); \ - make check + @cd $(BUILDDIR) && make check clean: @rm -rvf $(ROOT) \