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