diff --git a/Makefile b/Makefile index 62b79bb..7e2585c 100644 --- a/Makefile +++ b/Makefile @@ -8,26 +8,30 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -DEPENDS = openssl,zlib -ARCH = x86_64 -URL = http://curl.haxx.se/ +export SRCPKG = curl +export DEPENDS = glibc,gmp,gnutls,libcurl,nettle,openssl,zlib +export ARCH = x86_64 +export URL = http://curl.haxx.se/ +BRIEF = Tool which transfers data from or to a server DESC = curl is a command line tool and library for transferring data \ with URL syntax -SNAPVER = sr1 +SNAPVER = 2 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 = +LIB := $(PWD)/libcurl +LIBROOT := $(LIB)/ROOT +DEV := $(PWD)/curl-dev +DEVROOT := $(DEV)/ROOT include /usr/share/snap/Makefile.snaplinux -$(SRCDIR)/configure: $(ARCHIVE) +$(SRCDIR)/configure: @if [ '$(TYPE)' == 'application/x-bzip2' ]; then \ tar -jxf $(ARCHIVE); \ elif [ '$(TYPE)' == 'application/x-gzip' ]; then \ @@ -42,9 +46,10 @@ $(SRCDIR)/configure: $(ARCHIVE) fi $(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 \ @@ -57,8 +62,7 @@ $(SRCDIR)/config.log: $(SRCDIR)/configure --target=x86_64-snap-linux-gnu $(SRCDIR)/src/curl: $(SRCDIR)/config.log - @cd $(SRCDIR); \ - $(MAKE) + @cd $(SRCDIR) && make $(ROOT): $(SRCDIR)/src/curl @if [ -d $(ROOT) ]; then \ @@ -67,10 +71,22 @@ $(ROOT): $(SRCDIR)/src/curl mkdir -v $(ROOT); \ fi - @cd $(SRCDIR); \ - $(MAKEINST) DESTDIR=$(ROOT) + @cd $(SRCDIR) && make install DESTDIR=$(ROOT) - @$(SNAPHACKS) + @install -v -d $(LIB)/SNAP && \ + install -v -d $(LIBROOT)/usr/lib && \ + install -v -d $(DEV)/SNAP && \ + install -v -d $(DEVROOT) && \ + mv -v $(ROOT)/usr/lib/libcurl* $(LIBROOT)/usr/lib && \ + for file in `find $(ROOT)|egrep \ + 'man3\/|pkgconfig\/|\.a$$|\.h$$|\.m4$$'`; do \ + path=`dirname $$file|sed "s[$(ROOT)[$(DEVROOT)["`; \ + mkdir -vp -m 0755 $$path; \ + mv -v $$file $$path; \ + done && \ + find $(ROOT) -type d -empty -delete && \ + cd $(LIB) && make -f ../Makefile.libcurl && mv *.snap ../ && \ + cd $(DEV) && make -f ../Makefile.curl-dev && mv *.snap ../ test: $(ROOT) @cd $(SRCDIR); \ @@ -88,6 +104,8 @@ test: $(ROOT) clean: @rm -rvf $(ROOT) \ + $(DEV) \ + $(LIB) \ $(SNAPINFO) \ $(MANIFEST) \ $(FILES) \ diff --git a/Makefile.curl-dev b/Makefile.curl-dev new file mode 100644 index 0000000..d47bc87 --- /dev/null +++ b/Makefile.curl-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 = libcurl +BRIEF = Development files for curl +DESC = Development files for curl + +include /usr/share/snap/Makefile.snaplinux diff --git a/Makefile.libcurl b/Makefile.libcurl new file mode 100644 index 0000000..b65fc3d --- /dev/null +++ b/Makefile.libcurl @@ -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 = glibc,gmp,gnutls,nettle,zlib +BRIEF = Runtime library for curl +DESC = Runtime library for curl + +include /usr/share/snap/Makefile.snaplinux