From: ellson Date: Mon, 25 Aug 2008 19:06:22 +0000 (+0000) Subject: first-cut ubuntu packaging from graphviz_2.16-3ubuntu2.diff.gz X-Git-Tag: LAST_LIBGRAPH~32^2~3556 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4e7a9007eaa402e334002fd3f93bf1cfc8658346;p=graphviz first-cut ubuntu packaging from graphviz_2.16-3ubuntu2.diff.gz --- diff --git a/debian/libgv-guile.install b/debian/libgv-guile.install new file mode 100644 index 000000000..fe442b5b5 --- /dev/null +++ b/debian/libgv-guile.install @@ -0,0 +1,2 @@ +usr/lib/graphviz/guile/libgv_guile.so +usr/share/man/man3/gv_guile.3 diff --git a/debian/libgv-lua.install b/debian/libgv-lua.install new file mode 100644 index 000000000..f8863646b --- /dev/null +++ b/debian/libgv-lua.install @@ -0,0 +1,2 @@ +usr/lib/graphviz/lua/libgv_lua.so +usr/share/man/man3/gv_lua.3 diff --git a/debian/libgv-ocaml.install b/debian/libgv-ocaml.install new file mode 100644 index 000000000..0a91cb415 --- /dev/null +++ b/debian/libgv-ocaml.install @@ -0,0 +1,2 @@ +usr/lib/graphviz/ocaml +usr/share/man/man3/gv_ocaml.3 diff --git a/debian/libgv-perl.install b/debian/libgv-perl.install new file mode 100644 index 000000000..7f831ef36 --- /dev/null +++ b/debian/libgv-perl.install @@ -0,0 +1,4 @@ +usr/lib/graphviz/perl/gv.pm usr/lib/perl5 +usr/lib/graphviz/perl/gv.so usr/lib/perl5/auto/gv +usr/lib/graphviz/perl/libgv_perl.so usr/lib/perl5/auto/gv +usr/share/man/man3/gv_perl.3 diff --git a/debian/libgv-php5.install b/debian/libgv-php5.install new file mode 100644 index 000000000..f44e97e6e --- /dev/null +++ b/debian/libgv-php5.install @@ -0,0 +1,2 @@ +usr/lib/graphviz/php +usr/share/man/man3/gv_php.3 diff --git a/debian/libgv-python.install b/debian/libgv-python.install new file mode 100644 index 000000000..33a159af1 --- /dev/null +++ b/debian/libgv-python.install @@ -0,0 +1,2 @@ +usr/lib/graphviz/python +usr/share/man/man3/gv_python.3 diff --git a/debian/libgv-ruby.install b/debian/libgv-ruby.install new file mode 100644 index 000000000..cb301ee01 --- /dev/null +++ b/debian/libgv-ruby.install @@ -0,0 +1,2 @@ +usr/lib/graphviz/ruby/libgv_ruby.so +usr/share/man/man3/gv_ruby.3 diff --git a/debian/libgv-tcl.install b/debian/libgv-tcl.install new file mode 100644 index 000000000..fb1b7299a --- /dev/null +++ b/debian/libgv-tcl.install @@ -0,0 +1,6 @@ +usr/lib/graphviz/tcl +usr/lib/graphviz/pkgIndex.tcl +usr/share/man/man3/gv_tcl.3 +usr/share/man/man3/gdtclft.3 +usr/share/man/man3/tkspline.3 +usr/share/man/man3/tcldot.3 diff --git a/debian/rules b/debian/rules new file mode 100644 index 000000000..7505760e6 --- /dev/null +++ b/debian/rules @@ -0,0 +1,226 @@ +#!/usr/bin/make -f +# Sample debian/rules that uses debhelper. +# GNU copyright 1997 to 1999 by Joey Hess. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +include /usr/share/quilt/quilt.make + +# Get build platform info +export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) + +UPSTREAM_VERSION = $(shell dpkg-parsechangelog | perl -ne 'print $$1 if /^Version: (.*?)-(.*)$$/') +SONAME = 4 + +OCAMLABI = $(shell ocamlc -version) +OCAML_PACKAGE = $(CURDIR)/debian/libgv-ocaml + +PHP_EXTENSION_DIR = $(shell php-config5 --extension-dir) +PHP_PACKAGE = $(CURDIR)/debian/libgv-php5 + +LUA_VERSION = 5.1 +LUA_PACKAGE = $(CURDIR)/debian/libgv-lua + +DEV_PACKAGE = $(CURDIR)/debian/libgraphviz-dev + +PYTHON_VERSION = $(shell pyversions -d) +PYTHON_PACKAGE = $(CURDIR)/debian/libgv-python + +RUBY_VERSION = 1.8 +RUBY_PACKAGE = $(CURDIR)/debian/libgv-ruby + +CONFIG_SCRIPTS=config/config.guess lib/gd/config/config.guess libltdl/config.guess \ + config/config.sub lib/gd/config/config.sub libltdl/config.sub + +configure: patch configure-stamp +configure-stamp: + dh_testdir + + # Update the config scripts + for i in $(CONFIG_SCRIPTS); do \ + cp /usr/share/misc/`basename $$i` $$i ; \ + done + + # Configure the package + ./configure --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) \ + --prefix=/usr \ + --datadir=\$${prefix}/share \ + --infodir=\$${prefix}/share/info \ + --mandir=\$${prefix}/share/man \ + --disable-static \ + --with-pangocairo \ + --with-x \ + --without-gdk-pixbuf \ + --without-gnomeui \ + --without-gtk \ + --without-ipsepcola \ + --enable-guile \ + --enable-lua \ + --enable-ocaml \ + --enable-php \ + --enable-python \ + --enable-ruby \ + --enable-tcl \ + --disable-java \ + --disable-sharp \ + LDFLAGS="-Wl,--as-needed" + touch configure-stamp + +build: configure build-stamp +build-stamp: + dh_testdir + + # Build + $(MAKE) + touch build-stamp + +clean: clean-patched unpatch +clean-patched: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + + # Clean up if a build already happened + [ ! -f Makefile ] || $(MAKE) distclean + dh_clean $(CONFIG_SCRIPTS) + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Install the package into debian/tmp + $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp + + # Don't install diffimg, see NEWS.Debian + rm $(CURDIR)/debian/tmp/usr/bin/diffimg + + # Install lintian overrides + install -d $(CURDIR)/debian/tmp/usr/share/lintian/overrides + install -m 644 $(CURDIR)/debian/libgraphviz$(SONAME).lintian-overrides \ + $(CURDIR)/debian/tmp/usr/share/lintian/overrides/libgraphviz$(SONAME) + + # Rename manpages: s/.n$/.3/ + for i in $(CURDIR)/debian/tmp/usr/share/man/mann/*.n ; do \ + mv $$i $${i%%.n}.3; \ + done + + # Move manpages + install -d $(CURDIR)/debian/tmp/usr/share/man/man3 + find $(CURDIR)/debian/tmp/usr/share/man/mann -name '*.3' \ + -exec mv {} $(CURDIR)/debian/tmp/usr/share/man/man3 ';' + + # Compute the dependencies of the -dev package + # NOTE: It is important to do that before splitting the files into + # their respective packages, otherwise the symlinks are broken + d-devlibdeps \ + --override s/libpathplan$(SONAME)-dev// \ + --override s/libgraph$(SONAME)-dev// \ + --override s/libcdt$(SONAME)-dev// \ + $(CURDIR)/debian/libgraphviz-dev.substvars \ + $(CURDIR)/debian/tmp/usr/lib/*.so + + # Move from debian/tmp to the appropriate packages, rename one binary + dh_install --sourcedir=debian/tmp --list-missing + mv $(CURDIR)/debian/libgraphviz$(SONAME)/usr/sbin/dot \ + $(CURDIR)/debian/libgraphviz$(SONAME)/usr/sbin/libgraphviz$(SONAME)-config-update + + # Some additional work for libgv-php5 + install -d $(PHP_PACKAGE)/$(PHP_EXTENSION_DIR) + mv $(PHP_PACKAGE)/usr/lib/graphviz/php/libgv_php.so* \ + $(PHP_PACKAGE)/$(PHP_EXTENSION_DIR) + rm -rf $(PHP_PACKAGE)/usr/lib/graphviz + + # Some additional work for libgv-lua + # 1. Rename using the LUA_VERSION + mv $(LUA_PACKAGE)/usr/lib/graphviz/lua/libgv_lua.so \ + $(LUA_PACKAGE)/usr/lib/graphviz/lua/liblua$(LUA_VERSION)-libgv.so + # 2. Add a symlink + install -d $(LUA_PACKAGE)/usr/lib/lua/$(LUA_VERSION) + ln -s /usr/lib/graphviz/lua/liblua$(LUA_VERSION)-libgv.so \ + $(LUA_PACKAGE)/usr/lib/lua/$(LUA_VERSION)/gv.so + + # Some additional work for libgv-ocaml + # 1. Move the shared object to the stublibs directory + install -d $(OCAML_PACKAGE)/usr/lib/ocaml/$(OCAMLABI)/stublibs + mv $(OCAML_PACKAGE)/usr/lib/graphviz/ocaml/libgv_ocaml.so \ + $(OCAML_PACKAGE)/usr/lib/ocaml/$(OCAMLABI)/stublibs/dllgv.so + # 2. Move the devel files where they belong + install -d $(DEV_PACKAGE)/usr/lib/ocaml/$(OCAMLABI)/gv + mv $(OCAML_PACKAGE)/usr/lib/graphviz/ocaml/*.ml* \ + $(DEV_PACKAGE)/usr/lib/ocaml/$(OCAMLABI)/gv + # 3. Trash the (almost empty) directory (and its .la) + rm -rf $(OCAML_PACKAGE)/usr/lib/graphviz + + # Some additional work for libgv-python + install -d $(PYTHON_PACKAGE)/usr/lib/$(PYTHON_VERSION)/site-packages + mv $(PYTHON_PACKAGE)/usr/lib/graphviz/python/*.so \ + $(PYTHON_PACKAGE)/usr/lib/graphviz/python/*.py \ + $(PYTHON_PACKAGE)/usr/lib/$(PYTHON_VERSION)/site-packages + rm -rf $(PYTHON_PACKAGE)/usr/lib/graphviz + + # Debian-specific manpage + dh_installman -plibgraphviz$(SONAME) \ + $(CURDIR)/debian/libgraphviz$(SONAME)-config-update.1 + + # Some additional work for libgv-ruby + install -d $(RUBY_PACKAGE)/usr/lib/ruby/$(RUBY_VERSION) + mv $(RUBY_PACKAGE)/usr/lib/graphviz/ruby/libgv_ruby.so \ + $(RUBY_PACKAGE)/usr/lib/ruby/$(RUBY_VERSION)/gv.so + rm -rf $(RUBY_PACKAGE)/usr/lib/graphviz + + # Install additional ocaml files + install -d $(DEV_PACKAGE)/usr/lib/ocaml/$(OCAMLABI)/gv + cp debian/tmp/usr/lib/graphviz/ocaml/gv.cm* \ + $(DEV_PACKAGE)/usr/lib/ocaml/$(OCAMLABI)/gv + install -d $(DEV_PACKAGE)/usr/lib/ocaml/$(OCAMLABI)/METAS + mv debian/tmp/usr/lib/graphviz/ocaml/META.gv \ + $(DEV_PACKAGE)/usr/lib/ocaml/$(OCAMLABI)/METAS + +# Build architecture-independent files here. +binary-indep: build install + dh_testdir -i + dh_testroot -i + dh_installdocs -i + dh_installmenu -i + dh_installchangelogs ChangeLog -i + dh_perl -i + dh_link -i + dh_strip -i + dh_compress -i -X.pdf + dh_fixperms -i + dh_makeshlibs -i + dh_installdeb -i + dh_shlibdeps -i + dh_gencontrol -i + dh_md5sums -i + dh_builddeb -i + +# Build architecture-dependent files here. +# Pass -a to all debhelper commands in this target to reduce clutter. +binary-arch: build install + dh_testdir -a + dh_testroot -a + dh_installdocs -a -XMakefile + dh_installexamples -a + dh_installmenu -a + dh_installman -a + dh_installchangelogs ChangeLog -a + dh_perl -a + dh_pysupport -a + dh_link -a + dh_strip -a + dh_compress -a + dh_fixperms -a + dh_makeshlibs -plibgraphviz$(SONAME) -V + dh_installdeb -a + dh_shlibdeps -a -L libgraphviz$(SONAME) $(CURDIR)/debian/libgraphviz$(SONAME)/usr/lib + dh_gencontrol -a -- -VF:OCamlABI="$(OCAMLABI)" + dh_md5sums -a + dh_builddeb -a + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure