rules 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. #!/usr/bin/make -f
  2. # Sample debian/rules that uses debhelper.
  3. # GNU copyright 1997 to 1999 by Joey Hess.
  4. # Uncomment this to turn on verbose mode.
  5. #export DH_VERBOSE=1
  6. # Get build platform info
  7. export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
  8. export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
  9. PATHPLAN_SONAME = 4
  10. GVC_SONAME = 6
  11. CDT_SONAME = 5
  12. GRAPH_SONAME = 5
  13. CGRAPH_SONAME = 6
  14. GVPR_SONAME = 2
  15. EXPR_SONAME = 4
  16. XDOT_SONAME = 4
  17. GRAPHVIZ_SONAME = 4
  18. PHP_EXTENSION_DIR = $(shell php-config5 --extension-dir)
  19. PHP_PACKAGE = $(CURDIR)/debian/libgv-php5
  20. LUA_VERSION = 5.1
  21. LUA_PACKAGE = $(CURDIR)/debian/libgv-lua
  22. PYTHON_VERSION = $(shell python3 --version 2>&1 | sed 's/.* \(.*\)\..*/python\1/')
  23. PYTHON_PACKAGE = $(CURDIR)/debian/libgv-python
  24. RUBY_PACKAGE = $(CURDIR)/debian/libgv-ruby
  25. CONFIG_SCRIPTS=config/config.guess libltdl/config.guess \
  26. config/config.sub libltdl/config.sub
  27. configure: configure-stamp
  28. configure-stamp:
  29. dh_testdir
  30. # Update the config scripts
  31. for i in $(CONFIG_SCRIPTS); do \
  32. cp /usr/share/misc/`basename $$i` $$i ; \
  33. done
  34. # Configure the package
  35. ./configure --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) \
  36. --prefix=/usr \
  37. --datadir=\$${prefix}/share \
  38. --infodir=\$${prefix}/share/info \
  39. --mandir=\$${prefix}/share/man \
  40. --disable-static \
  41. --with-pangocairo \
  42. --with-x \
  43. --with-gdk \
  44. --with-ghostscript \
  45. --with-gtk \
  46. --with-gtkgl \
  47. --with-gtkglext \
  48. --with-glade \
  49. --with-ipsepcola \
  50. --with-lasi \
  51. --with-rsvg \
  52. --with-devil \
  53. --with-gts \
  54. --with-ortho \
  55. --with-sfdp \
  56. --with-smyrna \
  57. --disable-sharp \
  58. --enable-guile \
  59. --disable-java \
  60. --enable-lua \
  61. --enable-php \
  62. --enable-python \
  63. --disable-r \
  64. --enable-ruby \
  65. --enable-tcl \
  66. LDFLAGS="-Wl,--as-needed"
  67. touch configure-stamp
  68. build: configure build-stamp
  69. build-stamp:
  70. dh_testdir
  71. # Build
  72. $(MAKE)
  73. touch build-stamp
  74. clean: clean-patched
  75. clean-patched:
  76. dh_testdir
  77. dh_testroot
  78. rm -f build-stamp configure-stamp
  79. # Clean up if a build already happened
  80. [ ! -f Makefile ] || $(MAKE) distclean
  81. dh_clean $(CONFIG_SCRIPTS) \
  82. tclpkg/gv/gv.R tclpkg/gv/php_gv.h
  83. install: build
  84. dh_testdir
  85. dh_testroot
  86. dh_prep
  87. dh_installdirs
  88. # Install the package into debian/tmp
  89. $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
  90. # Remove .la files
  91. find -name '*.la' -delete
  92. # Install lintian overrides
  93. install -d $(CURDIR)/debian/tmp/usr/share/lintian/overrides
  94. install -m 644 $(CURDIR)/debian/libgraphviz$(GRAPHVIZ_SONAME).lintian-overrides \
  95. $(CURDIR)/debian/tmp/usr/share/lintian/overrides/libgraphviz$(GRAPHVIZ_SONAME)
  96. # Compute the dependencies of the -dev package
  97. # NOTE: It is important to do that before splitting the files into
  98. # their respective packages, otherwise the symlinks are broken
  99. d-devlibdeps \
  100. --override s/libpathplan$(PATHPLAN_SONAME)-dev// \
  101. --override s/libcgraph$(CGRAPH_SONAME)-dev// \
  102. --override s/libgraph$(GRAPH_SONAME)-dev// \
  103. --override s/libxdot$(XDOT_SONAME)-dev// \
  104. --override s/libcdt$(CDT_SONAME)-dev// \
  105. --override s/libgvpr$(GVPR_SONAME)-dev// \
  106. --override s/libgvc$(GVC_SONAME)-dev// \
  107. --override s/libexpr$(EXPR_SONAME)-dev// \
  108. --override s/libgts-0.7-5-dev/libgts-dev/ \
  109. --override s/libexpat1-dev// \
  110. --override s/libltdl7-dev// \
  111. --override s/zlib1g-dev// \
  112. $(CURDIR)/debian/libgraphviz-dev.substvars \
  113. $(CURDIR)/debian/tmp/usr/lib/*.so
  114. # Move from debian/tmp to the appropriate packages, rename one binary
  115. dh_install --sourcedir=debian/tmp --list-missing
  116. mv $(CURDIR)/debian/libgraphviz$(GRAPHVIZ_SONAME)/usr/sbin/dot \
  117. $(CURDIR)/debian/libgraphviz$(GRAPHVIZ_SONAME)/usr/sbin/libgraphviz$(GRAPHVIZ_SONAME)-config-update
  118. # Some additional work for libgv-php5
  119. install -d $(PHP_PACKAGE)/$(PHP_EXTENSION_DIR)
  120. mv $(PHP_PACKAGE)/usr/lib/graphviz/php/libgv_php.so* \
  121. $(PHP_PACKAGE)/$(PHP_EXTENSION_DIR)
  122. rm -rf $(PHP_PACKAGE)/usr/lib/graphviz
  123. # Some additional work for libgv-lua
  124. # 1. Rename using the LUA_VERSION
  125. mv $(LUA_PACKAGE)/usr/lib/graphviz/lua/libgv_lua.so \
  126. $(LUA_PACKAGE)/usr/lib/graphviz/lua/liblua$(LUA_VERSION)-libgv.so
  127. # 2. Add a symlink
  128. install -d $(LUA_PACKAGE)/usr/lib/lua/$(LUA_VERSION)
  129. ln -s /usr/lib/graphviz/lua/liblua$(LUA_VERSION)-libgv.so \
  130. $(LUA_PACKAGE)/usr/lib/lua/$(LUA_VERSION)/gv.so
  131. # Some additional work for libgv-python
  132. # Note gv.py isn't really duplicated, it's just installed in a location
  133. # where python-support will find it. Both being identical, python-support
  134. # will just do the right thing.
  135. install -d $(PYTHON_PACKAGE)/usr/lib/${PYTHON_VERSION}/site-packages
  136. cp $(PYTHON_PACKAGE)/usr/lib/graphviz/python3/gv.py \
  137. $(PYTHON_PACKAGE)/usr/lib/${PYTHON_VERSION}/site-packages
  138. mv $(PYTHON_PACKAGE)/usr/lib/graphviz/python3/*.so \
  139. $(PYTHON_PACKAGE)/usr/lib/${PYTHON_VERSION}/site-packages
  140. rm -rf $(PYTHON_PACKAGE)/usr/lib/graphviz
  141. # Some additional work for libgv-ruby
  142. install -d \
  143. $(RUBY_PACKAGE)/usr/lib/ruby/`ruby --version | cut -d' ' -f 2 | head -c 5`
  144. mv $(RUBY_PACKAGE)/usr/lib/graphviz/ruby/libgv_ruby.so \
  145. $(RUBY_PACKAGE)/usr/lib/ruby/`ruby --version | cut -d' ' -f 2 | head -c 5`/gv.so
  146. rm -rf $(RUBY_PACKAGE)/usr/lib/graphviz
  147. # Build architecture-independent files here.
  148. binary-indep: build install
  149. dh_testdir -i
  150. dh_testroot -i
  151. dh_installdocs -i
  152. dh_installmenu -i
  153. dh_installchangelogs CHANGELOG.md -i
  154. dh_perl -i
  155. dh_link -i
  156. dh_strip -i
  157. dh_compress -i -X.pdf
  158. dh_fixperms -i
  159. dh_makeshlibs -i
  160. dh_installdeb -i
  161. dh_shlibdeps -i
  162. dh_gencontrol -i
  163. dh_md5sums -i
  164. dh_builddeb -i
  165. # Build architecture-dependent files here.
  166. # Pass -a to all debhelper commands in this target to reduce clutter.
  167. binary-arch: build install
  168. dh_testdir -a
  169. dh_testroot -a
  170. dh_installdocs -a -XMakefile
  171. dh_installexamples -a
  172. dh_installmenu -a
  173. dh_installman -a
  174. dh_installchangelogs CHANGELOG.md -a
  175. dh_perl -a
  176. dh_link -a
  177. dh_strip -a
  178. dh_compress -a
  179. dh_fixperms -a
  180. dh_makeshlibs -plibgraphviz$(GRAPHVIZ_SONAME) -V 'libgraphviz4 (>= 2.18)'
  181. dh_installdeb -a
  182. dh_shlibdeps -a -L libgraphviz$(GRAPHVIZ_SONAME) $(CURDIR)/debian/libgraphviz$(GRAPHVIZ_SONAME)/usr/lib
  183. dh_gencontrol -a
  184. dh_md5sums -a
  185. dh_builddeb -a
  186. binary: binary-indep binary-arch
  187. .PHONY: build clean binary-indep binary-arch binary install configure