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:56:17 -05:00
parent 691d6c7042
commit 232e23de47
3 changed files with 65 additions and 21 deletions

View File

@@ -8,23 +8,24 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
DEPENDS =
ARCH = x86_64
URL = http://expat.sourceforge.net/
export SRCPKG = expat
export DEPENDS = glibc
export ARCH = x86_64
export URL = http://expat.sourceforge.net/
DESC = Expat is an XML parser library written in C.
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 install
SNAPHACKS = install -v -dm755 $(ROOT)/usr/share/doc/expat && \
install -v -m644 $(SRCDIR)/doc/*.{html,png,css} \
$(ROOT)/usr/share/doc/expat
LIB := $(PWD)/libexpat
LIBROOT := $(LIB)/ROOT
DEV := $(PWD)/expat-dev
DEVROOT := $(DEV)/ROOT
include /usr/share/snap/Makefile.snaplinux
@@ -43,20 +44,19 @@ $(SRCDIR)/configure: $(ARCHIVE)
fi
$(SRCDIR)/config.log: $(SRCDIR)/configure
@if [ -f $(PATCHDIR)/*.patch ]; then \
cd $(SRCDIR) && cat $(PATCHDIR)/*.patch|patch --verbose -Np1; \
fi
@cd $(SRCDIR) && \
for patch in `find $(PATCHDIR) -name \*.patch|sort`; do \
patch --verbose -Np1 -i $$patch; \
done
@cd $(SRCDIR); \
./configure \
--prefix=/usr \
--disable-static \
--build=x86_64-snap-linux-gnu \
--host=x86_64-snap-linux-gnu \
--target=x86_64-snap-linux-gnu
$(SRCDIR)/usr/lib/libexpat.so: $(SRCDIR)/config.log
@cd $(SRCDIR); \
$(MAKE)
@cd $(SRCDIR) && make
$(ROOT): $(SRCDIR)/usr/lib/libexpat.so
@if [ -d $(ROOT) ]; then \
@@ -65,17 +65,31 @@ $(ROOT): $(SRCDIR)/usr/lib/libexpat.so
mkdir -v $(ROOT); \
fi
@cd $(SRCDIR); \
$(MAKEINST) DESTDIR=$(ROOT)
@cd $(SRCDIR) && make install DESTDIR=$(ROOT) && \
install -v -dm755 $(ROOT)/usr/share/doc/expat && \
install -v -m644 doc/*.{html,png,css} $(ROOT)/usr/share/doc/expat
@$(SNAPHACKS)
@install -v -d $(LIB)/SNAP && \
install -v -d $(LIBROOT)/usr/lib && \
install -v -d $(DEV)/SNAP && \
install -v -d $(DEVROOT) && \
for file in `find $(ROOT)|egrep 'pkgconfig\/|\.a$$|\.h$$'`; do \
path=`dirname $$file|sed "s[$(ROOT)[$(DEVROOT)["`; \
mkdir -vp -m 0755 $$path; \
mv -v $$file $$path; \
done && \
mv -v $(ROOT)/usr/lib/libexpat* $(LIBROOT)/usr/lib && \
find $(ROOT) -type d -empty -delete && \
cd $(LIB) && make -f ../Makefile.libexpat && mv *.snap ../ && \
cd $(DEV) && make -f ../Makefile.expat-dev && mv *.snap ../
test: $(ROOT)
@cd $(SRCDIR); \
make check
@cd $(SRCDIR) && make check
clean:
@rm -rvf $(ROOT) \
$(DEV) \
$(LIB) \
$(SNAPINFO) \
$(MANIFEST) \
$(FILES) \

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

15
Makefile.libexpat 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
BRIEF = Runtime library for expat
DESC = Runtime library for expat
include /usr/share/snap/Makefile.snaplinux