| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
PACKAGE=brltty |
| 7 |
BRLAPI_VERSION=0.8 |
| 8 |
|
| 9 |
DPKG_EXPORT_BUILDFLAGS=1 |
| 10 |
include /usr/share/dpkg/architecture.mk |
| 11 |
include /usr/share/dpkg/pkg-info.mk |
| 12 |
include /usr/share/dpkg/buildflags.mk |
| 13 |
|
| 14 |
ifneq (,$(filter $(DEB_HOST_ARCH),hppa hurd-amd64 hurd-i386)) |
| 15 |
export DH_OPTIONS=-Nlibbrlapi-jni -Nlibbrlapi-java |
| 16 |
DISABLE_JAVA_SUPPORT=1 |
| 17 |
endif |
| 18 |
|
| 19 |
ifeq (,$(filter noudeb, $(DEB_BUILD_PROFILES))) |
| 20 |
with_udeb = yes |
| 21 |
endif |
| 22 |
|
| 23 |
PYVERS := $(shell py3versions --supported --version) |
| 24 |
|
| 25 |
CONFIGURE_OPTIONS = --exec-prefix=/usr \ |
| 26 |
--build=$(DEB_BUILD_GNU_TYPE) \ |
| 27 |
--host=$(DEB_HOST_GNU_TYPE) \ |
| 28 |
--without-theta --without-swift \ |
| 29 |
JAVA_JNI_DIR=/usr/lib/$(DEB_HOST_MULTIARCH)/jni |
| 30 |
|
| 31 |
DEB_CONFIGURE_OPTIONS = --with-curses=ncursesw --disable-stripping |
| 32 |
|
| 33 |
UDEB_CFLAGS=-Os -fomit-frame-pointer |
| 34 |
ifneq (,$(filter $(DEB_HOST_ARCH), ia64)) |
| 35 |
UDEB_LDFLAGS=-static-libgcc |
| 36 |
endif |
| 37 |
UDEB_DISABLE=speech-support pcm-support midi-support fm-support \ |
| 38 |
contracted-braille api gpm iconv icu x polkit liblouis |
| 39 |
UDEB_CONFIGURE_OPTIONS=--with-braille-driver=all \ |
| 40 |
--with-braille-device=usb: --with-screen-driver=-em,-fv,-sc,all \ |
| 41 |
--without-init-path --without-curses --without-rgx-package \ |
| 42 |
--with-bluetooth-package=none \ |
| 43 |
--with-hid-package=none \ |
| 44 |
--with-service-package==none \ |
| 45 |
$(patsubst %,--disable-%,$(UDEB_DISABLE)) |
| 46 |
|
| 47 |
ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH)) |
| 48 |
PYTHON_CROSS_ENV := |
| 49 |
else |
| 50 |
ifeq ($(DEB_HOST_ARCH_OS),hurd) |
| 51 |
PYTHON_CROSS_ENV := _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata__gnu0_${DEB_HOST_MULTIARCH} |
| 52 |
else |
| 53 |
PYTHON_CROSS_ENV := _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata__${DEB_HOST_ARCH_OS}_${DEB_HOST_MULTIARCH} |
| 54 |
endif |
| 55 |
endif |
| 56 |
|
| 57 |
export JAVA_HOME=/usr/lib/jvm/default-java |
| 58 |
|
| 59 |
binary: binary-indep binary-arch |
| 60 |
|
| 61 |
clean: |
| 62 |
dh_testdir |
| 63 |
dh_testroot |
| 64 |
rm -f build-*stamp |
| 65 |
rm -rf build-brltty* build-py* |
| 66 |
rm -f Bindings/Python/bindings.o |
| 67 |
rm -f acdir/config.sub |
| 68 |
rm -f acdir/config.guess |
| 69 |
rm -f aclocal.m4 |
| 70 |
rm -f configure |
| 71 |
rm -f debian/initramfs/hooks/brltty |
| 72 |
rm -f Documents/BrlAPIref/html/jquery.js |
| 73 |
|
| 74 |
dh_clean |
| 75 |
|
| 76 |
debconf-updatepo |
| 77 |
|
| 78 |
acdir/config.sub: /usr/share/misc/config.sub |
| 79 |
cp -f $< $@ |
| 80 |
acdir/config.guess: /usr/share/misc/config.guess |
| 81 |
cp -f $< $@ |
| 82 |
|
| 83 |
configure: |
| 84 |
./autogen |
| 85 |
|
| 86 |
config: build-brltty/config.status |
| 87 |
build-brltty/config.status: configure acdir/config.sub acdir/config.guess |
| 88 |
mkdir build-brltty |
| 89 |
cd build-brltty && \ |
| 90 |
../configure --disable-python-bindings \ |
| 91 |
$(CONFIGURE_OPTIONS) \ |
| 92 |
$(DEB_CONFIGURE_OPTIONS) |
| 93 |
|
| 94 |
config-python: $(PYVERS:%=build-py%/config.status) |
| 95 |
build-py%/config.status: configure acdir/config.sub acdir/config.guess |
| 96 |
mkdir -p build-py$* |
| 97 |
cd build-py$* && \ |
| 98 |
PYTHON=/usr/bin/python$* \ |
| 99 |
$(PYTHON_CROSS_ENV) \ |
| 100 |
../configure \ |
| 101 |
$(CONFIGURE_OPTIONS) \ |
| 102 |
$(DEB_CONFIGURE_OPTIONS) |
| 103 |
|
| 104 |
config-udeb: build-brltty-udeb/config.status |
| 105 |
build-brltty-udeb/config.status: configure acdir/config.sub acdir/config.guess |
| 106 |
mkdir build-brltty-udeb |
| 107 |
cd build-brltty-udeb && \ |
| 108 |
CFLAGS="$(CFLAGS) $(UDEB_CFLAGS)" \ |
| 109 |
LDFLAGS="$(LDFLAGS) $(UDEB_LDFLAGS)" \ |
| 110 |
../configure \ |
| 111 |
$(CONFIGURE_OPTIONS) \ |
| 112 |
$(UDEB_CONFIGURE_OPTIONS) |
| 113 |
|
| 114 |
build-arch: build-brltty $(if $(with_udeb),build-udeb) |
| 115 |
build-indep: build-arch build-python |
| 116 |
build: build-indep build-arch |
| 117 |
|
| 118 |
build-brltty: build-stamp |
| 119 |
build-stamp: config |
| 120 |
dh_testdir |
| 121 |
|
| 122 |
$(MAKE) -C build-brltty |
| 123 |
$(MAKE) -C build-brltty/Documents |
| 124 |
|
| 125 |
|
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
sed --in-place -e \ |
| 130 |
"s/\(.TH.* 3 \"\).*\(\" \"Version .*\)/\1$$(LC_ALL=C TZ=UTC date --date=@$(SOURCE_DATE_EPOCH) +'%a %b %d %Y')\2/" \ |
| 131 |
build-brltty/Documents/BrlAPIref/man/man3/* |
| 132 |
|
| 133 |
|
| 134 |
|
| 135 |
|
| 136 |
find build-brltty -name '*.html' -exec sed --in-place -e \ |
| 137 |
's/\(<META NAME="GENERATOR" CONTENT="LinuxDoc-Tools\)[^>]*>/\1">/' \ |
| 138 |
{} + |
| 139 |
|
| 140 |
touch $@ |
| 141 |
|
| 142 |
build-python: config-python $(PYVERS:%=build-py%-stamp) |
| 143 |
build-py%-stamp: config-python |
| 144 |
dh_testdir |
| 145 |
|
| 146 |
|
| 147 |
@echo blhc: ignore-line-regexp: .*Bindings/Python.* |
| 148 |
$(PYTHON_CROSS_ENV) $(MAKE) -C build-py$*/Bindings/Python V=1 |
| 149 |
|
| 150 |
touch $@ |
| 151 |
|
| 152 |
build-udeb: build-udeb-stamp |
| 153 |
build-udeb-stamp: config-udeb |
| 154 |
dh_testdir |
| 155 |
|
| 156 |
$(MAKE) -C build-brltty-udeb |
| 157 |
|
| 158 |
touch $@ |
| 159 |
|
| 160 |
|
| 161 |
binary-indep: brltty |
| 162 |
|
| 163 |
|
| 164 |
binary-arch: brltty $(if $(with_udeb),brltty-udeb) |
| 165 |
|
| 166 |
brltty: build-brltty build-python |
| 167 |
dh_testdir |
| 168 |
dh_testroot |
| 169 |
dh_prep |
| 170 |
dh_installdirs |
| 171 |
|
| 172 |
$(MAKE) -C build-brltty install install-messages install-appstream install-polkit INSTALL_ROOT=`pwd`/debian/tmp |
| 173 |
set -e ; for pyver in $(PYVERS); do \ |
| 174 |
$(PYTHON_CROSS_ENV) $(MAKE) -C build-py$$pyver/Bindings/Python install INSTALL_ROOT=`pwd`/debian/tmp V=1 ; \ |
| 175 |
done |
| 176 |
|
| 177 |
mkdir -p `pwd`/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH) |
| 178 |
mv `pwd`/debian/tmp/usr/lib/libbrlapi* `pwd`/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH) |
| 179 |
mv `pwd`/debian/tmp/usr/lib/pkgconfig `pwd`/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH) |
| 180 |
test -f `pwd`/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libbrlapi.so.$(BRLAPI_VERSION) |
| 181 |
sed -e 's/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/' < debian/initramfs/hooks/brltty.in > debian/initramfs/hooks/brltty |
| 182 |
|
| 183 |
rm -fr build-brltty/Bindings/Java/doc/jquery |
| 184 |
dh_install |
| 185 |
chmod +x debian/$@/usr/share/initramfs-tools/hooks/brltty |
| 186 |
chmod +x debian/$@/etc/brltty/Contraction/latex-access.ctb |
| 187 |
dh_installdocs |
| 188 |
dh_installexamples -p$@ |
| 189 |
for file in Drivers/Braille/*/README*; \ |
| 190 |
do cp $$file `pwd`/debian/$(PACKAGE)/usr/share/doc/brltty/`basename $$(dirname $$file)`.`basename $$file`; \ |
| 191 |
done |
| 192 |
|
| 193 |
dh_installinit -p$@ -r -- start 25 S . |
| 194 |
|
| 195 |
dh_installsystemd -p$@ --restart-after-upgrade |
| 196 |
dh_installchangelogs Documents/ChangeLog |
| 197 |
dh_installman |
| 198 |
dh_lintian |
| 199 |
dh_python3 -ppython3-brlapi |
| 200 |
mv debian/brltty/usr/lib/brltty/libbrlttysfl.so \ |
| 201 |
debian/brltty-flite/usr/lib/brltty |
| 202 |
mv debian/brltty/usr/lib/brltty/libbrlttyssd.so \ |
| 203 |
debian/brltty-speechd/usr/lib/brltty |
| 204 |
mv debian/brltty/usr/lib/brltty/libbrlttyses.so \ |
| 205 |
debian/brltty-espeak/usr/lib/brltty |
| 206 |
mv debian/brltty/usr/lib/brltty/libbrlttysen.so \ |
| 207 |
debian/brltty-espeak/usr/lib/brltty |
| 208 |
mv debian/brltty/usr/lib/brltty/libbrlttybxw.so \ |
| 209 |
debian/brltty-x11/usr/lib/brltty |
| 210 |
mkdir -p debian/brltty-x11/etc/brltty/Input/xw |
| 211 |
mv debian/brltty/etc/brltty/Input/xw/all.txt \ |
| 212 |
debian/brltty-x11/etc/brltty/Input/xw |
| 213 |
mv debian/brltty/usr/share/doc/brltty/XWindow.README \ |
| 214 |
debian/brltty-x11/usr/share/doc/brltty-x11/ |
| 215 |
mv debian/brltty/usr/lib/brltty/libbrlttyxa2.so \ |
| 216 |
debian/brltty-x11/usr/lib/brltty |
| 217 |
ifneq ($(DISABLE_JAVA_SUPPORT),1) |
| 218 |
mv debian/tmp/usr/share/java/brlapi.jar \ |
| 219 |
debian/libbrlapi-java/usr/share/java |
| 220 |
chmod 0644 debian/libbrlapi-java/usr/share/java/brlapi.jar |
| 221 |
endif |
| 222 |
cp build-brltty/Documents/brltty.conf debian/brltty/etc/brltty.conf |
| 223 |
dh_link -p$@ -plibbrlapi$(BRLAPI_VERSION) -plibbrlapi-dev |
| 224 |
dh_strip_nondeterminism -a -i -Nbrltty-udeb |
| 225 |
dh_strip -a |
| 226 |
dh_compress |
| 227 |
dh_fixperms -X /var/lib/BrlAPI |
| 228 |
dh_missing -a |
| 229 |
dh_makeshlibs -n -p$@ |
| 230 |
dh_makeshlibs -a -Nbrltty-udeb |
| 231 |
dh_installdeb -a -i -Nbrltty-udeb |
| 232 |
dh_shlibdeps -a -Nbrltty-udeb |
| 233 |
dh_gencontrol -a -i -Nbrltty-udeb |
| 234 |
dh_md5sums -a -i -Nbrltty-udeb |
| 235 |
dh_builddeb -a -i -Nbrltty-udeb |
| 236 |
|
| 237 |
brltty-udeb: build-udeb |
| 238 |
dh_testdir |
| 239 |
dh_testroot |
| 240 |
dh_installdirs -pbrltty-udeb |
| 241 |
|
| 242 |
$(MAKE) -C build-brltty-udeb install INSTALL_ROOT=`pwd`/debian/brltty-udeb |
| 243 |
|
| 244 |
|
| 245 |
rm -Rf debian/brltty-udeb/usr/share |
| 246 |
rm -Rf debian/brltty-udeb/usr/include |
| 247 |
rm -Rf debian/brltty-udeb/usr/lib/pkgconfig |
| 248 |
|
| 249 |
cp debian/brltty-udeb.prebaseconfig debian/brltty-udeb/usr/lib/finish-install.d/07brltty |
| 250 |
chmod 0755 debian/brltty-udeb/usr/lib/finish-install.d/07brltty |
| 251 |
cp debian/brltty-udeb.start debian/brltty-udeb/usr/lib/debian-installer.d/S19brltty |
| 252 |
rm -f debian/brltty-udeb/usr/bin/brltty-* |
| 253 |
rm -Rf debian/brltty-udeb/usr/share |
| 254 |
|
| 255 |
cd debian/brltty-udeb/etc/brltty && \ |
| 256 |
for file in */*.tt? */*.at? */*.ktb */*/*.ktb ; do \ |
| 257 |
sed -e 's/ *#.*//' -e 's/[ ]\+/ /g' $$file | sed -n '/./p' > $$file.tmp && \ |
| 258 |
mv $$file.tmp $$file; \ |
| 259 |
done |
| 260 |
rm debian/brltty-udeb/etc/brltty/Contraction/latex-access.ctb |
| 261 |
|
| 262 |
|
| 263 |
rm debian/brltty-udeb/etc/brltty/Input/*/*.txt |
| 264 |
|
| 265 |
cp debian/brltty-udeb.init debian/$@/usr/lib/debian-installer-startup.d/S37brltty |
| 266 |
chmod +x debian/$@/usr/lib/debian-installer-startup.d/S37brltty |
| 267 |
cp debian/brltty-udeb.udev.rules debian/$@/usr/lib/udev/rules.d/brltty.rules |
| 268 |
cp debian/brltty-udeb.udev.sh debian/$@/usr/lib/udev/brltty.sh |
| 269 |
chmod +x debian/$@/usr/lib/udev/brltty.sh |
| 270 |
cp debian/brltty-udeb.sh debian/$@/usr/lib/brltty/brltty.sh |
| 271 |
chmod +x debian/$@/usr/lib/brltty/brltty.sh |
| 272 |
mkdir -p debian/$@/usr/share/brltty-udeb |
| 273 |
cp debian/mate-preseed.cfg debian/$@/usr/share/brltty-udeb/mate-preseed.cfg |
| 274 |
|
| 275 |
dh_installdebconf -p$@ |
| 276 |
|
| 277 |
dh_strip_nondeterminism -p$@ |
| 278 |
dh_strip -p$@ |
| 279 |
dh_fixperms -p$@ |
| 280 |
dh_installdeb -p$@ |
| 281 |
dh_shlibdeps -p$@ |
| 282 |
dh_gencontrol -p$@ |
| 283 |
|
| 284 |
|
| 285 |
grep Depends: debian/brltty-udeb/DEBIAN/control | perl -ne 'map {unless (/-udeb/ or /^ ?preseed-common$$/) {print $$_; exit 1}} split /,/' |
| 286 |
dh_builddeb -p$@ |
| 287 |
|
| 288 |
.PHONY: brltty brltty-udeb build build-indep build-arch build-brltty build-udeb clean binary-indep binary-arch binary |