simonrob / email-oauth2-proxy

An IMAP/POP/SMTP proxy that transparently adds OAuth 2.0 authentication for email clients that don't support this method.
Apache License 2.0
804 stars 87 forks source link

Add a Makefile and systemd configuration files to install system-wide #132

Closed thiagomacieira closed 1 year ago

thiagomacieira commented 1 year ago

This will install by default to /usr/local, but you can override by running, for example: make prefix=/usr configdir=/etc

If you choose a prefix other than /usr or /usr/local, systemd won't find your files.

Some support is also there to install as a user service, with: make AS_USER=1

wtcline-intc commented 1 year ago

When I try to install I get the following error:

$ sudo make
[sudo] password for wtcline:
install -m 755 -d /usr/local/bin
install -m 755 -t /usr/local/bin emailproxy.py
install -m 755 -d /usr/local/etc/emailproxy
install -m 644 -t /usr/local/etc/emailproxy emailproxy.config
install -m 755 -d /usr/local/lib/systemd/system
bindir=/usr/local/bin configdir=/usr/local/etc; sed -e "s,@configdir@,$configdir,g" -e "s,@bindir@,$bindir,g" < emailproxy.service.in > /usr/local/lib/systemd/system/emailproxy.service
install -m 755 -d /usr/local/lib/sysusers.d
install -m 644 -t /usr/local/lib/sysusers.d sysusers.d/emailproxy.conf
install -m 755 -d 
install: missing file operand
Try 'install --help' for more information.
make: *** [Makefile:40: install-nm] Error 1

Looks like the install-nm target is trying to use nminstalldir but only nmdispatcherdir is defined. Changing the variable didn't help since the file it's trying to install, NetworkManager-dispatcher/emailproxy.sh, doesn't currently exist.

simonrob commented 1 year ago

Thanks for this contribution. I've been considering whether to merge, but have decided that, on balance, it is best not to add very platform-specific configurations such as this. Instead, I'll link to your branch as an example of how to achieve this.