xref: /netbsd-src/external/public-domain/xz/dist/build-aux/version.sh (revision 75cbb3d6e4fac2c8c149ebd3a1104dd4ac8c9b3a)
1#!/bin/sh
2#
3#############################################################################
4#
5# Get the version string from version.h and print it out without
6# trailing newline. This makes it suitable for use in configure.ac.
7#
8#############################################################################
9#
10# Author: Lasse Collin
11#
12# This file has been put into the public domain.
13# You can do whatever you want with this file.
14#
15#############################################################################
16
17sed -n 's/LZMA_VERSION_STABILITY_ALPHA/alpha/
18	s/LZMA_VERSION_STABILITY_BETA/beta/
19	s/LZMA_VERSION_STABILITY_STABLE//
20	s/^#define LZMA_VERSION_[MPS][AIT][AJNT][A-Z]* //p' \
21	src/liblzma/api/lzma/version.h \
22	| tr '\n' '|' \
23	| sed 's/|/./; s/|/./; s/|//g' \
24	| tr -d '\r\n'
25