diff --git a/Makefile b/Makefile index 10a1839..3e33e81 100644 --- a/Makefile +++ b/Makefile @@ -8,24 +8,26 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -DEPENDS = -ARCH = x86_64 -URL = http://www.lysator.liu.se/~nisse/nettle/ +export SRCPKG = nettle +export DEPENDS = glibc,gmp +export ARCH = x86_64 +export URL = http://www.lysator.liu.se/~nisse/nettle/ +BRIEF = Cryptographic library DESC = Nettle is a cryptographic library that is designed to fit easily in \ more or less any context -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 = install -v -d -m 755 $(ROOT)/usr/share/doc/nettle && \ - install -v -m 644 $(SRCDIR)/nettle.html \ - $(ROOT)/usr/share/doc/nettle/nettle.html +LIB := $(PWD)/libnettle +LIBROOT := $(LIB)/ROOT +DEV := $(PWD)/nettle-dev +DEVROOT := $(DEV)/ROOT include /usr/share/snap/Makefile.snaplinux @@ -57,8 +59,7 @@ $(SRCDIR)/config.log: $(SRCDIR)/configure --target=x86_64-snap-linux-gnu $(SRCDIR)/libnettle.so: $(SRCDIR)/config.log - @cd $(SRCDIR); \ - $(MAKE) + @cd $(SRCDIR) && make $(ROOT): $(SRCDIR)/libnettle.so @if [ -d $(ROOT) ]; then \ @@ -67,10 +68,25 @@ $(ROOT): $(SRCDIR)/libnettle.so mkdir -v $(ROOT); \ fi - @cd $(SRCDIR); \ - $(MAKEINST) DESTDIR=$(ROOT) + @cd $(SRCDIR) && make install DESTDIR=$(ROOT) + install -v -d -m 755 $(ROOT)/usr/share/doc/nettle && \ + install -v -m 644 $(SRCDIR)/nettle.html \ + $(ROOT)/usr/share/doc/nettle/nettle.html && \ + rm $(ROOT)/usr/share/info/dir - @$(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/lib* $(LIBROOT)/usr/lib && \ + for file in `find $(ROOT)|egrep 'man3\/|pkgconfig\/|\.a$$|\.h$$'`; 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.libnettle && mv *.snap ../ && \ + cd $(DEV) && make -f ../Makefile.nettle-dev && mv *.snap ../ test: $(ROOT) @cd $(SRCDIR); \ @@ -78,6 +94,8 @@ test: $(ROOT) clean: @rm -rvf $(ROOT) \ + $(DEV) \ + $(LIB) \ $(SNAPINFO) \ $(MANIFEST) \ $(FILES) \ diff --git a/Makefile.libnettle b/Makefile.libnettle new file mode 100644 index 0000000..ed2033a --- /dev/null +++ b/Makefile.libnettle @@ -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 +BRIEF = Runtime library for nettle +DESC = Runtime library for nettle + +include /usr/share/snap/Makefile.snaplinux diff --git a/Makefile.nettle-dev b/Makefile.nettle-dev new file mode 100644 index 0000000..5754eb3 --- /dev/null +++ b/Makefile.nettle-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 = libnettle +BRIEF = Development files for nettle +DESC = Development files for nettle + +include /usr/share/snap/Makefile.snaplinux