The following changes were made:

* Moved to new version scheme
  * Moved make/make install out of variables
  * Split into separate lib and dev packages
  * Corrected patch loop
This commit is contained in:
2017-05-30 08:10:33 -05:00
parent 9302286289
commit c84cb45d40
3 changed files with 63 additions and 16 deletions

View File

@@ -8,22 +8,26 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
DEPENDS = export SRCPKG = gnutls
ARCH = x86_64 export DEPENDS = glibc,gmp,libgcc,libgnutls,libstdc++,nettle,zlib
URL = http://www.gnutls.org/ export ARCH = x86_64
export URL = http://www.gnutls.org/
BRIEF = Secure communications library
DESC = GnuTLS is a secure communications library implementing the SSL, TLS \ DESC = GnuTLS is a secure communications library implementing the SSL, TLS \
and DTLS protocols and technologies around them. and DTLS protocols and technologies around them.
SNAPVER = sr0 SNAPVER = 1
ARCHIVE := $(PWD)/SRC/$(shell ls SRC|egrep '(bz2|gz|tar|xz)$$'|tail -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') TYPE := $(shell file -ib $(ARCHIVE)|cut -d';' -f1|tr -d '\n')
SRCDIR := $(shell tar -tf $(ARCHIVE)|head -1|sed 's/\/.*//') SRCDIR := $(shell tar -tf $(ARCHIVE)|head -1|sed 's/\/.*//')
PATCHDIR := $(PWD)/SRC/patches 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 LIB := $(PWD)/libgnutls
MAKEINST = make install LIBROOT := $(LIB)/ROOT
SNAPHACKS = DEV := $(PWD)/gnutls-dev
DEVROOT := $(DEV)/ROOT
include /usr/share/snap/Makefile.snaplinux include /usr/share/snap/Makefile.snaplinux
@@ -43,9 +47,10 @@ $(SRCDIR)/configure: $(ARCHIVE)
@touch $(SRCDIR)/configure @touch $(SRCDIR)/configure
$(SRCDIR)/config.log: $(SRCDIR)/configure $(SRCDIR)/config.log: $(SRCDIR)/configure
@if [ -f $(PATCHDIR)/*.patch ]; then \ @cd $(SRCDIR) && \
cd $(SRCDIR) && cat $(PATCHDIR)/*.patch|patch --verbose -Np1; \ for patch in `find $(PATCHDIR) -name \*.patch|sort`; do \
fi patch --verbose -Np1 -i $$patch; \
done
@cd $(SRCDIR); \ @cd $(SRCDIR); \
./configure \ ./configure \
--prefix=/usr \ --prefix=/usr \
@@ -56,8 +61,7 @@ $(SRCDIR)/config.log: $(SRCDIR)/configure
--target=x86_64-snap-linux-gnu --target=x86_64-snap-linux-gnu
$(SRCDIR)/src/.libs/lt-danetool: $(SRCDIR)/config.log $(SRCDIR)/src/.libs/lt-danetool: $(SRCDIR)/config.log
@cd $(SRCDIR); \ @cd $(SRCDIR) && make
$(MAKE)
$(ROOT): $(SRCDIR)/src/.libs/lt-danetool $(ROOT): $(SRCDIR)/src/.libs/lt-danetool
@if [ -d $(ROOT) ]; then \ @if [ -d $(ROOT) ]; then \
@@ -66,10 +70,21 @@ $(ROOT): $(SRCDIR)/src/.libs/lt-danetool
mkdir -v $(ROOT); \ mkdir -v $(ROOT); \
fi fi
@cd $(SRCDIR); \ @cd $(SRCDIR) && make install DESTDIR=$(ROOT)
$(MAKEINST) 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/lib* $(LIBROOT)/usr/lib && \
for file in `find $(ROOT)|egrep 'man3\/|pkgconfig\/|\.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.libgnutls && mv *.snap ../ && \
cd $(DEV) && make -f ../Makefile.gnutls-dev && mv *.snap ../
test: $(ROOT) test: $(ROOT)
@cd $(SRCDIR); \ @cd $(SRCDIR); \
@@ -77,6 +92,8 @@ test: $(ROOT)
clean: clean:
@rm -rvf $(ROOT) \ @rm -rvf $(ROOT) \
$(DEV) \
$(LIB) \
$(SNAPINFO) \ $(SNAPINFO) \
$(MANIFEST) \ $(MANIFEST) \
$(FILES) \ $(FILES) \

15
Makefile.gnutls-dev Normal file
View File

@@ -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 = gnutls
BRIEF = Development files for gnutls
DESC = Development files for gnutls
include /usr/share/snap/Makefile.snaplinux

15
Makefile.libgnutls Normal file
View File

@@ -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,libgcc,libstdc++,nettle,zlib
BRIEF = Runtime library for gnutls
DESC = Runtime library for gnutls
include /usr/share/snap/Makefile.snaplinux