Files
mars-smart/Makefile
2026-04-21 02:12:28 +02:00

52 lines
1.6 KiB
Makefile

include Makefile.rules
CGI_BINS=apply bindery control device doc general group listconfig logging logins menu printer security user volume
all:
( cd bin; make )
( cd etc; make )
for i in $(CGI_BINS); do \
./setshell $(BASH2_SHELL) < root/cgi-bin/$$i.in > root/cgi-bin/$$i; \
chmod 755 root/cgi-bin/$$i; \
done
clean:
( cd bin; make clean )
( cd etc; make clean )
for i in $(CGI_BINS); do \
rm -f root/cgi-bin/$$i; \
done
install: install-files install-config
install-files:
@echo "Installing files..."
install -d -g $(INSTALL_GROUP) -o root -m 755 $(DOC)
install -d -g $(INSTALL_GROUP) -o root -m 755 $(LIB)
$(DIRECTORY_COPY) forms $(LIB)/
chown -R root.$(INSTALL_GROUP) $(LIB)/forms
$(DIRECTORY_COPY) menus $(LIB)/
chown -R root.$(INSTALL_GROUP) $(LIB)/menus
mv doc `basename $(DOC)`
$(DIRECTORY_COPY) `basename $(DOC)` $(DOC)/..
mv `basename $(DOC)` doc
chown -R root.$(INSTALL_GROUP) $(DOC)/
$(DIRECTORY_COPY) root $(LIB)/
chown -R root.$(INSTALL_GROUP) $(LIB)/root
rm -f $(LIB)/root/cgi-bin/*.in
ln -s $(LIB)/etc/smart.conf $(LIB)/root/smart.conf
if ! [ -d $(LIB)/doc ]; then ln -s $(DOC) $(LIB)/doc; fi
( cd bin; make install )
( cd etc; make install )
install-config:
@echo "Adding SMArT to the inet daemon configuration files..."
echo -e '\n#SMArT MARS_NWE webconfig tool\n' >> /etc/inetd.conf
echo "smart stream tcp nowait root $(LIB)/webserve webserve" | sed -e 's/\\//g' >> /etc/inetd.conf
echo -e '\n#SMArT MARS_NWE webconfig tool\nsmart 902/tcp' >> /etc/services
@echo "Please send a HUP signal to inetd, using a command like this:"
@echo
@echo "killall -HUP inetd"