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
|
#!/usr/bin/make -f
#export DH_VERBOSE=1
# Set architecture variables for cross-compiling and for saving the configure
# script from having to guess our platform (since we know it already)
# Also sets multiarch lib vars
include /usr/share/dpkg/architecture.mk
# Get default flags
CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
# These additional compiler flags should bring up warnings about common
# sources of errors.
export CFLAGS += -Wall -Wformat=2 -Wunused -Wundef -Wextra -Wswitch-enum \
-Wpointer-arith -Wnested-externs -Wbad-function-cast -Wcast-qual \
-Wcast-align -Wshadow
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
configure_flags = --prefix=/usr/share --exec-prefix=/usr --with-x \
--host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE)
ifeq ($(DEB_HOST_ARCH_OS),linux)
configure_flags += --enable-gpm
else
# libgpm is not supported by non-linux architectures: #345268 #95843
configure_flags += --disable-gpm
endif
ifneq ($(DEB_HOST_ARCH_OS),hurd)
configure_flags += --enable-xft
else
# The xrender extension is not supported on the hurd: #95843
configure_flags += --disable-xft
endif
#to successfully build with a multiarch slang we need to explicitly specify
#include and library directories.
configure_flags += --with-slanglib=/usr/lib/$(DEB_HOST_MULTIARCH) --with-slanginc=/usr/include
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
jed=$(CURDIR)/debian/jed
xjed=$(CURDIR)/debian/xjed
jed-common=$(CURDIR)/debian/jed-common
clean:
dh_testdir
dh_autotools-dev_restoreconfig
dh_clean
[ ! -f Makefile ] || $(MAKE) distclean
rm -f build-stamp
-test -f configure.backup && mv configure.backup configure
config.status:
dh_testdir
dh_autotools-dev_updateconfig
mv configure configure.backup
(cd autoconf; $(MAKE) ../configure)
./configure $(configure_flags) || \
{ rc=$$?; cat config.log; exit $$rc; }
build: build-arch build-indep
build-indep: config.status
build-arch: build-stamp
build-stamp: config.status
dh_testdir
#
# --- MAKE ---
#
# These settings of DL_LIB, OTHERLIBS and XRENDERFONTLIBS are to get
# right of unnecessary dependencies on libraries.
# http://rerun.lefant.net/checklib/
#
# DL_LIB introduces a dependency on libdl that is already solved by
# libc. OTHERLIBS introduces a dependency on libm that is also solved
# by libc. XRENDERFONTLIBS fixes a problem with libxft-dev that defines
# libfontconfig.
#
# Upstream refused an attempt to fix these bugs. On other systems these
# dependencies are needed and the autoconf-make system of jed is to
# complex to fix it there.
# http://jupiter.jtan.com/~wingnut/jed-users/msg02560.html
$(MAKE) DL_LIB="" OTHERLIBS=-lutil XRENDERFONTLIBS=-lXft jed # getmail
$(MAKE) DL_LIB="" OTHERLIBS=-lutil XRENDERFONTLIBS=-lXft MOUSELIB= xjed
ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
$(MAKE) -C src runtests
endif
#unfortunately passing the multiarch dir for slang results in the
#upstream build system adding a rpath. Remove this with chrpath
chrpath -d src/objs/jed
chrpath -d src/objs/xjed
touch build-stamp
binary-indep: build-indep
dh_testdir
dh_testroot
# keep dh_install informations (debian/files) and debian/tmp
dh_prep
dh_installdirs -i
$(MAKE) -C src DESTDIR=$(jed-common) JED_MAN_FILES= install_data
rm -r $(jed-common)/usr/share/share
#
# --- JED-COMMON ---
#
# fill up /usr/share/doc/jed-common
dh_installchangelogs -pjed-common changes.txt
mv $(jed-common)/usr/share/jed/doc/README \
$(jed-common)/usr/share/jed/doc/manual \
$(jed-common)/usr/share/doc/jed-common
dh_link -pjed-common usr/share/jed/doc/txt usr/share/doc/jed-common/txt
dh_installdocs -pjed-common debian/README.Debian \
debian/init.d/README.Debian-startup \
debian/Debian-Jed-Policy.txt
dh_installinfo -pjed-common info/jed.*
cd $(jed-common)/usr/share/info && \
for i in 1 2 3; do mv jed.$${i}in jed.info-$$i; done && \
sed -i '/jed\..in/s/jed\.\([123]\)in/jed.info-\1/' jed.info
mv $(jed-common)/usr/share/doc/jed-common/manual \
$(jed-common)/usr/share/doc/jed-common/html
# generate html files from jed.tex
hevea -fix -o $(jed-common)/usr/share/doc/jed-common/html/jed.hevea \
$(jed-common)/usr/share/doc/jed-common/html/jed.tex
cd $(jed-common)/usr/share/doc/jed-common/html/; hacha jed.hevea
cd $(jed-common)/usr/share/doc/jed-common/html/; \
rm jed.hevea jed.haux jed.htoc jed.tex
# install some extra docs from the source
dh_installexamples -pjed-common lib/jed.conf \
$(jed-common)/usr/share/jed/lib/jed.rc
# install *.sl files
dh_install -pjed-common debian/defaults.sl usr/share/jed/lib/
rm $(jed-common)/usr/share/jed/lib/jed.rc # it's moved to examples above
# install compile script to build *.slc files after installation
dh_install -pjed-common debian/compile usr/share/jed/compile
mv $(jed-common)/usr/share/jed/compile/compile \
$(jed-common)/usr/share/jed/compile/jed-common
chmod +x $(jed-common)/usr/share/jed/compile/jed-common
# fill up /etc
dh_install -pjed-common debian/init.d/*.sl etc/jed.d/
dh_link -i usr/share/doc/jed-common/README.Debian-startup etc/jed.d/README
dh_installdebconf -i
#
# --- INSTALL-ARCH-INDEP ---
#
dh_compress -i --exclude=libfuns.hlp --exclude=jedfuns.hlp
dh_fixperms -i
dh_installdeb -i
dh_gencontrol -i
dh_md5sums -i
dh_builddeb -i
binary-arch: build-arch
dh_testdir
dh_testroot
# keep dh_install informations (debian/files) and debian/tmp
dh_clean -a
dh_installdirs -a
#
# --- JED ---
#
dh_install -pjed src/objs/jed usr/bin/
dh_installman -pjed doc/manual/jed.1
dh_link -pjed usr/share/doc/jed-common usr/share/doc/jed
#
# --- XJED ---
#
dh_install -pxjed src/objs/xjed usr/bin/
dh_installman -pxjed doc/manual/jed.1
mv $(xjed)/usr/share/man/man1/jed.1 $(xjed)/usr/share/man/man1/xjed.1
dh_link -pxjed usr/share/doc/jed-common usr/share/doc/xjed
#
# --- INSTALL-ARCH-DEP ---
#
dh_installmenu -a
dh_fixperms -a
dh_strip -a
dh_compress -a
dh_installdeb -a
dh_shlibdeps -a
dh_gencontrol -a
dh_md5sums -a
dh_builddeb -a
binary: binary-arch binary-indep
.PHONY: build build-arch build-indep clean binary binary-arch binary-indep
|