summaryrefslogtreecommitdiffstats
path: root/keygen/Makefile.am
blob: e77fe24ee92c5b3d6992760b75a504c244ee925d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

AM_CPPFLAGS = \
  -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \
  -DXRDP_SBIN_PATH=\"${sbindir}\" \
  -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \
  -DXRDP_PID_PATH=\"${localstatedir}/run\" \
  -I$(top_srcdir)/common

bin_PROGRAMS = \
  xrdp-keygen

xrdp_keygen_SOURCES = keygen.c

xrdp_keygen_LDADD = \
  $(top_builddir)/common/libcommon.la

xrdpsysconfdir = $(sysconfdir)/xrdp

install-data-hook:
	umask 077 && \
	  if [ ! -f $(DESTDIR)$(xrdpsysconfdir)/rsakeys.ini ]; then ./xrdp-keygen xrdp $(DESTDIR)$(xrdpsysconfdir)/rsakeys.ini; fi && \
	  if [ ! -f $(DESTDIR)$(xrdpsysconfdir)/cert.pem ]; then openssl req -x509 -newkey rsa:2048 -sha256 -nodes -keyout $(DESTDIR)$(xrdpsysconfdir)/key.pem -out $(DESTDIR)$(xrdpsysconfdir)/cert.pem -days 365 -subj /C=US/ST=CA/L=Sunnyvale/O=xrdp/CN=www.xrdp.org; fi

uninstall-hook:
	rm -f $(DESTDIR)$(xrdpsysconfdir)/rsakeys.ini