1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
|
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# This has to be exported to make some magic below work.
export DH_OPTIONS
ARCHLIB := $(shell perl -MConfig -e 'print $$Config{vendorarch}')
DEB_BUILD_MULTIARCH := $(shell dpkg-architecture -qDEB_BUILD_MULTIARCH)
DEB_HOST_MULTIARCH := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
autoreconf:
aclocal
autoreconf -f -i
override_dh_autoreconf:
dh_autoreconf debian/rules -- autoreconf
cp -p /usr/share/misc/config.* .
override_dh_auto_configure:
dh_auto_configure -- \
--cache-file=config.cache \
--includedir=/usr/include/ossp \
--libdir=/usr/lib/$(DEB_HOST_MULTIARCH) \
--without-perl \
--without-dce \
--with-cxx \
$(shell dpkg-buildflags --export=cmdline)
override_dh_auto_build:
dh_auto_build
# rebuild man pages
make man
# build perl bindings
cd perl; \
/usr/bin/perl Makefile.PL INSTALLDIRS=vendor COMPAT=1
make -C perl \
CC="$(CC)" \
OPTIMIZE="$(shell dpkg-buildflags --get CPPFLAGS; dpkg-buildflags --get CFLAGS)" \
OTHERLDFLAGS="$(shell dpkg-buildflags --get LDFLAGS)"
ifeq ($(DEB_BUILD_MULTIARCH),$(DEB_HOST_MULTIARCH))
make -C perl test
endif
# build php bindings
#cd php; \
#phpize5; \
#mkdir build-php5; \
#cd build-php5; \
#CC="$(CC)" CFLAGS="$(CFLAGS) -I../.. -L../.. -L../../.libs" \
#../configure \
# --cache-file=../config.cache \
# --enable-uuid \
# --disable-static \
# --with-php-config=php-config5; \
#make; \
#cd ..; \
#LD_LIBRARY_PATH=`pwd`/../.libs \
#php5 -q -d "safe_mode=0" -d "extension=uuid.so" -d "extension_dir=./build-php5/modules" uuid.ts 5
override_dh_auto_install:
dh_auto_install
cd perl; make install DESTDIR=$(CURDIR)/debian/libossp-uuid-perl
chrpath debian/libossp-uuid-perl/$(ARCHLIB)/auto/OSSP/uuid/uuid.so && \
chrpath -d debian/libossp-uuid-perl/$(ARCHLIB)/auto/OSSP/uuid/uuid.so
#cd php/build-php5; make install INSTALL_ROOT=$(CURDIR)/debian/php5-uuid
#chmod -x debian/php5-uuid/usr/lib/php5/*/uuid.so
#chrpath debian/php5-uuid/usr/lib/php5/*/uuid.so && \
#chrpath -d debian/php5-uuid/usr/lib/php5/*/uuid.so
override_dh_install:
dh_install
# rename manpages to not conflict with libuuid-dev
for i in debian/libossp-uuid-dev/usr/share/man/man3/*.3; do mv $$i $${i}ossp; done
install -D -m 644 debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/uuid.pc \
debian/libossp-uuid-dev/usr/lib/pkgconfig/ossp-uuid.pc
#override_dh_gencontrol:
# dh_gencontrol -- -Vphp5-uuid:Depends=phpapi-$(shell php-config5 --phpapi)
override_dh_auto_clean:
cd perl; test -f Makefile && touch Makefile && make distclean || true
#rm -rf php/build-php5
cd php; phpize --clean || true
dh_auto_clean
rm -f config.guess config.sub
rm -f uuid.1 uuid.3 uuid++.3 uuid-config.1
%:
dh $@ --with autoreconf
|