~strahinja/galeb-mkfiles

galeb-mkfiles/neomutt/mkfile -rw-r--r-- 1.8 KiB
9eba1b42Страхиња Радић Update TODO a day ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
mkpklib=/lib/mkpk
<$mkpklib/defaults.mk
<config.mk
<$mkpklib/derivatives.mk

PKG=		$PKGBASE-$PKGVER
BINDIR=		$PREFIX/bin
MANDIR=		$PREFIX/share/man
SYSCONFDIR=	/etc
LOCALSTATEDIR=	/var
MAILPATH=	$LOCALSTATEDIR/spool/mail
CFLAGS=		-Os -pipe -static --static -fcommon -fPIC
LDFLAGS=	-static --static -fcommon -zmuldefs -s

$PKGBASE:QV:
	for patch in $(find pat -type f -name '*.patch' | sort); do
		if [ -e $patch.applied ]; then
			continue
		fi
		printf "  PATCH\t%s\n" "$patch"
		patch -Np1 -i $patch || exit 1
		:>$patch.applied
	done
	printf "  CONF\t%s\n" --prefix=$PREFIX
	CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" \
	./configure --prefix=$PREFIX \
		--bindir=$BINDIR \
		--mandir=$MANDIR \
		--gpgme \
		--ssl \
		--sasl \
		--notmuch \
		--disable-idn \
		--pcre2 \
		--with-mailpath=$MAILPATH
	cp Makefile Makefile~
	sed -e "/^LIBS *=/s,\$, ./libconn.a -lnotmuch -lnotmuch_util \
	-lparse-time-string ""$(
		pkg-config --libs --static xapian-core) ""$(
		pkg-config --libs --static libsasl2) ""$(
		pkg-config --libs --static gpgme) ""$(
		pkg-config --libs --static libssl) ""$(
		pkg-config --libs --static gmime-3.0) "" -lgdbm \
	-ltalloc -lstdc++ -lpcre -lz -lzstd," \
		-e "/^LDFLAGS *=/s/\$/ -static-libgcc -static-libstdc++/" \
		-e "/^LIBCONNOBJS *+=/s,\$,\nLIBCONNOBJS+=   conn/sasl.o," \
		-e "/^LIBIMAPOBJS *+=/s,\$,\nLIBIMAPOBJS+= \
	  imap/auth_sasl.o," \
		Makefile~ > Makefile
	printf "  MAKE\n"
	make

install:QV:	$PKGBASE install-legal
	printf "  MAKE\t%s\n" "DESTDIR=$(realpath $DESTDIR) install"
	make DESTDIR=$(realpath $DESTDIR) install

install-legal:QV:	$PKGBASE
	for legalfile in $LEGALFILES; do
		printf "  INST\t%s\n" "$legalfile"
		$INSTALL -Dm0644 "$legalfile" $LEGALDIR/$legalfile
	done

clean:QV:
	if [ -e Makefile ]; then
		printf "  MAKE\tclean\n"
		#make clean
	fi

<$mkpklib/package.mk