The following changes were made:

* Removed some old Makefile vars no longer used
  * Split off separate dev package
This commit is contained in:
2018-07-28 10:29:28 -05:00
parent 84bb7dbf5d
commit 3021446ba4
2 changed files with 48 additions and 19 deletions

View File

@@ -8,26 +8,29 @@
# 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 ARCH = x86_64
ARCH = x86_64 export DEPENDS = glibc
URL = http://flex.sourceforge.net/ export BUILDDEPS =
export SRCPKG = $(PACKAGE)
export URL = http://flex.sourceforge.net/
REPO = main
BRIEF = Flex is a tool for generating scanners
DESC = Flex is a tool for generating scanners. A scanner, sometimes called a \ DESC = Flex is a tool for generating scanners. A scanner, sometimes called a \
tokenizer, is a program which recognizes lexical patterns in text. tokenizer, is a program which recognizes lexical patterns in text.
SNAPVER = sr1 SNAPVER = 3
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
MAKEINST = make install
SNAPHACKS = ln -sv flex $(ROOT)/usr/bin/lex && \
rm -v $(ROOT)/usr/share/info/dir
include /usr/share/snap/Makefile.snaplinux include /usr/share/snap/Makefile.snaplinux
DEV := $(PWD)/$(PACKAGE)-dev
DEVROOT := $(DEV)/ROOT
$(SRCDIR)/configure: $(ARCHIVE) $(SRCDIR)/configure: $(ARCHIVE)
@if [ '$(TYPE)' == 'application/x-bzip2' ]; then \ @if [ '$(TYPE)' == 'application/x-bzip2' ]; then \
tar -jxf $(ARCHIVE); \ tar -jxf $(ARCHIVE); \
@@ -43,9 +46,10 @@ $(SRCDIR)/configure: $(ARCHIVE)
fi fi
$(SRCDIR)/config.log: $(SRCDIR)/configure $(SRCDIR)/config.log: $(SRCDIR)/configure
@if [ -f $(PATCHDIR)/*.patch ]; then \ @cd $(SRCDIR) && \
cd $(SRCDIR) && cat $(PATCHDIR)/*.patch|patch --verbose -Np1; \ for patch in `find $(PATCHDIR) -name \*.patch|sort`; do \
fi patch --verbose -Np1 -i $$patch; \
done
@cd $(SRCDIR); \ @cd $(SRCDIR); \
./configure \ ./configure \
--prefix=/usr \ --prefix=/usr \
@@ -54,8 +58,7 @@ $(SRCDIR)/config.log: $(SRCDIR)/configure
--target=x86_64-snap-linux-gnu --target=x86_64-snap-linux-gnu
$(SRCDIR)/src/flex: $(SRCDIR)/config.log $(SRCDIR)/src/flex: $(SRCDIR)/config.log
@cd $(SRCDIR); \ @cd $(SRCDIR) && make
$(MAKE)
$(ROOT): $(SRCDIR)/src/flex $(ROOT): $(SRCDIR)/src/flex
@if [ -d $(ROOT) ]; then \ @if [ -d $(ROOT) ]; then \
@@ -64,10 +67,19 @@ $(ROOT): $(SRCDIR)/src/flex
mkdir -v $(ROOT); \ mkdir -v $(ROOT); \
fi fi
@cd $(SRCDIR); \ @cd $(SRCDIR) && make install DESTDIR=$(ROOT) && \
$(MAKEINST) DESTDIR=$(ROOT) ln -sv flex $(ROOT)/usr/bin/lex && \
rm -v $(ROOT)/usr/share/info/dir && \
@$(SNAPHACKS) install -v -d $(DEV)/SNAP && \
install -v -d $(DEVROOT) && \
for file in `find $(ROOT)| \
egrep '\.(a|h|la)$$'`; 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.$(PACKAGE)-dev && mv *.snap ../
test: $(ROOT) test: $(ROOT)
@cd $(SRCDIR); \ @cd $(SRCDIR); \
@@ -75,6 +87,7 @@ test: $(ROOT)
clean: clean:
@rm -rvf $(ROOT) \ @rm -rvf $(ROOT) \
$(DEV) \
$(SNAPINFO) \ $(SNAPINFO) \
$(MANIFEST) \ $(MANIFEST) \
$(FILES) \ $(FILES) \

16
Makefile.flex-dev Normal file
View File

@@ -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 = flex
REPO = dev
BRIEF = Development files for flex
DESC = Development files for flex
include /usr/share/snap/Makefile.snaplinux