From aca9ad0145bc84bc25a027cf422102a9005d07ef Mon Sep 17 00:00:00 2001 From: Jay Larson Date: Wed, 30 May 2018 16:34:04 -0500 Subject: [PATCH] The following changes were made: * split into separate db, db-dev, and db-doc packages * added some dependencies * moved to new version scheme * removed old SNAPHACKS * updated patch loop --- Makefile | 58 ++++++++++++++++++++++++++++++++++--------------- Makefile.db-dev | 16 ++++++++++++++ Makefile.db-doc | 16 ++++++++++++++ 3 files changed, 72 insertions(+), 18 deletions(-) create mode 100644 Makefile.db-dev create mode 100644 Makefile.db-doc diff --git a/Makefile b/Makefile index 03beef3..ba56c93 100644 --- a/Makefile +++ b/Makefile @@ -8,24 +8,31 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -DEPENDS = -ARCH = x86_64 -URL = https://www.oracle.com/database/berkeley-db/index.html -DESC = Berkeley DB is a family of embedded key-value database libraries -SNAPVER = sr0 +export ARCH = x86_64 +export DEPENDS = db,glibc,libgcc,libstdc++ +export BUILDDEPS = +export SRCPKG = $(PACKAGE) +export URL = https://www.oracle.com/database/berkeley-db/index.html +REPO = main +BRIEF = Berkeley DB database libraries +DESC = Berkeley DB is a family of embedded key-value database libraries \ +providing scalable high-performance data management services to applications. +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) - -MAKE = make -MAKEINST = make docdir=/usr/share/doc/$(PACKAGE) install -SNAPHACKS = +export VERSION := $(shell echo $(SRCDIR)|egrep -o '\-[0-9].*'| \ + sed 's/^-//')-$(SNAPVER) include /usr/share/snap/Makefile.snaplinux +DEV := $(PWD)/$(PACKAGE)-dev +DEVROOT := $(DEV)/ROOT +DOC := $(PWD)/$(PACKAGE)-doc +DOCROOT := $(DOC)/ROOT + $(SRCDIR)/dist/configure: $(ARCHIVE) @if [ '$(TYPE)' == 'application/x-bzip2' ]; then \ tar -jxf $(ARCHIVE); \ @@ -42,20 +49,21 @@ $(SRCDIR)/dist/configure: $(ARCHIVE) @touch $(SRCDIR)/dist/configure $(SRCDIR)/build_unix/config.log: $(SRCDIR)/dist/configure - @cd $(SRCDIR)/build_unix; \ + @cd $(SRCDIR)/build_unix && \ + for patch in `find $(PATCHDIR) -name \*.patch|sort`; do \ + patch --verbose -Np1 -i $$patch; \ + done && \ ../dist/configure \ --prefix=/usr \ --enable-compat185 \ --enable-dbm \ --enable-cxx \ - --disable-static \ --build=x86_64-snap-linux-gnu \ --host=x86_64-snap-linux-gnu \ --target=x86_64-snap-linux-gnu $(SRCDIR)/build_unix/db_verify.o: $(SRCDIR)/build_unix/config.log - @cd $(SRCDIR)/build_unix; \ - $(MAKE) + @cd $(SRCDIR)/build_unix && make $(ROOT): $(SRCDIR)/build_unix/db_verify.o @if [ -d $(ROOT) ]; then \ @@ -64,13 +72,27 @@ $(ROOT): $(SRCDIR)/build_unix/db_verify.o mkdir -v $(ROOT); \ fi - @cd $(SRCDIR)/build_unix; \ - $(MAKEINST) DESTDIR=$(ROOT) - - @$(SNAPHACKS) + @cd $(SRCDIR)/build_unix && make docdir=/usr/share/doc/$(PACKAGE) \ + install DESTDIR=$(ROOT) && \ + install -v -d $(DEV)/SNAP && \ + install -v -d $(DEVROOT) && \ + install -v -d $(DOC)/SNAP && \ + install -v -d -m 0755 $(DOCROOT)/usr/share && \ + for file in `find $(ROOT)| \ + egrep 'man3\/|pkgconfig\/|\.a$$|\.h$$|\.la$$|\.m4$$|\.pc$$'`; do \ + path=`dirname $$file|sed "s[$(ROOT)[$(DEVROOT)["`; \ + mkdir -p $$path; \ + mv $$file $$path; \ + done + @mv -v $(ROOT)/usr/share/doc $(DOCROOT)/usr/share/doc && \ + find $(ROOT) -type d -empty -delete && \ + cd $(DEV) && make -f ../Makefile.$(PACKAGE)-dev && mv *.snap ../ && \ + cd $(DOC) && make -f ../Makefile.$(PACKAGE)-doc && mv *.snap ../ clean: @rm -rvf $(ROOT) \ + $(DEV) \ + $(DOC) \ $(SNAPINFO) \ $(MANIFEST) \ $(FILES) \ diff --git a/Makefile.db-dev b/Makefile.db-dev new file mode 100644 index 0000000..8f7d3ad --- /dev/null +++ b/Makefile.db-dev @@ -0,0 +1,16 @@ +# 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 = db +REPO = dev +BRIEF = Development files for db +DESC = Development files for db + +include /usr/share/snap/Makefile.snaplinux diff --git a/Makefile.db-doc b/Makefile.db-doc new file mode 100644 index 0000000..6eabb8d --- /dev/null +++ b/Makefile.db-doc @@ -0,0 +1,16 @@ +# 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 = db +REPO = dev +BRIEF = Documentation for db +DESC = Documentation for db + +include /usr/share/snap/Makefile.snaplinux