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 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190
|
#! /usr/bin/make -f
# Based on the sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
endif
# Ensure the build aborts when there are still references to undefined
# symbols.
LDFLAGS += -Wl,-z,defs
# Make the linker work a bit harder so dynamic loading can be done faster
LDFLAGS += -Wl,-O1
# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
confflags := -v
# FHS locations
confflags += --prefix=/usr \
--mandir=\$${prefix}/share/man \
--infodir=\$${prefix}/share/info \
--with-html-dir=\$${prefix}/share/doc/libgsf-1-dev/html
# Compiler, language dialect
confflags += --enable-iso-c \
--enable-compile-warnings=maximum
# Features
confflags += --with-gnome --with-bz2 --enable-gtk-doc
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
confflags += --build $(DEB_HOST_GNU_TYPE)
else
confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
endif
# shared library versions, option 1
#version=1.0.0
#major=1
# option 2, assuming the library is created as src/.libs/libfoo.so.2.0.5 or so
version=`ls gsf/.libs/libgsf*.so.* | \
awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'`
major=`ls gsf/.libs/libgsf*.so.* | \
awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'`
upstreamversion=$(shell dpkg-parsechangelog | grep Version | head -1 | sed -e 's/Version: //g' -e 's/-[A-Za-z0-9\.]*$$//g')
source-updates:
# Update files/links generated by autotools
env srcdir=`pwd` NOCONFIGURE=1 sh autogen.sh
# Replace links by copies of their targets
for file in `find -type l` ; do \
tf=`tempfile` && \
install -p $$file $$tf && \
rm -f $$file && \
install -p $$tf $$file && \
rm -f $$tf ; \
done
rm -rf autom4te.cache
configure: config-stamp
config-stamp:
dh_testdir
rm -rf build && mkdir build
cd build && env "CFLAGS=$(CFLAGS)" "LDFLAGS=$(LDFLAGS)" ../configure $(confflags)
touch config-stamp
build: build-stamp
build-stamp: config-stamp
dh_testdir
$(MAKE) -C build
touch build-stamp
clean:
dh_testdir
dh_testroot
rm -f config-stamp build-stamp
-$(MAKE) -C build distclean
rm -rf build
rm -f config.cache config.status
rm -f doc/html/*.png doc/html/*.html
-find -type f -name 'Makefile.am' | sed -e 's/\.am$$//' | xargs rm -f
# Update config.{sub,guess} from autotools-dev, if possible.
-for f in config.sub config.guess ; do \
if test -r /usr/share/misc/$$f ; then \
OLDDATE=`./$$f -t | tr -d -` ; \
NEWDATE=`/usr/share/misc/$$f -t | tr -d -` ; \
if [ $$OLDDATE -lt $$NEWDATE ] ; then \
echo "GNU config automated update of $$f (replacing $$OLDDATE with $$NEWDATE)" 1>&2 ; \
cp -f /usr/share/misc/$$f $$f ; \
fi; \
fi; \
done
dh_clean
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
# Add here commands to install the package into debian/tmp
$(MAKE) -C build \
DESTDIR=$(CURDIR)/debian/tmp \
install
@if ! test -r $(CURDIR)/debian/tmp/usr/lib/libgsf-gnome-1.so ; then \
echo "" ; \
echo "libgsf-gnome-1 didn't get installed properly" ; \
echo "Perhaps ltmain.sh needs to be regenerated using a libtool package patched" ; \
echo "with the \"inst-prefix\" patch?" ; \
exit 1; \
fi
mkdir -p $(CURDIR)/debian/tmp/usr/lib/debug
for l in `find $(CURDIR)/debian/tmp/usr/lib -name '*.so*'`; do \
cp -vdf $$l $(CURDIR)/debian/tmp/usr/lib/debug ; \
done
# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.
# Build architecture-dependent files here.
binary-arch: build install
dh_testdir
dh_testroot
dh_install --sourcedir=debian/tmp --list-missing -Xindex.sgml
# dh_installdebconf
dh_installdocs
rm -rvf $(CURDIR)/debian/libgsf-1-dbg/usr/share/doc/libgsf-1-dbg
rm -rvf $(CURDIR)/debian/libgsf-gnome-1-dbg/usr/share/doc/libgsf-gnome-1-dbg
dh_link -plibgsf-1-dbg /usr/share/doc/libgsf-1/ /usr/share/doc/libgsf-1-dbg
dh_link -plibgsf-gnome-1-dbg /usr/share/doc/libgsf-gnome-1/ /usr/share/doc/libgsf-gnome-1-dbg
dh_link -plibgsf-1-dev /usr/share/doc/libgsf-1-dev/html/gsf/ /usr/share/gtk-doc/html/gsf
dh_installexamples
dh_installmenu
# dh_installlogrotate
# dh_installemacsen
# dh_installpam
# dh_installmime
# dh_installinit
dh_installcron
dh_installman
dh_installinfo
# dh_undocumented
dh_installchangelogs ChangeLog
dh_strip -v -Nlibgsf-1-dbg -N libgsf-gnome-1-dbg
dh_compress
dh_buildinfo
dh_fixperms
dh_makeshlibs -plibgsf-1 -V 'libgsf-1 (>= $(upstreamversion))'
dh_makeshlibs -plibgsf-gnome-1 -V 'libgsf-gnome-1 (>= $(upstreamversion))'
dh_installdeb
# dh_perl
dh_shlibdeps -l debian/libgsf-1/usr/lib/ -L libgsf-1
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
.PHONY: source-update configure build clean binary-indep binary-arch binary install
|