From 127a70018b22cea1637f92484f800749818e1508 Mon Sep 17 00:00:00 2001 From: Jay Larson Date: Sat, 21 Jan 2017 15:05:51 -0600 Subject: [PATCH] Finished splitting into separate binary, lib, and dev packages --- Makefile | 58 +++++++++++++++++++++++++++++++--------------- Makefile.libacl | 15 ++++++++++++ Makefile.libacldev | 14 +++++++++++ 3 files changed, 68 insertions(+), 19 deletions(-) create mode 100644 Makefile.libacl create mode 100644 Makefile.libacldev diff --git a/Makefile b/Makefile index 265a6b6..bef0e26 100644 --- a/Makefile +++ b/Makefile @@ -8,27 +8,43 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -DEPENDS = attr,glibc -ARCH = x86_64 -URL = http://savannah.nongnu.org/projects/acl +export SRCPKG = acl +export DEPENDS = attr,glibc,libacl +export ARCH = x86_64 +export URL = http://savannah.nongnu.org/projects/acl BRIEF = Access control list tools DESC = Commands for Manipulating POSIX Access Control Lists -SNAPVER = 3 +SNAPVER = 4 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) + +LIBACL := $(PWD)/libacl +export LIBACLROOT := $(LIBACL)/ROOT +LIBACLDEV := $(PWD)/libacl-dev +export LIBACLDEVROOT := $(LIBACLDEV)/ROOT -MAKE = make -MAKEINST = make install install-dev install-lib -SNAPHACKS = #SNAPHACKS = if [ -h $(ROOT)/lib/libacl.a ]; then \ # rm -v $(ROOT)/lib/libacl.a; fi include /usr/share/snap/Makefile.snaplinux +$(LIBACLROOT): $(ROOT) + @install -v -d $(LIBACL)/SNAP && \ + install -v -d $(LIBACLROOT) + @cd $(SRCDIR) && make install-lib DESTDIR=$(LIBACLROOT) + @cd $(LIBACL) && make -f ../Makefile.libacl && mv *.snap ../ + +$(LIBACLDEVROOT): $(ROOT) + @install -v -d $(LIBACLDEV)/SNAP && \ + install -v -d $(LIBACLDEVROOT) + @cd $(SRCDIR) && make install-dev DESTDIR=$(LIBACLDEVROOT) + @cd $(LIBACLDEV) && make -f ../Makefile.libacldev && mv *.snap ../ + $(SRCDIR): $(ARCHIVE) @if [ '$(TYPE)' == 'application/x-bzip2' ]; then \ tar -jxf $(ARCHIVE); \ @@ -44,23 +60,21 @@ $(SRCDIR): $(ARCHIVE) fi $(SRCDIR)/config.log: $(SRCDIR) - @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); \ - ./configure \ + @cd $(SRCDIR); ./configure \ --prefix=/usr \ --bindir=/bin \ --libdir=/lib \ --libexecdir=/usr/lib \ - --disable-static \ --build=x86_64-snap-linux-gnu \ --host=x86_64-snap-linux-gnu \ --target=x86_64-snap-linux-gnu $(SRCDIR)/chacl/.libs/chacl: $(SRCDIR)/config.log - @cd $(SRCDIR); \ - $(MAKE) + @cd $(SRCDIR) && make $(ROOT): $(SRCDIR)/chacl/.libs/chacl @if [ -d $(ROOT) ]; then \ @@ -68,11 +82,15 @@ $(ROOT): $(SRCDIR)/chacl/.libs/chacl else \ mkdir -v $(ROOT); \ fi - - @cd $(SRCDIR); \ - $(MAKEINST) DESTDIR=$(ROOT) - - @$(SNAPHACKS) + @install -v -d $(LIBACL)/SNAP && \ + install -v -d $(LIBACLROOT) && \ + install -v -d $(LIBACLDEV)/SNAP && \ + install -v -d $(LIBACLDEVROOT) && \ + cd $(SRCDIR) && make install-lib DESTDIR=$(LIBACLROOT) && \ + make install-dev DESTDIR=$(LIBACLDEVROOT) && \ + make install DESTDIR=$(ROOT) && \ + cd $(LIBACL) && make -f ../Makefile.libacl && mv *.snap ../ && \ + cd $(LIBACLDEV) && make -f ../Makefile.libacldev && mv *.snap ../ test: $(ROOT) @cd $(SRCDIR); \ @@ -80,6 +98,8 @@ test: $(ROOT) clean: @rm -rvf $(ROOT) \ + $(LIBACL) \ + $(LIBACLDEV) \ $(SNAPINFO) \ $(MANIFEST) \ $(FILES) \ diff --git a/Makefile.libacl b/Makefile.libacl new file mode 100644 index 0000000..72e6787 --- /dev/null +++ b/Makefile.libacl @@ -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 = attr,glibc +BRIEF = Access control list shared library +DESC = Shared library for manipulating POSIX Access Control Lists + +include /usr/share/snap/Makefile.snaplinux diff --git a/Makefile.libacldev b/Makefile.libacldev new file mode 100644 index 0000000..f2db8be --- /dev/null +++ b/Makefile.libacldev @@ -0,0 +1,14 @@ +# 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. + +BRIEF = Access control list development library +DESC = Development library for manipulating POSIX Access Control Lists + +include /usr/share/snap/Makefile.snaplinux