Subversion Repositories pike-old

Compare Revisions

Ignore whitespace Rev 2 → Rev 3

/trunk/debian/rules
13,9 → 13,6
#export DH_VERBOSE=1
include /usr/share/dpatch/dpatch.make
 
PIKEV=7.6
PIKE=pike$(PIKEV)
 
ifdef CCVER
CC=gcc-$(CCVER)
else
38,11 → 35,6
CFARGSEXTRA=--without-rtldebug --without-cdebug --without-debug
endif
 
# Temporary workaround for hppa linker issues
ifeq ($(DEB_BUILD_ARCH),hppa)
CFLAGS_EXTRA += -ffunction-sections
endif
 
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
CFARGSEXTRA += --with-rtldebug --with-cdebug --with-debug
endif
76,11 → 68,19
MACHINE_OPTS=--without-machine-code
endif
 
VERSION:=$(shell dpkg-parsechangelog | grep ^Version | sed -e 's/Version: //;s/-[^-]*$$//')
OS=$(shell uname -srm|sed -e 's/ /-/g'|tr '[A-Z]' '[a-z]'|tr '/' '_')
BUILDDIR=build/$(OS)
DEBVERSION:=$(shell dpkg-parsechangelog | sed -ne 's/Version: *\(.*\)-.*$$/\1/p')
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) \
--prefix=/usr
--with-cflags="$(CFLAGS_EXTRA)" \
--with-cppflags="$(CPPFLAGS_EXTRA)" \
--with-bignums \
88,12 → 88,10
--with-poll \
--with-zlib \
--with-freetype \
--with-ttflib \
--without-ttflib \
--with-libnettle \
--without-libpdf \
--without-libpanda \
--without-sybase \
--with-java \
--without-java \
--with-odbc \
--with-sane \
--with-postgres \
102,15 → 100,27
--with-perl \
--without-ffmpeg \
--without-libpdf \
--without-libpanda $(MACHINE_OPTS) $(EXTRA_ARGS) \
--without-libpanda \
--without-GTK \
--with-GTK2
--without-GTK2 \
$(MACHINE_OPTS) $(EXTRA_ARGS)
 
RUNPIKE=$(CURDIR)/$(BUILDDIR)/pike -DNOT_INSTALLED -DPRECOMPILED_SEARCH_MORE -m$(CURDIR)/$(BUILDDIR)/master.pike
RUNPIKE2=$(CURDIR)/debian/$(PIKE)-core/usr/bin/pike -m$(CURDIR)/$(BUILDDIR)/lib/master.pike
PIKE_FAKEROOT=$(CURDIR)/debian/$(PIKE)-core
PIKE_FAKEROOT_OMIT=$(BUILDDIR)*:$(CURDIR)/lib*:$(CURDIR)/src*:$(CURDIR)/bin*:$(CURDIR)/man*:$(BUILDDIR)/lib*:$(CURDIR)*:$(CURDIR)/debian/$(PIKE)-core*
include_prefix=/usr/include/pike/$(VERSION)
lib_prefix=/usr/lib/pike/$(VERSION)
 
MODULE_PACKAGES=$(shell dh_listpackages -a -N $(PIKE)-core -N $(PIKE)-dev)
#{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 Msql msql PDF Ffmpeg Oracle oracle sybase Gnome GTK GDK DVB Java TTF
# 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
 
build-arch: build-arch-stamp
126,10 → 136,6
dh_testdir
 
# Add here command to compile/build the arch indep package.
# It's ok not to do anything here, if you don't need to build
# anything for this package.
#/usr/bin/docbook-to-man debian/$(PIKE).sgml > $(PIKE).1
$(MAKE) documentation CONFIGUREARGS="$(CFARGS)"
touch build-indep-stamp
 
137,7 → 143,6
 
clean: clean-patched unpatch
dh_clean
rm -rf debian/pike7.6-gtk
 
clean-patched:
dh_testdir
149,124 → 154,62
rm -rf refdoc/modref refdoc/traditional_manual
 
