~jbboehr/+junk/php7.0-imagick-package

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: John Boehr
  • Date: 2015-12-03 23:13:24 UTC
  • Revision ID: jbboehr@gmail.com-20151203231324-qx1sm0z4eux5ve8o
Upgrade to PHP7.0

Show diffs side-by-side

added added

removed removed

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