I've done this before, but for some reason it does not work with a  
package I'm now tooling up. Why?

The idea is to create a custom Makefile for fink, embedded in  
the .info file.

What I get is each line separately executed. What's wrong???


PatchScript: <<
  cat > Makefile.fink <<EOF
VERSION=$(shell head -1 Changes | sed 's/ .*//')
RELEASEDATE=$(shell head -1 Changes | sed 's/.* //')
PREFIX=/usr/local
LUA_CPATH=$(PREFIX)/lib/lua/5.1

MANPAGES = $(wildcard doc/*.3)
SO = oocairo.so

CFLAGS = -O2 -ansi -pedantic -Wall -W -Wshadow -Wpointer-arith -Wcast- 
align \
          -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \
          -Wnested-externs -Wno-long-long \
           $(shell pkg-config --cflags lua cairo) \
           -DVERSION=\"$(VERSION)\"

LDFLAGS = $(shell pkg-config --libs lua cairo)

#---
all: $(SO) $(MANPAGES)

test: all
        echo 'lunit.main({...})' | lua51 -llunit - test/*.lua

$(SO): oocairo.c
        $(CC) -bundle $(CFLAGS) $(LDFLAGS) -o $@ $<

oocairo.c: obj*.c

doc/lua-%%.3: doc/lua-%%.pod Changes
        sed 's/E<copy>/(c)/g' <$< | sed 's/E<trade>/(tm)/g' <$< | sed 's/ 
E<ndash>/-/g' | sed 's/E<pi>/pi/g' | \
            pod2man --center="Lua OO Cairo binding" \
                    --name="$(shell echo $< | sed 's/^doc\///' | sed 's/\.pod$ 
$//' | tr a-z A-Z)" --section=3 \
                    --release="$(VERSION)" --date="$(RELEASEDATE)" >$@

install: all
        mkdir -p $(LUA_CPATH)
        install --mode=644 $(SO) $(LUA_CPATH)/oocairo.so
        mkdir -p $(PREFIX)/share/man/man3
        for manpage in $(MANPAGES); do \
            gzip -c $$manpage >$(PREFIX)/share/man/man3/$$(echo $$manpage |  
sed -e 's/^doc\///').gz; \
        done

clean:
        rm -f *.o $(SO)
        rm -f gmon.out *.bb *.bbg *.da *.gcov
        rm -f $(MANPAGES)

.PHONY: all install test clean
EOF
  echo ok
<<




-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Fink-devel mailing list
Fink-devel@lists.sourceforge.net
http://news.gmane.org/gmane.os.apple.fink.devel

Reply via email to