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
|
#!/usr/bin/make -f
export DH_VERBOSE=1
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
files=goo/parseargs xpdf/xfile xpdf/XPDFParams xpdf/CoreOutputDev xpdf/PDFCore
files+=xpdf/XPDFApp xpdf/XPDFCore xpdf/XPDFTree xpdf/XPDFViewer xpdf/xpdf
headers=xpdf/config.h xpdf/XPDFTreeP.h xpdf/about-text.h xpdf/*.xbm xpdf/xpdfIcon.xpm
includes=$(strip $(shell $(DEB_HOST_GNU_TYPE)-pkg-config --cflags poppler))
CXX=$(DEB_HOST_GNU_TYPE)-g++
LIBS+=-lXm $(shell $(DEB_HOST_GNU_TYPE)-pkg-config --libs poppler --libs xt --libs x11) -pthread
CPPFLAGS+=$(includes) $(includes)/goo $(includes)/splash
CPPFLAGS+=-Wno-write-strings -Wno-format-extra-args -Wfatal-errors
CPPFLAGS+=-DHAVE_DIRENT_H -DSYSTEM_XPDFRC=\"/etc/xpdf/xpdfrc\"
sources=$(sort $(shell for file in $(files); do echo $$file.*; done))
objects=$(sort $(shell for file in $(files); do echo build/$$(basename $$file).o; done))
override_dh_clean:
dh_clean
rm -rf build xpdf/xfile.* xpdf/XPDFParams.*
xpdf/xfile.%: goo/gfile.%
cp $< $@
sed -e s/GFILE/XFILE/g -i $@
xpdf/XPDFParams.%: xpdf/GlobalParams.%
cp $< $@
sed -e s/globalParams/xpdfParams/g -e s/GlobalParams/XPDFParams/g \
-e s/GLOBALPARAMS/XPDFPARAMS/g -e s/popplerParams/globalParams/g \
-e s/PopplerParams/GlobalParams/g \
-i $@
override_dh_auto_configure: xpdf/xfile.h xpdf/xfile.cc xpdf/XPDFParams.h xpdf/XPDFParams.cc
mkdir -p build
cp $(sources) $(headers) build
sed -e s/GString/GooString/g -e s/GMutex/GooMutex/g -e s/GHash/GooHash/g \
-e s/GList/GooList/g -e s/\<aconf\.h\>/\<poppler-config\.h\>/g \
-i build/*
mv build/parseargs.c build/parseargs.cc
override_dh_auto_build: $(objects)
$(CXX) $(LDFLAGS) -o build/xpdf.real $^ $(LIBS)
%:
dh ${@}
|