| 1 |
# well, a simpler makefile is hardly imaginable... |
| 2 |
|
| 3 |
# if destdir is set, debian package making is assumed |
| 4 |
# so we install relative to that and don't touch /usr/local |
| 5 |
# |
| 6 |
# if destdir is unset, we install into /usr/local: bin and the perl sitelib dir |
| 7 |
DESTDIR= |
| 8 |
|
| 9 |
ifneq "$(DESTDIR)" "" |
| 10 |
# the debian case |
| 11 |
PERLDIR:=$(DESTDIR)$(shell perl -MConfig -e 'print $$Config{vendorlib}') |
| 12 |
VERSION:=$(shell sed -n '1s/^.*(\(.*\)).*$$/\1/p' debian/changelog) |
| 13 |
PREFIX:=$(DESTDIR)/usr |
| 14 |
else |
| 15 |
# the non-debian case |
| 16 |
PERLDIR:=$(shell perl -MConfig -e 'print $$Config{sitelib}') |
| 17 |
VERSION:=$(shell git tag --sort=v:refname | tail -1 | cut -f 2 -d v) |
| 18 |
PREFIX:=/usr/local |
| 19 |
endif |
| 20 |
|
| 21 |
CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS) |
| 22 |
CFLAGS:=$(shell dpkg-buildflags --get CFLAGS) |
| 23 |
CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS) |
| 24 |
LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS) |
| 25 |
|
| 26 |
all: kuvert_submit |
| 27 |
|
| 28 |
clean: |
| 29 |
-rm -f kuvert_submit kuvert.tmp |
| 30 |
|
| 31 |
install: kuvert_submit kuvert |
| 32 |
# ensure all needed dirs are present |
| 33 |
install -d $(PREFIX)/bin $(PREFIX)/share/man/man1 $(PERLDIR)/Net/Server/Mail/ESMTP |
| 34 |
install kuvert_submit $(PREFIX)/bin |
| 35 |
# insert the version number |
| 36 |
sed 's/INSERT_VERSION/$(VERSION)/' kuvert > kuvert.tmp |
| 37 |
install kuvert.tmp $(PREFIX)/bin/kuvert |
| 38 |
-rm kuvert.tmp |
| 39 |
install plainAUTH.pm $(PERLDIR)/Net/Server/Mail/ESMTP/ |
| 40 |
pod2man --center="User Commands" -r Mail kuvert $(PREFIX)/share/man/man1/kuvert.1 |
| 41 |
pod2man --center="User Commands" -r Mail kuvert_submit.pod $(PREFIX)/share/man/man1/kuvert_submit.1 |
| 42 |
|