rules 3.71 KB
Newer Older
Albert Gräf's avatar
Albert Gräf committed
1 2 3 4 5 6
#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

7
nwjsver = 0.22.0
8 9 10 11 12 13 14 15
nwjspkg = nwjs-sdk-v$(nwjsver)-linux

ifeq ("$(shell dpkg-architecture -qDEB_HOST_ARCH)","amd64")
arch = x64
else
arch = ia32
endif

16 17 18 19 20 21 22
# Installation prefix. This must be something other than /usr if you want to
# install Purr Data alongside Pd-L2Ork. Note that some items such as desktop
# files and icons will still be installed under /usr so that the system finds
# them, but they will be renamed to prevent name clashes with files from the
# pd-l2ork package.
prefix = /opt/purr-data

Albert Gräf's avatar
Albert Gräf committed
23 24 25 26 27 28
%:
	dh $@

override_dh_auto_configure:

override_dh_auto_build:
29 30
# Copy the nw.js sources to where purr-data wants them.
	tar -xf debian/nwjs/$(nwjspkg)-$(arch).tar.gz && rm -rf pd/nw/nw && mv $(nwjspkg)-$(arch) pd/nw/nw
31
	cd l2ork_addons && (export inst_dir=$(prefix); ./tar_em_up.sh -B -n)
Albert Gräf's avatar
Albert Gräf committed
32 33

override_dh_auto_install:
34
	mkdir -p debian/purr-data && mv packages/linux_make/build/* debian/purr-data
35 36 37 38 39
# Create a link to the executable.
	mkdir -p debian/purr-data/usr/bin && ln -sf $(prefix)/bin/pd-l2ork debian/purr-data/usr/bin/purr-data
# Create links to the include and lib directories.
	mkdir -p debian/purr-data/usr/include && ln -sf $(prefix)/include/pd-l2ork debian/purr-data/usr/include/purr-data
	mkdir -p debian/purr-data/usr/lib && ln -sf $(prefix)/lib/pd-l2ork debian/purr-data/usr/lib/purr-data
40
# Remove some unneeded files.
41 42
	cd debian/purr-data/ && rm -rf Makefile README.txt etc usr/share/emacs
	cd debian/purr-data$(prefix)/lib/pd-l2ork/extra && rm -rf */*.pd_linux_o */*.la
43 44 45
# Add the bash completion file again, and edit it accordingly.
	mkdir -p debian/purr-data/etc/bash_completion.d
	sed -e 's/pd-l2ork/purr-data/g' < scripts/bash_completion/pd-l2ork > debian/purr-data/etc/bash_completion.d/purr-data
46 47 48 49 50 51 52
# Edit the library paths in the default user.settings file.
	cd debian/purr-data$(prefix)/lib/pd-l2ork && sed -e "s!/usr/lib/pd-l2ork!$(prefix)/lib/pd-l2ork!g" -i default.settings
# Replace the pd-l2ork desktop/mime files and icons with purr-data ones.
	cd debian/purr-data/usr/share/applications && (sed -e 's/pd-l2ork/purr-data/g' -e 's/Pd-L2Ork/Purr-Data/g' < pd-l2ork.desktop > purr-data.desktop) && (sed -e 's/pd-l2ork/purr-data/g' -e 's/Pd-L2Ork/Purr-Data/g' < pd-l2ork-debug.desktop > purr-data-debug.desktop) && rm -f pd-l2ork*.desktop
	cd debian/purr-data/usr/share/mime/packages && (sed -e 's/pd-l2ork/purr-data/g' < pd-l2ork.xml > purr-data.xml) && rm -f pd-l2ork.xml
	cd debian/purr-data/usr/share/icons/hicolor/128x128/apps/ && rm -f pd-l2ork-k12*.png && mv pd-l2ork.png purr-data.png && mv pd-l2ork-red.png purr-data-red.png
	cd debian/purr-data/usr/share/icons/hicolor/128x128/mimetypes/ && mv text-x-pd-l2ork.png text-x-purr-data.png
53
# Sanitize permissions.
54 55
	cd debian/purr-data && chmod -R go-w * && chmod -R a+r * && chmod a-x .$(prefix)/lib/pd-l2ork/default.settings
	find debian/purr-data$(prefix)/lib/pd-l2ork/bin/nw -executable -not -type d | xargs chmod a+x
56 57 58 59 60
	find debian/purr-data -executable -name '*.pd_linux' | xargs chmod a-x
	find debian/purr-data -executable -name '*.pd' | xargs chmod a-x
	find debian/purr-data -executable -name '*.txt' | xargs chmod a-x
	find debian/purr-data -executable -name '*.aif*' | xargs chmod a-x
	find debian/purr-data -type d | xargs chmod a+x
Albert Gräf's avatar
Albert Gräf committed
61

62 63 64 65
# NOTE: Older systems use dh_pysupport instead of dh_python2. See
# http://deb.li/dhs2p.
override_dh_python2:
	dh_python2 -n -Xxmlrpc-test.py
Albert Gräf's avatar
Albert Gräf committed
66 67 68 69

override_dh_compress:
	dh_compress -X.pd -X.wav -X.aiff -X.txt -X.md

70
override_dh_strip:
71
	dh_strip -Xbin/nw
72

73 74 75 76
# Supply some options to get rid of a gazillion of warnings about shared
# library files which are really externals.
override_dh_shlibdeps:
	dh_shlibdeps --dpkg-shlibdeps-params="--ignore-missing-info --warnings=0"