Makefile.am 4.2 KB

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