"Fossies" - the Fresh Open Source Software Archive

Member "s-nail-14.9.11/make-config.in" (8 Aug 2018, 9488 Bytes) of package /linux/misc/s-nail-14.9.11.tar.xz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "make-config.in": 14.9.10_vs_14.9.11.

    1 #@ make-config.in -- mk-config.mk template, completed by make-config.sh.
    2 #@ Please see INSTALL and make.rc instead.
    3 
    4 .PHONY: all test install uninstall clean distclean
    5 
    6 SIZE_CHECK = @if ( command -v size ) > /dev/null 2>&1; then size $(@); fi
    7 
    8 _version_from_header = VERSION="`< $(CWDDIR)gen-version.h $(sed) \
    9 		-e '/ n_VERSION /b X' -e d -e ':X' \
   10 		-e 's/[^\"]*\"v\([^\"]\{1,\}\)\"/\1/'`"
   11 
   12 all: $(VAL_UAGENT) $(OPTIONAL_PRIVSEP)
   13 
   14 $(VAL_UAGENT): $(OBJ) uman.1 urc.rc
   15 	$(ECHO_LINK)$(CC) $(LDFLAGS) -o $(@) $(OBJ) $(LIBS)
   16 	$(SIZE_CHECK)
   17 
   18 $(OBJ): mk-config.h $(CWDDIR)config.h $(SRCDIR)nail.h $(SRCDIR)nailfuns.h \
   19 		$(AMALGAM_DEP)
   20 $(AMALGAM_TARGET) auxlily.o: $(SRCDIR)gen-errors.h
   21 $(AMALGAM_TARGET) accmacvar.o: $(SRCDIR)gen-okeys.h $(CWDDIR)gen-version.h
   22 $(AMALGAM_TARGET) cmd-tab.o: $(SRCDIR)cmd-tab.h
   23 $(AMALGAM_TARGET) dotlock.o: $(SRCDIR)dotlock.h
   24 $(AMALGAM_TARGET) obs-imap.o: $(SRCDIR)obs-imap-gssapi.h
   25 $(AMALGAM_TARGET) mime-types.o: gen-mime-types.h
   26 $(AMALGAM_TARGET) obs-imap.o pop3.o smtp.o urlcrecry.o: $(SRCDIR)rfc1321.h
   27 $(AMALGAM_TARGET) smtp.o: $(SRCDIR)smtp-gssapi.h
   28 $(AMALGAM_TARGET) termcap.o: $(SRCDIR)gen-tcaps.h
   29 
   30 $(VAL_PRIVSEP): privsep.o
   31 	$(ECHO_LINK)$(CC) $(LDFLAGS) -o $(@) privsep.o $(BASE_LIBS)
   32 	$(SIZE_CHECK)
   33 
   34 privsep.o: $(SRCDIR)privsep.c mk-config.h $(CWDDIR)config.h \
   35 		$(SRCDIR)nail.h $(SRCDIR)dotlock.h
   36 	$(ECHO_CC)$(CC) $(CFLAGS) $(BASE_INCS) -c $(SRCDIR)privsep.c
   37 
   38 gen-mime-types.h: $(SRCDIR)mime.types
   39 	$(ECHO_GEN)\
   40 	LC_ALL=C < $(SRCDIR)mime.types > $(@) $(awk) '\
   41 	function add(mt, ln){\
   42 		gsub(/[[:space:]]+/, " ", ln);\
   43 		i = split(ln, i_a);\
   44 		e = "";\
   45 		for(j = 1; j <= i; ++j){\
   46 			k = i_a[j];\
   47 			e = (e ? e " " : "") k\
   48 		}\
   49 		if(e){\
   50 			if(e_a[mt])\
   51 				e_a[mt] = e_a[mt] " ";\
   52 			e_a[mt] = e_a[mt] e\
   53 		}\
   54 	}\
   55 	/^[[:space:]]*#/{next}\
   56 	/^[[:space:]]*$$/{ltype = ""; next}\
   57 	/^[[:space:]]/{\
   58 		if(!ltype)\
   59 			print "FAULTY CONTINUATION: " $$0 >> "/dev/stderr";\
   60 		add(ltype, $$0);\
   61 		next\
   62 	}\
   63 	/^(@([thHq]@)? )?[[:alpha:]]/{\
   64 		if($$1 ~ /^@([thHq]@)?$$/){\
   65 			pa = $$1;\
   66 			$$1 = $$2;\
   67 			$$2 = ""\
   68 		}else\
   69 			pa = "";\
   70 		if($$1 !~ /^([[:alnum:]]+)\/([[:alnum:]_+-]+)$$/)\
   71 			print "FAULTY MIME TYPE: <" $$1 ">" >> "/dev/stderr";\
   72 		ltype = $$1; $$1 = "";\
   73 		if(pa)\
   74 			p_a[ltype] = pa;\
   75 		if(!nt_a[ltype])\
   76 			no_a[++no_ai] = nt_a[ltype] = ltype;\
   77 		add(ltype, $$0)\
   78 	}\
   79 	END{\
   80 		for(z = 1; z <= no_ai; ++z){\
   81 			t = no_a[z];\
   82 			j = index(t, "/");\
   83 			mt = toupper(substr(t, 1, j - 1));\
   84 			j = substr(t, j + 1);\
   85 			l = length(j);\
   86 			if(!p_a[t])\
   87 				mt = "_MT_" mt;\
   88 			else{\
   89 				tm = p_a[t];\
   90 				if(tm == "@" || tm == "@t@")\
   91 					mt = "_MT_" mt " | a_MT_TM_PLAIN";\
   92 				else if(tm == "@h@")\
   93 					mt = "_MT_" mt " | a_MT_TM_SOUP_h";\
   94 				else if(tm == "@H@")\
   95 					mt = "_MT_" mt " | a_MT_TM_SOUP_H";\
   96 				else if(tm == "@q@")\
   97 					mt = "_MT_" mt " | a_MT_TM_QUIET";\
   98 			}\
   99 			print "   {" mt ", " l ", \"" j e_a[t] "\"},"\
  100 		}\
  101 	}\
  102 	'
  103 
  104 uman.1: $(SRCDIR)nail.1
  105 	$(ECHO_GEN)\
  106 	LC_ALL=C \
  107 		_UAGENT="$(VAL_UAGENT)" \
  108 		_SYSCONFRC="$(VAL_SYSCONFDIR)/$(VAL_SYSCONFRC)" \
  109 		_MAILRC="$(VAL_MAILRC)" \
  110 			_DEAD="$(VAL_DEAD)" \
  111 			_MBOX="$(VAL_MBOX)" \
  112 			_NETRC="$(VAL_NETRC)" \
  113 			_TMPDIR="$(VAL_TMPDIR)" \
  114 				_MT_S="$(VAL_MIME_TYPES_SYS)" \
  115 				_MT_U="$(VAL_MIME_TYPES_USR)" \
  116 		$(_version_from_header) \
  117 	< $(SRCDIR)nail.1 > $(@) $(awk) '\
  118 	BEGIN { written = 0 }\
  119 	/\.\\"--MKMAN-START--/, /\.\\"--MKMAN-END--/ {\
  120 		if (written++ != 0)\
  121 			next;\
  122 		OFS = "";\
  123 		print ".ds VV \\\\%v", ENVIRON["VERSION"];\
  124 		\
  125 		un = toupper(ENVIRON["_UAGENT"]);\
  126 			ln = tolower(un);\
  127 			cn = toupper(substr(ln, 1, 1)) substr(ln, 2);\
  128 			print ".ds UU \\\\%", un;\
  129 			print ".ds UA \\\\%", cn;\
  130 			print ".ds uA \\\\%", ln;\
  131 		path = ENVIRON["_SYSCONFRC"];\
  132 			gsub("/", "/\\:", path);\
  133 			print ".ds UR \\\\%", path;\
  134 		path = ENVIRON["_MAILRC"];\
  135 			gsub("/", "/\\:", path);\
  136 			print ".ds ur \\\\%", path;\
  137 		\
  138 		path = ENVIRON["_DEAD"];\
  139 			gsub("/", "/\\:", path);\
  140 			print ".ds VD \\\\%", path;\
  141 		path = ENVIRON["_MBOX"];\
  142 			gsub("/", "/\\:", path);\
  143 			print ".ds VM \\\\%", path;\
  144 		path = ENVIRON["_NETRC"];\
  145 			gsub("/", "/\\:", path);\
  146 			print ".ds VN \\\\%", path;\
  147 		path = ENVIRON["_TMPDIR"];\
  148 			gsub("/", "/\\:", path);\
  149 			print ".ds VT \\\\%", path;\
  150 		\
  151 		path = ENVIRON["_MT_S"];\
  152 			gsub("/", "/\\:", path);\
  153 			print ".ds vS \\\\%", path;\
  154 		path = ENVIRON["_MT_U"];\
  155 			gsub("/", "/\\:", path);\
  156 			print ".ds vU \\\\%", path;\
  157 		\
  158 		OFS = " ";\
  159 		next\
  160 	}\
  161 	{print}\
  162 	'
  163 
  164 urc.rc: $(SRCDIR)nail.rc
  165 	$(ECHO_GEN)\
  166 	LC_ALL=C _SYSCONFRC="$(VAL_SYSCONFRC)" _UAGENT="$(VAL_UAGENT)" \
  167 		$(_version_from_header) \
  168 	< $(SRCDIR)nail.rc > $(@) $(awk) 'BEGIN {written = 0}\
  169 	/^#--MKRC-START--/, /^#--MKRC-END--/ {\
  170 		if (written == 1)\
  171 			next;\
  172 		written = 1;\
  173 		OFS = "";\
  174 		ln = tolower(ENVIRON["_UAGENT"]);\
  175 		cn = toupper(substr(ln, 1, 1)) substr(ln, 2);\
  176 		print "#@ ", ENVIRON["_SYSCONFRC"];\
  177 		print "#@ Configuration file for ", cn, " v",\
  178 			ENVIRON["VERSION"];\
  179 		OFS = " ";\
  180 		next\
  181 	}\
  182 	{print}\
  183 	'
  184 
  185 install:
  186 	$(ECHO_BLOCK_BEGIN)\
  187 	__mkdir() {\
  188 		_dir="$(DESTDIR)$${1}";\
  189 		if [ -d "$${_dir}" ]; then :; else \
  190 			$(mkdir) -m 0755 -p "$${_dir}";\
  191 		fi;\
  192 	};\
  193 	__copyfile() {\
  194 		_mode=$${1} _src=$${2} _xdst=$${3} _dst="$(DESTDIR)$${3}";\
  195 		$(cp) -f "$${_src}" "$${_dst}";\
  196 		echo "rm -f \"\$${DESTDIR}$${_xdst}\"" >> \
  197 			"$(VAL_UAGENT)-uninstall.sh";\
  198 		$(chmod) $${_mode} "$${_dst}";\
  199 		\
  200 	};\
  201 	__copychownfile() {\
  202 		_mode=$${1} _ident=$${2} _src=$${3} \
  203 			_xdst=$${4} _dst="$(DESTDIR)$${4}";\
  204 		$(cp) -f "$${_src}" "$${_dst}";\
  205 		echo "rm -f \"\$${DESTDIR}$${_xdst}\"" >> \
  206 			"$(VAL_UAGENT)-uninstall.sh";\
  207 		$(chown) $${_ident} "$${_dst}" || true;\
  208 		$(chmod) $${_mode} "$${_dst}";\
  209 		\
  210 	};\
  211 	__stripfile() {\
  212 		_file=$${1};\
  213 		if [ "$(OPT_DEBUG)" != 0 ]; then :;\
  214 		elif [ -n "$(HAVE_STRIP)" ]; then \
  215 			$(strip) "$${_file}";\
  216 		fi;\
  217 	};\
  218 	\
  219 	cd $(CWDDIR) || exit 11;\
  220 	echo '#!/bin/sh -' > "$(VAL_UAGENT)-uninstall.sh";\
  221 	echo '#@ Uninstall script for $(VAL_UAGENT)' >> \
  222 		"$(VAL_UAGENT)-uninstall.sh";\
  223 	echo >> "$(VAL_UAGENT)-uninstall.sh";\
  224 	echo 'DESTDIR="$(DESTDIR)"' >> "$(VAL_UAGENT)-uninstall.sh";\
  225 	echo 'DESTDIR=' >> "$(VAL_UAGENT)-uninstall.sh";\
  226 	echo >> "$(VAL_UAGENT)-uninstall.sh";\
  227 	\
  228 	if [ -n "$(DESTDIR)" ]; then __mkdir ''; fi;\
  229 	__mkdir "$(VAL_BINDIR)";\
  230 	__mkdir "$(VAL_MANDIR)/man1";\
  231 	__mkdir "$(VAL_SYSCONFDIR)";\
  232 	\
  233 	__stripfile .obj/"$(VAL_UAGENT)";\
  234 	__copyfile 0555 .obj/"$(VAL_UAGENT)" "$(VAL_BINDIR)/$(VAL_UAGENT)";\
  235 	__copyfile 0444 .obj/uman.1 "$(VAL_MANDIR)/man1/$(VAL_UAGENT).1";\
  236 	if [ -f "$(DESTDIR)$(VAL_SYSCONFDIR)/$(VAL_SYSCONFRC)" ]; then :; else \
  237 		__copyfile 0444 .obj/urc.rc \
  238 			"$(VAL_SYSCONFDIR)/$(VAL_SYSCONFRC)";\
  239 	fi;\
  240 	\
  241 	if [ -n "$(OPTIONAL_PRIVSEP)" ]; then \
  242 		__mkdir "$(VAL_LIBEXECDIR)";\
  243 		\
  244 		__stripfile .obj/"$(VAL_PRIVSEP)";\
  245 		m='o=rx' o=;\
  246 		if [ -n "$(_____PRIVSEP_GROUP)" ]; then \
  247 			m="g=rxs,$${m}" o=":$(VAL_PRIVSEP_GROUP)";\
  248 		else \
  249 			m="g=rx,$${m}";\
  250 		fi;\
  251 		if [ -n "$(VAL_PRIVSEP_USER)" ]; then \
  252 			m="u=rxs,$${m}" o="$(VAL_PRIVSEP_USER)$${o}";\
  253 		else \
  254 			m="u=rx,$${m}";\
  255 		fi;\
  256 		__copychownfile "$${m}" "$${o}" .obj/"$(VAL_PRIVSEP)" \
  257 			"$(VAL_LIBEXECDIR)/$(VAL_PRIVSEP)";\
  258 	fi;\
  259 	\
  260 	if [ -z "$(DESTDIR)" ]; then \
  261 		__copyfile 0555 "$(VAL_UAGENT)-uninstall.sh" \
  262 			"$(VAL_BINDIR)/$(VAL_UAGENT)-uninstall.sh";\
  263 	fi;\
  264 	$(ECHO_BLOCK_END)
  265 
  266 uninstall:
  267 	@echo 'Invoke $(VAL_UAGENT)-uninstall.sh to uninstall $(VAL_UAGENT)'
  268 
  269 clean:
  270 	$(ECHO_CMD)\
  271 	$(rm) -f $(OBJ) $(VAL_UAGENT) ./gen-mime-types.h ./uman.1 ./urc.rc;\
  272 	if [ -n "$(OPTIONAL_PRIVSEP)" ]; then \
  273 		$(rm) -f ./privsep.o ./$(VAL_PRIVSEP);\
  274 	fi;\
  275 	\
  276 	if [ -f "$(VAL_UAGENT)-uninstall.sh" ]; then \
  277 		$(rm) -f ./$(VAL_UAGENT)-uninstall.sh;\
  278 	fi
  279 
  280 distclean: clean
  281 	$(ECHO_CMD)\
  282 	cd .. && $(rm) -rf .obj
  283 
  284 # MUST work with "grep=grep sed=sed cmp=cmp mv=mv", otherwise need to change
  285 # make-release.inc
  286 _update-version:
  287 	@LC_ALL=C; export LC_ALL;\
  288 	if [ -z "$(VERSION)" ]; then \
  289 		eval VERSION="`(cd $(SRCDIR);\
  290 			[ -d .git ] && git describe --tags) 2>/dev/null`";\
  291 		if [ -n "$${VERSION}" ]; then \
  292 			VERSION="`echo $${VERSION} |\
  293 				$(sed) -e 's/^v\{0,1\}\(.*\)/\1/'`";\
  294 			[ "`(cd $(SRCDIR) && git status --porcelain) |\
  295 				$(awk) '\
  296 					BEGIN {n=0}\
  297 					/gen-version\.h/ {next}\
  298 					/^\?\?/ {next}\
  299 					{++n}\
  300 					END {print n}\
  301 				'`" -ne 0 ] &&\
  302 				VERSION="$${VERSION}-dirty";\
  303 		else \
  304 			$(_version_from_header);\
  305 			echo "$${VERSION}" | $(grep) -q -F dirty ||\
  306 				VERSION="$${VERSION}-dirty";\
  307 		fi;\
  308 	fi;\
  309 	vmaj="`echo \"$${VERSION}\" |\
  310 		$(sed) -e 's/^\([^.]\{1,\}\).*/\1/'`";\
  311 	vmin="`echo \"$${VERSION}\" |\
  312 		$(sed) -e 's/^[^.]\{1,\}\.\([^.]\{1,\}\).*/\1/'`";\
  313 	[ "$${vmin}" = "$${VERSION}" ] && VERSION="$${VERSION}.0" vmin=0;\
  314 	vupd="`echo \"$${VERSION}\" |\
  315 		$(sed) -e 's/^[^.]\{1,\}\.[^.]\{1,\}\.\([^.-]\{1,\}\).*/\1/'`";\
  316 	[ "$${vupd}" = "$${VERSION}" ] && VERSION="$${VERSION}.0" vupd=0;\
  317 	trap "$(rm) -f ./version.tmp" 0 1 2 15;\
  318 	printf > ./version.tmp "#define n_VERSION \"v$${VERSION}\"\n";\
  319 	printf >> ./version.tmp \
  320 		"#define n_VERSION_DATE \"`date -u +'%Y-%m-%d'`\"\n";\
  321 	printf >> ./version.tmp "#define n_VERSION_MAJOR \"$${vmaj}\"\n";\
  322 	printf >> ./version.tmp "#define n_VERSION_MINOR \"$${vmin}\"\n";\
  323 	printf >> ./version.tmp "#define n_VERSION_UPDATE \"$${vupd}\"\n";\
  324 	printf >> ./version.tmp \
  325 		"#define n_VERSION_HEXNUM \"0x%02X%03X%03X\"\n" \
  326 		"$${vmaj}" "$${vmin}" "$${vupd}";\
  327 	$(cmp) ./version.tmp $(CWDDIR)gen-version.h >/dev/null 2>&1 && exit;\
  328 	$(mv) ./version.tmp $(CWDDIR)gen-version.h;\
  329 	trap : 0 1 2 15
  330 
  331 # s-mk-mode