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