install: DH_OPTIONS=
install: build
install: build-arch
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
 
# Add here commands to install the package into debian/tmp.
$(MAKE) -C$(BUILDDIR)/ \
buildroot=$(CURDIR)/debian/tmp \
prefix=/usr/lib \
$(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) \
include_prefix="/usr/include/pike/$(VERSION)/" \
install
install_nodoc
 
# Some cleaning
# -rm -f `find $(CURDIR)/debian/tmp/usr/lib/pike/$(VERSION)/ -name ".autodoc" -type f -print`
# -@for f in `cat $(CURDIR)/debian/toremove.txt | sed -e 's/@PIKE@/$(PIKE)/g;s/@VERSION@/$(VERSION)/g'`; do \
# echo Removing $(CURDIR)/debian/$(PIKE)-core/$$f ; \
# rm $(CURDIR)/debian/$(PIKE)-core/$$f &> /dev/null || echo " FAILED"; \
# done
# Some cleaning
find "$(TMP)$(lib_prefix)" -name '.autodoc' -type f -exec rm -f '{}' ';'
 
# an eye-candy
install -d -m 755 -o root -g root $(CURDIR)/debian/$(PIKE)-core/usr/share/pixmaps/pike
install -m 644 -o root -g root $(CURDIR)/debian/pike.xpm $(CURDIR)/debian/$(PIKE)-core/usr/share/pixmaps/pike/$(PIKE).xpm
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
 
# install the docs
mkdir -p $(CURDIR)/debian/$(PIKE)-doc/usr/share/doc/$(PIKE)-doc/html/manual
dh_install --sourcedir=$(CURDIR) -p$(PIKE)-manual refdoc/traditional_manual/* usr/share/doc/$(PIKE)-doc/html/manual
mkdir -p $(CURDIR)/debian/$(PIKE)-manual/usr/share/doc/$(PIKE)-doc/html/manual
install -m 644 -o root -g root $(CURDIR)/debian/dhelp.manual $(CURDIR)/debian/$(PIKE)-manual/usr/share/doc/$(PIKE)-doc/html/manual/.dhelp
 
mkdir -p $(CURDIR)/debian/$(PIKE)-doc/usr/share/doc/$(PIKE)-doc/html/reference
mkdir -p $(CURDIR)/debian/$(PIKE)-reference/usr/share/doc/$(PIKE)-doc/html/reference/
dh_install --sourcedir=$(CURDIR) -p$(PIKE)-reference refdoc/modref/* usr/share/doc/$(PIKE)-doc/html/reference
install -m 644 -o root -g root $(CURDIR)/debian/dhelp.refdoc $(CURDIR)/debian/$(PIKE)-reference/usr/share/doc/$(PIKE)-doc/html/reference/.dhelp
 
ln -sf ../lib/pike/$(VERSION)/bin/pike $(CURDIR)/debian/$(PIKE)-core/usr/bin/$(PIKE)
install -m 644 -o root -g root $(CURDIR)/man/pike.1 $(CURDIR)/debian/$(PIKE)-core/usr/share/man/man1/$(PIKE).1
rm -rf $(CURDIR)/debian/$(PIKE)-core/usr/lib/pike/$(VERSION)/man/
 
install -d -m 755 -o root -g root $(CURDIR)/debian/$(PIKE)-core/usr/include/pike/
mv $(CURDIR)/debian/$(PIKE)-core/usr/lib/pike/$(VERSION)/include/pike \
$(CURDIR)/debian/$(PIKE)-core/usr/include/pike/$(VERSION) ; \
rm -rf $(CURDIR)/debian/$(PIKE)-core/usr/lib/pike/$(VERSION)/include
chmod 644 `find $(CURDIR)/debian/$(PIKE)-core/usr/include/pike/$(VERSION)/ -type f -print`
 
# move all the *.pmod and *.pike files to /usr/share recreating the structure
install -d -m 755 -o root -g root $(CURDIR)/debian/$(PIKE)-core/usr/share/pike/$(VERSION)
for f in `(cd $(CURDIR)/debian/$(PIKE)-core/usr/lib/pike/$(VERSION)/lib/ && find -name "*.pmod" -print -o -name "*.pike" -print)`; do \
install -d -m 755 -o root -g root $(CURDIR)/debian/$(PIKE)-core/usr/share/pike/$(VERSION)/lib/`dirname $$f`/; \
if [ -f $(CURDIR)/debian/$(PIKE)-core/usr/lib/pike/$(VERSION)/lib/$$f ]; then \
mv $(CURDIR)/debian/$(PIKE)-core/usr/lib/pike/$(VERSION)/lib/$$f $(CURDIR)/debian/$(PIKE)-core/usr/share/pike/$(VERSION)/lib/$$f; \
(echo /usr/share/pike/$(VERSION)/lib/$$f /usr/lib/pike/$(VERSION)/lib/$$f | sed -e 's#/./#/#g') >> $(CURDIR)/debian/links; \
fi; \
# Fix permissions and shebang lines
-for f in `find $(TMP)/usr/bin $(TMP)/usr/lib -type f`; do \
if file $$f | grep -q "script"; then \
chmod a+x $$f; \
sed -ri -e 's@#!.*NOMODULE@#!/usr/bin/$(PIKE)@' \
-e 's@#! */usr/local/bin/pike@#!/usr/bin/$(PIKE)@' \
-e 's@#! */usr/bin/env.*pike@#!/usr/bin/$(PIKE)@' \
$$f; \
fi; \
done
dh_link && rm -f $(CURDIR)/debian/links
 
