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 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252
|
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 by Joey Hess.
#
# This version is for a hypothetical package that builds an
# architecture-dependant package, as well as an architecture-independent
# package.
#
# $Id: rules,v 1.64 2006/08/05 15:49:18 grendel Exp $
#
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
include /usr/share/dpatch/dpatch.make
ifdef CCVER
CC=gcc-$(CCVER)
else
CC=gcc
endif
export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
CFARGSEXTRA = --with-cdebug
ifneq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
export CC=$(DEB_HOST_GNU_TYPE)-gcc
CFARGSEXTRA += --host=$(DEB_HOST_GNU_TYPE)
endif
ifeq (,$(DEB_BUILD_ARCH))
DEB_BUILD_ARCH=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
endif
CFLAGS_EXTRA = -g
CPPFLAGS_EXTRA = -DDEBIAN
ifdef SSP
SSP_FLAGS=-fstack-protector
endif
ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
CFARGSEXTRA += --without-copt
else
CFARGSEXTRA += --with-copt
endif
ifneq (,$(filter debug,$(DEB_BUILD_OPTIONS)))
CFARGSEXTRA += --with-rtldebug
else
CFARGSEXTRA += --without-rtldebug
endif
CFLAGS_EXTRA += $(SSP_FLAGS)
# Temporary workaround for hppa linker issues
ifeq ($(DEB_BUILD_ARCH),hppa)
CFLAGS_EXTRA += -ffunction-sections
endif
ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
endif
EXTRA_ARGS=--with-security
DO_MACHINE_CODE=no
ifeq ($(DEB_BUILD_ARCH),i386)
DO_MACHINE_CODE=yes
endif
ifeq ($(DEB_BUILD_ARCH),powerpc)
DO_MACHINE_CODE=yes
endif
ifeq ($(DEB_BUILD_ARCH),sparc)
DO_MACHINE_CODE=no
endif
ifeq ($(DO_MACHINE_CODE),yes)
MACHINE_OPTS=--with-machine-code
else
MACHINE_OPTS=--without-machine-code
endif
#DEBVERSION:=$(shell dpkg-parsechangelog | sed -ne 's/Version: *\(.*\)-.*$$/\1/p')
DEBVERSION:=$(shell dpkg-parsechangelog | grep "Version:" | cut -d" " -f2 | cut -d"-" -f1)
MAJOR:=$(shell sed -ne 's/major://p' buildid.txt)
MINOR:=$(shell sed -ne 's/minor://p' buildid.txt)
BUILD:=$(shell sed -ne 's/build://p' buildid.txt)
PIKEV:=$(MAJOR).$(MINOR)
VERSION:=$(MAJOR).$(MINOR).$(BUILD)
PIKE:=pike$(PIKEV)
ifneq ($(VERSION),$(DEBVERSION))
$(error Version mismatch; buildid.txt: $(VERSION), debian/changelog: $(DEBVERSION))
endif
CFARGS=$(CFARGSEXTRA) \
--with-cflags='$(CFLAGS_EXTRA)' \
--with-cppflags='$(CPPFLAGS_EXTRA)' \
--with-bignums \
--with-gmp \
--with-poll \
--with-zlib \
--with-freetype \
--without-ttflib \
--with-libnettle \
--without-sybase \
--without-java \
--with-odbc \
--with-sane \
--with-postgres \
--with-postgres-include-dir=`pg_config --includedir` \
--with-libpq-dir=/usr/lib \
--without-ffmpeg \
--without-fftw \
--without-libpdf \
--without-libpanda \
--without-GTK \
--with-GTK2 \
--without-bundles \
--without-oracle \
--without-dvb \
--with-sqlite \
--disable-rpath \
--disable-smartlink_binary \
$(MACHINE_OPTS) $(EXTRA_ARGS)
include_prefix=/usr/include/pike$(PIKEV)/pike
lib_prefix=/usr/lib/pike$(PIKEV)
MODULE_PACKAGES=$(shell dh_listpackages -a -N $(PIKE)-core)
#{ADT,Array,Audio,Cache,Calendar,Calendar_I,COM,Colors,CommonLog,Crypto,Debug,Filesystem,Error,Float,Function,Geography,Getopt,Gettext,Gmp,Graphics,Gz,HTTPAccept,Int,Kerberos,Languages,Local,Locale,Mapping,Math,MIME,Mird,Multiset,Nettle,Parser,Pike,Pipe,Process,Program,Protocols,Regexp,Remote,SSL,Shuffler,Standards,Stdio,String,System,Thread,Tools,Unicode,Web,Yabu,Yp,_ADT,_Charset,_Roxen,___Gz,___MIME,___Math,___Mird,___Regexp,___Yp,____Charset,__builtin*,spider}.
#usr/lib/pike/*/modules/Sql.pmod/{module,Sql,rsql,sql_*}.*
excluded_modules:=Ssleay Mird Msql msql PDF Ffmpeg Oracle oracle sybase DVB Java TTF PV.pike Gnome GDK GTKSupport
# This is tricky. Note that it's only possible for an exclusion to match the last
# component specified in an .install file or on the command line, and below.
DH_EXCLUDE:=$(addprefix -X,$(excluded_modules))
DH_ALREADY=`for p in $(MODULE_PACKAGES); do \
find debian/$$p/usr/lib/pike?.?/* -type f -printf "-X%P "; done`
TMP=$(CURDIR)/debian/tmp
#export CFLAGS CC PIKE VERSION
export CC
build-arch: build-arch-stamp
build-arch-stamp: $(DPATCH_STAMPFN)
dh_testdir
$(MAKE) compile CONFIGUREARGS="$(CFARGS)"
touch build-arch-stamp
build-indep: build-indep-stamp
build-indep-stamp: $(DPATCH_STAMPFN)
dh_testdir
$(MAKE) documentation CONFIGUREARGS="$(CFARGS)"
touch build-indep-stamp
build: build-arch
clean: clean-patched unpatch
dh_clean
clean-patched:
dh_testdir
dh_testroot
rm -f build-stamp build-arch-stamp build-indep-stamp configure-stamp
$(MAKE) distclean
rm -rf refdoc/modref refdoc/traditional_manual
install: DH_OPTIONS=
install: build-arch
dh_testdir
dh_testroot
dh_clean -k
$(MAKE) INSTALLARGS=--traditional \
buildroot=$(TMP) \
prefix=/usr \
man_prefix=/usr/share/man \
lib_prefix="$(lib_prefix)" \
include_prefix="$(include_prefix)" \
pike_name=/usr/bin/$(PIKE) \
install_nodoc
# Some cleaning
find "$(TMP)$(lib_prefix)" -name '.autodoc' -type f -exec rm -f '{}' ';'
install -d -m755 $(TMP)/usr/share/pixmaps
install -m644 debian/pike.xpm $(TMP)/usr/share/pixmaps/$(PIKE).xpm
mv $(TMP)/usr/bin/pike $(TMP)/usr/bin/$(PIKE)
mv $(TMP)/usr/share/man/man1/pike.1 $(TMP)/usr/share/man/man1/$(PIKE).1
# Simply strip exec permissions and shebangs from all pike scripts.
find $(TMP)/usr -name *.p* -type f \
-exec chmod a-x '{}' + \
-exec sed -ri -e '1!b;/^#!/d' '{}' +
# Install our own, simpler specs file.
sed -e "s;@include_prefix@;$(include_prefix);g" \
-e "s;@CONFIGURE_ARGS@;$(CFARGS);g" \
debian/specs.in > $(TMP)$(include_prefix)/specs
# Fix precompike.pike
sed -i -e "s%\.\./lib%$(lib_prefix)%" $(TMP)$(include_prefix)/precompile.pike
# # pike -x module fix
# sed -i -e 's;\$$(MODULE_BASE)/dynamic_module_makefile;\$$(PIKE_SRC_DIR)/modules/dynamic_module_makefile;g' \
# $(TMP)$(include_prefix)/modules/dynamic_module_makefile
# Build architecture-independent files here.
# Pass -i to all debhelper commands in this target to reduce clutter.
binary-indep: build-indep
dh_testdir -i
dh_testroot -i
# install the docs
dh_install -p$(PIKE)-manual refdoc/traditional_manual/* usr/share/doc/$(PIKE)-doc/html/manual
dh_install -p$(PIKE)-reference refdoc/modref/* usr/share/doc/$(PIKE)-doc/html/reference
dh_install -i -N$(PIKE)-manual -N$(PIKE)-reference --sourcedir=$(TMP)
dh_installdocs -i
dh_installchangelogs -i -k CHANGES
dh_link -i
dh_compress -i
dh_fixperms -i
dh_installdeb -i
dh_gencontrol -i
dh_md5sums -i
dh_builddeb -i
# Build architecture-dependent files here.
binary-arch: build-arch install
dh_testdir -a
dh_testroot -a
dh_install -a -N$(PIKE)-core --sourcedir=debian/tmp $(DH_EXCLUDE)
dh_install -p$(PIKE)-core --sourcedir=debian/tmp $(DH_EXCLUDE) $(DH_ALREADY)
for p in $(MODULE_PACKAGES) $(PIKE)-dev; do \
dh_link -p$$p usr/share/doc/$(PIKE)-core usr/share/doc/$$p; \
done
dh_installdocs -a
dh_installmenu -a
dh_installchangelogs -a -k CHANGES
dh_strip -a
dh_compress -a
dh_fixperms -a -X/run_autoconfig -X/precompile.sh -X/smartlink -X/fixdepends.sh -X/install_module -X/mktestsuite
dh_installdeb -a
dh_shlibdeps -a
dh_gencontrol -a
dh_md5sums -a
dh_builddeb -a
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure
|