mirror of
https://github.com/yrutschle/sslh.git
synced 2025-04-15 08:30:34 +03:00
use directory version when compiling from a tarball without git
This commit is contained in:
parent
62cbb55b8e
commit
9beacc63f9
2
Makefile
2
Makefile
@ -3,7 +3,7 @@
|
|||||||
VERSION=$(shell ./genver.sh -r)
|
VERSION=$(shell ./genver.sh -r)
|
||||||
USELIBCONFIG=1 # Use libconfig? (necessary to use configuration files)
|
USELIBCONFIG=1 # Use libconfig? (necessary to use configuration files)
|
||||||
USELIBWRAP= # Use libwrap?
|
USELIBWRAP= # Use libwrap?
|
||||||
USELIBCAP= # Use libcap?
|
USELIBCAP=1 # Use libcap?
|
||||||
COV_TEST= # Perform test coverage?
|
COV_TEST= # Perform test coverage?
|
||||||
PREFIX=/usr/local
|
PREFIX=/usr/local
|
||||||
|
|
||||||
|
19
genver.sh
19
genver.sh
@ -1,4 +1,4 @@
|
|||||||
#! /bin/sh
|
#! /bin/bash
|
||||||
|
|
||||||
if [ ${#} -eq 1 ] && [ "x$1" = "x-r" ]; then
|
if [ ${#} -eq 1 ] && [ "x$1" = "x-r" ]; then
|
||||||
# release text only
|
# release text only
|
||||||
@ -10,10 +10,19 @@ fi
|
|||||||
if ! `(git status | grep -q "On branch") 2> /dev/null`; then
|
if ! `(git status | grep -q "On branch") 2> /dev/null`; then
|
||||||
# If we don't have git, we can't work out what
|
# If we don't have git, we can't work out what
|
||||||
# version this is. It must have been downloaded as a
|
# version this is. It must have been downloaded as a
|
||||||
# zip file. Github creates the zip file with all
|
# zip file.
|
||||||
# files dated from the last change: use the
|
|
||||||
# Makefile's modification time as a release number
|
# If downloaded from the release page, the directory
|
||||||
release=zip-`stat -c "%y" Makefile | sed 's/ .*//'`
|
# has the version number.
|
||||||
|
release=`pwd | sed s/.*sslh-// | grep "[[:digit:]]"`
|
||||||
|
|
||||||
|
if [ "x$release" = "x" ]; then
|
||||||
|
# If downloaded from the head, Github creates the
|
||||||
|
# zip file with all files dated from the last
|
||||||
|
# change: use the Makefile's modification time as a
|
||||||
|
# release number
|
||||||
|
release=head-`stat -c "%y" Makefile | sed 's/ .*//'`
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if head=`git rev-parse --verify HEAD 2>/dev/null`; then
|
if head=`git rev-parse --verify HEAD 2>/dev/null`; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user