diff --git a/Makefile b/Makefile index 7120d86..ebdb1dd 100644 --- a/Makefile +++ b/Makefile @@ -8,22 +8,24 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -DEPENDS = -ARCH = x86_64 -URL = http://tukaani.org/xz/ +export SRCPKG = xz +export DEPENDS = glibc +export ARCH = x86_64 +export URL = http://tukaani.org/xz/ +BRIEF = xz compression software DESC = XZ Utils is free general-purpose data compression software with high \ compression ratio -SNAPVER = sr0 +SNAPVER = 1 ARCHIVE := $(PWD)/SRC/$(shell ls SRC|egrep '(bz2|gz|tar|xz)$$'|tail -1) TYPE := $(shell file -ib $(ARCHIVE)|cut -d';' -f1|tr -d '\n') SRCDIR := $(shell tar -tf $(ARCHIVE)|head -1|sed 's/\/.*//') PATCHDIR := $(PWD)/SRC/patches -VERSION := $(shell echo $(SRCDIR)|egrep -o '\-[0-9].*'|sed 's/^-//')$(SNAPVER) +export VERSION := $(shell echo $(SRCDIR)|egrep -o '\-[0-9].*'| \ + sed 's/^-//')-$(SNAPVER) -MAKE = make -MAKEINST = make install -SNAPHACKS = +DEV := $(PWD)/xz-dev +DEVROOT := $(DEV)/ROOT include /usr/share/snap/Makefile.snaplinux @@ -43,20 +45,19 @@ $(SRCDIR)/configure: $(ARCHIVE) @touch $(SRCDIR)/configure $(SRCDIR)/config.log: $(SRCDIR)/configure - @if [ -f $(PATCHDIR)/*.patch ]; then \ - cd $(SRCDIR) && cat $(PATCHDIR)/*.patch|patch --verbose -Np1; \ - fi + @cd $(SRCDIR) && \ + for patch in `find $(PATCHDIR) -name \*.patch|sort`; do \ + patch --verbose -Np1 -i $$patch; \ + done @cd $(SRCDIR); \ ./configure \ --prefix=/usr \ - --disable-static \ --build=x86_64-snap-linux-gnu \ --host=x86_64-snap-linux-gnu \ --target=x86_64-snap-linux-gnu $(SRCDIR)/src/xz/.libs/xz: $(SRCDIR)/config.log - @cd $(SRCDIR); \ - $(MAKE) + @cd $(SRCDIR) && make $(ROOT): $(SRCDIR)/src/xz/.libs/xz @if [ -d $(ROOT) ]; then \ @@ -65,10 +66,19 @@ $(ROOT): $(SRCDIR)/src/xz/.libs/xz mkdir -v $(ROOT); \ fi - @cd $(SRCDIR); \ - $(MAKEINST) DESTDIR=$(ROOT) + @cd $(SRCDIR) && make install DESTDIR=$(ROOT) - @$(SNAPHACKS) + @install -v -d $(DEV)/SNAP && \ + install -v -d $(DEVROOT) && \ + install -v -d $(DEVROOT)/usr/share && \ + for file in `find $(ROOT)|egrep 'pkgconfig\/|\.a$$|\.h$$'`; do \ + path=`dirname $$file|sed "s[$(ROOT)[$(DEVROOT)["`; \ + mkdir -p $$path; \ + mv $$file $$path; \ + done && \ + mv -v $(ROOT)/usr/share/doc $(DEVROOT)/usr/share/doc && \ + find $(ROOT) -type d -empty -delete && \ + cd $(DEV) && make -f ../Makefile.xz-dev && mv *.snap ../ test: $(ROOT) @cd $(SRCDIR); \ @@ -76,6 +86,7 @@ test: $(ROOT) clean: @rm -rvf $(ROOT) \ + $(DEV) \ $(SNAPINFO) \ $(MANIFEST) \ $(FILES) \ diff --git a/Makefile.xz-dev b/Makefile.xz-dev new file mode 100644 index 0000000..fe2d668 --- /dev/null +++ b/Makefile.xz-dev @@ -0,0 +1,15 @@ +# 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 = xz +BRIEF = Development files for xz +DESC = Development files for xz + +include /usr/share/snap/Makefile.snaplinux