#!/bin/sh
-# $Id: version.c.SH 3342 2007-04-01 22:10:05Z jilles $
-
spitshell=cat
-package=IRC
+package=charybdis
echo "Extracting $package/src/version.c..."
if test -r version.c.last
then
- generation=`sed -n 's/^char \*generation = \"\(.*\)\";/\1/p' < version.c.last`
+ generation=`sed -n 's/^const char \*generation = \"\(.*\)\";/\1/p' < version.c.last`
if test ! "$generation" ; then generation=0; fi
else
generation=0
generation=`expr $generation + 1`
-uname=`uname -a`
-
-creation=`LC_ALL=C date | \
+if test -n "$SOURCE_DATE_EPOCH" -a "$EXTERNAL_BUILD_TIMESTAMP" = '' ; then
+ EXTERNAL_BUILD_TIMESTAMP=$SOURCE_DATE_EPOCH
+fi
+if test "$EXTERNAL_BUILD_TIMESTAMP" = ''; then
+ creation=`LC_ALL=C date | \
awk '{if (NF == 6) \
{ print $1 " " $2 " " $3 " " $6 " at " $4 " " $5 } \
else \
{ print $1 " " $2 " " $3 " " $7 " at " $4 " " $5 " " $6 }}'`
+else
+ creation="$EXTERNAL_BUILD_TIMESTAMP"
+fi
$spitshell >version.c <<!SUB!THIS!
/*
- * IRC - Internet Relay Chat, src/version.c
+ * $package - Internet Relay Chat, src/version.c
* Copyright (C) 1990 Chelsea Ashley Dyerman
*
* This program is free software; you can redistribute it and/or modify
#include "patchlevel.h"
#include "serno.h"
+#include "stdinc.h"
const char *generation = "$generation";
const char *creation = "$creation";
-const char *platform = "$uname";
const char *ircd_version = PATCHLEVEL;
const char *serno = SERNO;
+const unsigned long int datecode = DATECODE;
const char *infotext[] =
{
"$package --",
"Based on the original code written by Jarkko Oikarinen",
- "Copyright 1988, 1989, 1990, 1991 University of Oulu, Computing Center",
- "Copyright (c) 1996-2001 Hybrid Development Team",
+ "Copyright (c) 1988-1991 University of Oulu, Computing Center",
+ "Copyright (c) 1996-2001 Hybrid Development Team",
"Copyright (c) 2002-2009 ircd-ratbox Development Team",
"Copyright (c) 2005-2016 charybdis development team",
" ",
" ",
!SUB!THIS!
-IFS='
-'
-for i in `grep -v '^$Id' ../CREDITS |tr -d '"'` ; do
-echo " \"$i\"," >> version.c
-done
+sed 's/^$/ /;s/.*/\ "&\",/' ../CREDITS >> version.c
$spitshell >>version.c <<!SUB!THISTOO!
- "",
- 0,
+ " ",
+ NULL,
};
!SUB!THISTOO!