]> git.ipfire.org Git - thirdparty/sarg.git/blame - archive.sh
Update the translation files
[thirdparty/sarg.git] / archive.sh
CommitLineData
6937c365
FM
1#!/bin/sh
2
3Sources="."
4Target=".."
5
6Version=$(cat "$Sources/CMakeLists.txt" | sed -n -e 's/^SET(sarg_VERSION \([0-9]\))/\1/p')
7if [ -z "$Version" ] ; then
8 echo "No version found"
9 exit 1
10fi
11Revision=$(cat "$Sources/CMakeLists.txt" | sed -n -e 's/^SET(sarg_REVISION "\([0-9][0-9]*.*\)")/\1/p')
12if [ -z "$Revision" ] ; then
13 echo "No revision found"
14 exit 1
15fi
16Version="$Version.$Revision"
17
18VersionCheck=$(cat "$Sources/configure.in" | sed -n -e 's/^AC_INIT(\[sarg\],\[\([0-9][0-9]*\.[0-9][0-9]*.*\)\])/\1/p')
19if [ "x$Version" != "x$VersionCheck" ] ; then
20 echo "CMakeLists and configure doesn't refer to the same version"
21 exit 1
22fi
23
24SargList="$Target/sarglist.txt.unsort"
25SortList="$Target/sarglist.txt"
aee4b2ef 26DirList="$Target/sargdir.txt"
6937c365 27ExcludeList="$Target/sargexclude.txt"
aee4b2ef 28ArchiveFile="$Target/sarg-$Version.tar"
6937c365
FM
29
30SedSources=$(echo "$Sources" | sed -e 's/\./\\./')
31ls $Sources/*.c | sed -e "s/^$SedSources\///" > $SargList
32ls $Sources/include/*.h | sed -e "s/^$SedSources\///" >> $SargList
33ls $Sources/po/*.{po,gmo,pot} | sed -e "s/^$SedSources\///" >> $SargList
34
35echo "
36config.h
37aclocal.m4
38BETA-TESTERS
39ChangeLog
40CMakeLists.txt
6937c365
FM
41configure.in
42CONTRIBUTORS
43COPYING
44css.tpl
45DONATIONS
46Doxyfile
47exclude_codes
48htaccess
49LICENSE
50Makefile.in
51README
52README_cmake
53sarg.1
54sarg.conf
55user_limit_block
56cfgaux
57documentation
58fonts
59images
60include/config.h.in
61sarg-php
a91a1f21 62sarg_manpage.xml
6937c365
FM
63po/remove-potcdate.sin
64po/Makefile.in.in
65po/POTFILES.in
66po/quot.sed
67po/Rules-quot
68po/insert-header.sin
69po/ChangeLog
70po/LINGUAS
71po/en@quot.header
72po/en@boldquot.header
73po/boldquot.sed
74po/Makevars
75sorttable/sorttable.js
76" >> $SargList
77
aee4b2ef
FM
78[ -f "$DirList" ] && rm "$DirList"
79cat $SargList | while read file
80do
81 [ -z "$file" ] && continue
82 if [ -f "$file" ] ; then
83 echo "$file" >> "$DirList"
84 elif [ -d "$file" ] ; then
85 find "$file" -type f >> "$DirList"
86 else
87 echo "Unknown file type $file"
88 exit 1
89 fi
90done
91rm "$SargList"
92
93sort -u "$DirList" | sed -e '/^$/d' > "$SortList"
94rm "$DirList"
6937c365
FM
95
96echo "
97*/.svn
98*/.git
99*~
100*.o
101.gitignore
102" > "$ExcludeList"
103
aee4b2ef
FM
104tar cf "$ArchiveFile" -C "$Sources" --files-from="$SortList" --no-recursion --transform="s,^,sarg-$Version/," --owner root --group root --mode 644
105tar rf "$ArchiveFile" -C "$Sources" "configure" --exclude-from="$ExcludeList" --transform="s,^,sarg-$Version/," --owner root --group root --mode 755
106gzip -f "$ArchiveFile"
107CompressFile="$ArchiveFile.gz"
6937c365
FM
108
109md5sum $CompressFile > "$Target/sarg-$Version.md5sum"
110echo "md5sum:"
111cat "$Target/sarg-$Version.md5sum"
112
113sha1sum $CompressFile > "$Target/sarg-$Version.sha1sum"
114echo "sha1sum:"
115cat "$Target/sarg-$Version.sha1sum"
116
117sha256sum $CompressFile > "$Target/sarg-$Version.sha256sum"
118echo "sha256sum:"
119cat "$Target/sarg-$Version.sha256sum"