Makefile.am 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. # Solaris packages automake file
  2. # $Id$
  3. # XXX This file uses GNU make extensions.
  4. .PHONY: packages
  5. # the names of the various subpackages, and some convenient
  6. # derived variables.
  7. pkg_names = daemons dev doc libs smf
  8. pkg_quagga_daemons = zebra bgpd ospfd ospf6d ripd ripngd
  9. pkg_name_rev = @PACKAGE_VERSION@-@CONFDATE@-@target_os@-@target_cpu@
  10. pkg_depends = $(pkg_names:%=depend.%)
  11. pkg_packages = $(pkg_names:%=@PACKAGE_TARNAME@-%-$(pkg_name_rev).pkg)
  12. pkg_pkginfos = $(pkg_names:%=pkginfo.%.full)
  13. pkg_prototypes = $(pkg_names:%=prototype.%)
  14. pkg_manifests = quagga.xml
  15. # pkgmk variable substitutions wont grok ${variable} in prototype
  16. # file, so we cant let autoconf generate the file sadly
  17. # wish automake would just provide a template for this
  18. edit = $(SED) \
  19. -e 's,@prefix\@,$(prefix),g' \
  20. -e 's,@exec_prefix,$(exec_prefix),g' \
  21. -e 's,@bindir\@,$(bindir),g' \
  22. -e 's,@sbindir\@,$(sbindir),g' \
  23. -e 's,@libexecdir\@,$(libexecdir),g' \
  24. -e 's,@datadir\@,$(datadir),g' \
  25. -e 's,@sysconfdir\@,$(sysconfdir),g' \
  26. -e 's,@sharedstatedir\@,$(sharedstatedir),g' \
  27. -e 's,@localstatedir\@,$(localstatedir),g' \
  28. -e 's,@libdir\@,$(libdir),g' \
  29. -e 's,@includedir\@,$(includedir),g' \
  30. -e 's,@infodir\@,$(infodir),g' \
  31. -e 's,@mandir\@,$(mandir),g' \
  32. -e 's,@enable_user\@,$(enable_user),g' \
  33. -e 's,@enable_group\@,$(enable_group),g' \
  34. -e 's,@enable_vty_group\@,$(enable_vty_group),g' \
  35. -e 's,@quagga_statedir\@,$(quagga_statedir),g' \
  36. -e 's,[@]PACKAGE_NAME[@],@PACKAGE_NAME@,g' \
  37. -e 's,[@]PACKAGE_TARNAME[@],@PACKAGE_TARNAME@,g' \
  38. -e 's,[@]PACKAGE_VERSION[@],@PACKAGE_VERSION@,g' \
  39. -e 's,[@]PACKAGE_BUGREPORT[@],@PACKAGE_BUGREPORT@,g' \
  40. -e 's,[@]CONFDATE[@],@CONFDATE@,g' \
  41. -e 's,[@]target_cpu[@],$(target_cpu),g' \
  42. -e 's,[@]target_host[@],$(target_host),g' \
  43. -e 's,[@]target_os[@],$(target_os),g'
  44. # common options for pkgmk
  45. pkg_make_vars = exec_prefix=@exec_prefix@ prefix=@prefix@ \
  46. builddir=@builddir@ srcdir=@srcdir@ \
  47. top_builddir=@top_builddir@ top_srcdir=@top_srcdir@ \
  48. abs_builddir=@abs_builddir@ abs_srcdir=@abs_srcdir@ \
  49. abs_top_builddir=@abs_top_builddir@ abs_top_srcdir=@abs_top_srcdir@
  50. # pkgmk: write the package to spool in build dir, to avoid root dependencies
  51. pkg_make = pkgmk -o -d @abs_builddir@ \
  52. -f $< DESTDIR="$(DESTDIR)/" $(pkg_make_vars)
  53. # pkgtrans: write a pkg file stream, shame we cant pipe directly to it from
  54. # pkgmk..
  55. pkg_trans = pkgtrans -s @abs_builddir@ "@abs_builddir@/$@"
  56. # pkgmk can only cope with a single pkginfo, cant 'stack' various
  57. # pkginfo template files and a package specific pkginfo file in the prototype
  58. # Create the package specific template here, and create the full pkginfo
  59. # by cating this and the common pkginfo.tmpl together.
  60. pkginfo.tmpl: $(srcdir)/pkginfo.tmpl.in Makefile
  61. rm -f $@
  62. $(edit) $< > $@
  63. pkginfo.%.tmpl: $(srcdir)/pkginfo.%.tmpl.in Makefile
  64. rm -f $@
  65. $(edit) $< > $@
  66. pkginfo.%.full: pkginfo.%.tmpl pkginfo.tmpl Makefile
  67. cat pkginfo.tmpl pkginfo.$*.tmpl > $@
  68. # use 'edit' above to transform prototype.in to pkgmk acceptable prototype
  69. prototype.%: $(srcdir)/prototype.%.in Makefile
  70. rm -f $@
  71. $(edit) $< > $@
  72. # use edit to construct the SMF manifest files
  73. %.xml: $(srcdir)/%.xml.in Makefile
  74. rm -f $@
  75. $(edit) $< > $@
  76. # use edit to construct the depend files
  77. depend.%: $(srcdir)/depend.%.in Makefile
  78. rm -f $@
  79. $(edit) $< > $@
  80. # method file (bit like init script)
  81. quagga.init: $(srcdir)/quagga.init.in Makefile
  82. rm -f $@
  83. $(edit) $< > $@
  84. # construct the pkg
  85. @PACKAGE_TARNAME@-%-$(pkg_name_rev).pkg: prototype.% \
  86. depend.% quagga.init pkginfo.%.full
  87. ($(pkg_make) && \
  88. $(pkg_trans) "QUAGGA$*")
  89. %.pkg.gz : %.pkg
  90. (gzip -c $< > $@)
  91. # pkginfo.package and prototype.package are all built sources
  92. #BUILT_SOURCES = pkginfo.daemons pkginfo.dev pkginfo.doc pkginfo.libs \
  93. # prototype.daemons prototype.dev prototype.doc prototype.libs
  94. BUILT_SOURCES = $(pkg_pkginfos) pkginfo.tmpl $(pkg_prototypes) \
  95. $(pkg_manifests) $(pkg_depends) quagga.init
  96. CLEANFILES = $(BUILT_SOURCES) $(pkg_packages)
  97. EXTRA_DIST = $(pkg_manifests:%=%.in) $(pkg_prototypes:%=%.in) \
  98. $(pkg_names:%=pkginfo.%.tmpl.in) $(srcdir)/pkginfo.tmpl.in \
  99. $(pkg_depends:%=%.in) quagga.init.in README.txt
  100. pkg-root-install:
  101. (cd $(top_builddir) && \
  102. $(MAKE) DESTDIR=$(abs_builddir)/quagga-root install)
  103. packages: $(pkg_packages)
  104. #nodist_pkgdata_DATA = $(pkg_packages)