- $(INSTALL) -D -o root -g root -m 0755 l2tpns $(bindir)/l2tpns
- $(INSTALL) -D -o root -g root -m 0755 nsctl $(bindir)/nsctl
- $(INSTALL) -D -o root -g root -m 0600 etc/l2tpns.cfg.default $(etcdir)/l2tpns.cfg
- $(INSTALL) -D -o root -g root -m 0644 etc/ip_pool.default $(etcdir)/l2tpns.ip_pool
- $(INSTALL) -D -o root -g root -m 0600 etc/users.default $(etcdir)/l2tpns.users
- for PLUGIN in $(PLUGINS); do \
- $(INSTALL) -D -o root -g root -m 0755 $(PLUGIN) $(libdir)/$(PLUGIN); \
+ $(INSTALL) -m 0755 l2tpns $(DESTDIR)$(bindir)/l2tpns
+ $(INSTALL) -m 0755 nsctl $(DESTDIR)$(bindir)/nsctl
+
+ $(INSTALL) -m 0644 Docs/startup-config.5 $(DESTDIR)$(man5dir)/startup-config.5
+ $(INSTALL) -m 0644 Docs/l2tpns.8 $(DESTDIR)$(man8dir)/l2tpns.8
+ $(INSTALL) -m 0644 Docs/nsctl.8 $(DESTDIR)$(man8dir)/nsctl.8
+
+ gzip --best --force $(DESTDIR)$(man5dir)/*.5 $(DESTDIR)$(man8dir)/*.8
+
+ @for config in startup-config users ip_pool; \
+ do \
+ suffix=; \
+ mode=0600; [ $$config = ip_pool ] && mode=0644; \
+ if [ -f $(DESTDIR)$(etcdir)/$$config ]; \
+ then \
+ cmp -s etc/$$config.default $(DESTDIR)$(etcdir)/$$config && continue; \
+ suffix=.default; \
+ fi; \
+ echo $(INSTALL) -m $$mode etc/$$config.default $(DESTDIR)$(etcdir)/$$config$$suffix; \
+ $(INSTALL) -m $$mode etc/$$config.default $(DESTDIR)$(etcdir)/$$config$$suffix; \
+ done
+
+ @for plugin in $(PLUGINS); \
+ do \
+ echo $(INSTALL) -m 0755 $$plugin $(DESTDIR)$(libdir)/$$plugin; \
+ $(INSTALL) -m 0755 $$plugin $(DESTDIR)$(libdir)/$$plugin; \