~jbboehr/+junk/php-handlebars-package

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: John Boehr
  • Date: 2015-03-04 09:11:09 UTC
  • Revision ID: jbboehr@gmail.com-20150304091109-nqwkzzzpp017vg59
Initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/make -f
 
2
 
 
3
#DEB_SRCDIR := $(shell basename imagick-*)
 
4
DEB_SRCDIR := .
 
5
 
 
6
include /usr/share/cdbs/1/rules/debhelper.mk
 
7
 
 
8
PHP_EX5=$(shell /usr/bin/php-config5 --extension-dir)
 
9
 
 
10
# don't link against unnecessary libraries such as libX11
 
11
export LDFLAGS += -Wl,--as-needed
 
12
 
 
13
#
 
14
# local hacks
 
15
#
 
16
 
 
17
clean::
 
18
        rm -f debian/php5-*.postrm \
 
19
                debian/php5-*.postinst
 
20
        -cd $(DEB_SRCDIR) && phpize5 --clean
 
21
 
 
22
configure_for_php5::
 
23
        # Hack here because:
 
24
        # - we don't want the module linked against some libx* (unused symbols)
 
25
        # We want to link with just needed libraries
 
26
        # - "-Wl,--as-needed" is ignored if not the first argument of the linker
 
27
        # We have to patch the linker call script ltmain.sh
 
28
        cd $(DEB_SRCDIR) && phpize5 && \
 
29
            ./configure --enable-handlebars --with-php-config=/usr/bin/php-config5
 
30
        sed -e 's/phpX/php5/g' < debian/phpX-handlebars.postinst > debian/php5-handlebars.postinst
 
31
        sed -e 's/phpX/php5/g' < debian/phpX-handlebars.postrm   > debian/php5-handlebars.postrm
 
32
 
 
33
#
 
34
# cdbs things
 
35
#
 
36
 
 
37
install/php5-handlebars:: configure_for_php5
 
38
        $(MAKE) -C $(DEB_SRCDIR)
 
39
        mkdir -p debian/php5-handlebars$(PHP_EX5)
 
40
        install -m 644 -o root -g root $(DEB_SRCDIR)/modules/handlebars.so debian/php5-handlebars$(PHP_EX5)/handlebars.so
 
41
        echo "php5:Depends=phpapi-`php-config5 --phpapi`, php5-common" >> debian/php5-handlebars.substvars
 
42
        mkdir -p debian/php5-handlebars/usr/share/php5-handlebars
 
43
        cp debian/handlebars.ini debian/php5-handlebars/usr/share/php5-handlebars/handlebars.ini-dist
 
44