The following changes were made to Makefile:

* added BRIEF
  * moved to new version scheme
  * moved make and make install out of variables
  * split off separate dev package
  * fixed patch loop
This commit is contained in:
2017-04-06 12:46:01 -05:00
parent 86493cd09d
commit 0b5d8ff7a5
2 changed files with 38 additions and 14 deletions

View File

@@ -8,22 +8,23 @@
# 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 = libpipeline
ARCH = x86_64 export DEPENDS = glibc
URL = http://libpipeline.nongnu.org/ export ARCH = x86_64
export URL = http://libpipeline.nongnu.org/
BRIEF = C library for process pipelines
DESC = libpipeline is a C library for manipulating pipelines of subprocesses \ DESC = libpipeline is a C library for manipulating pipelines of subprocesses \
in a flexible and convenient way. in a flexible and convenient way.
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 DEV := $(PWD)/libpipeline-dev
MAKEINST = make install DEVROOT := $(DEV)/ROOT
SNAPHACKS =
include /usr/share/snap/Makefile.snaplinux include /usr/share/snap/Makefile.snaplinux
@@ -43,7 +44,8 @@ $(SRCDIR)/configure: $(ARCHIVE)
@touch $(SRCDIR)/configure @touch $(SRCDIR)/configure
$(SRCDIR)/config.log: $(SRCDIR)/configure $(SRCDIR)/config.log: $(SRCDIR)/configure
@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; \ patch --verbose -Np1 -i $$patch; \
done done
@cd $(SRCDIR); \ @cd $(SRCDIR); \
@@ -54,8 +56,7 @@ $(SRCDIR)/config.log: $(SRCDIR)/configure
--target=x86_64-snap-linux-gnu --target=x86_64-snap-linux-gnu
$(SRCDIR)/lib/.libs/libpipeline.so.$(VERSION): $(SRCDIR)/config.log $(SRCDIR)/lib/.libs/libpipeline.so.$(VERSION): $(SRCDIR)/config.log
@cd $(SRCDIR); \ @cd $(SRCDIR) && make
$(MAKE)
$(ROOT): $(SRCDIR)/lib/.libs/libpipeline.so.$(VERSION) $(ROOT): $(SRCDIR)/lib/.libs/libpipeline.so.$(VERSION)
@if [ -d $(ROOT) ]; then \ @if [ -d $(ROOT) ]; then \
@@ -64,10 +65,17 @@ $(ROOT): $(SRCDIR)/lib/.libs/libpipeline.so.$(VERSION)
mkdir -v $(ROOT); \ mkdir -v $(ROOT); \
fi fi
@cd $(SRCDIR); \ @cd $(SRCDIR) && make install DESTDIR=$(ROOT)
$(MAKEINST) DESTDIR=$(ROOT)
@$(SNAPHACKS) @install -v -d $(DEV)/SNAP && \
install -v -d $(DEVROOT) && \
for file in `find $(ROOT)|egrep 'man3\/|pkgconfig\/|\.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.libpipeline-dev && mv *.snap ../
test: $(ROOT) test: $(ROOT)
@cd $(SRCDIR); \ @cd $(SRCDIR); \
@@ -75,6 +83,7 @@ test: $(ROOT)
clean: clean:
@rm -rvf $(ROOT) \ @rm -rvf $(ROOT) \
$(DEV) \
$(SNAPINFO) \ $(SNAPINFO) \
$(MANIFEST) \ $(MANIFEST) \
$(FILES) \ $(FILES) \

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