diff options
| author | Wilmer van der Gaast <wilmer@gaast.net> | 2011-03-18 00:57:14 +0000 | 
|---|---|---|
| committer | Wilmer van der Gaast <wilmer@gaast.net> | 2011-03-18 00:57:14 +0000 | 
| commit | 417002e1714b97cc3073e3968ee0cee3181dc96c (patch) | |
| tree | cb48a2257695cab1f90bfbe40b340823d98e49ce | |
| parent | f68fd5f0a37883438a13b8043489543f01b78c35 (diff) | |
systemd stuff (bug #738)
| -rw-r--r-- | Makefile | 24 | ||||
| -rwxr-xr-x | configure | 19 | 
2 files changed, 40 insertions, 3 deletions
| @@ -26,18 +26,18 @@ endif  # Expansion of variables  subdirobjs = $(foreach dir,$(subdirs),$(dir)/$(dir).o) -all: $(OUTFILE) $(OTR_PI) +all: $(OUTFILE) $(OTR_PI) systemd  	$(MAKE) -C doc  uninstall: uninstall-bin uninstall-doc   	@echo -e '\nmake uninstall does not remove files in '$(DESTDIR)$(ETCDIR)', you can use make uninstall-etc to do that.\n' -install: install-bin install-doc install-plugins +install: install-bin install-doc install-plugins install-systemd  	@if ! [ -d $(DESTDIR)$(CONFIG) ]; then echo -e '\nThe configuration directory $(DESTDIR)$(CONFIG) does not exist yet, don'\''t forget to create it!'; fi  	@if ! [ -e $(DESTDIR)$(ETCDIR)/bitlbee.conf ]; then echo -e '\nNo files are installed in '$(DESTDIR)$(ETCDIR)' by make install. Run make install-etc to do that.'; fi  	@echo -.PHONY:   install   install-bin   install-etc   install-doc install-plugins \ +.PHONY:   install   install-bin   install-etc   install-doc install-plugins install-systemd \          uninstall uninstall-bin uninstall-etc uninstall-doc \          all clean distclean tar $(subdirs) @@ -109,6 +109,24 @@ ifdef OTR_PI  	install -m 0755 otr.so $(DESTDIR)$(PLUGINDIR)  endif +systemd: +ifdef SYSTEMDSYSTEMUNITDIR +	sed 's|@sbindir@|$(BINDIR)|' init/bitlbee.service.in > init/bitlbee.service +	sed 's|@sbindir@|$(BINDIR)|' init/bitlbee@.service.in > init/bitlbee@.service +endif + +install-systemd: +ifdef SYSTEMDSYSTEMUNITDIR +ifeq ($(USER),root) +	mkdir -p $(DESTDIR)$(SYSTEMDSYSTEMUNITDIR) +	install -m 0644 init/bitlbee.service $(DESTDIR)$(SYSTEMDSYSTEMUNITDIR) +	install -m 0644 init/bitlbee@.service $(DESTDIR)$(SYSTEMDSYSTEMUNITDIR) +	install -m 0644 init/bitlbee.socket $(DESTDIR)$(SYSTEMDSYSTEMUNITDIR) +else +	@echo Not root, so not installing systemd files. +endif +endif +  tar:  	fakeroot debian/rules clean || make distclean  	x=$$(basename $$(pwd)); \ @@ -15,6 +15,7 @@ datadir='$prefix/share/bitlbee/'  config='/var/lib/bitlbee/'  plugindir='$prefix/lib/bitlbee/'  includedir='$prefix/include/bitlbee/' +systemdsystemunitdir=''  libevent='/usr/'  pidfile='/var/run/bitlbee.pid'  ipcsocket='/var/run/bitlbee.sock' @@ -61,6 +62,7 @@ Option		Description				Default  --mandir=...						$mandir  --datadir=...						$datadir  --plugindir=...						$plugindir +--systemdsystemunitdir=...				$systemdsystemunitdir  --pidfile=...						$pidfile  --config=...						$config  --ipcsocket=...						$ipcsocket @@ -486,6 +488,17 @@ else  	fi;  fi +if [ -z "$systemdsystemunitdir" ]; then +	if $PKG_CONFIG --exists systemd; then +		systemdsystemunitdir=`$PKG_CONFIG --variable=systemdsystemunitdir systemd` +	fi +fi +if [ -n "$systemdsystemunitdir" ]; then +	if [ "$systemdsystemunitdir" != "no" ]; then +		echo "SYSTEMDSYSTEMUNITDIR=$systemdsystemunitdir" >> Makefile.settings +	fi +fi +  if [ "$gcov" = "1" ]; then  	echo "CFLAGS+=--coverage" >> Makefile.settings  	echo "EFLAGS+=--coverage" >> Makefile.settings @@ -726,6 +739,12 @@ else  	echo '  Off-the-Record (OTR) Messaging disabled.'  fi +if [ -n "$systemdsystemunitdir" ]; then +	echo '  systemd enabled.' +else +	echo '  systemd disabled.' +fi +  echo '  Using event handler: '$events  echo '  Using SSL library: '$ssl  #echo '  Building with these storage backends: '$STORAGES | 
