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 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392
|
#!/usr/bin/make -f
#export DH_VERBOSE=1
include /usr/share/dpkg/architecture.mk
include /usr/share/dpkg/buildopts.mk
ifneq ($(DEB_BUILD_OPTION_PARALLEL),)
JOBS = $(DEB_BUILD_OPTION_PARALLEL)
else
JOBS = 1
endif
ROOT_DIR=$(shell pwd)
export HOME := $(ROOT_DIR)/debian
-include $(ROOT_DIR)/erts/vsn.mk
-include $(ROOT_DIR)/lib/diameter/vsn.mk
-include $(ROOT_DIR)/lib/erl_interface/vsn.mk
-include $(ROOT_DIR)/lib/jinterface/vsn.mk
-include $(ROOT_DIR)/lib/ic/vsn.mk
-include $(ROOT_DIR)/lib/tools/vsn.mk
-include $(ROOT_DIR)/lib/common_test/vsn.mk
-include $(ROOT_DIR)/lib/snmp/vsn.mk
-include $(ROOT_DIR)/lib/observer/vsn.mk
-include $(ROOT_DIR)/lib/edoc/vsn.mk
SOURCE_VERSION=$(shell dpkg-parsechangelog | sed -ne's!^Version: \(.*\)-.*!\1!p')
PCRE_MAJOR=$(shell cat erts/emulator/pcre/pcre.h | grep PCRE_MAJOR | sed -e's/.*\s\([0-9]\+\).*/\1/')
PCRE_MINOR=$(shell cat erts/emulator/pcre/pcre.h | grep PCRE_MINOR | sed -e's/.*\s\([0-9]\+\).*/\1/')
PCRE_VERSION=$(PCRE_MAJOR).$(PCRE_MINOR)
ABI_VERSION=17.0
MAN_DIR = $(ROOT_DIR)/debian/tmp/usr/share/man/man1
ifneq ($(findstring hurd-i386,$(DEB_HOST_ARCH)),)
YEAR2038_OPT=--disable-year2038
else
YEAR2038_OPT=
endif
ifneq ($(findstring hurd,$(DEB_HOST_ARCH)),)
ESOCK_OPT=--disable-esock
else
ESOCK_OPT=--enable-esock
endif
ifneq ($(findstring hurd,$(DEB_HOST_ARCH)),)
KERNEL_POLL_OPT=--disable-kernel-poll
else
KERNEL_POLL_OPT=--enable-kernel-poll
endif
LIBSCTP=$(shell grep-status -s Depends -PX libsctp-dev |sed -e 's!.*\(libsctp[0-9]*\).*!\1!')
LIBSCTPDEP=$(shell grep-status -s Version -PX $(LIBSCTP) | sed -e's!^Version: \(.*\)-[^-]*!$(LIBSCTP) (>= \1)!')
ifeq ($(findstring hurd,$(DEB_HOST_ARCH))$(findstring bsd,$(DEB_HOST_ARCH)),)
SYSTEMD_OPT=--enable-systemd
SCTP_OPT=--enable-sctp
else
SYSTEMD_OPT=
SCTP_OPT=--disable-sctp
endif
ifeq ($(findstring i386,$(DEB_HOST_ARCH)),)
SSE2=
else
SSE2=-msse2
endif
ifeq ($(findstring armel,$(DEB_HOST_ARCH)),)
OPTIMIZATION=-O2
else
OPTIMIZATION=-O1
endif
ifeq ($(findstring debug,$(DEB_BUILD_OPTIONS)),debug)
CFLAGS=-g $(OPTIMIZATION) -fno-strict-aliasing $(SSE2)
GEN_OPT_FLGS=$(OPTIMIZATION) -fno-strict-aliasing $(SSE2)
TYPE=debug
else
CFLAGS=-g $(OPTIMIZATION) -fno-strict-aliasing $(SSE2)
GEN_OPT_FLGS=$(OPTIMIZATION) -fno-strict-aliasing $(SSE2)
TYPE=
endif
JAVA_OPTIONS=-Xlint -source 1.8 -target 1.8
export LC_ALL := C.UTF-8
MANPAGE_DIRS = $(shell find $(ROOT_DIR) -not \( -wholename '*/.pc' -prune \) \
-a \( -name '*_cmd.md' -or -name dialyzer.erl \) -exec dirname {} _cmd.md \; | tr "\n" ":")
MANPAGE_NAMES = $(shell find $(ROOT_DIR) -not \( -wholename '*/.pc' -prune \) \
-a -name '*_cmd.md' -exec basename {} _cmd.md \;) dialyzer start_embedded
MANPAGES = $(MANPAGE_NAMES:%=$(MAN_DIR)/%.1)
vpath %_cmd.md $(MANPAGE_DIRS)
# manpages builds section 1 manual pages
manpages: manpages-stamp
manpages-stamp: $(MANPAGES)
dh_testdir
touch manpages-stamp
$(MAN_DIR):
install -d $(MAN_DIR)
$(MAN_DIR)/start_embedded.1: $(MAN_DIR)/start.1
sed -e's/START/START_EMBEDDED/' \
-e's/Bstart\([ \\]\)/Bstart_embedded\1/' <$< >$@
$(MAN_DIR)/dialyzer.1: lib/dialyzer/src/dialyzer.erl $(MAN_DIR)
debian/scripts/fixmanpage $< 1 | ronn | sed -e's/start(1)/start_embedded(1)/' >$@
$(MAN_DIR)/%.1: %_cmd.md $(MAN_DIR)
debian/scripts/fixmanpage $< 1 | ronn | sed -e's/start(1)/start_embedded(1)/' >$@
# Files generated from templates
SCRIPTS_SRC = $(wildcard debian/erlang-*.in) $(wildcard debian/scripts/*.in)
SCRIPTS = $(SCRIPTS_SRC:%.in=%)
$(SCRIPTS) debian/control: %: %.in debian/rules
sed -e's/@VERSION@/$(VSN)/g' \
-e's/@SOURCE_VERSION@/$(SOURCE_VERSION)/g' \
-e's/@ABI_VERSION@/$(ABI_VERSION)/g' \
-e's/@PCRE_VERSION@/$(PCRE_VERSION)/g' \
-e's/@EI_VSN@/$(EI_VSN)/g' \
-e's/@JINTERFACE_VSN@/$(JINTERFACE_VSN)/g' \
-e's/@IC_VSN@/$(IC_VSN)/g' \
-e's/@COMMON_TEST_VSN@/$(COMMON_TEST_VSN)/g' \
-e's/@SNMP_VSN@/$(SNMP_VSN)/g' \
-e's/@DIAMETER_VSN@/$(DIAMETER_VSN)/g' \
-e's/@OBSERVER_VSN@/$(OBSERVER_VSN)/g' \
-e's/@EDOC_VSN@/$(EDOC_VSN)/g' \
-e's/@TOOLS_VSN@/$(TOOLS_VSN)/g' <$< >$@
# Building the package
clean:
dh_testdir
dh_testroot
#
[ ! -f Makefile ] || $(MAKE) -j $(JOBS) clean
#
# Remove installed erlang from debian/
rm -rvf debian/erlang-docs
#
# Restore replaced configure, config.guess, and config.sub files
for i in `find $(ROOT_DIR) -regex '.*config\(ure\|\.guess\|\.sub\)~'` ; do \
mv -v $$i $${i%%\~} ; \
done
#
# Remove files, which were generated from templates
rm -vf $(SCRIPTS)
#
# *.install were also generated on-the-fly
rm -vf debian/*.install
rm -vf debian/erlang-doc.links
#
rm -vf debian/AUTHORS
#
# Remove touched stamp files
rm -vf *-stamp
#
dh_clean -Xtest.erl.orig
automake: automake-stamp
automake-stamp: debian/control
dh_testdir
#
# Return error if there are known nonfree docs in upstream tarball
# Return error if there are prebuilt binaries in upstream tarball
err=0 ; \
for fn in `find lib/*/doc -name standard -or -name archive` ; do \
err=1 ; \
echo Found directory $$fn with non-free docs in upstream. Please remove it. ; \
done ; \
if [ -f prebuilt.files ] ; then \
err=1 ; \
echo Found prebuilt binaries in upstream. Please remove them. ; \
fi ; \
if [ $$err = 1 ] ; then \
echo ; \
echo Use uscan --download to get the upstream tarball. ; \
echo ; \
false ; \
fi
#
# Preserve configure scripts
for i in `find $(ROOT_DIR) -not \( -wholename '*/.pc' -prune \) \
-a -name 'configure'` ; do \
cp -vf $$i $$i~ ; \
done
#
# Replace config.guess and config.sub by installed in /usr/share/misc.
for i in `find $(ROOT_DIR) -not \( -wholename '*/.pc' -prune \) \
-a -name 'config.guess'` ; do \
cp -vfb /usr/share/misc/config.guess $$i ; \
done
for i in `find $(ROOT_DIR) -not \( -wholename '*/.pc' -prune \) \
-a -name 'config.sub'` ; do \
cp -vfb /usr/share/misc/config.sub $$i ; \
done
#
# Regenerate configure scripts using autoconf
./otp_build update_configure --no-commit
#
touch automake-stamp
configure: configure-stamp
configure-stamp: automake-stamp
dh_testdir
#
CFLAGS="$(CFLAGS)" \
./configure --host=$(DEB_HOST_GNU_TYPE) \
--build=$(DEB_BUILD_GNU_TYPE) \
--prefix=/usr \
--libexecdir=/usr/bin \
--infodir=/usr/share/info \
--mandir=/usr/share/man \
$(KERNEL_POLL_OPT) \
$(ESOCK_OPT) \
$(SYSTEMD_OPT) \
$(SCTP_OPT) \
$(YEAR2038_OPT) \
--enable-dynamic-ssl-lib \
--with-ssl-rpath=no \
--enable-shared-zlib \
--disable-builtin-zlib \
--without-ssl-zlib \
--disable-silent-rules
#
touch configure-stamp
boot: boot-stamp
boot-stamp: configure-stamp
dh_testdir
$(MAKE) -j $(JOBS) TYPE=$(TYPE) GEN_OPT_FLGS="$(GEN_OPT_FLGS)" JAVA_OPTIONS="$(JAVA_OPTIONS)"
touch boot-stamp
install: install-stamp
install-stamp: boot-stamp
dh_testdir
#
$(MAKE) -j $(JOBS) DESTDIR=$(ROOT_DIR)/debian/tmp TYPE=$(TYPE) install
#
# Replace ROOTDIR in "erl" and "start" scripts for real rootdir
# If there's no erl or start then it's better to fail than silently continue
for dir in debian/tmp/usr/lib/erlang/erts-$(VSN)/bin \
debian/tmp/usr/lib/erlang/bin; do \
for val in erl start; do \
sed -i 's!ROOTDIR=.*!ROOTDIR=/usr/lib/erlang!' $${dir}/$${val}; \
done; \
done
#
# Correct ERL_ROOT in RELEASES file
sed 's!%ERL_ROOT%!/usr/lib/erlang!' \
debian/tmp/usr/lib/erlang/releases/RELEASES.src \
>debian/tmp/usr/lib/erlang/releases/RELEASES
#
# Get rid of windows cruft
find debian/tmp -name *.bat -exec rm -v {} \;
#
# Fix permissions
cp debian/tmp/usr/lib/erlang/erts-$(VSN)/bin/start_erl.src \
debian/tmp/usr/lib/erlang/erts-$(VSN)/bin/start_erl
chmod 755 debian/tmp/usr/lib/erlang/erts-$(VSN)/bin/start_erl
chmod 755 debian/tmp/usr/lib/erlang/erts-$(VSN)/bin/*.src
chmod 644 debian/tmp/usr/lib/erlang/bin/start.script
chmod 644 debian/tmp/usr/lib/erlang/lib/wx-*/examples/*/*.beam
#
# Remove some files which should be rather in erlang-doc-html package
find debian/tmp/usr/lib/erlang/lib -name info -exec rm -v {} \;
rm -rv debian/tmp/usr/lib/erlang/erts-$(VSN)/doc
#
# Remove unnecessary Install and manpage formatting scripts
rm -v debian/tmp/usr/lib/erlang/Install
rm -rv debian/tmp/usr/lib/erlang/misc
touch install-stamp
docs: docs-stamp
docs-stamp:
dh_testdir
ifeq ($(filter nodoc,$(DEB_BUILD_PROFILES)),)
PATH=$(ROOT_DIR)/bin:$$PATH $(MAKE) -j $(JOBS) docs
$(MAKE) -j $(JOBS) DESTDIR=$(ROOT_DIR)/debian/erlang-docs install-docs
#
(cd $(ROOT_DIR)/debian/erlang-docs/usr/lib/erlang/lib ; \
perl $(ROOT_DIR)/debian/scripts/genlinks $(VSN) >$(ROOT_DIR)/debian/erlang-doc.links)
install -d $(ROOT_DIR)/debian/erlang-docs/usr/lib/html
mv $(ROOT_DIR)/debian/erlang-docs/usr/lib/erlang/* $(ROOT_DIR)/debian/erlang-docs/usr/lib/html
# Use system-wide javascript libraries
ln -sf /usr/share/javascript/jquery/jquery.min.js \
$(ROOT_DIR)/debian/erlang-docs/usr/lib/html/lib/jinterface-*/doc/html/assets/java/script-dir/jquery-[0-9]*.min.js
ln -sf /usr/share/javascript/jquery-ui/themes/base/jquery-ui.min.css \
$(ROOT_DIR)/debian/erlang-docs/usr/lib/html/lib/jinterface-*/doc/html/assets/java/script-dir/jquery-ui.min.css
ln -sf /usr/share/javascript/jquery-ui/jquery-ui.min.js \
$(ROOT_DIR)/debian/erlang-docs/usr/lib/html/lib/jinterface-*/doc/html/assets/java/script-dir/jquery-ui.min.js
endif
touch docs-stamp
build: build-arch build-indep
build-arch: build-stamp manpages-stamp
build-indep: build-stamp docs-stamp
build-stamp: install-stamp $(SCRIPTS)
dh_testdir
#
# Place each installed file into the proper package.
# See this script and the debian/patterns/* files for more informations.
sh debian/scripts/analyse debian/tmp
#
# Add all author lists to debian/AUTHORS
cat $(ROOT_DIR)/erts/AUTHORS >>debian/AUTHORS
for i in $$(find $(ROOT_DIR) -name AUTHORS | sort | tail -n +3) ; do \
echo $$i ; \
echo "" >>debian/AUTHORS ; \
echo "------------------------------------------------------------------------" >>debian/AUTHORS ; \
echo "$$(basename $$(dirname $$i))" >>debian/AUTHORS ; \
echo "" >>debian/AUTHORS ; \
cat $$i >>debian/AUTHORS ; \
done
#
touch build-stamp
binary: binary-indep binary-arch
binary-indep: build-stamp docs-stamp
dh_testdir
dh_testroot
dh_installdirs -i
dh_install -i
dh_lintian -i
ifeq ($(filter nodoc,$(DEB_BUILD_PROFILES)),)
dh_installdocs -i -A debian/README.Debian debian/AUTHORS
else
dh_installdocs -i -Nerlang-doc -A debian/README.Debian debian/AUTHORS
endif
dh_installemacsen -i
dh_installexamples -i
dh_installchangelogs -i
dh_installman -i
dh_installmenu -i
dh_link -i
dh_strip -i
dh_compress -i -X.txt -X.erl -X.hrl -X.c -X.js -X.kwc -X.pdf -X.eix -X.src -X.beam -X.md
dh_fixperms -i
dh_makeshlibs -i
dh_installdeb -i
dh_shlibdeps -i
dh_gencontrol -i
dh_md5sums -i
dh_builddeb -i
binary-arch: build-stamp manpages-stamp
dh_testdir
dh_testroot
dh_installdirs -a
dh_install -a
#
#sed -i -e 's/Depends: /Depends: $${erlang:Depends}, /g' debian/control
#$(ROOT_DIR)/debian/erlang-dev/usr/bin/erlang-depends -a
#grep -r erlang:Depends debian/
#false
#
dh_lintian -a
dh_installdocs -a -A debian/README.Debian debian/AUTHORS
dh_installchangelogs -a
dh_installemacsen -a
dh_installexamples -a
dh_installman -a
dh_installmenu -a
dh_link -a
dh_installsystemd -a --name=epmd
dh_strip -a
dh_compress -a
dh_fixperms -a
dh_makeshlibs -a
dh_installdeb -a
dh_shlibdeps -a
dh_gencontrol -a -- -Vlibsctp:Version='$(LIBSCTPDEP)'
dh_md5sums -a
dh_builddeb -a
.PHONY: clean automake build build-arch build-indep
.PHONY: binary binary-arch binary-indep
.PHONY: configure boot install docs manpages
|