sed -e "`$(RUNPIKE) -e 'write("s#@CFLAGS@#%s#g;s/@LDFLAGS@//g;s/@MAJOR@/%d/g; s/@MINOR@/%d/g; s/@BUILD@/%d/g","-I/usr/include/pike/$(VERSION)/", __REAL_MAJOR__, __REAL_MINOR__, __REAL_BUILD__);'`" \
$(CURDIR)/debian/pike-config.in > $(CURDIR)/debian/$(PIKE)-dev/usr/bin/$(PIKE)-config
 
# Fix permissions
find $(CURDIR)/debian/$(PIKE)-core/usr/lib/pike/$(VERSION) -type f -exec chmod -x '{}' ';'
chmod 755 $(CURDIR)/debian/$(PIKE)-core/usr/lib/pike/$(VERSION)/bin/pike
 
for f in `find $(CURDIR)/debian/$(PIKE)-core/usr/bin -type f` \
`find $(CURDIR)/debian/$(PIKE)-core/usr/lib/pike/$(VERSION) -type f` \
`find $(CURDIR)/debian/$(PIKE)-core/usr/share/pike/$(VERSION) -type f`; \
do \
file $$f | grep "script" >/dev/null \
&& perl -pi -e 's@#\!.*NOMODULE@#\!/usr/bin/$(PIKE)@' $$f \
&& chmod a+x $$f; \
file $$f | grep "script" >/dev/null \
&& perl -pi -e 's@#\!.*/usr/local/bin/pike@#\!/usr/bin/$(PIKE)@' $$f; \
file $$f | grep "script" >/dev/null \
&& perl -pi -e 's@#\!.*/usr/bin/env.*pike@#\!/usr/bin/$(PIKE)@' $$f; \
done; exit 0
 
find build/ -name precompile.sh -exec 'cp {} $(CURDIR)/debian/$(PIKE)-core/usr/include/pike/$(VERSION)' \;
find build/ -name smartlink -exec 'cp {} $(CURDIR)/debian/$(PIKE)-core/usr/include/pike/$(VERSION)' \;
cp ./bin/fixdepends.sh ./bin/install_module ./bin/mktestsuite $(CURDIR)/debian/$(PIKE)-core/usr/include/pike/$(VERSION)
 
