1 PACKAGE_TARNAME := @PACKAGE_TARNAME@
3 CY_ATTACH_GROUP := @CY_ATTACH_GROUP@
6 version := $(shell $(git) describe --always --tags --dirty="+" --match="v*" | $(sed) -e 's@-\([^-]*\)-\([^-]*\)$$@+\1.\2@;s@^v@@')
8 version := @PACKAGE_VERSION@
16 deb := $(shell grep ^Package: $(srcdir)/control.in | cut -d ' ' -f 2-)_$(shell grep ^Version: $(srcdir)/control.in | cut -d ' ' -f 2 | $(sed) -e 's/\#/$(version)/')_$(arch).deb
18 ifeq ($(depends)$(dll),dylib)
19 control.tmp: control.in .libs/cycript .libs/$(lib)cycript.dylib
20 $(sed) -e 's/&/'"$$(dpkg-query -S $$(otool -lah .libs/cycript .libs/*.dylib | grep dylib | grep -v ':$$' | $(sed) -e 's/^ *name //;s/ (offset [0-9]*)$$//' | sort -u) 2>/dev/null | $(sed) -e 's/:.*//; /^cycript$$/ d; s/$$/,/' | sort -u | tr '\n' ' ')"'/;s/, $$//;s/#/$(version)/;s/%/$(arch)/' $< >$@
22 ifeq ($(depends)$(dll),so)
23 control.tmp: control.in .libs/cycript .libs/$(lib)cycript.so
24 $(sed) -e 's/&/'"$$(dpkg-query -S $$(ldd cycript $(lib)cycript.so | $(sed) -e '/:$$/ d; s/^[ \t]*\([^ ]* => \)\?\([^ ]*\) .*/\2/' | sort -u) 2>/dev/null | $(sed) -e 's/:.*//; /^cycript$$/ d; s/$$/,/' | sort -u | tr '\n' ' ')"'/;s/, $$//;s/#/$(version)/;s/%/$(arch)/' $< >$@
26 control.tmp: control.in
27 $(sed) -e 's/&/$(depends)/;s/,$$//;s/#/$(version)/;s/%/$(arch)/' $< >$@
32 [[ -e control ]] && diff control control.tmp &>/dev/null || cp -pRf control.tmp control
34 $(deb): $(all) control
36 mkdir -p package/DEBIAN
37 cp -pR control package/DEBIAN
38 mkdir -p package/usr/{bin,lib,sbin}
39 cp -pR .libs/$(lib)cycript.0.$(dll) package/usr/lib
40 cp -pR .libs/$(lib)cycript.$(dll) package/usr/lib
41 cp -pR .libs/cycript package/usr/bin
42 dpkg-deb -b package $(deb)
48 libcycript.la: $(code)
49 $(ldid) .libs/$(lib)cycript.$(dll)
51 cycript: Console.lo libcycript.la $(inject)
52 $(entitle) .libs/cycript
56 install: cycript libcycript.la
57 ifneq ($(CY_ATTACH_GROUP),)
58 chgrp $(CY_ATTACH_GROUP) $(DESTDIR)$(bindir)/cycript
59 chmod g+s $(DESTDIR)$(bindir)/cycript