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
# GNU General Public License for more details.
DEPENDS =
ARCH = x86_64
URL = http://flex.sourceforge.net/
export ARCH = x86_64
export DEPENDS = glibc
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 \
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)
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 install
SNAPHACKS = ln -sv flex $(ROOT)/usr/bin/lex && \
rm -v $(ROOT)/usr/share/info/dir
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
$(SRCDIR)/configure: $(ARCHIVE)
@if [ '$(TYPE)' == 'application/x-bzip2' ]; then \
tar -jxf $(ARCHIVE); \
@@ -43,9 +46,10 @@ $(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 \
@@ -54,8 +58,7 @@ $(SRCDIR)/config.log: $(SRCDIR)/configure
--target=x86_64-snap-linux-gnu
$(SRCDIR)/src/flex: $(SRCDIR)/config.log
@cd $(SRCDIR); \
$(MAKE)
@cd $(SRCDIR) && make
$(ROOT): $(SRCDIR)/src/flex
@if [ -d $(ROOT) ]; then \
@@ -64,10 +67,19 @@ $(ROOT): $(SRCDIR)/src/flex
mkdir -v $(ROOT); \
fi
@cd $(SRCDIR); \
$(MAKEINST) DESTDIR=$(ROOT)
@$(SNAPHACKS)
@cd $(SRCDIR) && make install DESTDIR=$(ROOT) && \
ln -sv flex $(ROOT)/usr/bin/lex && \
rm -v $(ROOT)/usr/share/info/dir && \
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)
@cd $(SRCDIR); \
@@ -75,6 +87,7 @@ test: $(ROOT)
clean:
@rm -rvf $(ROOT) \
$(DEV) \
$(SNAPINFO) \
$(MANIFEST) \
$(FILES) \