Makefile
changeset 960 b4b2d30f6c97
parent 959 25d27dfee90e
child 961 d7b4c9d10b92
equal deleted inserted replaced
959:25d27dfee90e 960:b4b2d30f6c97
   104 
   104 
   105 ################################################################
   105 ################################################################
   106 # Install/uninstall targets.
   106 # Install/uninstall targets.
   107 
   107 
   108 .PHONY: install
   108 .PHONY: install
       
   109 .ONESHELL:
   109 install:
   110 install:
   110 	for item in $(OVERRIDDEN_ITEMS); do \
   111 	for item in $(OVERRIDDEN_ITEMS); do
   111 		if [[ -f $$item ]]; then \
   112 		if [[ -f $$item ]]; then
   112 			$(INSTALL_DATA) $$item $(HOME)/$$item; \
   113 			$(INSTALL_DATA) $$item $(HOME)/$$item
   113 		fi; \
   114 		fi
   114 		if [[ -d $$item ]]; then \
   115 		if [[ -d $$item ]]; then
   115 			for file in `find $$item`; do \
   116 			for file in `find $$item`; do
   116 				if [[ -d $$file ]]; then \
   117 				if [[ -d $$file ]]; then
   117 					mkdir -p $(HOME)/$$file; \
   118 					mkdir -p $(HOME)/$$file
   118 					continue; \
   119 					continue
   119 				fi; \
   120 				fi
   120 				$(INSTALL_DATA) $$file $(HOME)/$$file; \
   121 				$(INSTALL_DATA) $$file $(HOME)/$$file
   121 			done; \
   122 			done
   122 		fi; \
   123 		fi
   123 	done
   124 	done
   124 	chmod 700 ~/.gnupg/
   125 	chmod 700 ~/.gnupg/
   125 	chmod a+x ~/.fvwm/FvwmKbdd.pl ~/.fvwm/xinit
   126 	chmod a+x ~/.fvwm/FvwmKbdd.pl ~/.fvwm/xinit
   126 	command -v fvwm || exit 0; \
   127 	command -v fvwm || exit 0
   127 	for f in /etc/xdg/menus/*.menu; do \
   128 	for f in /etc/xdg/menus/*.menu; do
   128 		[[ -f "$$f" ]] || continue; \
   129 		[[ -f "$$f" ]] || continue
   129 		fname=$${f%.menu}; \
   130 		fname=$${f%.menu}
   130 		fname=$${fname##*/}; \
   131 		fname=$${fname##*/}
   131 		python .fvwm/xdg2fvwm.py Menu-$$fname $$f >~/.fvwm/$$fname.hook; \
   132 		python .fvwm/xdg2fvwm.py Menu-$$fname $$f >~/.fvwm/$$fname.hook
   132 		echo "Read $$[HOME]/.fvwm/$$fname.hook" >>~/.fvwm/config; \
   133 		echo "Read $$[HOME]/.fvwm/$$fname.hook" >>~/.fvwm/config
   133 		echo "AddToMenu MenuMyRoot $$fname Popup Menu-$$fname" >>~/.fvwm/config; \
   134 		echo "AddToMenu MenuMyRoot $$fname Popup Menu-$$fname" >>~/.fvwm/config
   134 	done
   135 	done
   135 	mkdir -p ~/.screenshot
   136 	mkdir -p ~/.screenshot
   136 	for item in $(IFNONEXIST_ITEMS); do \
   137 	for item in $(IFNONEXIST_ITEMS); do
   137 		if [[ -f $$item ]] && ! [[ -f $(HOME)/$$item ]]; then \
   138 		if [[ -f $$item ]] && ! [[ -f $(HOME)/$$item ]]; then
   138 			$(INSTALL_DATA) $$item $(HOME)/$$item; \
   139 			$(INSTALL_DATA) $$item $(HOME)/$$item
   139 		fi; \
   140 		fi
   140 		if [[ -d $$item ]]; then \
   141 		if [[ -d $$item ]]; then
   141 			for file in `find $$item`; do \
   142 			for file in `find $$item`; do
   142 				if [[ -d $$file ]]; then \
   143 				if [[ -d $$file ]]; then
   143 					mkdir -p $(HOME)/$$file; \
   144 					mkdir -p $(HOME)/$$file
   144 					continue; \
   145 					continue
   145 				fi; \
   146 				fi
   146 				if [[ ! -f $(HOME)/$$file ]]; then \
   147 				if [[ ! -f $(HOME)/$$file ]]; then
   147 					$(INSTALL_DATA) $$file $(HOME)/$$file; \
   148 					$(INSTALL_DATA) $$file $(HOME)/$$file
   148 				fi; \
   149 				fi
   149 			done; \
   150 			done
   150 		fi; \
   151 		fi
   151 	done
   152 	done
   152 	chmod a+x ~/.xinitrc ~/.xserverrc
   153 	chmod a+x ~/.xinitrc ~/.xserverrc
   153 	rm -f ~/.xsession
   154 	rm -f ~/.xsession
   154 	ln -s ~/.xinitrc ~/.xsession
   155 	ln -s ~/.xinitrc ~/.xsession
   155 	rm -f ~/.bash_profile
   156 	rm -f ~/.bash_profile
   156 	cp ~/.bashrc ~/.bash_profile
   157 	cp ~/.bashrc ~/.bash_profile
   157 	mkdir -p $(HOME)/.config/mc $(HOME)/.local/share/mc/; \
   158 	mkdir -p $(HOME)/.config/mc $(HOME)/.local/share/mc/
   158 	umask 0117; \
   159 	umask 0117
   159 	$(INSTALL_DATA) .local/share/mc/bashrc $(HOME)/.local/share/mc/; \
   160 	$(INSTALL_DATA) .local/share/mc/bashrc $(HOME)/.local/share/mc/
   160 	cat .config/mc/mc.ext /etc/mc/mc.ext > $(HOME)/.config/mc/mc.ext
   161 	cat .config/mc/mc.ext /etc/mc/mc.ext > $(HOME)/.config/mc/mc.ext
   161 ifneq '' '$(filter $(host_os),cygwin linux)'
   162 ifneq '' '$(filter $(host_os),cygwin linux)'
   162 	if command -v file 1>/dev/null; then \
   163 	if command -v file 1>/dev/null; then
   163 		$(INSTALL_DATA) .magic $(HOME); \
   164 		$(INSTALL_DATA) .magic $(HOME)
   164 		cd $(HOME); \
   165 		cd $(HOME)
   165 		file --compile -m .magic; \
   166 		file --compile -m .magic
   166 	fi
   167 	fi
   167 endif
   168 endif
   168 	mkdir -p $(HOME)/.local/share/applications/
   169 	mkdir -p $(HOME)/.local/share/applications/
   169 	$(INSTALL_DATA) .local/share/applications/mimeapps.list $(HOME)/.local/share/applications/
   170 	$(INSTALL_DATA) .local/share/applications/mimeapps.list $(HOME)/.local/share/applications/
   170 	sed -e 's=@CFG_FONT_SIZE@=$(CFG_FONT_SIZE)=' <.minttyrc >$(HOME)/.minttyrc
   171 	sed -e 's=@CFG_FONT_SIZE@=$(CFG_FONT_SIZE)=' <.minttyrc >$(HOME)/.minttyrc
   171 
   172 
   172 .PHONY: uninstall
   173 .PHONY: uninstall
       
   174 .ONESHELL:
   173 uninstall:
   175 uninstall:
   174 	for item in $(OVERRIDDEN_ITEMS); do \
   176 	for item in $(OVERRIDDEN_ITEMS); do
   175 		if [ -f $$item ]; then \
   177 		if [ -f $$item ]; then
   176 			[ -f $(HOME)/$$file ] && rm -f $(HOME)/$$item; \
   178 			[ -f $(HOME)/$$file ] && rm -f $(HOME)/$$item
   177 		fi; \
   179 		fi
   178 		if [ -d $$item ]; then \
   180 		if [ -d $$item ]; then
   179 			for file in `find $$item -depth`; do \
   181 			for file in `find $$item -depth`; do
   180 				if [ -d $$file ]; then \
   182 				if [ -d $$file ]; then
   181 					rmdir $(HOME)/$$file || :; \
   183 					rmdir $(HOME)/$$file || :
   182 					continue; \
   184 					continue
   183 				fi; \
   185 				fi
   184 				[ -f $(HOME)/$$file ] && rm $(HOME)/$$file; \
   186 				[ -f $(HOME)/$$file ] && rm $(HOME)/$$file
   185 			done; \
   187 			done
   186 		fi; \
   188 		fi
   187 	done
   189 	done
   188 	rm -f $(HOME)/.mc/bashrc $(HOME)/.mc/ini $(HOME)/.mc/bindings
   190 	rm -f $(HOME)/.mc/bashrc $(HOME)/.mc/ini $(HOME)/.mc/bindings
   189 	rmdir $(HOME)/.mc || :
   191 	rmdir $(HOME)/.mc || :
   190 
   192 
   191 ################################################################
   193 ################################################################