aboutsummaryrefslogblamecommitdiffstats
path: root/xorg-server/Makefile
blob: a4b433b3d36589e5cd730107d55ed51e501f12a1 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
       

                                                            








                                                                                                  


                                                                                   




                                                             
                                










                                                                                                             
                                                               


                                                                                 

          

                                               
                                        
                                       
                                       

                                       
 

                           
.POSIX:

XKBDBIND_GIT_HASH = 2ab5473fc48d91ecce1f11c49e5decdcf821e3d4

install:
	if test -L ~/.config/backgrounds; then \
		test "$$(readlink -- ~/.config/backgrounds)" = ~/.dotfiles/.secrets/backgrounds; \
	else \
		test ! -e ~/.config/backgrounds && \
		ln -sf -- ~/.dotfiles/.secrets/backgrounds ~/.config/backgrounds; \
	fi
	mkdir -p -- ../.secrets/backgrounds
	if test ! -L ~/.config/background && test ! -e ~/.config/background; then \
		ln -s backgrounds/default ~/.config/background; \
	fi
	../check-installed-shebang setkeys
	../check-in-path sponge
	../check-any-installed asroot asroot-libpassphrase
	../check-any-installed xorg-setxkbmap x11-xkb-utils
	../check-any-installed xorg-xmodmap x11-xserver-utils
	mkdir -p -- ~/.local/bin
	test ! -e ~/.local/bin/setkeys || test -L ~/.local/bin/setkeys
	ln -sf -- ~/.dotfiles/xorg-server/setkeys ~/.local/bin/setkeys
	if test -d xkbdbind; then \
		if test -d xkbdbind/.git; then \
			if ! git log '--format=format:%H' | grep '^$(XKBDBIND_GIT_HASH)$$' >/dev/null; then \
				(cd -- xkbdbind && git pull) || :; \
			fi; \
		fi; \
	else \
		git clone 'git://git.maandree.se/xkbdbind' || cp -r /usr/src/xkbdbind/ .; \
	fi
	gpp -s '%%' < xkbdbind.config.h.gpp > xkbdbind/config.h
	cd xkbdbind && $(MAKE)
	test ! -e ~/.local/bin/xkbdbind || test -L ~/.local/bin/xkbdbind
	ln -sf -- ~/.dotfiles/xorg-server/xkbdbind/xkbdbind ~/.local/bin/xkbdbind

uninstall:
	+! ../check-installed xorg-server
	+! ../check-installed xserver-xorg-core
	-unlink -- ~/.config/backgrounds
	-unlink -- ~/.config/background
	-unlink -- ~/.local/bin/setkeys
	-unlink -- ~/.local/bin/xkdbind
	-rm -rf -- xkbdbind

clean:
	-rm -rf -- xkbdbind