diff --git a/Makefile b/Makefile index 7d94c24..054b121 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 = https://sites.google.com/site/fullycapable/ +export SRCPKG = libcap +export DEPENDS = +export ARCH = x86_64 +export URL = https://sites.google.com/site/fullycapable/ +BRIEF = Library for POSIX.1e functionality DESC = This is a library for getting and setting POSIX.1e (formerly POSIX 6) \ draft 15 capabilities. -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 RAISE_SETFCAP=no prefix=/usr install -SNAPHACKS = +DEV := $(PWD)/libcap-dev +DEVROOT := $(DEV)/ROOT include /usr/share/snap/Makefile.snaplinux @@ -43,11 +45,11 @@ $(SRCDIR)/Makefile: $(ARCHIVE) @touch $(SRCDIR)/Makefile $(SRCDIR)/progs/setcap: $(SRCDIR)/Makefile - @cd $(SRCDIR) && for patch in `find $(PATCHDIR) -name \*.patch`; do \ + @cd $(SRCDIR) && \ + for patch in `find $(PATCHDIR) -name \*.patch|sort`; do \ patch --verbose -Np1 -i $$patch; \ done - @cd $(SRCDIR); \ - $(MAKE) + @cd $(SRCDIR) && make $(ROOT): $(SRCDIR)/progs/setcap @if [ -d $(ROOT) ]; then \ @@ -56,17 +58,22 @@ $(ROOT): $(SRCDIR)/progs/setcap mkdir -v $(ROOT); \ fi - @cd $(SRCDIR); \ - $(MAKEINST) DESTDIR=$(ROOT) + @cd $(SRCDIR) && make RAISE_SETFCAP=no prefix=/usr \ + install DESTDIR=$(ROOT) - @$(SNAPHACKS) - -test: $(ROOT) - @cd $(SRCDIR); \ - make test + @install -v -d $(DEV)/SNAP && \ + install -v -d $(DEVROOT) && \ + for file in `find $(ROOT)|egrep 'man3\/|pkgconfig\/|\.a$$|\.h$$'`; do \ + path=`dirname $$file|sed "s[$(ROOT)[$(DEVROOT)["`; \ + mkdir -p $$path; \ + mv $$file $$path; \ + done && \ + find $(ROOT) -type d -empty -delete && \ + cd $(DEV) && make -f ../Makefile.libcap-dev && mv *.snap ../ clean: @rm -rvf $(ROOT) \ + $(DEV) \ $(SNAPINFO) \ $(MANIFEST) \ $(FILES) \ diff --git a/Makefile.libcap-dev b/Makefile.libcap-dev new file mode 100644 index 0000000..fc8601a --- /dev/null +++ b/Makefile.libcap-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 = libcap +BRIEF = Development files for libcap +DESC = Development files for libcap + +include /usr/share/snap/Makefile.snaplinux diff --git a/SRC/patches/01_disable-static.patch b/SRC/patches/01_disable-static.patch deleted file mode 100644 index b4d5631..0000000 --- a/SRC/patches/01_disable-static.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -Naur a/libcap/Makefile b/libcap/Makefile ---- a/libcap/Makefile 2016-01-30 18:01:41.000000000 -0600 -+++ b/libcap/Makefile 2016-09-29 11:24:21.488000000 -0500 -@@ -66,7 +66,6 @@ - mkdir -p -m 0755 $(FAKEROOT)$(INCDIR)/sys - install -m 0644 include/sys/capability.h $(FAKEROOT)$(INCDIR)/sys - mkdir -p -m 0755 $(FAKEROOT)$(LIBDIR) -- install -m 0644 $(STALIBNAME) $(FAKEROOT)$(LIBDIR)/$(STALIBNAME) - install -m 0644 $(MINLIBNAME) $(FAKEROOT)$(LIBDIR)/$(MINLIBNAME) - ln -sf $(MINLIBNAME) $(FAKEROOT)$(LIBDIR)/$(MAJLIBNAME) - ln -sf $(MAJLIBNAME) $(FAKEROOT)$(LIBDIR)/$(LIBNAME)