# Some more permission changes
for f in run_autoconfig precompile.sh smartlink fixdepends.sh install_module mktestsuite; do \
chmod 755 $(CURDIR)/debian/$(PIKE)-core/usr/include/pike/$(VERSION)/$$f ; \
done
 
# Create the documentation links to save space
for f in `cat $(CURDIR)/debian/tocoredoc.txt`; do \
dh_link -p$$f /usr/share/doc/$(PIKE)-core /usr/share/doc/$$f ; \
done
 
# install the specs file
# Install the specs file
sed -e 's/@PIKEVERSION@/$(VERSION)/g' \
-e 's;@CONFIGURE_ARGS@;$(CFARGS);g' \
< $(CURDIR)/debian/specs.in > $(CURDIR)/debian/$(PIKE)-core/usr/include/pike/$(VERSION)/specs
< debian/specs.in > $(TMP)$(include_prefix)/specs
 
# pike -x module fix
echo 's;\$$\(MODULE_BASE\)/dynamic_module_makefile;\$$\(PIKE_SRC_DIR\)/dynamic_module_makefile;g' > \
$(CURDIR)/debian/sed-script.tmp
sed -r -f $(CURDIR)/debian/sed-script.tmp < \
$(CURDIR)/debian/$(PIKE)-core/usr/include/pike/$(VERSION)/dynamic_module_makefile > \
$(CURDIR)/debian/$(PIKE)-core/usr/include/pike/$(VERSION)/dynamic_module_makefile.new
mv $(CURDIR)/debian/$(PIKE)-core/usr/include/pike/$(VERSION)/dynamic_module_makefile.new \
$(CURDIR)/debian/$(PIKE)-core/usr/include/pike/$(VERSION)/dynamic_module_makefile
rm -f $(CURDIR)/debian/sed-script.tmp
# Install pike-config
sed -e "s#@CFLAGS@#$(include_prefix)#;s/@LDFLAGS@//" \
-e "s/@MAJOR@/$(MAJOR)/;s/@MINOR@/$(MINOR)/;s/@BUILD@/$(BUILD)/" \
debian/pike-config.in > $(TMP)/usr/bin/$(PIKE)-config
 
rm -r $(CURDIR)/debian/$(PIKE)-core/usr/lib/pike/$(VERSION)/doc
dh_install --sourcedir=debian/tmp
# # pike -x module fix
sed -i -e 's;\$$(MODULE_BASE)/dynamic_module_makefile;\$$(PIKE_SRC_DIR)/dynamic_module_makefile;g' \
$(TMP)$(include_prefix)/dynamic_module_makefile
 
# Need to move dynamic_module_makefile back to -core, since it contains platform-specific stuff
# mv $(CURDIR)/debian/$(PIKE)-dev/usr/include/pike/$(VERSION)/dynamic_module_makefile \
# $(CURDIR)/debian/$(PIKE)-core/usr/include/pike/$(VERSION)/dynamic_module_makefile
 
# Build architecture-independent files here.
# Pass -i to all debhelper commands in this target to reduce clutter.
binary-indep: build-indep install
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
dh_link -i
282,14 → 225,18
dh_testdir -a
dh_testroot -a
# dh_installdebconf -a
dh_install -a --sourcedir=debian/tmp -N$(PIKE)-core $(DH_EXCLUDE)
dh_install -p$(PIKE)-core --sourcedir=debian/tmp $(DH_EXCLUDE) $(DH_ALREADY)
for p in $(MODULE_PACKAGES); do \
dh_link -p$$p usr/share/doc/$(PIKE)-core usr/share/doc/$$p; \
done
dh_installdocs -a
dh_installmenu -a -p$(PIKE)-core
dh_installman -p$(PIKE)-core debian/tmp/usr/share/man/man1/$(PIKE).1
dh_installmenu -a
# dh_installman -a
dh_installchangelogs -a
dh_strip -a
dh_link -a
dh_compress -a
dh_fixperms -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