2 # OpenXPKI Deployment Makefile
4 # Written by Martin Bartosch for the OpenXPKI project 2006
5 # Copyright (c) 2006 by The OpenXPKI Project
8 VERGEN
= ..
/..
/tools
/vergen
10 SHELL
= [% shell.bash
%]
11 BINDIR
= [% dir.
bindir %]
12 MANDIR
= [% dir.
mandir %]
13 SYSCONFDIR
= [% dir.sysconfdir
%]
14 OPENXPKICONFDIR
= [% dir.openxpkiconfdir
%]
15 DATADIR
= [% dir.
datadir %]
16 LOCALEDIR
= [% dir.localedir
%]
17 # FIXME: where will the installpreifx be defined?
18 # FIXME: perhaps something like DESTDIR but inline of some config file?
19 INSTALLPREFIX
= [% dir.installprefix
%]
20 PERLLIB
= [% dir.perllib
%]
21 TEMPLATEDIR
= [% dir.templatedir
%]
22 STATEDIR
= [% dir.openxpkistatedir
%]
23 SESSIONDIR
= [% dir.openxpkisessiondir
%]
27 CFG
= .
/bin
/openxpki-metaconf
28 INSTALL
= /usr
/bin
/install
30 RUNUSER
= [% server.runuser
%]
31 RUNGROUP
= [% server.rungroup
%]
32 ADMUSER
= [% server.admuser
%]
33 ADMGROUP
= [% server.admgroup
%]
35 CONFIGFILE
= etc
/templates
/$(TEMPLATE
)/openxpki.conf
36 VERSION_FILE
= .
/VERSION
38 ###########################################################################
39 # no user serviceable parts below this line
44 bin
/openxpki-configure.in \
46 TOOLS_DST
= $(TOOLS_SRC
:.in
=)
48 TOOLS
= $(TOOLS_DST
) \
49 bin
/openxpki-metaconf \
51 TOOLS_MAN1
= $(TOOLS_SRC
:.in
=.1) \
52 bin
/openxpki-metaconf
.1 \
56 install: makedirs installtemplates installbin postinstallhelp
59 @
( if
[ -e
$(VERGEN
) ] ; then \
60 $(VERGEN
) --format version
> $(VERSION_FILE
); \
62 @
( if
[ ! -e
$(VERSION_FILE
) ] ; then \
63 echo
"Could not determine version" ; \
67 readversion
: writeversion
68 VERSION
=$(shell cat
$(VERSION_FILE
))
70 tools
: readversion
$(TOOLS
)
72 $(TOOLS_DST
): $(TOOLS_SRC
) $(CONFIGFILE
)
73 for file in
$(TOOLS_DST
) ; do \
75 --config
$(CONFIGFILE
) \
76 --setcfg deployment.version
="$(VERSION)" \
77 --file
$$file.in
>$$file ;\
81 for PROG in
$(TOOLS
); do pod2man
$$PROG $$PROG.1; done
84 @echo Creating directories
85 @if
(test `uname` = "SunOS"); then \
86 /usr
/sbin
/install -u
$(ADMUSER
) -g
$(ADMGROUP
) -m
0755 -d
$(DESTDIR
)$(INSTALLPREFIX
)$(BINDIR
); \
87 /usr
/sbin
/install -u
$(ADMUSER
) -g
$(ADMGROUP
) -m
0755 -d
$(DESTDIR
)$(INSTALLPREFIX
)$(MANDIR
)/man1
; \
88 /usr
/sbin
/install -u
$(RUNUSER
) -g
$(RUNGROUP
) -m
0755 -d
$(DESTDIR
)$(INSTALLPREFIX
)$(TEMPLATEDIR
); \
89 /usr
/sbin
/install -u
$(ADMUSER
) -g
$(ADMGROUP
) -m
0755 -d
$(DESTDIR
)$(INSTALLPREFIX
)$(LOCALEDIR
); \
91 $(INSTALL
) -o
$(ADMUSER
) -g
$(ADMGROUP
) -m
0755 -d
$(DESTDIR
)$(INSTALLPREFIX
)$(BINDIR
); \
92 $(INSTALL
) -o
$(ADMUSER
) -g
$(ADMGROUP
) -m
0755 -d
$(DESTDIR
)$(INSTALLPREFIX
)$(MANDIR
)/man1
; \
93 $(INSTALL
) -o
$(RUNUSER
) -g
$(RUNGROUP
) -m
0755 -d
$(DESTDIR
)$(INSTALLPREFIX
)$(TEMPLATEDIR
); \
94 $(INSTALL
) -o
$(ADMUSER
) -g
$(ADMGROUP
) -m
0755 -d
$(DESTDIR
)$(INSTALLPREFIX
)$(LOCALEDIR
); \
98 @echo
"Installing binary files to $(DESTDIR)$(INSTALLPREFIX)$(BINDIR)"
99 @for file in
$(TOOLS
) ; do \
100 if
(test `uname` = "SunOS"); then \
101 /usr
/sbin
/install -u
$(ADMUSER
) -g
$(ADMGROUP
) -m
0755 -f
$(DESTDIR
)$(INSTALLPREFIX
)$(BINDIR
)/ $$file ;\
102 /usr
/sbin
/install -u
$(ADMUSER
) -g
$(ADMGROUP
) -m
0644 -f
$(DESTDIR
)$(INSTALLPREFIX
)$(MANDIR
)/man1
/ $$file.1 ;\
104 $(INSTALL
) -o
$(ADMUSER
) -g
$(ADMGROUP
) -m
0755 $$file $(DESTDIR
)$(INSTALLPREFIX
)$(BINDIR
)/ ;\
105 $(INSTALL
) -o
$(ADMUSER
) -g
$(ADMGROUP
) -m
0644 $$file.1 $(DESTDIR
)$(INSTALLPREFIX
)$(MANDIR
)/man1
/ ;\
110 @echo
"Installing template files to $(DESTDIR)$(INSTALLPREFIX)$(TEMPLATEDIR)"
113 ADMGROUP
=$(ADMGROUP
) \
114 TARGETDIR
=$(DESTDIR
)$(INSTALLPREFIX
)$(TEMPLATEDIR
) \
116 FILEINCLUDE
="(\.xml|\.conf|\.txt)$$" \
117 .
/bin
/installtemplates.sh
119 #FIXME: quickstart/openxpki.conf file, created by the "configure", is not removed by the next target
121 rm -f Makefile
$(TOOLS_DST
) $(TOOLS_MAN1
) $(CONFIGFILE
)
126 if
[ -d openxpki-deployment-
$(VERSION
) ] ; then \
127 rm -rf openxpki-deployment-
$(VERSION
)/ ; \
129 mkdir openxpki-deployment-
$(VERSION
)
132 --exclude
"Makefile" \
133 --exclude
"openxpki-deployment-*" \
137 tar -C openxpki-deployment-
$(VERSION
)/ -x
-f
-
138 find openxpki-deployment-
$(VERSION
) -name
"*.in" | \
139 sed
-e
's/\.in//g' | while read file
; do \
142 tar cf openxpki-deployment-
$(VERSION
).
tar openxpki-deployment-
$(VERSION
)
143 gzip
--best
--force openxpki-deployment-
$(VERSION
).
tar
144 rm -rf openxpki-deployment-
$(VERSION
)/
148 @echo
"OpenXPKI Deployment Tool"
151 @echo
"make - build OpenXPKI administrative environment"
152 @echo
"make install - install OpenXPKI administrative environment"
157 @echo
"Installation complete"
159 @echo
"You should now run the deployment tool to create a new OpenXPKI instance"
160 @echo
"in the default location $(OPENXPKICONFDIR):"
162 @echo
"openxpkiadm deploy"
166 @echo
"Installation summary:"
168 @echo
"Readonly file and directory ownership: $(ADMUSER):$(ADMGROUP)"
169 @echo
"OpenXPKI daemon runtime user: $(RUNUSER):$(RUNGROUP)"
171 @echo
"Installation directories:"
172 @echo
"Bindir: $(BINDIR)"
173 @echo
"OpenXPKI config directory: $(OPENXPKICONFDIR)"
174 @echo
"OpenXPKI templates: $(TEMPLATEDIR)"